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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  2.07k|      : quantization_bits_(-1),
   54|  2.07k|        max_quantized_value_(-1),
   55|  2.07k|        max_value_(-1),
   56|  2.07k|        dequantization_scale_(1.f),
   57|  2.07k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  1.87k|  bool SetQuantizationBits(int32_t q) {
   60|  1.87k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 533, False: 1.33k]
  |  Branch (60:18): [True: 135, False: 1.20k]
  ------------------
   61|    668|      return false;
   62|    668|    }
   63|  1.20k|    quantization_bits_ = q;
   64|  1.20k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.20k|    max_value_ = max_quantized_value_ - 1;
   66|  1.20k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.20k|    center_value_ = max_value_ / 2;
   68|  1.20k|    return true;
   69|  1.87k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  1.63M|                                           int32_t *out_t) const {
   77|  1.63M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 2.88k, False: 1.63M]
  |  Branch (77:20): [True: 0, False: 2.88k]
  |  Branch (77:32): [True: 2.88k, False: 1.63M]
  |  Branch (77:42): [True: 0, False: 2.88k]
  ------------------
   78|  1.63M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 1.18M, False: 449k]
  |  Branch (78:29): [True: 4.16k, False: 1.18M]
  ------------------
   79|  4.16k|      s = max_value_;
   80|  4.16k|      t = max_value_;
   81|  1.63M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 2.88k, False: 1.63M]
  |  Branch (81:26): [True: 1.03k, False: 1.85k]
  ------------------
   82|  1.03k|      t = center_value_ - (t - center_value_);
   83|  1.63M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 1.18M, False: 448k]
  |  Branch (83:35): [True: 4.23k, False: 1.18M]
  ------------------
   84|  4.23k|      t = center_value_ + (center_value_ - t);
   85|  1.62M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 1.18M, False: 447k]
  |  Branch (85:35): [True: 422, False: 1.18M]
  ------------------
   86|    422|      s = center_value_ + (center_value_ - s);
   87|  1.62M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 3.42k, False: 1.62M]
  |  Branch (87:26): [True: 1.35k, False: 2.07k]
  ------------------
   88|  1.35k|      s = center_value_ - (s - center_value_);
   89|  1.35k|    }
   90|       |
   91|  1.63M|    *out_s = s;
   92|  1.63M|    *out_t = t;
   93|  1.63M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  1.63M|                                                       int32_t *out_t) const {
  100|  1.63M|    DRACO_DCHECK_EQ(
  101|  1.63M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  1.63M|        center_value_);
  103|  1.63M|    int32_t s, t;
  104|  1.63M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 1.05M, False: 587k]
  ------------------
  105|       |      // Right hemisphere.
  106|  1.05M|      s = (int_vec[1] + center_value_);
  107|  1.05M|      t = (int_vec[2] + center_value_);
  108|  1.05M|    } else {
  109|       |      // Left hemisphere.
  110|   587k|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 36.8k, False: 550k]
  ------------------
  111|  36.8k|        s = std::abs(int_vec[2]);
  112|   550k|      } else {
  113|   550k|        s = (max_value_ - std::abs(int_vec[2]));
  114|   550k|      }
  115|   587k|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 40.7k, False: 546k]
  ------------------
  116|  40.7k|        t = std::abs(int_vec[1]);
  117|   546k|      } else {
  118|   546k|        t = (max_value_ - std::abs(int_vec[1]));
  119|   546k|      }
  120|   587k|    }
  121|  1.63M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  1.63M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|   136k|                                                    float *out_vector) const {
  199|   136k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|   136k|                                 in_t * dequantization_scale_ - 1.f,
  201|   136k|                                 out_vector);
  202|   136k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  1.10M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  1.10M|    DRACO_DCHECK_LE(s, center_value_);
  208|  1.10M|    DRACO_DCHECK_LE(t, center_value_);
  209|  1.10M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  1.10M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  1.10M|    const uint32_t st =
  212|  1.10M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  1.10M|    return st <= center_value_;
  214|  1.10M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  1.47M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  1.47M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  1.47M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  1.47M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  1.47M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  1.47M|    int32_t sign_s = 0;
  223|  1.47M|    int32_t sign_t = 0;
  224|  1.47M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 1.32M, False: 150k]
  |  Branch (224:20): [True: 1.20M, False: 117k]
  ------------------
  225|  1.20M|      sign_s = 1;
  226|  1.20M|      sign_t = 1;
  227|  1.20M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 174k, False: 93.3k]
  |  Branch (227:27): [True: 83.4k, False: 90.7k]
  ------------------
  228|  83.4k|      sign_s = -1;
  229|  83.4k|      sign_t = -1;
  230|   184k|    } else {
  231|   184k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 93.3k, False: 90.7k]
  ------------------
  232|   184k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 90.7k, False: 93.3k]
  ------------------
  233|   184k|    }
  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|  1.47M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  1.47M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  1.47M|    uint32_t us = *s;
  241|  1.47M|    uint32_t ut = *t;
  242|  1.47M|    us = us + us - corner_point_s;
  243|  1.47M|    ut = ut + ut - corner_point_t;
  244|  1.47M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 1.28M, False: 184k]
  ------------------
  245|  1.28M|      uint32_t temp = us;
  246|  1.28M|      us = -ut;
  247|  1.28M|      ut = -temp;
  248|  1.28M|    } else {
  249|   184k|      std::swap(us, ut);
  250|   184k|    }
  251|  1.47M|    us = us + corner_point_s;
  252|  1.47M|    ut = ut + corner_point_t;
  253|       |
  254|  1.47M|    *s = us;
  255|  1.47M|    *t = ut;
  256|  1.47M|    *s /= 2;
  257|  1.47M|    *t /= 2;
  258|  1.47M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  2.21M|  int32_t ModMax(int32_t x) const {
  273|  2.21M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 4.91k, False: 2.20M]
  ------------------
  274|  4.91k|      return x - this->max_quantized_value();
  275|  4.91k|    }
  276|  2.20M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 2.16k, False: 2.20M]
  ------------------
  277|  2.16k|      return x + this->max_quantized_value();
  278|  2.16k|    }
  279|  2.20M|    return x;
  280|  2.20M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.15k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  7.08k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  6.63M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|   136k|                                           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|   136k|    float y = in_s_scaled;
  329|   136k|    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|   136k|    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|   136k|    float x_offset = -x;
  342|   136k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 43.7k, False: 93.2k]
  ------------------
  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|   136k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 51.3k, False: 85.5k]
  ------------------
  348|   136k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 51.3k, False: 85.6k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|   136k|    const float norm_squared = x * x + y * y + z * z;
  352|   136k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 136k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|   136k|    } else {
  357|   136k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|   136k|      out_vector[0] = x * d;
  359|   136k|      out_vector[1] = y * d;
  360|   136k|      out_vector[2] = z * d;
  361|   136k|    }
  362|   136k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  1.63M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  1.63M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  1.63M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  1.63M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  1.63M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  1.63M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  1.63M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 1.44M, False: 194k]
  ------------------
  181|  1.44M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  1.44M|    } else {
  183|   194k|      vec[0] =
  184|   194k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   194k|          abs_sum;
  186|   194k|      vec[1] =
  187|   194k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   194k|          abs_sum;
  189|   194k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 104k, False: 90.6k]
  ------------------
  190|   104k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   104k|      } else {
  192|  90.6k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|  90.6k|      }
  194|   194k|    }
  195|  1.63M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    307|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    307|            attribute, transform, mesh_data),
   52|    307|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    293|                                                                *buffer) {
  194|    293|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    293|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    293|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 5, False: 288]
  ------------------
  196|       |    // Decode prediction mode.
  197|      5|    uint8_t mode;
  198|      5|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 5]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      5|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 4, False: 1]
  ------------------
  203|       |      // Unsupported mode.
  204|      4|      return false;
  205|      4|    }
  206|      5|  }
  207|    289|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.32k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.08k, False: 235]
  ------------------
  211|  1.08k|    uint32_t num_flags;
  212|  1.08k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 11, False: 1.07k]
  ------------------
  213|     11|      return false;
  214|     11|    }
  215|  1.07k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 31, False: 1.04k]
  ------------------
  216|     31|      return false;
  217|     31|    }
  218|  1.04k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 387, False: 656]
  ------------------
  219|    387|      is_crease_edge_[i].resize(num_flags);
  220|    387|      RAnsBitDecoder decoder;
  221|    387|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 12, False: 375]
  ------------------
  222|     12|        return false;
  223|     12|      }
  224|  1.82M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.82M, False: 375]
  ------------------
  225|  1.82M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.82M|      }
  227|    375|      decoder.EndDecoding();
  228|    375|    }
  229|  1.04k|  }
  230|    235|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    235|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    289|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    210|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    210|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    210|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.05k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 840, False: 210]
  ------------------
   93|    840|    pred_vals[i].resize(num_components, 0);
   94|    840|  }
   95|    210|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    210|                                         out_data);
   97|       |
   98|    210|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    210|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    210|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    210|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    210|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    210|  const int corner_map_size =
  109|    210|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   830k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 830k, False: 136]
  ------------------
  111|   830k|    const CornerIndex start_corner_id =
  112|   830k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   830k|    CornerIndex corner_id(start_corner_id);
  115|   830k|    int num_parallelograms = 0;
  116|   830k|    bool first_pass = true;
  117|  1.80M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 1.01M, False: 796k]
  ------------------
  118|  1.01M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 70.7k, False: 942k]
  ------------------
  119|  1.01M|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  1.01M|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  70.7k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  70.7k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 574, False: 70.1k]
  ------------------
  127|    574|          break;
  128|    574|        }
  129|  70.7k|      }
  130|       |
  131|       |      // Proceed to the next corner attached to the vertex. First swing left
  132|       |      // and if we reach a boundary, swing right from the start corner.
  133|  1.01M|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 1.00M, False: 7.35k]
  ------------------
  134|  1.00M|        corner_id = table->SwingLeft(corner_id);
  135|  1.00M|      } else {
  136|  7.35k|        corner_id = table->SwingRight(corner_id);
  137|  7.35k|      }
  138|  1.01M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 33.5k, False: 978k]
  ------------------
  139|  33.5k|        break;
  140|  33.5k|      }
  141|   978k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 799k, False: 178k]
  |  Branch (141:47): [True: 796k, False: 3.25k]
  ------------------
  142|   796k|        first_pass = false;
  143|   796k|        corner_id = table->SwingRight(start_corner_id);
  144|   796k|      }
  145|   978k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   830k|    int num_used_parallelograms = 0;
  150|   830k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 38.8k, False: 791k]
  ------------------
  151|  6.32M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 6.28M, False: 38.8k]
  ------------------
  152|  6.28M|        multi_pred_vals[i] = 0;
  153|  6.28M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   109k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 70.7k, False: 38.7k]
  ------------------
  156|  70.7k|        const int context = num_parallelograms - 1;
  157|  70.7k|        const int pos = is_crease_edge_pos[context]++;
  158|  70.7k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 74, False: 70.6k]
  ------------------
  159|     74|          return false;
  160|     74|        }
  161|  70.6k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  70.6k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 20.2k, False: 50.4k]
  ------------------
  163|  20.2k|          ++num_used_parallelograms;
  164|  3.03M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 3.01M, False: 20.2k]
  ------------------
  165|  3.01M|            multi_pred_vals[j] =
  166|  3.01M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  3.01M|          }
  168|  20.2k|        }
  169|  70.6k|      }
  170|  38.8k|    }
  171|   830k|    const int dst_offset = p * num_components;
  172|   830k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 822k, False: 8.05k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   822k|      const int src_offset = (p - 1) * num_components;
  176|   822k|      this->transform().ComputeOriginalValue(
  177|   822k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   822k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|  1.16M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 1.15M, False: 8.05k]
  ------------------
  181|  1.15M|        multi_pred_vals[c] /= num_used_parallelograms;
  182|  1.15M|      }
  183|  8.05k|      this->transform().ComputeOriginalValue(
  184|  8.05k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  8.05k|    }
  186|   830k|  }
  187|    136|  return true;
  188|    210|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    344|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    344|            attribute, transform, mesh_data),
   52|    344|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    325|                                                                *buffer) {
  194|    325|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    325|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    325|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 2, False: 323]
  ------------------
  196|       |    // Decode prediction mode.
  197|      2|    uint8_t mode;
  198|      2|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 2]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      2|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 1, False: 1]
  ------------------
  203|       |      // Unsupported mode.
  204|      1|      return false;
  205|      1|    }
  206|      2|  }
  207|    324|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.39k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.15k, False: 236]
  ------------------
  211|  1.15k|    uint32_t num_flags;
  212|  1.15k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 11, False: 1.14k]
  ------------------
  213|     11|      return false;
  214|     11|    }
  215|  1.14k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 54, False: 1.09k]
  ------------------
  216|     54|      return false;
  217|     54|    }
  218|  1.09k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 470, False: 620]
  ------------------
  219|    470|      is_crease_edge_[i].resize(num_flags);
  220|    470|      RAnsBitDecoder decoder;
  221|    470|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 23, False: 447]
  ------------------
  222|     23|        return false;
  223|     23|      }
  224|  1.02M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.02M, False: 447]
  ------------------
  225|  1.02M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.02M|      }
  227|    447|      decoder.EndDecoding();
  228|    447|    }
  229|  1.09k|  }
  230|    236|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    236|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    324|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    201|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    201|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    201|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.00k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 804, False: 201]
  ------------------
   93|    804|    pred_vals[i].resize(num_components, 0);
   94|    804|  }
   95|    201|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    201|                                         out_data);
   97|       |
   98|    201|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    201|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    201|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    201|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    201|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    201|  const int corner_map_size =
  109|    201|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  77.1k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 77.1k, False: 75]
  ------------------
  111|  77.1k|    const CornerIndex start_corner_id =
  112|  77.1k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  77.1k|    CornerIndex corner_id(start_corner_id);
  115|  77.1k|    int num_parallelograms = 0;
  116|  77.1k|    bool first_pass = true;
  117|   451k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 447k, False: 3.91k]
  ------------------
  118|   447k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 145k, False: 302k]
  ------------------
  119|   447k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   447k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   145k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   145k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 318, False: 144k]
  ------------------
  127|    318|          break;
  128|    318|        }
  129|   145k|      }
  130|       |
  131|       |      // Proceed to the next corner attached to the vertex. First swing left
  132|       |      // and if we reach a boundary, swing right from the start corner.
  133|   447k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 443k, False: 4.33k]
  ------------------
  134|   443k|        corner_id = table->SwingLeft(corner_id);
  135|   443k|      } else {
  136|  4.33k|        corner_id = table->SwingRight(corner_id);
  137|  4.33k|      }
  138|   447k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 72.8k, False: 374k]
  ------------------
  139|  72.8k|        break;
  140|  72.8k|      }
  141|   374k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 6.11k, False: 368k]
  |  Branch (141:47): [True: 3.91k, False: 2.19k]
  ------------------
  142|  3.91k|        first_pass = false;
  143|  3.91k|        corner_id = table->SwingRight(start_corner_id);
  144|  3.91k|      }
  145|   374k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  77.1k|    int num_used_parallelograms = 0;
  150|  77.1k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 75.3k, False: 1.77k]
  ------------------
  151|  3.78M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 3.71M, False: 75.3k]
  ------------------
  152|  3.71M|        multi_pred_vals[i] = 0;
  153|  3.71M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   220k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 144k, False: 75.2k]
  ------------------
  156|   144k|        const int context = num_parallelograms - 1;
  157|   144k|        const int pos = is_crease_edge_pos[context]++;
  158|   144k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 126, False: 144k]
  ------------------
  159|    126|          return false;
  160|    126|        }
  161|   144k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   144k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 16.3k, False: 128k]
  ------------------
  163|  16.3k|          ++num_used_parallelograms;
  164|   745k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 729k, False: 16.3k]
  ------------------
  165|   729k|            multi_pred_vals[j] =
  166|   729k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|   729k|          }
  168|  16.3k|        }
  169|   144k|      }
  170|  75.3k|    }
  171|  76.9k|    const int dst_offset = p * num_components;
  172|  76.9k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 68.8k, False: 8.09k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  68.8k|      const int src_offset = (p - 1) * num_components;
  176|  68.8k|      this->transform().ComputeOriginalValue(
  177|  68.8k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  68.8k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   405k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 397k, False: 8.09k]
  ------------------
  181|   397k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   397k|      }
  183|  8.09k|      this->transform().ComputeOriginalValue(
  184|  8.09k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  8.09k|    }
  186|  76.9k|  }
  187|     75|  return true;
  188|    201|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  1.77k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  1.77k|    mesh_ = mesh;
   39|  1.77k|    corner_table_ = table;
   40|  1.77k|    data_to_corner_map_ = data_to_corner_map;
   41|  1.77k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  1.77k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  9.02M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  6.15M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  6.15M|    return vertex_to_data_map_;
   48|  6.15M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  5.32M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  5.32M|    return data_to_corner_map_;
   51|  5.32M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  1.82k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  1.82k|    mesh_ = mesh;
   39|  1.82k|    corner_table_ = table;
   40|  1.82k|    data_to_corner_map_ = data_to_corner_map;
   41|  1.82k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  1.82k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  7.11M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  6.10M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  6.10M|    return vertex_to_data_map_;
   48|  6.10M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  1.57M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  1.57M|    return data_to_corner_map_;
   51|  1.57M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  1.77k|      : mesh_(nullptr),
   31|  1.77k|        corner_table_(nullptr),
   32|  1.77k|        vertex_to_data_map_(nullptr),
   33|  1.77k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  1.82k|      : mesh_(nullptr),
   31|  1.82k|        corner_table_(nullptr),
   32|  1.82k|        vertex_to_data_map_(nullptr),
   33|  1.82k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   339k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   125k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   331k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   148k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.50k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.50k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  8.00M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.59k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.59k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  2.35M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    132|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    132|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|     97|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|     97|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    127|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    127|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    128|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    128|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    263|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    132|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    132|    DRACO_DCHECK_EQ(i, 0);
   70|    132|    (void)i;
   71|    132|    return GeometryAttribute::POSITION;
   72|    132|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    132|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    132|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 132]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    132|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 131]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    131|    predictor_.SetPositionAttribute(*att);
   82|    131|    return true;
   83|    132|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    131|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    131|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 8, False: 123]
  ------------------
  145|      8|    return false;
  146|      8|  }
  147|       |
  148|    123|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    123|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    123|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 38, False: 85]
  ------------------
  150|     38|    uint8_t prediction_mode;
  151|     38|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 38]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     38|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 37]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     37|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 37]
  ------------------
  160|     37|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     37|  }
  164|    122|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    122|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 5, False: 117]
  ------------------
  168|      5|    return false;
  169|      5|  }
  170|       |
  171|    117|  return true;
  172|    122|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    117|                                      const PointIndex *entry_to_point_id_map) {
  103|    117|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    117|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    117|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    117|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    117|  const int corner_map_size =
  111|    117|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    117|  VectorD<int32_t, 3> pred_normal_3d;
  114|    117|  int32_t pred_normal_oct[2];
  115|       |
  116|   339k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 339k, False: 117]
  ------------------
  117|   339k|    const CornerIndex corner_id =
  118|   339k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   339k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   339k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   339k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   339k|                    octahedron_tool_box_.center_value());
  125|   339k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 93.9k, False: 245k]
  ------------------
  126|  93.9k|      pred_normal_3d = -pred_normal_3d;
  127|  93.9k|    }
  128|   339k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   339k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   339k|    const int data_offset = data_id * 2;
  132|   339k|    this->transform().ComputeOriginalValue(
  133|   339k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   339k|  }
  135|    117|  flip_normal_bit_decoder_.EndDecoding();
  136|    117|  return true;
  137|    117|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    117|  void SetQuantizationBits(int q) {
   85|    117|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    117|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    193|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|     97|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|     97|    DRACO_DCHECK_EQ(i, 0);
   70|     97|    (void)i;
   71|     97|    return GeometryAttribute::POSITION;
   72|     97|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|     97|  bool SetParentAttribute(const PointAttribute *att) override {
   75|     97|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 97]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|     97|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 96]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|     96|    predictor_.SetPositionAttribute(*att);
   82|     96|    return true;
   83|     97|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|     96|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|     96|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 91]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|       |
  148|     91|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|     91|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     91|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 11, False: 80]
  ------------------
  150|     11|    uint8_t prediction_mode;
  151|     11|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 11]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     11|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 10]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     10|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 10]
  ------------------
  160|     10|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     10|  }
  164|     90|#endif
  165|       |
  166|       |  // Init normal flips.
  167|     90|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 1, False: 89]
  ------------------
  168|      1|    return false;
  169|      1|  }
  170|       |
  171|     89|  return true;
  172|     90|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|     89|                                      const PointIndex *entry_to_point_id_map) {
  103|     89|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|     89|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|     89|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|     89|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|     89|  const int corner_map_size =
  111|     89|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|     89|  VectorD<int32_t, 3> pred_normal_3d;
  114|     89|  int32_t pred_normal_oct[2];
  115|       |
  116|   125k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 125k, False: 89]
  ------------------
  117|   125k|    const CornerIndex corner_id =
  118|   125k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   125k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   125k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   125k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   125k|                    octahedron_tool_box_.center_value());
  125|   125k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 118k, False: 7.43k]
  ------------------
  126|   118k|      pred_normal_3d = -pred_normal_3d;
  127|   118k|    }
  128|   125k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   125k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   125k|    const int data_offset = data_id * 2;
  132|   125k|    this->transform().ComputeOriginalValue(
  133|   125k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   125k|  }
  135|     89|  flip_normal_bit_decoder_.EndDecoding();
  136|     89|  return true;
  137|     89|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|     89|  void SetQuantizationBits(int q) {
   85|     89|    octahedron_tool_box_.SetQuantizationBits(q);
   86|     89|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    252|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    127|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    127|    DRACO_DCHECK_EQ(i, 0);
   70|    127|    (void)i;
   71|    127|    return GeometryAttribute::POSITION;
   72|    127|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    126|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    126|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 126]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    126|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 125]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    125|    predictor_.SetPositionAttribute(*att);
   82|    125|    return true;
   83|    126|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    124|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    124|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 6, False: 118]
  ------------------
  145|      6|    return false;
  146|      6|  }
  147|       |
  148|    118|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    118|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    118|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 39, False: 79]
  ------------------
  150|     39|    uint8_t prediction_mode;
  151|     39|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 39]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     39|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 9, False: 30]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      9|      return false;
  157|      9|    }
  158|       |
  159|     30|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 30]
  ------------------
  160|     30|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     30|  }
  164|    109|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    109|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 5, False: 104]
  ------------------
  168|      5|    return false;
  169|      5|  }
  170|       |
  171|    104|  return true;
  172|    109|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    104|                                      const PointIndex *entry_to_point_id_map) {
  103|    104|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    104|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    104|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    104|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    104|  const int corner_map_size =
  111|    104|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    104|  VectorD<int32_t, 3> pred_normal_3d;
  114|    104|  int32_t pred_normal_oct[2];
  115|       |
  116|   331k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 330k, False: 104]
  ------------------
  117|   330k|    const CornerIndex corner_id =
  118|   330k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   330k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   330k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   330k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   330k|                    octahedron_tool_box_.center_value());
  125|   330k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 308k, False: 22.4k]
  ------------------
  126|   308k|      pred_normal_3d = -pred_normal_3d;
  127|   308k|    }
  128|   330k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   330k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   330k|    const int data_offset = data_id * 2;
  132|   330k|    this->transform().ComputeOriginalValue(
  133|   330k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   330k|  }
  135|    104|  flip_normal_bit_decoder_.EndDecoding();
  136|    104|  return true;
  137|    104|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    104|  void SetQuantizationBits(int q) {
   85|    104|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    104|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    254|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    128|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    128|    DRACO_DCHECK_EQ(i, 0);
   70|    128|    (void)i;
   71|    128|    return GeometryAttribute::POSITION;
   72|    128|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    128|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    128|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 128]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    128|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 126]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    126|    predictor_.SetPositionAttribute(*att);
   82|    126|    return true;
   83|    128|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    125|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    125|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 120]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|       |
  148|    120|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    120|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    120|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 15, False: 105]
  ------------------
  150|     15|    uint8_t prediction_mode;
  151|     15|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 15]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     15|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 14]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     14|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 14]
  ------------------
  160|     14|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     14|  }
  164|    119|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    119|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 5, False: 114]
  ------------------
  168|      5|    return false;
  169|      5|  }
  170|       |
  171|    114|  return true;
  172|    119|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    114|                                      const PointIndex *entry_to_point_id_map) {
  103|    114|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    114|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    114|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    114|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    114|  const int corner_map_size =
  111|    114|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    114|  VectorD<int32_t, 3> pred_normal_3d;
  114|    114|  int32_t pred_normal_oct[2];
  115|       |
  116|   148k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 147k, False: 114]
  ------------------
  117|   147k|    const CornerIndex corner_id =
  118|   147k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   147k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   147k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   147k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   147k|                    octahedron_tool_box_.center_value());
  125|   147k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 146k, False: 1.39k]
  ------------------
  126|   146k|      pred_normal_3d = -pred_normal_3d;
  127|   146k|    }
  128|   147k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   147k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   147k|    const int data_offset = data_id * 2;
  132|   147k|    this->transform().ComputeOriginalValue(
  133|   147k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   147k|  }
  135|    114|  flip_normal_bit_decoder_.EndDecoding();
  136|    114|  return true;
  137|    114|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    114|  void SetQuantizationBits(int q) {
   85|    114|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    114|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    184|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    184|            attribute, transform, mesh_data),
   37|    184|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    366|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    184|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    184|    DRACO_DCHECK_EQ(i, 0);
   70|    184|    (void)i;
   71|    184|    return GeometryAttribute::POSITION;
   72|    184|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    183|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    183|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 183]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    183|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 182]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    182|    predictor_.SetPositionAttribute(*att);
   82|    182|    return true;
   83|    183|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    180|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    180|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 17, False: 163]
  ------------------
  145|     17|    return false;
  146|     17|  }
  147|       |
  148|    163|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    163|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    163|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 57, False: 106]
  ------------------
  150|     57|    uint8_t prediction_mode;
  151|     57|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 57]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     57|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 3, False: 54]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      3|      return false;
  157|      3|    }
  158|       |
  159|     54|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 54]
  ------------------
  160|     54|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     54|  }
  164|    160|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    160|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 7, False: 153]
  ------------------
  168|      7|    return false;
  169|      7|  }
  170|       |
  171|    153|  return true;
  172|    160|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    153|                                      const PointIndex *entry_to_point_id_map) {
  103|    153|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    153|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    153|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    153|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    153|  const int corner_map_size =
  111|    153|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    153|  VectorD<int32_t, 3> pred_normal_3d;
  114|    153|  int32_t pred_normal_oct[2];
  115|       |
  116|   534k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 534k, False: 153]
  ------------------
  117|   534k|    const CornerIndex corner_id =
  118|   534k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   534k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   534k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   534k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   534k|                    octahedron_tool_box_.center_value());
  125|   534k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 531k, False: 3.03k]
  ------------------
  126|   531k|      pred_normal_3d = -pred_normal_3d;
  127|   531k|    }
  128|   534k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   534k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   534k|    const int data_offset = data_id * 2;
  132|   534k|    this->transform().ComputeOriginalValue(
  133|   534k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   534k|  }
  135|    153|  flip_normal_bit_decoder_.EndDecoding();
  136|    153|  return true;
  137|    153|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    153|  void SetQuantizationBits(int q) {
   85|    153|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    153|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    320|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    320|            attribute, transform, mesh_data),
   37|    320|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    638|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    320|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    320|    DRACO_DCHECK_EQ(i, 0);
   70|    320|    (void)i;
   71|    320|    return GeometryAttribute::POSITION;
   72|    320|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    320|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    320|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 320]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    320|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 318]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    318|    predictor_.SetPositionAttribute(*att);
   82|    318|    return true;
   83|    320|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    316|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    316|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 20, False: 296]
  ------------------
  145|     20|    return false;
  146|     20|  }
  147|       |
  148|    296|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    296|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    296|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 79, False: 217]
  ------------------
  150|     79|    uint8_t prediction_mode;
  151|     79|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 8, False: 71]
  ------------------
  152|      8|      return false;
  153|      8|    }
  154|     71|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 70]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     70|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 70]
  ------------------
  160|     70|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     70|  }
  164|    287|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    287|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 14, False: 273]
  ------------------
  168|     14|    return false;
  169|     14|  }
  170|       |
  171|    273|  return true;
  172|    287|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    273|                                      const PointIndex *entry_to_point_id_map) {
  103|    273|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    273|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    273|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    273|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    273|  const int corner_map_size =
  111|    273|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    273|  VectorD<int32_t, 3> pred_normal_3d;
  114|    273|  int32_t pred_normal_oct[2];
  115|       |
  116|   160k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 160k, False: 273]
  ------------------
  117|   160k|    const CornerIndex corner_id =
  118|   160k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   160k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   160k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   160k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   160k|                    octahedron_tool_box_.center_value());
  125|   160k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 151k, False: 8.94k]
  ------------------
  126|   151k|      pred_normal_3d = -pred_normal_3d;
  127|   151k|    }
  128|   160k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   160k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   160k|    const int data_offset = data_id * 2;
  132|   160k|    this->transform().ComputeOriginalValue(
  133|   160k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   160k|  }
  135|    273|  flip_normal_bit_decoder_.EndDecoding();
  136|    273|  return true;
  137|    273|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    273|  void SetQuantizationBits(int q) {
   85|    273|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    273|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    132|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    132|            attribute, transform, mesh_data),
   37|    132|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|     97|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|     97|            attribute, transform, mesh_data),
   37|     97|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    127|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    127|            attribute, transform, mesh_data),
   37|    127|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    128|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    128|            attribute, transform, mesh_data),
   37|    128|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    169|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    169|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 36, False: 133]
  ------------------
  105|     36|      this->normal_prediction_mode_ = mode;
  106|     36|      return true;
  107|    133|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 133, False: 0]
  ------------------
  108|    133|      this->normal_prediction_mode_ = mode;
  109|    133|      return true;
  110|    133|    }
  111|      0|    return false;
  112|    169|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   339k|                             DataTypeT *prediction) override {
   42|   339k|    DRACO_DCHECK(this->IsInitialized());
   43|   339k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   339k|    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|   339k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   339k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   339k|    VectorD<int64_t, 3> normal;
   53|   339k|    CornerIndex c_next, c_prev;
   54|   764k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 425k, False: 339k]
  ------------------
   55|       |      // Getting corners.
   56|   425k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 204, False: 425k]
  ------------------
   57|    204|        c_next = corner_table->Next(corner_id);
   58|    204|        c_prev = corner_table->Previous(corner_id);
   59|   425k|      } else {
   60|   425k|        c_next = corner_table->Next(cit.Corner());
   61|   425k|        c_prev = corner_table->Previous(cit.Corner());
   62|   425k|      }
   63|   425k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   425k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   425k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   425k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   425k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   425k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   425k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   425k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   425k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   425k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   425k|      cit.Next();
   81|   425k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   339k|    constexpr int64_t upper_bound = 1 << 29;
   85|   339k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 136, False: 338k]
  ------------------
   86|    136|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    136|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 61, False: 75]
  ------------------
   88|     61|        const int64_t quotient = abs_sum / upper_bound;
   89|     61|        normal = normal / quotient;
   90|     61|      }
   91|   338k|    } else {
   92|   338k|      const int64_t abs_sum = normal.AbsSum();
   93|   338k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.53k, False: 337k]
  ------------------
   94|  1.53k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.53k|        normal = normal / quotient;
   96|  1.53k|      }
   97|   338k|    }
   98|   339k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   339k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   339k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   339k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   339k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    107|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    107|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 9, False: 98]
  ------------------
  105|      9|      this->normal_prediction_mode_ = mode;
  106|      9|      return true;
  107|     98|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 98, False: 0]
  ------------------
  108|     98|      this->normal_prediction_mode_ = mode;
  109|     98|      return true;
  110|     98|    }
  111|      0|    return false;
  112|    107|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   125k|                             DataTypeT *prediction) override {
   42|   125k|    DRACO_DCHECK(this->IsInitialized());
   43|   125k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   125k|    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|   125k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   125k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   125k|    VectorD<int64_t, 3> normal;
   53|   125k|    CornerIndex c_next, c_prev;
   54|   876k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 750k, False: 125k]
  ------------------
   55|       |      // Getting corners.
   56|   750k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 48, False: 750k]
  ------------------
   57|     48|        c_next = corner_table->Next(corner_id);
   58|     48|        c_prev = corner_table->Previous(corner_id);
   59|   750k|      } else {
   60|   750k|        c_next = corner_table->Next(cit.Corner());
   61|   750k|        c_prev = corner_table->Previous(cit.Corner());
   62|   750k|      }
   63|   750k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   750k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   750k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   750k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   750k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   750k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   750k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   750k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   750k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   750k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   750k|      cit.Next();
   81|   750k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   125k|    constexpr int64_t upper_bound = 1 << 29;
   85|   125k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 32, False: 125k]
  ------------------
   86|     32|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     32|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 14, False: 18]
  ------------------
   88|     14|        const int64_t quotient = abs_sum / upper_bound;
   89|     14|        normal = normal / quotient;
   90|     14|      }
   91|   125k|    } else {
   92|   125k|      const int64_t abs_sum = normal.AbsSum();
   93|   125k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 93.1k, False: 32.5k]
  ------------------
   94|  93.1k|        const int64_t quotient = abs_sum / upper_bound;
   95|  93.1k|        normal = normal / quotient;
   96|  93.1k|      }
   97|   125k|    }
   98|   125k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   125k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   125k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   125k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   125k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    157|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    157|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 28, False: 129]
  ------------------
  105|     28|      this->normal_prediction_mode_ = mode;
  106|     28|      return true;
  107|    129|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 129, False: 0]
  ------------------
  108|    129|      this->normal_prediction_mode_ = mode;
  109|    129|      return true;
  110|    129|    }
  111|      0|    return false;
  112|    157|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   330k|                             DataTypeT *prediction) override {
   42|   330k|    DRACO_DCHECK(this->IsInitialized());
   43|   330k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   330k|    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|   330k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   330k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   330k|    VectorD<int64_t, 3> normal;
   53|   330k|    CornerIndex c_next, c_prev;
   54|   998k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 667k, False: 330k]
  ------------------
   55|       |      // Getting corners.
   56|   667k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 156, False: 667k]
  ------------------
   57|    156|        c_next = corner_table->Next(corner_id);
   58|    156|        c_prev = corner_table->Previous(corner_id);
   59|   667k|      } else {
   60|   667k|        c_next = corner_table->Next(cit.Corner());
   61|   667k|        c_prev = corner_table->Previous(cit.Corner());
   62|   667k|      }
   63|   667k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   667k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   667k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   667k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   667k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   667k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   667k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   667k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   667k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   667k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   667k|      cit.Next();
   81|   667k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   330k|    constexpr int64_t upper_bound = 1 << 29;
   85|   330k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 104, False: 330k]
  ------------------
   86|    104|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    104|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 48, False: 56]
  ------------------
   88|     48|        const int64_t quotient = abs_sum / upper_bound;
   89|     48|        normal = normal / quotient;
   90|     48|      }
   91|   330k|    } else {
   92|   330k|      const int64_t abs_sum = normal.AbsSum();
   93|   330k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.41k, False: 329k]
  ------------------
   94|  1.41k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.41k|        normal = normal / quotient;
   96|  1.41k|      }
   97|   330k|    }
   98|   330k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   330k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   330k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   330k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   330k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    142|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    142|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 12, False: 130]
  ------------------
  105|     12|      this->normal_prediction_mode_ = mode;
  106|     12|      return true;
  107|    130|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 130, False: 0]
  ------------------
  108|    130|      this->normal_prediction_mode_ = mode;
  109|    130|      return true;
  110|    130|    }
  111|      0|    return false;
  112|    142|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   147k|                             DataTypeT *prediction) override {
   42|   147k|    DRACO_DCHECK(this->IsInitialized());
   43|   147k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   147k|    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|   147k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   147k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   147k|    VectorD<int64_t, 3> normal;
   53|   147k|    CornerIndex c_next, c_prev;
   54|  1.02M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 881k, False: 147k]
  ------------------
   55|       |      // Getting corners.
   56|   881k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 66, False: 881k]
  ------------------
   57|     66|        c_next = corner_table->Next(corner_id);
   58|     66|        c_prev = corner_table->Previous(corner_id);
   59|   881k|      } else {
   60|   881k|        c_next = corner_table->Next(cit.Corner());
   61|   881k|        c_prev = corner_table->Previous(cit.Corner());
   62|   881k|      }
   63|   881k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   881k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   881k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   881k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   881k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   881k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   881k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   881k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   881k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   881k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   881k|      cit.Next();
   81|   881k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   147k|    constexpr int64_t upper_bound = 1 << 29;
   85|   147k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 44, False: 147k]
  ------------------
   86|     44|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     44|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 16, False: 28]
  ------------------
   88|     16|        const int64_t quotient = abs_sum / upper_bound;
   89|     16|        normal = normal / quotient;
   90|     16|      }
   91|   147k|    } else {
   92|   147k|      const int64_t abs_sum = normal.AbsSum();
   93|   147k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 82.3k, False: 65.5k]
  ------------------
   94|  82.3k|        const int64_t quotient = abs_sum / upper_bound;
   95|  82.3k|        normal = normal / quotient;
   96|  82.3k|      }
   97|   147k|    }
   98|   147k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   147k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   147k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   147k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   147k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    184|      : Base(md) {
   35|    184|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    184|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    238|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    238|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 53, False: 185]
  ------------------
  105|     53|      this->normal_prediction_mode_ = mode;
  106|     53|      return true;
  107|    185|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 185, False: 0]
  ------------------
  108|    185|      this->normal_prediction_mode_ = mode;
  109|    185|      return true;
  110|    185|    }
  111|      0|    return false;
  112|    238|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   534k|                             DataTypeT *prediction) override {
   42|   534k|    DRACO_DCHECK(this->IsInitialized());
   43|   534k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   534k|    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|   534k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   534k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   534k|    VectorD<int64_t, 3> normal;
   53|   534k|    CornerIndex c_next, c_prev;
   54|  1.08M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 552k, False: 534k]
  ------------------
   55|       |      // Getting corners.
   56|   552k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 300, False: 552k]
  ------------------
   57|    300|        c_next = corner_table->Next(corner_id);
   58|    300|        c_prev = corner_table->Previous(corner_id);
   59|   552k|      } else {
   60|   552k|        c_next = corner_table->Next(cit.Corner());
   61|   552k|        c_prev = corner_table->Previous(cit.Corner());
   62|   552k|      }
   63|   552k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   552k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   552k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   552k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   552k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   552k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   552k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   552k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   552k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   552k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   552k|      cit.Next();
   81|   552k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   534k|    constexpr int64_t upper_bound = 1 << 29;
   85|   534k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 256, False: 534k]
  ------------------
   86|    256|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    256|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 95, False: 161]
  ------------------
   88|     95|        const int64_t quotient = abs_sum / upper_bound;
   89|     95|        normal = normal / quotient;
   90|     95|      }
   91|   534k|    } else {
   92|   534k|      const int64_t abs_sum = normal.AbsSum();
   93|   534k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.61k, False: 532k]
  ------------------
   94|  1.61k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.61k|        normal = normal / quotient;
   96|  1.61k|      }
   97|   534k|    }
   98|   534k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   534k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   534k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   534k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   534k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    320|      : Base(md) {
   35|    320|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    320|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    390|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    390|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 69, False: 321]
  ------------------
  105|     69|      this->normal_prediction_mode_ = mode;
  106|     69|      return true;
  107|    321|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 321, False: 0]
  ------------------
  108|    321|      this->normal_prediction_mode_ = mode;
  109|    321|      return true;
  110|    321|    }
  111|      0|    return false;
  112|    390|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   160k|                             DataTypeT *prediction) override {
   42|   160k|    DRACO_DCHECK(this->IsInitialized());
   43|   160k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   160k|    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|   160k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   160k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   160k|    VectorD<int64_t, 3> normal;
   53|   160k|    CornerIndex c_next, c_prev;
   54|  1.07M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 915k, False: 160k]
  ------------------
   55|       |      // Getting corners.
   56|   915k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 390, False: 914k]
  ------------------
   57|    390|        c_next = corner_table->Next(corner_id);
   58|    390|        c_prev = corner_table->Previous(corner_id);
   59|   914k|      } else {
   60|   914k|        c_next = corner_table->Next(cit.Corner());
   61|   914k|        c_prev = corner_table->Previous(cit.Corner());
   62|   914k|      }
   63|   915k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   915k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   915k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   915k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   915k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   915k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   915k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   915k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   915k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   915k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   915k|      cit.Next();
   81|   915k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   160k|    constexpr int64_t upper_bound = 1 << 29;
   85|   160k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 366, False: 160k]
  ------------------
   86|    366|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    366|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 106, False: 260]
  ------------------
   88|    106|        const int64_t quotient = abs_sum / upper_bound;
   89|    106|        normal = normal / quotient;
   90|    106|      }
   91|   160k|    } else {
   92|   160k|      const int64_t abs_sum = normal.AbsSum();
   93|   160k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 3.06k, False: 157k]
  ------------------
   94|  3.06k|        const int64_t quotient = abs_sum / upper_bound;
   95|  3.06k|        normal = normal / quotient;
   96|  3.06k|      }
   97|   160k|    }
   98|   160k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   160k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   160k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   160k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   160k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    132|      : Base(md) {
   35|    132|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    132|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|     97|      : Base(md) {
   35|     97|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     97|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    127|      : Base(md) {
   35|    127|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    127|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    128|      : Base(md) {
   35|    128|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    128|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.19M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.19M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.19M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.19M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.19M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.19M|    return GetPositionForDataId(data_id);
   77|  1.19M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.19M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.19M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.19M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.19M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.19M|    VectorD<int64_t, 3> pos;
   68|  1.19M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.19M|    return pos;
   70|  1.19M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    131|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    131|    pos_attribute_ = &position_attribute;
   43|    131|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    117|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    117|    entry_to_point_id_map_ = map;
   46|    117|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.62M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.62M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.62M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.62M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.62M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.62M|    return GetPositionForDataId(data_id);
   77|  1.62M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.62M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.62M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.62M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.62M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.62M|    VectorD<int64_t, 3> pos;
   68|  1.62M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.62M|    return pos;
   70|  1.62M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     96|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     96|    pos_attribute_ = &position_attribute;
   43|     96|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     89|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     89|    entry_to_point_id_map_ = map;
   46|     89|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.66M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.66M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.66M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.66M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.66M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.66M|    return GetPositionForDataId(data_id);
   77|  1.66M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.66M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.66M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.66M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.66M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.66M|    VectorD<int64_t, 3> pos;
   68|  1.66M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.66M|    return pos;
   70|  1.66M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    125|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    125|    pos_attribute_ = &position_attribute;
   43|    125|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    104|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    104|    entry_to_point_id_map_ = map;
   46|    104|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.91M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.91M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.91M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.91M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.91M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.91M|    return GetPositionForDataId(data_id);
   77|  1.91M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.91M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.91M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.91M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.91M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.91M|    VectorD<int64_t, 3> pos;
   68|  1.91M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.91M|    return pos;
   70|  1.91M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    126|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    126|    pos_attribute_ = &position_attribute;
   43|    126|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    114|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    114|    entry_to_point_id_map_ = map;
   46|    114|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    184|      : pos_attribute_(nullptr),
   36|    184|        entry_to_point_id_map_(nullptr),
   37|    184|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    184|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.63M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.63M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.63M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.63M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.63M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.63M|    return GetPositionForDataId(data_id);
   77|  1.63M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.63M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.63M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.63M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.63M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.63M|    VectorD<int64_t, 3> pos;
   68|  1.63M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.63M|    return pos;
   70|  1.63M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    182|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    182|    pos_attribute_ = &position_attribute;
   43|    182|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    153|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    153|    entry_to_point_id_map_ = map;
   46|    153|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    320|      : pos_attribute_(nullptr),
   36|    320|        entry_to_point_id_map_(nullptr),
   37|    320|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    320|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.99M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.99M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.99M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.99M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.99M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.99M|    return GetPositionForDataId(data_id);
   77|  1.99M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.99M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.99M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.99M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.99M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.99M|    VectorD<int64_t, 3> pos;
   68|  1.99M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.99M|    return pos;
   70|  1.99M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    318|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    318|    pos_attribute_ = &position_attribute;
   43|    318|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    273|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    273|    entry_to_point_id_map_ = map;
   46|    273|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    132|      : pos_attribute_(nullptr),
   36|    132|        entry_to_point_id_map_(nullptr),
   37|    132|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    132|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|     97|      : pos_attribute_(nullptr),
   36|     97|        entry_to_point_id_map_(nullptr),
   37|     97|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|     97|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    127|      : pos_attribute_(nullptr),
   36|    127|        entry_to_point_id_map_(nullptr),
   37|    127|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    127|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    128|      : pos_attribute_(nullptr),
   36|    128|        entry_to_point_id_map_(nullptr),
   37|    128|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    128|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    258|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    258|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    245|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    245|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    245|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    245|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    245|      new DataTypeT[num_components]());
   70|       |
   71|    245|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    245|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    245|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    245|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    245|  const int corner_map_size =
   78|    245|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|  1.04M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 1.04M, False: 245]
  ------------------
   80|  1.04M|    const CornerIndex start_corner_id =
   81|  1.04M|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|  1.04M|    CornerIndex corner_id(start_corner_id);
   84|  1.04M|    int num_parallelograms = 0;
   85|  59.3M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 58.3M, False: 1.04M]
  ------------------
   86|  58.3M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  58.3M|    }
   88|  2.32M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 1.28M, False: 1.04M]
  ------------------
   89|  1.28M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 100k, False: 1.18M]
  ------------------
   90|  1.28M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  1.28M|              num_components, parallelogram_pred_vals.get())) {
   92|  3.36M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 3.26M, False: 100k]
  ------------------
   93|  3.26M|          pred_vals[c] =
   94|  3.26M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  3.26M|        }
   96|   100k|        ++num_parallelograms;
   97|   100k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  1.28M|      corner_id = table->SwingRight(corner_id);
  101|  1.28M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 46.7k, False: 1.23M]
  ------------------
  102|  46.7k|        corner_id = kInvalidCornerIndex;
  103|  46.7k|      }
  104|  1.28M|    }
  105|       |
  106|  1.04M|    const int dst_offset = p * num_components;
  107|  1.04M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 988k, False: 54.0k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|   988k|      const int src_offset = (p - 1) * num_components;
  111|   988k|      this->transform().ComputeOriginalValue(
  112|   988k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   988k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  1.82M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 1.76M, False: 54.0k]
  ------------------
  116|  1.76M|        pred_vals[c] /= num_parallelograms;
  117|  1.76M|      }
  118|  54.0k|      this->transform().ComputeOriginalValue(
  119|  54.0k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|  54.0k|    }
  121|  1.04M|  }
  122|    245|  return true;
  123|    245|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    309|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    309|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    290|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    290|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    290|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    290|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    290|      new DataTypeT[num_components]());
   70|       |
   71|    290|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    290|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    290|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    290|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    290|  const int corner_map_size =
   78|    290|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   482k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 481k, False: 290]
  ------------------
   80|   481k|    const CornerIndex start_corner_id =
   81|   481k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   481k|    CornerIndex corner_id(start_corner_id);
   84|   481k|    int num_parallelograms = 0;
   85|  14.2M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 13.7M, False: 481k]
  ------------------
   86|  13.7M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  13.7M|    }
   88|  3.33M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 2.85M, False: 481k]
  ------------------
   89|  2.85M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 937k, False: 1.91M]
  ------------------
   90|  2.85M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  2.85M|              num_components, parallelogram_pred_vals.get())) {
   92|  27.8M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 26.8M, False: 937k]
  ------------------
   93|  26.8M|          pred_vals[c] =
   94|  26.8M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  26.8M|        }
   96|   937k|        ++num_parallelograms;
   97|   937k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  2.85M|      corner_id = table->SwingRight(corner_id);
  101|  2.85M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 473k, False: 2.38M]
  ------------------
  102|   473k|        corner_id = kInvalidCornerIndex;
  103|   473k|      }
  104|  2.85M|    }
  105|       |
  106|   481k|    const int dst_offset = p * num_components;
  107|   481k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 866, False: 480k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|    866|      const int src_offset = (p - 1) * num_components;
  111|    866|      this->transform().ComputeOriginalValue(
  112|    866|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   480k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  14.2M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 13.7M, False: 480k]
  ------------------
  116|  13.7M|        pred_vals[c] /= num_parallelograms;
  117|  13.7M|      }
  118|   480k|      this->transform().ComputeOriginalValue(
  119|   480k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   480k|    }
  121|   481k|  }
  122|    290|  return true;
  123|    290|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  3.71M|    int num_components, DataTypeT *out_prediction) {
   49|  3.71M|  const CornerIndex oci = table->Opposite(ci);
   50|  3.71M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 3.15M, False: 562k]
  ------------------
   51|  3.15M|    return false;
   52|  3.15M|  }
   53|   562k|  int vert_opp, vert_next, vert_prev;
   54|   562k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   562k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   562k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 304k, False: 257k]
  |  Branch (56:35): [True: 237k, False: 67.3k]
  ------------------
   57|   237k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 221k, False: 16.0k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   221k|    const int v_opp_off = vert_opp * num_components;
   60|   221k|    const int v_next_off = vert_next * num_components;
   61|   221k|    const int v_prev_off = vert_prev * num_components;
   62|  18.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 18.5M, False: 221k]
  ------------------
   63|  18.5M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  18.5M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  18.5M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  18.5M|      const int64_t result =
   67|  18.5M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  18.5M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  18.5M|    }
   71|   221k|    return true;
   72|   221k|  }
   73|   340k|  return false;  // Not all data is available for prediction
   74|   562k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   562k|    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|   562k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   562k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   562k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   562k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  3.59M|    int num_components, DataTypeT *out_prediction) {
   49|  3.59M|  const CornerIndex oci = table->Opposite(ci);
   50|  3.59M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 11.9k, False: 3.58M]
  ------------------
   51|  11.9k|    return false;
   52|  11.9k|  }
   53|  3.58M|  int vert_opp, vert_next, vert_prev;
   54|  3.58M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  3.58M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  3.58M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 1.92M, False: 1.65M]
  |  Branch (56:35): [True: 1.47M, False: 453k]
  ------------------
   57|  1.47M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 1.37M, False: 100k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  1.37M|    const int v_opp_off = vert_opp * num_components;
   60|  1.37M|    const int v_next_off = vert_next * num_components;
   61|  1.37M|    const int v_prev_off = vert_prev * num_components;
   62|  53.5M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 52.1M, False: 1.37M]
  ------------------
   63|  52.1M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  52.1M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  52.1M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  52.1M|      const int64_t result =
   67|  52.1M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  52.1M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  52.1M|    }
   71|  1.37M|    return true;
   72|  1.37M|  }
   73|  2.21M|  return false;  // Not all data is available for prediction
   74|  3.58M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  3.58M|    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|  3.58M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  3.58M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  3.58M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  3.58M|}

_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|    116|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|    116|            attribute, transform, mesh_data),
   46|    116|        pos_attribute_(nullptr),
   47|    116|        entry_to_point_id_map_(nullptr),
   48|    116|        num_components_(0),
   49|    116|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   71|    231|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   73|    116|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|    116|    DRACO_DCHECK_EQ(i, 0);
   75|    116|    (void)i;
   76|    116|    return GeometryAttribute::POSITION;
   77|    116|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|    116|  bool SetParentAttribute(const PointAttribute *att) override {
   80|    116|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 116]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|    116|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 116]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|    116|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 1, False: 115]
  ------------------
   87|      1|      return false;  // Currently works only for 3 component positions.
   88|      1|    }
   89|    115|    pos_attribute_ = att;
   90|    115|    return true;
   91|    116|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  153|    110|    DecodePredictionData(DecoderBuffer *buffer) {
  154|       |  // Decode the delta coded orientations.
  155|    110|  uint32_t num_orientations = 0;
  156|    110|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    110|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (156:7): [True: 3, False: 107]
  ------------------
  157|      3|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (157:9): [True: 0, False: 3]
  ------------------
  158|      0|      return false;
  159|      0|    }
  160|    107|  } else {
  161|    107|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (161:9): [True: 1, False: 106]
  ------------------
  162|      1|      return false;
  163|      1|    }
  164|    107|  }
  165|    109|  if (num_orientations == 0) {
  ------------------
  |  Branch (165:7): [True: 1, False: 108]
  ------------------
  166|      1|    return false;
  167|      1|  }
  168|    108|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (168:7): [True: 15, False: 93]
  ------------------
  169|       |    // We can't have more orientations than the maximum number of decoded
  170|       |    // values.
  171|     15|    return false;
  172|     15|  }
  173|     93|  orientations_.resize(num_orientations);
  174|     93|  bool last_orientation = true;
  175|     93|  RAnsBitDecoder decoder;
  176|     93|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (176:7): [True: 1, False: 92]
  ------------------
  177|      1|    return false;
  178|      1|  }
  179|  81.4k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (179:24): [True: 81.3k, False: 92]
  ------------------
  180|  81.3k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (180:9): [True: 3.45k, False: 77.9k]
  ------------------
  181|  3.45k|      last_orientation = !last_orientation;
  182|  3.45k|    }
  183|  81.3k|    orientations_[i] = last_orientation;
  184|  81.3k|  }
  185|     92|  decoder.EndDecoding();
  186|     92|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  187|     92|                                     MeshDataT>::DecodePredictionData(buffer);
  188|     93|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|     65|                          const PointIndex *entry_to_point_id_map) {
  126|     65|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 6, False: 59]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      6|    return false;
  129|      6|  }
  130|     59|  num_components_ = num_components;
  131|     59|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|     59|  predicted_value_ =
  133|     59|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|     59|  this->transform().Init(num_components);
  135|       |
  136|     59|  const int corner_map_size =
  137|     59|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|   556k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (138:19): [True: 556k, False: 37]
  ------------------
  139|   556k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  140|   556k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (140:9): [True: 22, False: 556k]
  ------------------
  141|     22|      return false;
  142|     22|    }
  143|       |
  144|   556k|    const int dst_offset = p * num_components;
  145|   556k|    this->transform().ComputeOriginalValue(
  146|   556k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  147|   556k|  }
  148|     37|  return true;
  149|     59|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  193|   556k|                          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|   556k|  const CornerIndex next_corner_id =
  198|   556k|      this->mesh_data().corner_table()->Next(corner_id);
  199|   556k|  const CornerIndex prev_corner_id =
  200|   556k|      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|   556k|  int next_data_id, prev_data_id;
  204|       |
  205|   556k|  int next_vert_id, prev_vert_id;
  206|   556k|  next_vert_id =
  207|   556k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  208|   556k|  prev_vert_id =
  209|   556k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  210|       |
  211|   556k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  212|   556k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  213|       |
  214|   556k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (214:7): [True: 381k, False: 175k]
  |  Branch (214:33): [True: 206k, False: 175k]
  ------------------
  215|       |    // Both other corners have available UV coordinates for prediction.
  216|   206k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  217|   206k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  218|   206k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (218:9): [True: 203k, False: 2.60k]
  ------------------
  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|   407k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (222:24): [True: 407k, False: 203k]
  ------------------
  223|   407k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (223:13): [True: 0, False: 407k]
  |  Branch (223:36): [True: 110, False: 407k]
  ------------------
  224|   407k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (224:13): [True: 0, False: 407k]
  ------------------
  225|    110|          predicted_value_[i] = INT_MIN;
  226|   407k|        } else {
  227|   407k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  228|   407k|        }
  229|   407k|      }
  230|   203k|      return true;
  231|   203k|    }
  232|       |
  233|       |    // Get positions at all corners.
  234|  2.60k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  235|  2.60k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  236|  2.60k|    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.60k|    const Vector3f pn = prev_pos - next_pos;
  261|  2.60k|    const Vector3f cn = tip_pos - next_pos;
  262|  2.60k|    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.60k|    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.60k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  5.20k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (273:9): [True: 0, False: 2.60k]
  |  Branch (273:53): [True: 76, False: 2.52k]
  ------------------
  274|     76|      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|     76|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  279|  2.52k|    } else {
  280|  2.52k|      s = 0;
  281|  2.52k|      t = 0;
  282|  2.52k|    }
  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.60k|    const Vector2f pn_uv = p_uv - n_uv;
  299|  2.60k|    const float pnus = pn_uv[0] * s + n_uv[0];
  300|  2.60k|    const float pnut = pn_uv[0] * t;
  301|  2.60k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  302|  2.60k|    const float pnvt = pn_uv[1] * t;
  303|  2.60k|    Vector2f predicted_uv;
  304|  2.60k|    if (orientations_.empty()) {
  ------------------
  |  Branch (304:9): [True: 22, False: 2.58k]
  ------------------
  305|     22|      return false;
  306|     22|    }
  307|       |
  308|       |    // When decoding the data, we already know which orientation to use.
  309|  2.58k|    const bool orientation = orientations_.back();
  310|  2.58k|    orientations_.pop_back();
  311|  2.58k|    if (orientation) {
  ------------------
  |  Branch (311:9): [True: 567, False: 2.01k]
  ------------------
  312|    567|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  313|  2.01k|    } else {
  314|  2.01k|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  315|  2.01k|    }
  316|  2.58k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (316:9): [True: 2.58k, 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.58k|      const double u = floor(predicted_uv[0] + 0.5);
  321|  2.58k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (321:11): [True: 0, False: 2.58k]
  |  Branch (321:28): [True: 56, False: 2.52k]
  |  Branch (321:43): [True: 9, False: 2.51k]
  ------------------
  322|     65|        predicted_value_[0] = INT_MIN;
  323|  2.51k|      } else {
  324|  2.51k|        predicted_value_[0] = static_cast<int>(u);
  325|  2.51k|      }
  326|  2.58k|      const double v = floor(predicted_uv[1] + 0.5);
  327|  2.58k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (327:11): [True: 0, False: 2.58k]
  |  Branch (327:28): [True: 38, False: 2.54k]
  |  Branch (327:43): [True: 15, False: 2.52k]
  ------------------
  328|     53|        predicted_value_[1] = INT_MIN;
  329|  2.52k|      } else {
  330|  2.52k|        predicted_value_[1] = static_cast<int>(v);
  331|  2.52k|      }
  332|  2.58k|    } 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.58k|    return true;
  338|  2.60k|  }
  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|   350k|  int data_offset = 0;
  343|   350k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (343:7): [True: 175k, False: 175k]
  ------------------
  344|       |    // Use the value on the previous corner as the prediction.
  345|   175k|    data_offset = prev_data_id * num_components_;
  346|   175k|  }
  347|   350k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (347:7): [True: 4, False: 350k]
  ------------------
  348|       |    // Use the value on the next corner as the prediction.
  349|      4|    data_offset = next_data_id * num_components_;
  350|   350k|  } else {
  351|       |    // None of the other corners have a valid value. Use the last encoded value
  352|       |    // as the prediction if possible.
  353|   350k|    if (data_id > 0) {
  ------------------
  |  Branch (353:9): [True: 350k, False: 59]
  ------------------
  354|   350k|      data_offset = (data_id - 1) * num_components_;
  355|   350k|    } else {
  356|       |      // We are encoding the first value. Predict 0.
  357|    177|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (357:23): [True: 118, False: 59]
  ------------------
  358|    118|        predicted_value_[i] = 0;
  359|    118|      }
  360|     59|      return true;
  361|     59|    }
  362|   350k|  }
  363|  1.05M|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (363:19): [True: 700k, False: 350k]
  ------------------
  364|   700k|    predicted_value_[i] = data[data_offset + i];
  365|   700k|  }
  366|   350k|  return true;
  367|   350k|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   413k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT *data) const {
  103|   413k|    const int data_offset = entry_id * num_components_;
  104|   413k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   413k|                    static_cast<float>(data[data_offset + 1]));
  106|   413k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   94|  7.80k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  7.80k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  7.80k|    Vector3f pos;
   97|  7.80k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  7.80k|                                 &pos[0]);
   99|  7.80k|    return pos;
  100|  7.80k|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|     99|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|     99|            attribute, transform, mesh_data),
   46|     99|        pos_attribute_(nullptr),
   47|     99|        entry_to_point_id_map_(nullptr),
   48|     99|        num_components_(0),
   49|     99|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   71|    197|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   73|     99|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|     99|    DRACO_DCHECK_EQ(i, 0);
   75|     99|    (void)i;
   76|     99|    return GeometryAttribute::POSITION;
   77|     99|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|     99|  bool SetParentAttribute(const PointAttribute *att) override {
   80|     99|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 99]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|     99|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 99]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|     99|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 1, False: 98]
  ------------------
   87|      1|      return false;  // Currently works only for 3 component positions.
   88|      1|    }
   89|     98|    pos_attribute_ = att;
   90|     98|    return true;
   91|     99|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  153|     95|    DecodePredictionData(DecoderBuffer *buffer) {
  154|       |  // Decode the delta coded orientations.
  155|     95|  uint32_t num_orientations = 0;
  156|     95|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     95|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (156:7): [True: 0, False: 95]
  ------------------
  157|      0|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (157:9): [True: 0, False: 0]
  ------------------
  158|      0|      return false;
  159|      0|    }
  160|     95|  } else {
  161|     95|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (161:9): [True: 1, False: 94]
  ------------------
  162|      1|      return false;
  163|      1|    }
  164|     95|  }
  165|     94|  if (num_orientations == 0) {
  ------------------
  |  Branch (165:7): [True: 1, False: 93]
  ------------------
  166|      1|    return false;
  167|      1|  }
  168|     93|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (168:7): [True: 8, False: 85]
  ------------------
  169|       |    // We can't have more orientations than the maximum number of decoded
  170|       |    // values.
  171|      8|    return false;
  172|      8|  }
  173|     85|  orientations_.resize(num_orientations);
  174|     85|  bool last_orientation = true;
  175|     85|  RAnsBitDecoder decoder;
  176|     85|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (176:7): [True: 1, False: 84]
  ------------------
  177|      1|    return false;
  178|      1|  }
  179|  15.2k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (179:24): [True: 15.1k, False: 84]
  ------------------
  180|  15.1k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (180:9): [True: 485, False: 14.6k]
  ------------------
  181|    485|      last_orientation = !last_orientation;
  182|    485|    }
  183|  15.1k|    orientations_[i] = last_orientation;
  184|  15.1k|  }
  185|     84|  decoder.EndDecoding();
  186|     84|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  187|     84|                                     MeshDataT>::DecodePredictionData(buffer);
  188|     85|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|     75|                          const PointIndex *entry_to_point_id_map) {
  126|     75|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 3, False: 72]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      3|    return false;
  129|      3|  }
  130|     72|  num_components_ = num_components;
  131|     72|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|     72|  predicted_value_ =
  133|     72|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|     72|  this->transform().Init(num_components);
  135|       |
  136|     72|  const int corner_map_size =
  137|     72|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|   175k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (138:19): [True: 175k, False: 57]
  ------------------
  139|   175k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  140|   175k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (140:9): [True: 15, False: 175k]
  ------------------
  141|     15|      return false;
  142|     15|    }
  143|       |
  144|   175k|    const int dst_offset = p * num_components;
  145|   175k|    this->transform().ComputeOriginalValue(
  146|   175k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  147|   175k|  }
  148|     57|  return true;
  149|     72|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  193|   175k|                          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|   175k|  const CornerIndex next_corner_id =
  198|   175k|      this->mesh_data().corner_table()->Next(corner_id);
  199|   175k|  const CornerIndex prev_corner_id =
  200|   175k|      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|   175k|  int next_data_id, prev_data_id;
  204|       |
  205|   175k|  int next_vert_id, prev_vert_id;
  206|   175k|  next_vert_id =
  207|   175k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  208|   175k|  prev_vert_id =
  209|   175k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  210|       |
  211|   175k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  212|   175k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  213|       |
  214|   175k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (214:7): [True: 174k, False: 129]
  |  Branch (214:33): [True: 174k, False: 131]
  ------------------
  215|       |    // Both other corners have available UV coordinates for prediction.
  216|   174k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  217|   174k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  218|   174k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (218:9): [True: 173k, False: 1.32k]
  ------------------
  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|   346k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (222:24): [True: 346k, False: 173k]
  ------------------
  223|   346k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (223:13): [True: 0, False: 346k]
  |  Branch (223:36): [True: 51, False: 346k]
  ------------------
  224|   346k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (224:13): [True: 0, False: 346k]
  ------------------
  225|     51|          predicted_value_[i] = INT_MIN;
  226|   346k|        } else {
  227|   346k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  228|   346k|        }
  229|   346k|      }
  230|   173k|      return true;
  231|   173k|    }
  232|       |
  233|       |    // Get positions at all corners.
  234|  1.32k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  235|  1.32k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  236|  1.32k|    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.32k|    const Vector3f pn = prev_pos - next_pos;
  261|  1.32k|    const Vector3f cn = tip_pos - next_pos;
  262|  1.32k|    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.32k|    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.32k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  2.65k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (273:9): [True: 0, False: 1.32k]
  |  Branch (273:53): [True: 247, False: 1.07k]
  ------------------
  274|    247|      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|    247|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  279|  1.07k|    } else {
  280|  1.07k|      s = 0;
  281|  1.07k|      t = 0;
  282|  1.07k|    }
  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.32k|    const Vector2f pn_uv = p_uv - n_uv;
  299|  1.32k|    const float pnus = pn_uv[0] * s + n_uv[0];
  300|  1.32k|    const float pnut = pn_uv[0] * t;
  301|  1.32k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  302|  1.32k|    const float pnvt = pn_uv[1] * t;
  303|  1.32k|    Vector2f predicted_uv;
  304|  1.32k|    if (orientations_.empty()) {
  ------------------
  |  Branch (304:9): [True: 15, False: 1.31k]
  ------------------
  305|     15|      return false;
  306|     15|    }
  307|       |
  308|       |    // When decoding the data, we already know which orientation to use.
  309|  1.31k|    const bool orientation = orientations_.back();
  310|  1.31k|    orientations_.pop_back();
  311|  1.31k|    if (orientation) {
  ------------------
  |  Branch (311:9): [True: 886, False: 425]
  ------------------
  312|    886|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  313|    886|    } else {
  314|    425|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  315|    425|    }
  316|  1.31k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (316:9): [True: 1.31k, 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.31k|      const double u = floor(predicted_uv[0] + 0.5);
  321|  1.31k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (321:11): [True: 0, False: 1.31k]
  |  Branch (321:28): [True: 22, False: 1.28k]
  |  Branch (321:43): [True: 16, False: 1.27k]
  ------------------
  322|     38|        predicted_value_[0] = INT_MIN;
  323|  1.27k|      } else {
  324|  1.27k|        predicted_value_[0] = static_cast<int>(u);
  325|  1.27k|      }
  326|  1.31k|      const double v = floor(predicted_uv[1] + 0.5);
  327|  1.31k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (327:11): [True: 0, False: 1.31k]
  |  Branch (327:28): [True: 35, False: 1.27k]
  |  Branch (327:43): [True: 17, False: 1.25k]
  ------------------
  328|     52|        predicted_value_[1] = INT_MIN;
  329|  1.25k|      } else {
  330|  1.25k|        predicted_value_[1] = static_cast<int>(v);
  331|  1.25k|      }
  332|  1.31k|    } 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.31k|    return true;
  338|  1.32k|  }
  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|    260|  int data_offset = 0;
  343|    260|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (343:7): [True: 131, False: 129]
  ------------------
  344|       |    // Use the value on the previous corner as the prediction.
  345|    131|    data_offset = prev_data_id * num_components_;
  346|    131|  }
  347|    260|  if (next_data_id < data_id) {
  ------------------
  |  Branch (347:7): [True: 4, False: 256]
  ------------------
  348|       |    // Use the value on the next corner as the prediction.
  349|      4|    data_offset = next_data_id * num_components_;
  350|    256|  } else {
  351|       |    // None of the other corners have a valid value. Use the last encoded value
  352|       |    // as the prediction if possible.
  353|    256|    if (data_id > 0) {
  ------------------
  |  Branch (353:9): [True: 184, False: 72]
  ------------------
  354|    184|      data_offset = (data_id - 1) * num_components_;
  355|    184|    } else {
  356|       |      // We are encoding the first value. Predict 0.
  357|    216|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (357:23): [True: 144, False: 72]
  ------------------
  358|    144|        predicted_value_[i] = 0;
  359|    144|      }
  360|     72|      return true;
  361|     72|    }
  362|    256|  }
  363|    564|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (363:19): [True: 376, False: 188]
  ------------------
  364|    376|    predicted_value_[i] = data[data_offset + i];
  365|    376|  }
  366|    188|  return true;
  367|    260|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   349k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT *data) const {
  103|   349k|    const int data_offset = entry_id * num_components_;
  104|   349k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   349k|                    static_cast<float>(data[data_offset + 1]));
  106|   349k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   94|  3.97k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  3.97k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  3.97k|    Vector3f pos;
   97|  3.97k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  3.97k|                                 &pos[0]);
   99|  3.97k|    return pos;
  100|  3.97k|  }

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

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

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    112|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    329|  bool AreCorrectionsPositive() override {
   71|    329|    return transform_.AreCorrectionsPositive();
   72|    329|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    102|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    102|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 20, False: 82]
  ------------------
   50|     20|      return false;
   51|     20|    }
   52|     82|    return true;
   53|    102|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|   502k|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    152|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    391|  bool AreCorrectionsPositive() override {
   71|    391|    return transform_.AreCorrectionsPositive();
   72|    391|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    142|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    142|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 14, False: 128]
  ------------------
   50|     14|      return false;
   51|     14|    }
   52|    128|    return true;
   53|    142|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|   605k|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  3.40k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  2.36k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  3.25k|  bool AreCorrectionsPositive() override {
   71|  3.25k|    return transform_.AreCorrectionsPositive();
   72|  3.25k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  2.55k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  2.55k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 205, False: 2.34k]
  ------------------
   50|    205|      return false;
   51|    205|    }
   52|  2.34k|    return true;
   53|  2.55k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  24.1M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    341|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    407|      : attribute_(attribute), transform_(transform) {}

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

_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|     82|    const PointIndex *) {
   50|     82|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|     82|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|     82|  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|  37.0k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 36.9k, False: 82]
  ------------------
   57|  36.9k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  36.9k|                                           in_corr + i, out_data + i);
   59|  36.9k|  }
   60|     82|  return true;
   61|     82|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    128|    const PointIndex *) {
   50|    128|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    128|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    128|  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|   125k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 125k, False: 128]
  ------------------
   57|   125k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|   125k|                                           in_corr + i, out_data + i);
   59|   125k|  }
   60|    128|  return true;
   61|    128|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    311|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    226|    const PointIndex *) {
   50|    226|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    226|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    226|  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.2M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 18.2M, False: 226]
  ------------------
   57|  18.2M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  18.2M|                                           in_corr + i, out_data + i);
   59|  18.2M|  }
   60|    226|  return true;
   61|    226|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    112|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    152|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    326|    uint16_t bitstream_version) {
   38|    326|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    326|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 326, False: 0]
  ------------------
   40|    326|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 4, False: 322]
  ------------------
   41|    322|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 22, False: 300]
  ------------------
   42|    300|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 300]
  ------------------
   43|    300|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 20, False: 280]
  ------------------
   44|    280|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 229, False: 51]
  ------------------
   45|    312|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 37, False: 14]
  ------------------
   46|    312|    const CornerTable *const ct = source->GetCornerTable();
   47|    312|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    312|        source->GetAttributeEncodingData(att_id);
   49|    312|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 78, False: 234]
  |  Branch (49:26): [True: 0, False: 234]
  ------------------
   50|       |      // No connectivity data found.
   51|     78|      return nullptr;
   52|     78|    }
   53|       |    // Connectivity data exists.
   54|    234|    const MeshAttributeCornerTable *const att_ct =
   55|    234|        source->GetAttributeCornerTable(att_id);
   56|    234|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 135, False: 99]
  ------------------
   57|    135|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    135|      MeshData md;
   59|    135|      md.Set(source->mesh(), att_ct,
   60|    135|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    135|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    135|      MeshPredictionSchemeFactoryT factory;
   63|    135|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    135|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 132, False: 3]
  ------------------
   65|    132|        return ret;
   66|    132|      }
   67|    135|    } else {
   68|     99|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|     99|      MeshData md;
   70|     99|      md.Set(source->mesh(), ct,
   71|     99|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|     99|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|     99|      MeshPredictionSchemeFactoryT factory;
   74|     99|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|     99|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 97, False: 2]
  ------------------
   76|     97|        return ret;
   77|     97|      }
   78|     99|    }
   79|    234|  }
   80|     19|  return nullptr;
   81|    326|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    406|    uint16_t bitstream_version) {
   38|    406|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    406|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 406, False: 0]
  ------------------
   40|    406|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 21, False: 385]
  ------------------
   41|    385|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 11, False: 374]
  ------------------
   42|    374|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 3, False: 371]
  ------------------
   43|    371|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 27, False: 344]
  ------------------
   44|    344|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 287, False: 57]
  ------------------
   45|    397|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 48, False: 9]
  ------------------
   46|    397|    const CornerTable *const ct = source->GetCornerTable();
   47|    397|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    397|        source->GetAttributeEncodingData(att_id);
   49|    397|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 128, False: 269]
  |  Branch (49:26): [True: 0, False: 269]
  ------------------
   50|       |      // No connectivity data found.
   51|    128|      return nullptr;
   52|    128|    }
   53|       |    // Connectivity data exists.
   54|    269|    const MeshAttributeCornerTable *const att_ct =
   55|    269|        source->GetAttributeCornerTable(att_id);
   56|    269|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 139, False: 130]
  ------------------
   57|    139|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    139|      MeshData md;
   59|    139|      md.Set(source->mesh(), att_ct,
   60|    139|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    139|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    139|      MeshPredictionSchemeFactoryT factory;
   63|    139|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    139|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 127, False: 12]
  ------------------
   65|    127|        return ret;
   66|    127|      }
   67|    139|    } else {
   68|    130|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    130|      MeshData md;
   70|    130|      md.Set(source->mesh(), ct,
   71|    130|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    130|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    130|      MeshPredictionSchemeFactoryT factory;
   74|    130|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    130|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 128, False: 2]
  ------------------
   76|    128|        return ret;
   77|    128|      }
   78|    130|    }
   79|    269|  }
   80|     23|  return nullptr;
   81|    406|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  3.38k|    uint16_t bitstream_version) {
   38|  3.38k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  3.38k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 3.38k, False: 0]
  ------------------
   40|  3.38k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 910, False: 2.47k]
  ------------------
   41|  2.47k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 589, False: 1.89k]
  ------------------
   42|  1.89k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 674, False: 1.21k]
  ------------------
   43|  1.21k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 341, False: 875]
  ------------------
   44|    875|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 511, False: 364]
  ------------------
   45|  3.24k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 220, False: 144]
  ------------------
   46|  3.24k|    const CornerTable *const ct = source->GetCornerTable();
   47|  3.24k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  3.24k|        source->GetAttributeEncodingData(att_id);
   49|  3.24k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 147, False: 3.09k]
  |  Branch (49:26): [True: 0, False: 3.09k]
  ------------------
   50|       |      // No connectivity data found.
   51|    147|      return nullptr;
   52|    147|    }
   53|       |    // Connectivity data exists.
   54|  3.09k|    const MeshAttributeCornerTable *const att_ct =
   55|  3.09k|        source->GetAttributeCornerTable(att_id);
   56|  3.09k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 1.50k, False: 1.59k]
  ------------------
   57|  1.50k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  1.50k|      MeshData md;
   59|  1.50k|      md.Set(source->mesh(), att_ct,
   60|  1.50k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  1.50k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  1.50k|      MeshPredictionSchemeFactoryT factory;
   63|  1.50k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  1.50k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 1.50k, False: 0]
  ------------------
   65|  1.50k|        return ret;
   66|  1.50k|      }
   67|  1.59k|    } else {
   68|  1.59k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  1.59k|      MeshData md;
   70|  1.59k|      md.Set(source->mesh(), ct,
   71|  1.59k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  1.59k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  1.59k|      MeshPredictionSchemeFactoryT factory;
   74|  1.59k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  1.59k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 1.59k, False: 0]
  ------------------
   76|  1.59k|        return ret;
   77|  1.59k|      }
   78|  1.59k|    }
   79|  3.09k|  }
   80|    144|  return nullptr;
   81|  3.38k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|   604k|  bool IsInBottomLeft(const Point2 &p) const {
   93|   604k|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 422k, False: 182k]
  |  Branch (93:22): [True: 395k, False: 26.6k]
  ------------------
   94|   395k|      return true;
   95|   395k|    }
   96|   208k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 65.6k, False: 143k]
  |  Branch (96:25): [True: 19.7k, False: 45.8k]
  ------------------
   97|   604k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|   604k|  int32_t GetRotationCount(Point2 pred) const {
   51|   604k|    const DataType sign_x = pred[0];
   52|   604k|    const DataType sign_y = pred[1];
   53|       |
   54|   604k|    int32_t rotation_count = 0;
   55|   604k|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 422k, False: 182k]
  ------------------
   56|   422k|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 395k, False: 26.6k]
  ------------------
   57|   395k|        rotation_count = 0;
   58|   395k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 2.24k, False: 24.3k]
  ------------------
   59|  2.24k|        rotation_count = 3;
   60|  24.3k|      } else {
   61|  24.3k|        rotation_count = 1;
   62|  24.3k|      }
   63|   422k|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 116k, False: 65.6k]
  ------------------
   64|   116k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 71.5k, False: 44.9k]
  ------------------
   65|  71.5k|        rotation_count = 2;
   66|  71.5k|      } else {
   67|  44.9k|        rotation_count = 1;
   68|  44.9k|      }
   69|   116k|    } else {
   70|  65.6k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 19.7k, False: 45.8k]
  ------------------
   71|  19.7k|        rotation_count = 0;
   72|  45.8k|      } else {
   73|  45.8k|        rotation_count = 3;
   74|  45.8k|      }
   75|  65.6k|    }
   76|   604k|    return rotation_count;
   77|   604k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   377k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   377k|    switch (rotation_count) {
   81|   117k|      case 1:
  ------------------
  |  Branch (81:7): [True: 117k, False: 260k]
  ------------------
   82|   117k|        return Point2(p[1], -p[0]);
   83|   143k|      case 2:
  ------------------
  |  Branch (83:7): [True: 143k, False: 234k]
  ------------------
   84|   143k|        return Point2(-p[0], -p[1]);
   85|   117k|      case 3:
  ------------------
  |  Branch (85:7): [True: 117k, False: 260k]
  ------------------
   86|   117k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 377k]
  ------------------
   88|      0|        return p;
   89|   377k|    }
   90|   377k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    407|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

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

_ZN5draco26SequentialAttributeDecoderC2Ev:
   20|  12.1k|    : decoder_(nullptr), attribute_(nullptr), attribute_id_(-1) {}
_ZN5draco26SequentialAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   23|  12.1k|                                      int attribute_id) {
   24|  12.1k|  decoder_ = decoder;
   25|  12.1k|  attribute_ = decoder->point_cloud()->attribute(attribute_id);
   26|  12.1k|  attribute_id_ = attribute_id;
   27|  12.1k|  return true;
   28|  12.1k|}
_ZN5draco26SequentialAttributeDecoder23DecodePortableAttributeERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   38|  7.27k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   39|  7.27k|  if (attribute_->num_components() <= 0 ||
  ------------------
  |  Branch (39:7): [True: 0, False: 7.27k]
  ------------------
   40|  7.27k|      !attribute_->Reset(point_ids.size())) {
  ------------------
  |  Branch (40:7): [True: 0, False: 7.27k]
  ------------------
   41|      0|    return false;
   42|      0|  }
   43|  7.27k|  if (!DecodeValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (43:7): [True: 1.49k, False: 5.77k]
  ------------------
   44|  1.49k|    return false;
   45|  1.49k|  }
   46|  5.77k|  return true;
   47|  7.27k|}
_ZN5draco26SequentialAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   50|  2.69k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   51|       |  // Default implementation does not apply any transform.
   52|  2.69k|  return true;
   53|  2.69k|}
_ZN5draco26SequentialAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   56|    351|    const std::vector<PointIndex> &point_ids) {
   57|       |  // Default implementation does not apply any transform.
   58|    351|  return true;
   59|    351|}
_ZN5draco26SequentialAttributeDecoder20GetPortableAttributeEv:
   61|  5.39k|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.39k|  if (!attribute_->is_mapping_identity() && portable_attribute_ &&
  ------------------
  |  Branch (64:7): [True: 4.27k, False: 1.12k]
  |  Branch (64:45): [True: 3.97k, False: 296]
  ------------------
   65|  3.97k|      portable_attribute_->is_mapping_identity()) {
  ------------------
  |  Branch (65:7): [True: 2.92k, False: 1.05k]
  ------------------
   66|  2.92k|    portable_attribute_->SetExplicitMapping(attribute_->indices_map_size());
   67|  2.92k|    for (PointIndex i(0);
   68|  20.2M|         i < static_cast<uint32_t>(attribute_->indices_map_size()); ++i) {
  ------------------
  |  Branch (68:10): [True: 20.2M, False: 2.92k]
  ------------------
   69|  20.2M|      portable_attribute_->SetPointMapEntry(i, attribute_->mapped_index(i));
   70|  20.2M|    }
   71|  2.92k|  }
   72|  5.39k|  return portable_attribute_.get();
   73|  5.39k|}
_ZN5draco26SequentialAttributeDecoder20InitPredictionSchemeEPNS_25PredictionSchemeInterfaceE:
   76|  4.15k|    PredictionSchemeInterface *ps) {
   77|  5.66k|  for (int i = 0; i < ps->GetNumParentAttributes(); ++i) {
  ------------------
  |  Branch (77:19): [True: 1.52k, False: 4.14k]
  ------------------
   78|  1.52k|    const int att_id = decoder_->point_cloud()->GetNamedAttributeId(
   79|  1.52k|        ps->GetParentAttributeType(i));
   80|  1.52k|    if (att_id == -1) {
  ------------------
  |  Branch (80:9): [True: 2, False: 1.52k]
  ------------------
   81|      2|      return false;  // Requested attribute does not exist.
   82|      2|    }
   83|  1.52k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   84|  1.52k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.52k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:9): [True: 0, False: 1.52k]
  ------------------
   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.52k|#endif
   90|  1.52k|    {
   91|  1.52k|      const PointAttribute *const pa = decoder_->GetPortableAttribute(att_id);
   92|  1.52k|      if (pa == nullptr || !ps->SetParentAttribute(pa)) {
  ------------------
  |  Branch (92:11): [True: 1, False: 1.52k]
  |  Branch (92:28): [True: 14, False: 1.51k]
  ------------------
   93|     15|        return false;
   94|     15|      }
   95|  1.52k|    }
   96|  1.52k|  }
   97|  4.14k|  return true;
   98|  4.15k|}
_ZN5draco26SequentialAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  101|    678|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  102|    678|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
  103|    678|  const int entry_size = static_cast<int>(attribute_->byte_stride());
  104|    678|  std::unique_ptr<uint8_t[]> value_data_ptr(new uint8_t[entry_size]);
  105|    678|  uint8_t *const value_data = value_data_ptr.get();
  106|    678|  int out_byte_pos = 0;
  107|       |  // Decode raw attribute values in their original format.
  108|  4.51k|  for (int i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (108:19): [True: 3.88k, False: 631]
  ------------------
  109|  3.88k|    if (!in_buffer->Decode(value_data, entry_size)) {
  ------------------
  |  Branch (109:9): [True: 47, False: 3.83k]
  ------------------
  110|     47|      return false;
  111|     47|    }
  112|  3.83k|    attribute_->buffer()->Write(out_byte_pos, value_data, entry_size);
  113|  3.83k|    out_byte_pos += entry_size;
  114|  3.83k|  }
  115|    631|  return true;
  116|    678|}

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

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  21.4k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  3.95k|    DecoderBuffer *buffer) {
   30|  3.95k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 197, False: 3.75k]
  ------------------
   31|    197|    return false;
   32|    197|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  3.75k|  const int32_t num_attributes = GetNumAttributes();
   35|  3.75k|  sequential_decoders_.resize(num_attributes);
   36|  15.8k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 12.1k, False: 3.73k]
  ------------------
   37|  12.1k|    uint8_t decoder_type;
   38|  12.1k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 7, False: 12.1k]
  ------------------
   39|      7|      return false;
   40|      7|    }
   41|       |    // Create the decoder from the id.
   42|  12.1k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  12.1k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 9, False: 12.1k]
  ------------------
   44|      9|      return false;
   45|      9|    }
   46|  12.1k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 8, False: 12.1k]
  ------------------
   47|      8|      return false;
   48|      8|    }
   49|  12.1k|  }
   50|  3.73k|  return true;
   51|  3.75k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  3.47k|    DecoderBuffer *buffer) {
   55|  3.47k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 3.47k]
  |  Branch (55:22): [True: 7, False: 3.47k]
  ------------------
   56|      7|    return false;
   57|      7|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  3.47k|  const int32_t num_attributes = GetNumAttributes();
   60|  15.2k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 11.8k, False: 3.47k]
  ------------------
   61|  11.8k|    PointAttribute *const pa =
   62|  11.8k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  11.8k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 0, False: 11.8k]
  ------------------
   64|      0|      return false;
   65|      0|    }
   66|  11.8k|  }
   67|  3.47k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  3.47k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  3.47k|    DecoderBuffer *in_buffer) {
   72|  3.47k|  const int32_t num_attributes = GetNumAttributes();
   73|  9.24k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 7.27k, False: 1.97k]
  ------------------
   74|  7.27k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 1.49k, False: 5.77k]
  ------------------
   75|  7.27k|                                                          in_buffer)) {
   76|  1.49k|      return false;
   77|  1.49k|    }
   78|  7.27k|  }
   79|  1.97k|  return true;
   80|  3.47k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  1.97k|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|  1.97k|  const int32_t num_attributes = GetNumAttributes();
   85|  5.05k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 3.42k, False: 1.63k]
  ------------------
   86|  3.42k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 348, False: 3.07k]
  ------------------
   87|  3.42k|            point_ids_, in_buffer)) {
   88|    348|      return false;
   89|    348|    }
   90|  3.42k|  }
   91|  1.63k|  return true;
   92|  1.97k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  1.63k|    TransformAttributesToOriginalFormat() {
   96|  1.63k|  const int32_t num_attributes = GetNumAttributes();
   97|  4.07k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 2.76k, False: 1.30k]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  2.76k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 2.76k, False: 0]
  ------------------
  100|  2.76k|      const PointAttribute *const attribute =
  101|  2.76k|          sequential_decoders_[i]->attribute();
  102|  2.76k|      const PointAttribute *const portable_attribute =
  103|  2.76k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  2.76k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 2.41k, False: 351]
  |  Branch (104:11): [True: 778, False: 1.98k]
  ------------------
  105|  2.41k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 778, False: 1.63k]
  ------------------
  106|  2.41k|              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|    778|        sequential_decoders_[i]->attribute()->CopyFrom(*portable_attribute);
  113|    778|        continue;
  114|    778|      }
  115|  2.76k|    }
  116|  1.98k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 327, False: 1.66k]
  ------------------
  117|  1.98k|            point_ids_)) {
  118|    327|      return false;
  119|    327|    }
  120|  1.98k|  }
  121|  1.30k|  return true;
  122|  1.63k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  12.1k|    uint8_t decoder_type) {
  127|  12.1k|  switch (decoder_type) {
  128|  1.48k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 1.48k, False: 10.6k]
  ------------------
  129|  1.48k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  1.48k|          new SequentialAttributeDecoder());
  131|  9.61k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 9.61k, False: 2.50k]
  ------------------
  132|  9.61k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  9.61k|          new SequentialIntegerAttributeDecoder());
  134|    160|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 160, False: 11.9k]
  ------------------
  135|    160|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    160|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|    853|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 853, False: 11.2k]
  ------------------
  139|    853|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|    853|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|      9|    default:
  ------------------
  |  Branch (142:5): [True: 9, False: 12.1k]
  ------------------
  143|      9|      break;
  144|  12.1k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|      9|  return nullptr;
  147|  12.1k|}

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  10.6k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() {}
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   26|  10.6k|                                             int attribute_id) {
   27|  10.6k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (27:7): [True: 0, False: 10.6k]
  ------------------
   28|      0|    return false;
   29|      0|  }
   30|  10.6k|  return true;
   31|  10.6k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   34|  1.63k|    const std::vector<PointIndex> &point_ids) {
   35|  1.63k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  1.63k|  if (decoder() &&
  ------------------
  |  Branch (36:7): [True: 1.63k, False: 0]
  ------------------
   37|  1.63k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.63k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (37:7): [True: 0, False: 1.63k]
  ------------------
   38|      0|    return true;  // Don't revert the transform here for older files.
   39|      0|  }
   40|  1.63k|#endif
   41|  1.63k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   42|  1.63k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   45|  6.59k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   46|       |  // Decode prediction scheme.
   47|  6.59k|  int8_t prediction_scheme_method;
   48|  6.59k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (48:7): [True: 31, False: 6.56k]
  ------------------
   49|     31|    return false;
   50|     31|  }
   51|       |  // Check that decoded prediction scheme method type is valid.
   52|  6.56k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (52:7): [True: 37, False: 6.52k]
  ------------------
   53|  6.52k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (53:7): [True: 77, False: 6.44k]
  ------------------
   54|    114|    return false;
   55|    114|  }
   56|  6.44k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (56:7): [True: 6.44k, False: 5]
  ------------------
   57|  6.44k|    int8_t prediction_transform_type;
   58|  6.44k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (58:9): [True: 18, False: 6.42k]
  ------------------
   59|     18|      return false;
   60|     18|    }
   61|       |    // Check that decoded prediction scheme transform type is valid.
   62|  6.42k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (62:9): [True: 14, False: 6.41k]
  ------------------
   63|  6.41k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (63:9): [True: 67, False: 6.34k]
  ------------------
   64|     81|      return false;
   65|     81|    }
   66|  6.34k|    prediction_scheme_ = CreateIntPredictionScheme(
   67|  6.34k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   68|  6.34k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   69|  6.34k|  }
   70|       |
   71|  6.34k|  if (prediction_scheme_) {
  ------------------
  |  Branch (71:7): [True: 4.15k, False: 2.19k]
  ------------------
   72|  4.15k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (72:9): [True: 17, False: 4.14k]
  ------------------
   73|     17|      return false;
   74|     17|    }
   75|  4.15k|  }
   76|       |
   77|  6.33k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (77:7): [True: 1.18k, False: 5.14k]
  ------------------
   78|  1.18k|    return false;
   79|  1.18k|  }
   80|       |
   81|  5.14k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   82|  5.14k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   83|  5.14k|  if (decoder() &&
  ------------------
  |  Branch (83:7): [True: 5.14k, False: 0]
  ------------------
   84|  5.14k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  5.14k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:7): [True: 0, False: 5.14k]
  ------------------
   85|       |    // For older files, revert the transform right after we decode the data.
   86|      0|    if (!StoreValues(num_values)) {
  ------------------
  |  Branch (86:9): [True: 0, False: 0]
  ------------------
   87|      0|      return false;
   88|      0|    }
   89|      0|  }
   90|  5.14k|#endif
   91|  5.14k|  return true;
   92|  5.14k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   97|  5.56k|    PredictionSchemeTransformType transform_type) {
   98|  5.56k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (98:7): [True: 2.15k, False: 3.40k]
  ------------------
   99|  2.15k|    return nullptr;  // For now we support only wrap transform.
  100|  2.15k|  }
  101|  3.40k|  return CreatePredictionSchemeForDecoder<
  102|  3.40k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  103|  3.40k|      method, attribute_id(), decoder());
  104|  5.56k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  107|  6.33k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  108|  6.33k|  const int num_components = GetNumValueComponents();
  109|  6.33k|  if (num_components <= 0) {
  ------------------
  |  Branch (109:7): [True: 0, False: 6.33k]
  ------------------
  110|      0|    return false;
  111|      0|  }
  112|  6.33k|  const size_t num_entries = point_ids.size();
  113|  6.33k|  const size_t num_values = num_entries * num_components;
  114|  6.33k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  115|  6.33k|  int32_t *const portable_attribute_data = GetPortableAttributeData();
  116|  6.33k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (116:7): [True: 7, False: 6.32k]
  ------------------
  117|      7|    return false;
  118|      7|  }
  119|  6.32k|  uint8_t compressed;
  120|  6.32k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (120:7): [True: 17, False: 6.30k]
  ------------------
  121|     17|    return false;
  122|     17|  }
  123|  6.30k|  if (compressed > 0) {
  ------------------
  |  Branch (123:7): [True: 517, False: 5.79k]
  ------------------
  124|       |    // Decode compressed values.
  125|    517|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (125:9): [True: 180, False: 337]
  ------------------
  126|    517|                       in_buffer,
  127|    517|                       reinterpret_cast<uint32_t *>(portable_attribute_data))) {
  128|    180|      return false;
  129|    180|    }
  130|  5.79k|  } else {
  131|       |    // Decode the integer data directly.
  132|       |    // Get the number of bytes for a given entry.
  133|  5.79k|    uint8_t num_bytes;
  134|  5.79k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (134:9): [True: 8, False: 5.78k]
  ------------------
  135|      8|      return false;
  136|      8|    }
  137|  5.78k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (137:9): [True: 301, False: 5.48k]
  ------------------
  138|    301|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (138:11): [True: 0, False: 301]
  ------------------
  139|    301|          sizeof(int32_t) * num_values) {
  140|      0|        return false;
  141|      0|      }
  142|    301|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (142:11): [True: 8, False: 293]
  ------------------
  143|    301|                             sizeof(int32_t) * num_values)) {
  144|      8|        return false;
  145|      8|      }
  146|  5.48k|    } else {
  147|  5.48k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (147:11): [True: 25, False: 5.45k]
  ------------------
  148|  5.48k|          num_bytes * num_values) {
  149|     25|        return false;
  150|     25|      }
  151|  5.45k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (151:11): [True: 26, False: 5.43k]
  ------------------
  152|  5.45k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  153|     26|        return false;
  154|     26|      }
  155|   818M|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (155:26): [True: 818M, False: 5.43k]
  ------------------
  156|   818M|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (156:13): [True: 0, False: 818M]
  ------------------
  157|      0|          return false;
  158|      0|        }
  159|   818M|      }
  160|  5.43k|    }
  161|  5.78k|  }
  162|       |
  163|  6.06k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (163:7): [True: 6.06k, False: 0]
  |  Branch (163:26): [True: 2.09k, False: 3.97k]
  ------------------
  164|  5.34k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (164:26): [True: 3.25k, False: 720]
  ------------------
  165|       |    // Convert the values back to the original signed format.
  166|  5.34k|    ConvertSymbolsToSignedInts(
  167|  5.34k|        reinterpret_cast<const uint32_t *>(portable_attribute_data),
  168|  5.34k|        static_cast<int>(num_values), portable_attribute_data);
  169|  5.34k|  }
  170|       |
  171|       |  // If the data was encoded with a prediction scheme, we must revert it.
  172|  6.06k|  if (prediction_scheme_) {
  ------------------
  |  Branch (172:7): [True: 3.97k, False: 2.09k]
  ------------------
  173|  3.97k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (173:9): [True: 564, False: 3.40k]
  ------------------
  174|    564|      return false;
  175|    564|    }
  176|       |
  177|  3.40k|    if (num_values > 0) {
  ------------------
  |  Branch (177:9): [True: 3.40k, False: 0]
  ------------------
  178|  3.40k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (178:11): [True: 350, False: 3.05k]
  ------------------
  179|  3.40k|              portable_attribute_data, portable_attribute_data,
  180|  3.40k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  181|    350|        return false;
  182|    350|      }
  183|  3.40k|    }
  184|  3.40k|  }
  185|  5.14k|  return true;
  186|  6.06k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  188|  1.27k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  189|  1.27k|  switch (attribute()->data_type()) {
  190|    108|    case DT_UINT8:
  ------------------
  |  Branch (190:5): [True: 108, False: 1.16k]
  ------------------
  191|    108|      StoreTypedValues<uint8_t>(num_values);
  192|    108|      break;
  193|    595|    case DT_INT8:
  ------------------
  |  Branch (193:5): [True: 595, False: 676]
  ------------------
  194|    595|      StoreTypedValues<int8_t>(num_values);
  195|    595|      break;
  196|     66|    case DT_UINT16:
  ------------------
  |  Branch (196:5): [True: 66, False: 1.20k]
  ------------------
  197|     66|      StoreTypedValues<uint16_t>(num_values);
  198|     66|      break;
  199|    189|    case DT_INT16:
  ------------------
  |  Branch (199:5): [True: 189, False: 1.08k]
  ------------------
  200|    189|      StoreTypedValues<int16_t>(num_values);
  201|    189|      break;
  202|    126|    case DT_UINT32:
  ------------------
  |  Branch (202:5): [True: 126, False: 1.14k]
  ------------------
  203|    126|      StoreTypedValues<uint32_t>(num_values);
  204|    126|      break;
  205|     79|    case DT_INT32:
  ------------------
  |  Branch (205:5): [True: 79, False: 1.19k]
  ------------------
  206|     79|      StoreTypedValues<int32_t>(num_values);
  207|     79|      break;
  208|    108|    default:
  ------------------
  |  Branch (208:5): [True: 108, False: 1.16k]
  ------------------
  209|    108|      return false;
  210|  1.27k|  }
  211|  1.16k|  return true;
  212|  1.27k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  236|  6.33k|    int num_entries, int num_components) {
  237|  6.33k|  GeometryAttribute ga;
  238|  6.33k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  239|  6.33k|          false, num_components * DataTypeLength(DT_INT32), 0);
  240|  6.33k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  241|  6.33k|  port_att->SetIdentityMapping();
  242|  6.33k|  port_att->Reset(num_entries);
  243|  6.33k|  port_att->set_unique_id(attribute()->unique_id());
  244|  6.33k|  SetPortableAttribute(std::move(port_att));
  245|  6.33k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  215|    108|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    108|  const int num_components = attribute()->num_components();
  217|    108|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    108|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    108|      new AttributeTypeT[num_components]);
  220|    108|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    108|  int val_id = 0;
  222|    108|  int out_byte_pos = 0;
  223|   280k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 280k, False: 108]
  ------------------
  224|  16.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 16.4M, False: 280k]
  ------------------
  225|  16.4M|      const AttributeTypeT value =
  226|  16.4M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  16.4M|      att_val[c] = value;
  228|  16.4M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   280k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   280k|    out_byte_pos += entry_size;
  232|   280k|  }
  233|    108|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  215|    595|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    595|  const int num_components = attribute()->num_components();
  217|    595|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    595|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    595|      new AttributeTypeT[num_components]);
  220|    595|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    595|  int val_id = 0;
  222|    595|  int out_byte_pos = 0;
  223|   123M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 123M, False: 595]
  ------------------
  224|   296M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 172M, False: 123M]
  ------------------
  225|   172M|      const AttributeTypeT value =
  226|   172M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   172M|      att_val[c] = value;
  228|   172M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   123M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   123M|    out_byte_pos += entry_size;
  232|   123M|  }
  233|    595|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  215|     66|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     66|  const int num_components = attribute()->num_components();
  217|     66|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     66|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     66|      new AttributeTypeT[num_components]);
  220|     66|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     66|  int val_id = 0;
  222|     66|  int out_byte_pos = 0;
  223|   626k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 626k, False: 66]
  ------------------
  224|  30.4M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 29.8M, False: 626k]
  ------------------
  225|  29.8M|      const AttributeTypeT value =
  226|  29.8M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  29.8M|      att_val[c] = value;
  228|  29.8M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   626k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   626k|    out_byte_pos += entry_size;
  232|   626k|  }
  233|     66|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  215|    189|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    189|  const int num_components = attribute()->num_components();
  217|    189|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    189|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    189|      new AttributeTypeT[num_components]);
  220|    189|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    189|  int val_id = 0;
  222|    189|  int out_byte_pos = 0;
  223|   986k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 986k, False: 189]
  ------------------
  224|  48.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 47.7M, False: 986k]
  ------------------
  225|  47.7M|      const AttributeTypeT value =
  226|  47.7M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  47.7M|      att_val[c] = value;
  228|  47.7M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   986k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   986k|    out_byte_pos += entry_size;
  232|   986k|  }
  233|    189|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  215|    126|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    126|  const int num_components = attribute()->num_components();
  217|    126|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    126|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    126|      new AttributeTypeT[num_components]);
  220|    126|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    126|  int val_id = 0;
  222|    126|  int out_byte_pos = 0;
  223|   878k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 877k, False: 126]
  ------------------
  224|   113M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 112M, False: 877k]
  ------------------
  225|   112M|      const AttributeTypeT value =
  226|   112M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   112M|      att_val[c] = value;
  228|   112M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   877k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   877k|    out_byte_pos += entry_size;
  232|   877k|  }
  233|    126|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  215|     79|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     79|  const int num_components = attribute()->num_components();
  217|     79|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     79|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     79|      new AttributeTypeT[num_components]);
  220|     79|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     79|  int val_id = 0;
  222|     79|  int out_byte_pos = 0;
  223|  11.0M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 11.0M, False: 79]
  ------------------
  224|  64.8M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 53.8M, False: 11.0M]
  ------------------
  225|  53.8M|      const AttributeTypeT value =
  226|  53.8M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  53.8M|      att_val[c] = value;
  228|  53.8M|    }
  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|     79|}

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

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

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

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

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

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|  3.87M|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|  3.87M|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|  3.87M|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|  3.87M|    const int remaining = 32 - num_used_bits_;
   54|  3.87M|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 2.11M, False: 1.75M]
  ------------------
   55|  2.11M|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 1.87M, False: 248k]
  ------------------
   56|  1.87M|        return false;
   57|  1.87M|      }
   58|   248k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   248k|      num_used_bits_ += nbits;
   60|   248k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 8.19k, False: 239k]
  ------------------
   61|  8.19k|        ++pos_;
   62|  8.19k|        num_used_bits_ = 0;
   63|  8.19k|      }
   64|  1.75M|    } else {
   65|  1.75M|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 1.74M, False: 7.89k]
  ------------------
   66|  1.74M|        return false;
   67|  1.74M|      }
   68|  7.89k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  7.89k|      num_used_bits_ = nbits - remaining;
   70|  7.89k|      ++pos_;
   71|  7.89k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  7.89k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  7.89k|    }
   74|   256k|    return true;
   75|  3.87M|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  5.17M|  bool DecodeNextBit() {
   35|  5.17M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  5.17M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 4.94M, False: 235k]
  ------------------
   37|  4.94M|      return false;
   38|  4.94M|    }
   39|   235k|    const bool bit = *pos_ & selector;
   40|   235k|    ++num_used_bits_;
   41|   235k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 7.23k, False: 228k]
  ------------------
   42|  7.23k|      ++pos_;
   43|  7.23k|      num_used_bits_ = 0;
   44|  7.23k|    }
   45|   235k|    return bit;
   46|  5.17M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    496|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    460|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    298|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  6.39k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 6.22k, False: 173]
  ------------------
   35|  6.22k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 125, False: 6.09k]
  ------------------
   36|    125|        return false;
   37|    125|      }
   38|  6.22k|    }
   39|    173|    return bit_decoder_.StartDecoding(source_buffer);
   40|    298|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  1.80M|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|  1.80M|    uint32_t result = 0;
   49|  11.5M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 9.75M, False: 1.80M]
  ------------------
   50|  9.75M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  9.75M|      result = (result << 1) + bit;
   52|  9.75M|    }
   53|  1.80M|    *value = result;
   54|  1.80M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|     67|  void EndDecoding() {
   57|  2.21k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 2.14k, False: 67]
  ------------------
   58|  2.14k|      folded_number_decoders_[i].EndDecoding();
   59|  2.14k|    }
   60|     67|    bit_decoder_.EndDecoding();
   61|     67|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    460|  FoldedBit32Decoder() {}

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  39.9k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  20.5k|                                const uint8_t *const buf, int offset) {
  301|  20.5k|  unsigned x;
  302|  20.5k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 42, False: 20.5k]
  ------------------
  303|     42|    return 1;
  304|     42|  }
  305|  20.5k|  ans->buf = buf;
  306|  20.5k|  x = buf[offset - 1] >> 6;
  307|  20.5k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 17.7k, False: 2.79k]
  ------------------
  308|  17.7k|    ans->buf_offset = offset - 1;
  309|  17.7k|    ans->state = buf[offset - 1] & 0x3F;
  310|  17.7k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 2.54k, False: 248]
  ------------------
  311|  2.54k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 3, False: 2.54k]
  ------------------
  312|      3|      return 1;
  313|      3|    }
  314|  2.54k|    ans->buf_offset = offset - 2;
  315|  2.54k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  2.54k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 243, False: 5]
  ------------------
  317|    243|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 4, False: 239]
  ------------------
  318|      4|      return 1;
  319|      4|    }
  320|    239|    ans->buf_offset = offset - 3;
  321|    239|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    239|  } else {
  323|      5|    return 1;
  324|      5|  }
  325|  20.5k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  20.5k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  20.5k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  20.5k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  20.5k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 6, False: 20.5k]
  ------------------
  327|      6|    return 1;
  328|      6|  }
  329|  20.5k|  return 0;
  330|  20.5k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  2.54k|static uint32_t mem_get_le16(const void *vmem) {
   68|  2.54k|  uint32_t val;
   69|  2.54k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  2.54k|  val = mem[1] << 8;
   72|  2.54k|  val |= mem[0];
   73|  2.54k|  return val;
   74|  2.54k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    239|static uint32_t mem_get_le24(const void *vmem) {
   77|    239|  uint32_t val;
   78|    239|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    239|  val = mem[2] << 16;
   81|    239|  val |= mem[1] << 8;
   82|    239|  val |= mem[0];
   83|    239|  return val;
   84|    239|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  4.25G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  4.25G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  4.25G|  unsigned quot, rem, x, xn;
  172|  4.25G|#endif
  173|  4.25G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  4.25G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  4.25G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  8.51G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 3.58G, False: 669M]
  |  Branch (174:40): [True: 84.5k, False: 3.58G]
  ------------------
  175|  84.5k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|  84.5k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|  84.5k|  }
  177|       |#if DRACO_ANS_IMPL1
  178|       |  val = ans->state % DRACO_ANS_P8_PRECISION < p;
  179|       |  l_s = val ? p : p0;
  180|       |  ans->state = (ans->state / DRACO_ANS_P8_PRECISION) * l_s +
  181|       |               ans->state % DRACO_ANS_P8_PRECISION - (!val * p);
  182|       |#else
  183|  4.25G|  x = ans->state;
  184|  4.25G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  4.25G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  4.25G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  4.25G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  4.25G|  xn = quot * p;
  187|  4.25G|  val = rem < p;
  188|  4.25G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  8.51G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 3.58G, False: 665M]
  |  |  ------------------
  ------------------
  189|  3.58G|    ans->state = xn + rem;
  190|  3.58G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   665M|    ans->state = x - xn - p;
  193|   665M|  }
  194|  4.25G|#endif
  195|  4.25G|  return val;
  196|  4.25G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  54.4k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  54.4k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  54.4k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  54.4k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  3.52k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|  1.98k|                                       uint32_t num_symbols) {
  482|  1.98k|    lut_table_.resize(rans_precision);
  483|  1.98k|    probability_table_.resize(num_symbols);
  484|  1.98k|    uint32_t cum_prob = 0;
  485|  1.98k|    uint32_t act_prob = 0;
  486|  14.4k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 12.5k, False: 1.83k]
  ------------------
  487|  12.5k|      probability_table_[i].prob = token_probs[i];
  488|  12.5k|      probability_table_[i].cum_prob = cum_prob;
  489|  12.5k|      cum_prob += token_probs[i];
  490|  12.5k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 146, False: 12.4k]
  ------------------
  491|    146|        return false;
  492|    146|      }
  493|  6.97M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 6.96M, False: 12.4k]
  ------------------
  494|  6.96M|        lut_table_[j] = i;
  495|  6.96M|      }
  496|  12.4k|      act_prob = cum_prob;
  497|  12.4k|    }
  498|  1.83k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 168, False: 1.66k]
  ------------------
  499|    168|      return false;
  500|    168|    }
  501|  1.66k|    return true;
  502|  1.83k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.31k|  inline int read_init(const uint8_t *const buf, int offset) {
  422|  1.31k|    unsigned x;
  423|  1.31k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 82, False: 1.23k]
  ------------------
  424|     82|      return 1;
  425|     82|    }
  426|  1.23k|    ans_.buf = buf;
  427|  1.23k|    x = buf[offset - 1] >> 6;
  428|  1.23k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 777, False: 454]
  ------------------
  429|    777|      ans_.buf_offset = offset - 1;
  430|    777|      ans_.state = buf[offset - 1] & 0x3F;
  431|    777|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 159, False: 295]
  ------------------
  432|    159|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 26, False: 133]
  ------------------
  433|     26|        return 1;
  434|     26|      }
  435|    133|      ans_.buf_offset = offset - 2;
  436|    133|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    295|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 187, False: 108]
  ------------------
  438|    187|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 35, False: 152]
  ------------------
  439|     35|        return 1;
  440|     35|      }
  441|    152|      ans_.buf_offset = offset - 3;
  442|    152|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    152|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 108, False: 0]
  ------------------
  444|    108|      ans_.buf_offset = offset - 4;
  445|    108|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    108|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|  1.17k|    ans_.state += l_rans_base;
  450|  1.17k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.17k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 104, False: 1.06k]
  ------------------
  451|    104|      return 1;
  452|    104|    }
  453|  1.06k|    return 0;
  454|  1.17k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    219|static uint32_t mem_get_le16(const void *vmem) {
   68|    219|  uint32_t val;
   69|    219|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    219|  val = mem[1] << 8;
   72|    219|  val |= mem[0];
   73|    219|  return val;
   74|    219|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    244|static uint32_t mem_get_le24(const void *vmem) {
   77|    244|  uint32_t val;
   78|    244|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    244|  val = mem[2] << 16;
   81|    244|  val |= mem[1] << 8;
   82|    244|  val |= mem[0];
   83|    244|  return val;
   84|    244|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    312|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    312|  uint32_t val;
   88|    312|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    312|  val = mem[3] << 24;
   91|    312|  val |= mem[2] << 16;
   92|    312|  val |= mem[1] << 8;
   93|    312|  val |= mem[0];
   94|    312|  return val;
   95|    312|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|  68.8M|  inline int rans_read() {
  463|  68.8M|    unsigned rem;
  464|  68.8M|    unsigned quo;
  465|  68.8M|    struct rans_dec_sym sym;
  466|  68.8M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 57.5M, False: 11.2M]
  |  Branch (466:40): [True: 20.9k, False: 57.5M]
  ------------------
  467|  20.9k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  20.9k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  20.9k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  68.8M|    quo = ans_.state / rans_precision;
  472|  68.8M|    rem = ans_.state % rans_precision;
  473|  68.8M|    fetch_sym(&sym, rem);
  474|  68.8M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  68.8M|    return sym.val;
  476|  68.8M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|  68.8M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  68.8M|    uint32_t symbol = lut_table_[rem];
  507|  68.8M|    out->val = symbol;
  508|  68.8M|    out->prob = probability_table_[symbol].prob;
  509|  68.8M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  68.8M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|  1.00k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    280|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|    168|                                       uint32_t num_symbols) {
  482|    168|    lut_table_.resize(rans_precision);
  483|    168|    probability_table_.resize(num_symbols);
  484|    168|    uint32_t cum_prob = 0;
  485|    168|    uint32_t act_prob = 0;
  486|  2.58k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 2.44k, False: 146]
  ------------------
  487|  2.44k|      probability_table_[i].prob = token_probs[i];
  488|  2.44k|      probability_table_[i].cum_prob = cum_prob;
  489|  2.44k|      cum_prob += token_probs[i];
  490|  2.44k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 22, False: 2.41k]
  ------------------
  491|     22|        return false;
  492|     22|      }
  493|  1.07M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.07M, False: 2.41k]
  ------------------
  494|  1.07M|        lut_table_[j] = i;
  495|  1.07M|      }
  496|  2.41k|      act_prob = cum_prob;
  497|  2.41k|    }
  498|    146|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 24, False: 122]
  ------------------
  499|     24|      return false;
  500|     24|    }
  501|    122|    return true;
  502|    146|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|     59|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     59|    unsigned x;
  423|     59|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 3, False: 56]
  ------------------
  424|      3|      return 1;
  425|      3|    }
  426|     56|    ans_.buf = buf;
  427|     56|    x = buf[offset - 1] >> 6;
  428|     56|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 21, False: 35]
  ------------------
  429|     21|      ans_.buf_offset = offset - 1;
  430|     21|      ans_.state = buf[offset - 1] & 0x3F;
  431|     35|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 4, False: 31]
  ------------------
  432|      4|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 3]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      3|      ans_.buf_offset = offset - 2;
  436|      3|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     31|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 15, False: 16]
  ------------------
  438|     15|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 6, False: 9]
  ------------------
  439|      6|        return 1;
  440|      6|      }
  441|      9|      ans_.buf_offset = offset - 3;
  442|      9|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     16|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 16, False: 0]
  ------------------
  444|     16|      ans_.buf_offset = offset - 4;
  445|     16|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     16|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     49|    ans_.state += l_rans_base;
  450|     49|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     49|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 14, False: 35]
  ------------------
  451|     14|      return 1;
  452|     14|    }
  453|     35|    return 0;
  454|     49|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|  72.7k|  inline int rans_read() {
  463|  72.7k|    unsigned rem;
  464|  72.7k|    unsigned quo;
  465|  72.7k|    struct rans_dec_sym sym;
  466|  73.3k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 32.7k, False: 40.6k]
  |  Branch (466:40): [True: 621, False: 32.1k]
  ------------------
  467|    621|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    621|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    621|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  72.7k|    quo = ans_.state / rans_precision;
  472|  72.7k|    rem = ans_.state % rans_precision;
  473|  72.7k|    fetch_sym(&sym, rem);
  474|  72.7k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  72.7k|    return sym.val;
  476|  72.7k|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|  72.7k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  72.7k|    uint32_t symbol = lut_table_[rem];
  507|  72.7k|    out->val = symbol;
  508|  72.7k|    out->prob = probability_table_[symbol].prob;
  509|  72.7k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  72.7k|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|     35|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    264|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|    160|                                       uint32_t num_symbols) {
  482|    160|    lut_table_.resize(rans_precision);
  483|    160|    probability_table_.resize(num_symbols);
  484|    160|    uint32_t cum_prob = 0;
  485|    160|    uint32_t act_prob = 0;
  486|  3.38k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 3.24k, False: 138]
  ------------------
  487|  3.24k|      probability_table_[i].prob = token_probs[i];
  488|  3.24k|      probability_table_[i].cum_prob = cum_prob;
  489|  3.24k|      cum_prob += token_probs[i];
  490|  3.24k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 22, False: 3.22k]
  ------------------
  491|     22|        return false;
  492|     22|      }
  493|  4.02M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 4.01M, False: 3.22k]
  ------------------
  494|  4.01M|        lut_table_[j] = i;
  495|  4.01M|      }
  496|  3.22k|      act_prob = cum_prob;
  497|  3.22k|    }
  498|    138|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 26, False: 112]
  ------------------
  499|     26|      return false;
  500|     26|    }
  501|    112|    return true;
  502|    138|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|     71|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     71|    unsigned x;
  423|     71|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 1, False: 70]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|     70|    ans_.buf = buf;
  427|     70|    x = buf[offset - 1] >> 6;
  428|     70|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 23, False: 47]
  ------------------
  429|     23|      ans_.buf_offset = offset - 1;
  430|     23|      ans_.state = buf[offset - 1] & 0x3F;
  431|     47|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 17, False: 30]
  ------------------
  432|     17|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 6, False: 11]
  ------------------
  433|      6|        return 1;
  434|      6|      }
  435|     11|      ans_.buf_offset = offset - 2;
  436|     11|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     30|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 16, False: 14]
  ------------------
  438|     16|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 3, False: 13]
  ------------------
  439|      3|        return 1;
  440|      3|      }
  441|     13|      ans_.buf_offset = offset - 3;
  442|     13|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     14|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 14, False: 0]
  ------------------
  444|     14|      ans_.buf_offset = offset - 4;
  445|     14|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     14|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     61|    ans_.state += l_rans_base;
  450|     61|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     61|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 12, False: 49]
  ------------------
  451|     12|      return 1;
  452|     12|    }
  453|     49|    return 0;
  454|     61|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|   364k|  inline int rans_read() {
  463|   364k|    unsigned rem;
  464|   364k|    unsigned quo;
  465|   364k|    struct rans_dec_sym sym;
  466|   366k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 354k, False: 11.3k]
  |  Branch (466:40): [True: 1.67k, False: 353k]
  ------------------
  467|  1.67k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.67k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.67k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|   364k|    quo = ans_.state / rans_precision;
  472|   364k|    rem = ans_.state % rans_precision;
  473|   364k|    fetch_sym(&sym, rem);
  474|   364k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   364k|    return sym.val;
  476|   364k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|   364k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   364k|    uint32_t symbol = lut_table_[rem];
  507|   364k|    out->val = symbol;
  508|   364k|    out->prob = probability_table_[symbol].prob;
  509|   364k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   364k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     49|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    315|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|    205|                                       uint32_t num_symbols) {
  482|    205|    lut_table_.resize(rans_precision);
  483|    205|    probability_table_.resize(num_symbols);
  484|    205|    uint32_t cum_prob = 0;
  485|    205|    uint32_t act_prob = 0;
  486|  14.9k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 14.8k, False: 173]
  ------------------
  487|  14.8k|      probability_table_[i].prob = token_probs[i];
  488|  14.8k|      probability_table_[i].cum_prob = cum_prob;
  489|  14.8k|      cum_prob += token_probs[i];
  490|  14.8k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 32, False: 14.7k]
  ------------------
  491|     32|        return false;
  492|     32|      }
  493|  10.3M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 10.2M, False: 14.7k]
  ------------------
  494|  10.2M|        lut_table_[j] = i;
  495|  10.2M|      }
  496|  14.7k|      act_prob = cum_prob;
  497|  14.7k|    }
  498|    173|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 38, False: 135]
  ------------------
  499|     38|      return false;
  500|     38|    }
  501|    135|    return true;
  502|    173|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     74|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     74|    unsigned x;
  423|     74|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 68]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     68|    ans_.buf = buf;
  427|     68|    x = buf[offset - 1] >> 6;
  428|     68|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 22, False: 46]
  ------------------
  429|     22|      ans_.buf_offset = offset - 1;
  430|     22|      ans_.state = buf[offset - 1] & 0x3F;
  431|     46|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 16, False: 30]
  ------------------
  432|     16|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 10, False: 6]
  ------------------
  433|     10|        return 1;
  434|     10|      }
  435|      6|      ans_.buf_offset = offset - 2;
  436|      6|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     30|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 23, False: 7]
  ------------------
  438|     23|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 19, False: 4]
  ------------------
  439|     19|        return 1;
  440|     19|      }
  441|      4|      ans_.buf_offset = offset - 3;
  442|      4|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      7|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 7, False: 0]
  ------------------
  444|      7|      ans_.buf_offset = offset - 4;
  445|      7|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      7|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     39|    ans_.state += l_rans_base;
  450|     39|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     39|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 6, False: 33]
  ------------------
  451|      6|      return 1;
  452|      6|    }
  453|     33|    return 0;
  454|     39|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|  37.2k|  inline int rans_read() {
  463|  37.2k|    unsigned rem;
  464|  37.2k|    unsigned quo;
  465|  37.2k|    struct rans_dec_sym sym;
  466|  37.5k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 36.2k, False: 1.37k]
  |  Branch (466:40): [True: 352, False: 35.8k]
  ------------------
  467|    352|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    352|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    352|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  37.2k|    quo = ans_.state / rans_precision;
  472|  37.2k|    rem = ans_.state % rans_precision;
  473|  37.2k|    fetch_sym(&sym, rem);
  474|  37.2k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  37.2k|    return sym.val;
  476|  37.2k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|  37.2k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  37.2k|    uint32_t symbol = lut_table_[rem];
  507|  37.2k|    out->val = symbol;
  508|  37.2k|    out->prob = probability_table_[symbol].prob;
  509|  37.2k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  37.2k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|     33|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    324|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|    200|                                       uint32_t num_symbols) {
  482|    200|    lut_table_.resize(rans_precision);
  483|    200|    probability_table_.resize(num_symbols);
  484|    200|    uint32_t cum_prob = 0;
  485|    200|    uint32_t act_prob = 0;
  486|  1.47k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 1.30k, False: 176]
  ------------------
  487|  1.30k|      probability_table_[i].prob = token_probs[i];
  488|  1.30k|      probability_table_[i].cum_prob = cum_prob;
  489|  1.30k|      cum_prob += token_probs[i];
  490|  1.30k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 24, False: 1.27k]
  ------------------
  491|     24|        return false;
  492|     24|      }
  493|  37.4M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 37.4M, False: 1.27k]
  ------------------
  494|  37.4M|        lut_table_[j] = i;
  495|  37.4M|      }
  496|  1.27k|      act_prob = cum_prob;
  497|  1.27k|    }
  498|    176|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 43, False: 133]
  ------------------
  499|     43|      return false;
  500|     43|    }
  501|    133|    return true;
  502|    176|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     68|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     68|    unsigned x;
  423|     68|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 62]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     62|    ans_.buf = buf;
  427|     62|    x = buf[offset - 1] >> 6;
  428|     62|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 18, False: 44]
  ------------------
  429|     18|      ans_.buf_offset = offset - 1;
  430|     18|      ans_.state = buf[offset - 1] & 0x3F;
  431|     44|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 6, False: 38]
  ------------------
  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|     38|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 21, False: 17]
  ------------------
  438|     21|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 6, False: 15]
  ------------------
  439|      6|        return 1;
  440|      6|      }
  441|     15|      ans_.buf_offset = offset - 3;
  442|     15|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     17|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 17, False: 0]
  ------------------
  444|     17|      ans_.buf_offset = offset - 4;
  445|     17|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     17|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     55|    ans_.state += l_rans_base;
  450|     55|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     55|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 7, False: 48]
  ------------------
  451|      7|      return 1;
  452|      7|    }
  453|     48|    return 0;
  454|     55|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|   130k|  inline int rans_read() {
  463|   130k|    unsigned rem;
  464|   130k|    unsigned quo;
  465|   130k|    struct rans_dec_sym sym;
  466|   131k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 84.0k, False: 47.2k]
  |  Branch (466:40): [True: 250, False: 83.7k]
  ------------------
  467|    250|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    250|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    250|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|   130k|    quo = ans_.state / rans_precision;
  472|   130k|    rem = ans_.state % rans_precision;
  473|   130k|    fetch_sym(&sym, rem);
  474|   130k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   130k|    return sym.val;
  476|   130k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|   130k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   130k|    uint32_t symbol = lut_table_[rem];
  507|   130k|    out->val = symbol;
  508|   130k|    out->prob = probability_table_[symbol].prob;
  509|   130k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   130k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|     48|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    260|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|    161|                                       uint32_t num_symbols) {
  482|    161|    lut_table_.resize(rans_precision);
  483|    161|    probability_table_.resize(num_symbols);
  484|    161|    uint32_t cum_prob = 0;
  485|    161|    uint32_t act_prob = 0;
  486|  3.66k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 3.53k, False: 135]
  ------------------
  487|  3.53k|      probability_table_[i].prob = token_probs[i];
  488|  3.53k|      probability_table_[i].cum_prob = cum_prob;
  489|  3.53k|      cum_prob += token_probs[i];
  490|  3.53k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 26, False: 3.50k]
  ------------------
  491|     26|        return false;
  492|     26|      }
  493|  58.1M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 58.1M, False: 3.50k]
  ------------------
  494|  58.1M|        lut_table_[j] = i;
  495|  58.1M|      }
  496|  3.50k|      act_prob = cum_prob;
  497|  3.50k|    }
  498|    135|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 40, False: 95]
  ------------------
  499|     40|      return false;
  500|     40|    }
  501|     95|    return true;
  502|    135|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     59|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     59|    unsigned x;
  423|     59|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 53]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     53|    ans_.buf = buf;
  427|     53|    x = buf[offset - 1] >> 6;
  428|     53|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 18, False: 35]
  ------------------
  429|     18|      ans_.buf_offset = offset - 1;
  430|     18|      ans_.state = buf[offset - 1] & 0x3F;
  431|     35|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 4, False: 31]
  ------------------
  432|      4|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 3]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      3|      ans_.buf_offset = offset - 2;
  436|      3|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     31|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 10, False: 21]
  ------------------
  438|     10|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 9]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|      9|      ans_.buf_offset = offset - 3;
  442|      9|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     21|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 21, False: 0]
  ------------------
  444|     21|      ans_.buf_offset = offset - 4;
  445|     21|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     21|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     51|    ans_.state += l_rans_base;
  450|     51|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     51|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 13, False: 38]
  ------------------
  451|     13|      return 1;
  452|     13|    }
  453|     38|    return 0;
  454|     51|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|   303k|  inline int rans_read() {
  463|   303k|    unsigned rem;
  464|   303k|    unsigned quo;
  465|   303k|    struct rans_dec_sym sym;
  466|   304k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 219k, False: 84.1k]
  |  Branch (466:40): [True: 851, False: 219k]
  ------------------
  467|    851|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    851|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    851|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|   303k|    quo = ans_.state / rans_precision;
  472|   303k|    rem = ans_.state % rans_precision;
  473|   303k|    fetch_sym(&sym, rem);
  474|   303k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   303k|    return sym.val;
  476|   303k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|   303k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   303k|    uint32_t symbol = lut_table_[rem];
  507|   303k|    out->val = symbol;
  508|   303k|    out->prob = probability_table_[symbol].prob;
  509|   303k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   303k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     38|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.43k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|    816|                                       uint32_t num_symbols) {
  482|    816|    lut_table_.resize(rans_precision);
  483|    816|    probability_table_.resize(num_symbols);
  484|    816|    uint32_t cum_prob = 0;
  485|    816|    uint32_t act_prob = 0;
  486|  11.8k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 11.0k, False: 778]
  ------------------
  487|  11.0k|      probability_table_[i].prob = token_probs[i];
  488|  11.0k|      probability_table_[i].cum_prob = cum_prob;
  489|  11.0k|      cum_prob += token_probs[i];
  490|  11.0k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 38, False: 11.0k]
  ------------------
  491|     38|        return false;
  492|     38|      }
  493|   744M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 744M, False: 11.0k]
  ------------------
  494|   744M|        lut_table_[j] = i;
  495|   744M|      }
  496|  11.0k|      act_prob = cum_prob;
  497|  11.0k|    }
  498|    778|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 87, False: 691]
  ------------------
  499|     87|      return false;
  500|     87|    }
  501|    691|    return true;
  502|    778|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    383|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    383|    unsigned x;
  423|    383|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 22, False: 361]
  ------------------
  424|     22|      return 1;
  425|     22|    }
  426|    361|    ans_.buf = buf;
  427|    361|    x = buf[offset - 1] >> 6;
  428|    361|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 86, False: 275]
  ------------------
  429|     86|      ans_.buf_offset = offset - 1;
  430|     86|      ans_.state = buf[offset - 1] & 0x3F;
  431|    275|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 91, False: 184]
  ------------------
  432|     91|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 33, False: 58]
  ------------------
  433|     33|        return 1;
  434|     33|      }
  435|     58|      ans_.buf_offset = offset - 2;
  436|     58|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    184|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 55, False: 129]
  ------------------
  438|     55|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 13, False: 42]
  ------------------
  439|     13|        return 1;
  440|     13|      }
  441|     42|      ans_.buf_offset = offset - 3;
  442|     42|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    129|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 129, False: 0]
  ------------------
  444|    129|      ans_.buf_offset = offset - 4;
  445|    129|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    129|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    315|    ans_.state += l_rans_base;
  450|    315|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    315|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 35, False: 280]
  ------------------
  451|     35|      return 1;
  452|     35|    }
  453|    280|    return 0;
  454|    315|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  64.5M|  inline int rans_read() {
  463|  64.5M|    unsigned rem;
  464|  64.5M|    unsigned quo;
  465|  64.5M|    struct rans_dec_sym sym;
  466|  64.5M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 57.7M, False: 6.83M]
  |  Branch (466:40): [True: 3.39k, False: 57.7M]
  ------------------
  467|  3.39k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  3.39k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  3.39k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  64.5M|    quo = ans_.state / rans_precision;
  472|  64.5M|    rem = ans_.state % rans_precision;
  473|  64.5M|    fetch_sym(&sym, rem);
  474|  64.5M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  64.5M|    return sym.val;
  476|  64.5M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  64.5M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  64.5M|    uint32_t symbol = lut_table_[rem];
  507|  64.5M|    out->val = symbol;
  508|  64.5M|    out->prob = probability_table_[symbol].prob;
  509|  64.5M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  64.5M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    280|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|  1.01k|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|  1.01k|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|  1.01k|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 1.01k]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|  1.01k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|  1.01k|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.01k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 57, False: 958]
  ------------------
   67|     57|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 7, False: 50]
  ------------------
   68|      7|      return false;
   69|      7|    }
   70|       |
   71|     57|  } else
   72|    958|#endif
   73|    958|  {
   74|    958|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 28, False: 930]
  ------------------
   75|     28|      return false;
   76|     28|    }
   77|    958|  }
   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|    980|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 57, False: 923]
  ------------------
   83|     57|    return false;
   84|     57|  }
   85|    923|  probability_table_.resize(num_symbols_);
   86|    923|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 352, False: 571]
  ------------------
   87|    352|    return true;
   88|    352|  }
   89|       |  // Decode the table.
   90|  33.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 33.2k, False: 426]
  ------------------
   91|  33.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|  33.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 59, False: 33.1k]
  ------------------
   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|  33.1k|    const int token = prob_data & 3;
  102|  33.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 12.0k, False: 21.0k]
  ------------------
  103|  12.0k|      const uint32_t offset = prob_data >> 2;
  104|  12.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 65, False: 12.0k]
  ------------------
  105|     65|        return false;
  106|     65|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   391k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 379k, False: 12.0k]
  ------------------
  109|   379k|        probability_table_[i + j] = 0;
  110|   379k|      }
  111|  12.0k|      i += offset;
  112|  21.0k|    } else {
  113|  21.0k|      const int extra_bytes = token;
  114|  21.0k|      uint32_t prob = prob_data >> 2;
  115|  42.5k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 21.4k, False: 21.0k]
  ------------------
  116|  21.4k|        uint8_t eb;
  117|  21.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 21.4k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  21.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  21.4k|      }
  124|  21.0k|      probability_table_[i] = prob;
  125|  21.0k|    }
  126|  33.1k|  }
  127|    426|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 121, False: 305]
  ------------------
  128|    121|    return false;
  129|    121|  }
  130|    305|  return true;
  131|    426|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    575|    DecoderBuffer *buffer) {
  136|    575|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    575|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    575|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    575|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 31, False: 544]
  ------------------
  140|     31|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 7, False: 24]
  ------------------
  141|      7|      return false;
  142|      7|    }
  143|       |
  144|     31|  } else
  145|    544|#endif
  146|    544|  {
  147|    544|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 37, False: 507]
  ------------------
  148|     37|      return false;
  149|     37|    }
  150|    544|  }
  151|    531|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 110, False: 421]
  ------------------
  152|    110|    return false;
  153|    110|  }
  154|    421|  const uint8_t *const data_head =
  155|    421|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    421|  buffer->Advance(bytes_encoded);
  158|    421|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 88, False: 333]
  ------------------
  159|     88|    return false;
  160|     88|  }
  161|    333|  return true;
  162|    421|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    438|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  1.00M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    275|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    275|  ans_.read_end();
  167|    275|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    436|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    436|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    436|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 436]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    436|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    436|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    436|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 61, False: 375]
  ------------------
   67|     61|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 57]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     61|  } else
   72|    375|#endif
   73|    375|  {
   74|    375|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 366]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    375|  }
   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|    423|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 47, False: 376]
  ------------------
   83|     47|    return false;
   84|     47|  }
   85|    376|  probability_table_.resize(num_symbols_);
   86|    376|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 16, False: 360]
  ------------------
   87|     16|    return true;
   88|     16|  }
   89|       |  // Decode the table.
   90|  1.39M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.39M, False: 242]
  ------------------
   91|  1.39M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  1.39M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 38, False: 1.39M]
  ------------------
   95|     38|      return false;
   96|     38|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.39M|    const int token = prob_data & 3;
  102|  1.39M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 408k, False: 983k]
  ------------------
  103|   408k|      const uint32_t offset = prob_data >> 2;
  104|   408k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 56, False: 408k]
  ------------------
  105|     56|        return false;
  106|     56|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  12.7M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 12.3M, False: 408k]
  ------------------
  109|  12.3M|        probability_table_[i + j] = 0;
  110|  12.3M|      }
  111|   408k|      i += offset;
  112|   983k|    } else {
  113|   983k|      const int extra_bytes = token;
  114|   983k|      uint32_t prob = prob_data >> 2;
  115|  1.01M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 30.9k, False: 983k]
  ------------------
  116|  30.9k|        uint8_t eb;
  117|  30.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 24, False: 30.9k]
  ------------------
  118|     24|          return false;
  119|     24|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  30.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  30.9k|      }
  124|   983k|      probability_table_[i] = prob;
  125|   983k|    }
  126|  1.39M|  }
  127|    242|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 75, False: 167]
  ------------------
  128|     75|    return false;
  129|     75|  }
  130|    167|  return true;
  131|    242|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    183|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    167|    DecoderBuffer *buffer) {
  136|    167|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    167|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    167|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    167|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 13, False: 154]
  ------------------
  140|     13|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 12]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     13|  } else
  145|    154|#endif
  146|    154|  {
  147|    154|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 152]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    154|  }
  151|    164|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 34, False: 130]
  ------------------
  152|     34|    return false;
  153|     34|  }
  154|    130|  const uint8_t *const data_head =
  155|    130|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    130|  buffer->Advance(bytes_encoded);
  158|    130|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 15, False: 115]
  ------------------
  159|     15|    return false;
  160|     15|  }
  161|    115|  return true;
  162|    130|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  30.6M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    115|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    115|  ans_.read_end();
  167|    115|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    494|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    494|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    494|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 494]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    494|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    494|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    494|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 43, False: 451]
  ------------------
   67|     43|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 41]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     43|  } else
   72|    451|#endif
   73|    451|  {
   74|    451|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 444]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    451|  }
   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|    485|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 36, False: 449]
  ------------------
   83|     36|    return false;
   84|     36|  }
   85|    449|  probability_table_.resize(num_symbols_);
   86|    449|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 437]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|   282k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 282k, False: 340]
  ------------------
   91|   282k|    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|   282k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 49, False: 282k]
  ------------------
   95|     49|      return false;
   96|     49|    }
   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|   282k|    const int token = prob_data & 3;
  102|   282k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 168k, False: 113k]
  ------------------
  103|   168k|      const uint32_t offset = prob_data >> 2;
  104|   168k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 168k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  5.72M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 5.55M, False: 168k]
  ------------------
  109|  5.55M|        probability_table_[i + j] = 0;
  110|  5.55M|      }
  111|   168k|      i += offset;
  112|   168k|    } else {
  113|   113k|      const int extra_bytes = token;
  114|   113k|      uint32_t prob = prob_data >> 2;
  115|   156k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 43.2k, False: 113k]
  ------------------
  116|  43.2k|        uint8_t eb;
  117|  43.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 43.1k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  43.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  43.1k|      }
  124|   113k|      probability_table_[i] = prob;
  125|   113k|    }
  126|   282k|  }
  127|    340|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 25, False: 315]
  ------------------
  128|     25|    return false;
  129|     25|  }
  130|    315|  return true;
  131|    340|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    327|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    315|    DecoderBuffer *buffer) {
  136|    315|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    315|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    315|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    315|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 19, False: 296]
  ------------------
  140|     19|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 17]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     19|  } else
  145|    296|#endif
  146|    296|  {
  147|    296|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 7, False: 289]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|    296|  }
  151|    306|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 75, False: 231]
  ------------------
  152|     75|    return false;
  153|     75|  }
  154|    231|  const uint8_t *const data_head =
  155|    231|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    231|  buffer->Advance(bytes_encoded);
  158|    231|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 20, False: 211]
  ------------------
  159|     20|    return false;
  160|     20|  }
  161|    211|  return true;
  162|    231|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  4.19M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    211|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    211|  ans_.read_end();
  167|    211|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    335|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    335|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    335|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 335]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    335|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    335|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    335|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 48, False: 287]
  ------------------
   67|     48|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 47]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     48|  } else
   72|    287|#endif
   73|    287|  {
   74|    287|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 285]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    287|  }
   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|    332|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 14, False: 318]
  ------------------
   83|     14|    return false;
   84|     14|  }
   85|    318|  probability_table_.resize(num_symbols_);
   86|    318|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 314]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|  7.81k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 7.58k, False: 226]
  ------------------
   91|  7.58k|    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.58k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 53, False: 7.53k]
  ------------------
   95|     53|      return false;
   96|     53|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  7.53k|    const int token = prob_data & 3;
  102|  7.53k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.19k, False: 4.33k]
  ------------------
  103|  3.19k|      const uint32_t offset = prob_data >> 2;
  104|  3.19k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 3.17k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   104k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 101k, False: 3.17k]
  ------------------
  109|   101k|        probability_table_[i + j] = 0;
  110|   101k|      }
  111|  3.17k|      i += offset;
  112|  4.33k|    } else {
  113|  4.33k|      const int extra_bytes = token;
  114|  4.33k|      uint32_t prob = prob_data >> 2;
  115|  7.51k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.18k, False: 4.32k]
  ------------------
  116|  3.18k|        uint8_t eb;
  117|  3.18k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 3.17k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.17k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.17k|      }
  124|  4.32k|      probability_table_[i] = prob;
  125|  4.32k|    }
  126|  7.53k|  }
  127|    226|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 19, False: 207]
  ------------------
  128|     19|    return false;
  129|     19|  }
  130|    207|  return true;
  131|    226|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    211|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    207|    DecoderBuffer *buffer) {
  136|    207|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    207|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    207|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    207|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 44, False: 163]
  ------------------
  140|     44|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 5, False: 39]
  ------------------
  141|      5|      return false;
  142|      5|    }
  143|       |
  144|     44|  } else
  145|    163|#endif
  146|    163|  {
  147|    163|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 160]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    163|  }
  151|    199|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 94, False: 105]
  ------------------
  152|     94|    return false;
  153|     94|  }
  154|    105|  const uint8_t *const data_head =
  155|    105|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    105|  buffer->Advance(bytes_encoded);
  158|    105|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 20, False: 85]
  ------------------
  159|     20|    return false;
  160|     20|  }
  161|     85|  return true;
  162|    105|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  11.9M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|     85|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     85|  ans_.read_end();
  167|     85|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    237|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    237|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    237|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 237]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    237|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    237|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    237|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 22, False: 215]
  ------------------
   67|     22|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 20]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     22|  } else
   72|    215|#endif
   73|    215|  {
   74|    215|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 204]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    215|  }
   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|    224|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 214]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    214|  probability_table_.resize(num_symbols_);
   86|    214|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 207]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  4.73k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 4.60k, False: 132]
  ------------------
   91|  4.60k|    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|  4.60k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 4.56k]
  ------------------
   95|     36|      return false;
   96|     36|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  4.56k|    const int token = prob_data & 3;
  102|  4.56k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.31k, False: 2.24k]
  ------------------
  103|  2.31k|      const uint32_t offset = prob_data >> 2;
  104|  2.31k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 2.29k]
  ------------------
  105|     24|        return false;
  106|     24|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  76.1k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 73.8k, False: 2.29k]
  ------------------
  109|  73.8k|        probability_table_[i + j] = 0;
  110|  73.8k|      }
  111|  2.29k|      i += offset;
  112|  2.29k|    } else {
  113|  2.24k|      const int extra_bytes = token;
  114|  2.24k|      uint32_t prob = prob_data >> 2;
  115|  3.54k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.30k, False: 2.23k]
  ------------------
  116|  1.30k|        uint8_t eb;
  117|  1.30k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 15, False: 1.29k]
  ------------------
  118|     15|          return false;
  119|     15|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.29k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.29k|      }
  124|  2.23k|      probability_table_[i] = prob;
  125|  2.23k|    }
  126|  4.56k|  }
  127|    132|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 10, False: 122]
  ------------------
  128|     10|    return false;
  129|     10|  }
  130|    122|  return true;
  131|    132|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    129|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    122|    DecoderBuffer *buffer) {
  136|    122|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    122|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    122|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    122|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 106]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 13]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     16|  } else
  145|    106|#endif
  146|    106|  {
  147|    106|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 103]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    106|  }
  151|    116|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 21, False: 95]
  ------------------
  152|     21|    return false;
  153|     21|  }
  154|     95|  const uint8_t *const data_head =
  155|     95|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     95|  buffer->Advance(bytes_encoded);
  158|     95|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 12, False: 83]
  ------------------
  159|     12|    return false;
  160|     12|  }
  161|     83|  return true;
  162|     95|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  2.80M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|     83|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     83|  ans_.read_end();
  167|     83|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    329|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    329|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    329|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 329]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    329|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    329|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    329|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 55, False: 274]
  ------------------
   67|     55|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 54]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     55|  } else
   72|    274|#endif
   73|    274|  {
   74|    274|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 267]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    274|  }
   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|    321|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 19, False: 302]
  ------------------
   83|     19|    return false;
   84|     19|  }
   85|    302|  probability_table_.resize(num_symbols_);
   86|    302|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 298]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|  9.46k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 9.24k, False: 222]
  ------------------
   91|  9.24k|    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.24k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 45, False: 9.19k]
  ------------------
   95|     45|      return false;
   96|     45|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  9.19k|    const int token = prob_data & 3;
  102|  9.19k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.88k, False: 6.30k]
  ------------------
  103|  2.88k|      const uint32_t offset = prob_data >> 2;
  104|  2.88k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 19, False: 2.86k]
  ------------------
  105|     19|        return false;
  106|     19|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  97.1k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 94.3k, False: 2.86k]
  ------------------
  109|  94.3k|        probability_table_[i + j] = 0;
  110|  94.3k|      }
  111|  2.86k|      i += offset;
  112|  6.30k|    } else {
  113|  6.30k|      const int extra_bytes = token;
  114|  6.30k|      uint32_t prob = prob_data >> 2;
  115|  11.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 5.46k, False: 6.29k]
  ------------------
  116|  5.46k|        uint8_t eb;
  117|  5.46k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 5.45k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  5.45k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  5.45k|      }
  124|  6.29k|      probability_table_[i] = prob;
  125|  6.29k|    }
  126|  9.19k|  }
  127|    222|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 23, False: 199]
  ------------------
  128|     23|    return false;
  129|     23|  }
  130|    199|  return true;
  131|    222|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    203|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    199|    DecoderBuffer *buffer) {
  136|    199|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    199|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    199|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    199|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 36, False: 163]
  ------------------
  140|     36|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 33]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     36|  } else
  145|    163|#endif
  146|    163|  {
  147|    163|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 162]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    163|  }
  151|    195|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 72, False: 123]
  ------------------
  152|     72|    return false;
  153|     72|  }
  154|    123|  const uint8_t *const data_head =
  155|    123|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    123|  buffer->Advance(bytes_encoded);
  158|    123|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 27, False: 96]
  ------------------
  159|     27|    return false;
  160|     27|  }
  161|     96|  return true;
  162|    123|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  8.23M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|     96|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     96|  ans_.read_end();
  167|     96|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    335|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    335|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    335|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 335]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    335|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    335|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    335|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 47, False: 288]
  ------------------
   67|     47|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 44]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     47|  } else
   72|    288|#endif
   73|    288|  {
   74|    288|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 282]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    288|  }
   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|    326|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 21, False: 305]
  ------------------
   83|     21|    return false;
   84|     21|  }
   85|    305|  probability_table_.resize(num_symbols_);
   86|    305|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 13, False: 292]
  ------------------
   87|     13|    return true;
   88|     13|  }
   89|       |  // Decode the table.
   90|  1.25M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.25M, False: 181]
  ------------------
   91|  1.25M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  1.25M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 60, False: 1.25M]
  ------------------
   95|     60|      return false;
   96|     60|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.25M|    const int token = prob_data & 3;
  102|  1.25M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 484k, False: 773k]
  ------------------
  103|   484k|      const uint32_t offset = prob_data >> 2;
  104|   484k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 28, False: 484k]
  ------------------
  105|     28|        return false;
  106|     28|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  19.0M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 18.6M, False: 484k]
  ------------------
  109|  18.6M|        probability_table_[i + j] = 0;
  110|  18.6M|      }
  111|   484k|      i += offset;
  112|   773k|    } else {
  113|   773k|      const int extra_bytes = token;
  114|   773k|      uint32_t prob = prob_data >> 2;
  115|  1.27M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 503k, False: 773k]
  ------------------
  116|   503k|        uint8_t eb;
  117|   503k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 23, False: 503k]
  ------------------
  118|     23|          return false;
  119|     23|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   503k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   503k|      }
  124|   773k|      probability_table_[i] = prob;
  125|   773k|    }
  126|  1.25M|  }
  127|    181|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 13, False: 168]
  ------------------
  128|     13|    return false;
  129|     13|  }
  130|    168|  return true;
  131|    181|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    181|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    168|    DecoderBuffer *buffer) {
  136|    168|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    168|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    168|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    168|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 22, False: 146]
  ------------------
  140|     22|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 5, False: 17]
  ------------------
  141|      5|      return false;
  142|      5|    }
  143|       |
  144|     22|  } else
  145|    146|#endif
  146|    146|  {
  147|    146|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 144]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    146|  }
  151|    161|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 51, False: 110]
  ------------------
  152|     51|    return false;
  153|     51|  }
  154|    110|  const uint8_t *const data_head =
  155|    110|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    110|  buffer->Advance(bytes_encoded);
  158|    110|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 28, False: 82]
  ------------------
  159|     28|    return false;
  160|     28|  }
  161|     82|  return true;
  162|    110|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  8.01M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|     82|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     82|  ans_.read_end();
  167|     82|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    343|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    343|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    343|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 343]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    343|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    343|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    343|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 51, False: 292]
  ------------------
   67|     51|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 47]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     51|  } else
   72|    292|#endif
   73|    292|  {
   74|    292|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 22, False: 270]
  ------------------
   75|     22|      return false;
   76|     22|    }
   77|    292|  }
   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|    317|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 30, False: 287]
  ------------------
   83|     30|    return false;
   84|     30|  }
   85|    287|  probability_table_.resize(num_symbols_);
   86|    287|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 284]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|  6.35k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 6.14k, False: 212]
  ------------------
   91|  6.14k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  6.14k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 30, False: 6.11k]
  ------------------
   95|     30|      return false;
   96|     30|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  6.11k|    const int token = prob_data & 3;
  102|  6.11k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.17k, False: 2.93k]
  ------------------
  103|  3.17k|      const uint32_t offset = prob_data >> 2;
  104|  3.17k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 3.15k]
  ------------------
  105|     24|        return false;
  106|     24|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   110k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 107k, False: 3.15k]
  ------------------
  109|   107k|        probability_table_[i + j] = 0;
  110|   107k|      }
  111|  3.15k|      i += offset;
  112|  3.15k|    } else {
  113|  2.93k|      const int extra_bytes = token;
  114|  2.93k|      uint32_t prob = prob_data >> 2;
  115|  5.31k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.39k, False: 2.91k]
  ------------------
  116|  2.39k|        uint8_t eb;
  117|  2.39k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 18, False: 2.38k]
  ------------------
  118|     18|          return false;
  119|     18|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.38k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.38k|      }
  124|  2.91k|      probability_table_[i] = prob;
  125|  2.91k|    }
  126|  6.11k|  }
  127|    212|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 28, False: 184]
  ------------------
  128|     28|    return false;
  129|     28|  }
  130|    184|  return true;
  131|    212|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    187|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|    184|    DecoderBuffer *buffer) {
  136|    184|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    184|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    184|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    184|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 34, False: 150]
  ------------------
  140|     34|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 33]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     34|  } else
  145|    150|#endif
  146|    150|  {
  147|    150|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 148]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    150|  }
  151|    181|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 83, False: 98]
  ------------------
  152|     83|    return false;
  153|     83|  }
  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: 37, False: 61]
  ------------------
  159|     37|    return false;
  160|     37|  }
  161|     61|  return true;
  162|     98|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  2.01M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     61|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     61|  ans_.read_end();
  167|     61|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    280|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    280|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    280|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 280]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    280|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    280|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    280|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 18, False: 262]
  ------------------
   67|     18|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 17]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     18|  } else
   72|    262|#endif
   73|    262|  {
   74|    262|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 256]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    262|  }
   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|    273|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 20, False: 253]
  ------------------
   83|     20|    return false;
   84|     20|  }
   85|    253|  probability_table_.resize(num_symbols_);
   86|    253|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 242]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|  24.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 23.8k, False: 168]
  ------------------
   91|  23.8k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  23.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 35, False: 23.8k]
  ------------------
   95|     35|      return false;
   96|     35|    }
   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.8k|    const int token = prob_data & 3;
  102|  23.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 14.4k, False: 9.35k]
  ------------------
  103|  14.4k|      const uint32_t offset = prob_data >> 2;
  104|  14.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 23, False: 14.4k]
  ------------------
  105|     23|        return false;
  106|     23|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   573k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 559k, False: 14.4k]
  ------------------
  109|   559k|        probability_table_[i + j] = 0;
  110|   559k|      }
  111|  14.4k|      i += offset;
  112|  14.4k|    } else {
  113|  9.35k|      const int extra_bytes = token;
  114|  9.35k|      uint32_t prob = prob_data >> 2;
  115|  14.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 5.62k, False: 9.34k]
  ------------------
  116|  5.62k|        uint8_t eb;
  117|  5.62k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 5.61k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  5.61k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  5.61k|      }
  124|  9.34k|      probability_table_[i] = prob;
  125|  9.34k|    }
  126|  23.8k|  }
  127|    168|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 46, False: 122]
  ------------------
  128|     46|    return false;
  129|     46|  }
  130|    122|  return true;
  131|    168|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    133|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|    122|    DecoderBuffer *buffer) {
  136|    122|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    122|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    122|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    122|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 122]
  ------------------
  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|    122|#endif
  146|    122|  {
  147|    122|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 121]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    122|  }
  151|    121|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 62, False: 59]
  ------------------
  152|     62|    return false;
  153|     62|  }
  154|     59|  const uint8_t *const data_head =
  155|     59|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     59|  buffer->Advance(bytes_encoded);
  158|     59|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 24, False: 35]
  ------------------
  159|     24|    return false;
  160|     24|  }
  161|     35|  return true;
  162|     59|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|  72.7k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     35|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     35|  ans_.read_end();
  167|     35|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    264|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    264|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    264|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 264]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    264|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    264|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    264|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 8, False: 256]
  ------------------
   67|      8|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 7]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|      8|  } else
   72|    256|#endif
   73|    256|  {
   74|    256|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 252]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    256|  }
   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|    259|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 17, False: 242]
  ------------------
   83|     17|    return false;
   84|     17|  }
   85|    242|  probability_table_.resize(num_symbols_);
   86|    242|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 238]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|   140k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 140k, False: 160]
  ------------------
   91|   140k|    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|   140k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 140k]
  ------------------
   95|     36|      return false;
   96|     36|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   140k|    const int token = prob_data & 3;
  102|   140k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 38.1k, False: 102k]
  ------------------
  103|  38.1k|      const uint32_t offset = prob_data >> 2;
  104|  38.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 38.1k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.32M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.28M, False: 38.1k]
  ------------------
  109|  1.28M|        probability_table_[i + j] = 0;
  110|  1.28M|      }
  111|  38.1k|      i += offset;
  112|   102k|    } else {
  113|   102k|      const int extra_bytes = token;
  114|   102k|      uint32_t prob = prob_data >> 2;
  115|   171k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 69.1k, False: 102k]
  ------------------
  116|  69.1k|        uint8_t eb;
  117|  69.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 15, False: 69.1k]
  ------------------
  118|     15|          return false;
  119|     15|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  69.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  69.1k|      }
  124|   102k|      probability_table_[i] = prob;
  125|   102k|    }
  126|   140k|  }
  127|    160|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 48, False: 112]
  ------------------
  128|     48|    return false;
  129|     48|  }
  130|    112|  return true;
  131|    160|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    116|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    112|    DecoderBuffer *buffer) {
  136|    112|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    112|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    112|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    112|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 112]
  ------------------
  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|    112|#endif
  146|    112|  {
  147|    112|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 111]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    112|  }
  151|    111|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 40, False: 71]
  ------------------
  152|     40|    return false;
  153|     40|  }
  154|     71|  const uint8_t *const data_head =
  155|     71|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     71|  buffer->Advance(bytes_encoded);
  158|     71|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 22, False: 49]
  ------------------
  159|     22|    return false;
  160|     22|  }
  161|     49|  return true;
  162|     71|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   364k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     49|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     49|  ans_.read_end();
  167|     49|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    315|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    315|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    315|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 315]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    315|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    315|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    315|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 32, False: 283]
  ------------------
   67|     32|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 31]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     32|  } else
   72|    283|#endif
   73|    283|  {
   74|    283|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 281]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    283|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    312|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 18, False: 294]
  ------------------
   83|     18|    return false;
   84|     18|  }
   85|    294|  probability_table_.resize(num_symbols_);
   86|    294|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 290]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|  68.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 67.8k, False: 205]
  ------------------
   91|  67.8k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  67.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 33, False: 67.8k]
  ------------------
   95|     33|      return false;
   96|     33|    }
   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|  67.8k|    const int token = prob_data & 3;
  102|  67.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 22.2k, False: 45.6k]
  ------------------
  103|  22.2k|      const uint32_t offset = prob_data >> 2;
  104|  22.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 36, False: 22.1k]
  ------------------
  105|     36|        return false;
  106|     36|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   839k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 817k, False: 22.1k]
  ------------------
  109|   817k|        probability_table_[i + j] = 0;
  110|   817k|      }
  111|  22.1k|      i += offset;
  112|  45.6k|    } else {
  113|  45.6k|      const int extra_bytes = token;
  114|  45.6k|      uint32_t prob = prob_data >> 2;
  115|  69.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 23.4k, False: 45.6k]
  ------------------
  116|  23.4k|        uint8_t eb;
  117|  23.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 23.4k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  23.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  23.4k|      }
  124|  45.6k|      probability_table_[i] = prob;
  125|  45.6k|    }
  126|  67.8k|  }
  127|    205|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 70, False: 135]
  ------------------
  128|     70|    return false;
  129|     70|  }
  130|    135|  return true;
  131|    205|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|    139|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|    135|    DecoderBuffer *buffer) {
  136|    135|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    135|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    135|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    135|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 135]
  ------------------
  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|    135|#endif
  146|    135|  {
  147|    135|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 4, False: 131]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|    135|  }
  151|    131|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 57, False: 74]
  ------------------
  152|     57|    return false;
  153|     57|  }
  154|     74|  const uint8_t *const data_head =
  155|     74|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     74|  buffer->Advance(bytes_encoded);
  158|     74|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 41, False: 33]
  ------------------
  159|     41|    return false;
  160|     41|  }
  161|     33|  return true;
  162|     74|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|  37.2k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     33|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     33|  ans_.read_end();
  167|     33|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    324|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    324|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    324|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 324]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    324|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    324|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    324|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 5, False: 319]
  ------------------
   67|      5|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 4]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|      5|  } else
   72|    319|#endif
   73|    319|  {
   74|    319|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 310]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    319|  }
   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|    314|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 305]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|    305|  probability_table_.resize(num_symbols_);
   86|    305|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 296]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  39.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 39.4k, False: 200]
  ------------------
   91|  39.4k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  39.4k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 55, False: 39.4k]
  ------------------
   95|     55|      return false;
   96|     55|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  39.4k|    const int token = prob_data & 3;
  102|  39.4k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.66k, False: 32.7k]
  ------------------
  103|  6.66k|      const uint32_t offset = prob_data >> 2;
  104|  6.66k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 6.64k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   227k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 221k, False: 6.64k]
  ------------------
  109|   221k|        probability_table_[i + j] = 0;
  110|   221k|      }
  111|  6.64k|      i += offset;
  112|  32.7k|    } else {
  113|  32.7k|      const int extra_bytes = token;
  114|  32.7k|      uint32_t prob = prob_data >> 2;
  115|  40.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 7.46k, False: 32.7k]
  ------------------
  116|  7.46k|        uint8_t eb;
  117|  7.46k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 19, False: 7.44k]
  ------------------
  118|     19|          return false;
  119|     19|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  7.44k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  7.44k|      }
  124|  32.7k|      probability_table_[i] = prob;
  125|  32.7k|    }
  126|  39.4k|  }
  127|    200|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 67, False: 133]
  ------------------
  128|     67|    return false;
  129|     67|  }
  130|    133|  return true;
  131|    200|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    142|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    133|    DecoderBuffer *buffer) {
  136|    133|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    133|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    133|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    133|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 133]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|    133|#endif
  146|    133|  {
  147|    133|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 130]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    133|  }
  151|    130|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 62, False: 68]
  ------------------
  152|     62|    return false;
  153|     62|  }
  154|     68|  const uint8_t *const data_head =
  155|     68|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     68|  buffer->Advance(bytes_encoded);
  158|     68|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 20, False: 48]
  ------------------
  159|     20|    return false;
  160|     20|  }
  161|     48|  return true;
  162|     68|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|   130k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     48|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     48|  ans_.read_end();
  167|     48|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    260|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    260|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    260|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 260]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    260|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    260|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    260|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 17, False: 243]
  ------------------
   67|     17|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 15]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     17|  } else
   72|    243|#endif
   73|    243|  {
   74|    243|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 241]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    243|  }
   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|    256|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 246]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    246|  probability_table_.resize(num_symbols_);
   86|    246|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 235]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|   191k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 191k, False: 161]
  ------------------
   91|   191k|    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|   191k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 33, False: 191k]
  ------------------
   95|     33|      return false;
   96|     33|    }
   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|   191k|    const int token = prob_data & 3;
  102|   191k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 48.2k, False: 143k]
  ------------------
  103|  48.2k|      const uint32_t offset = prob_data >> 2;
  104|  48.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 28, False: 48.2k]
  ------------------
  105|     28|        return false;
  106|     28|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.74M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.69M, False: 48.2k]
  ------------------
  109|  1.69M|        probability_table_[i + j] = 0;
  110|  1.69M|      }
  111|  48.2k|      i += offset;
  112|   143k|    } else {
  113|   143k|      const int extra_bytes = token;
  114|   143k|      uint32_t prob = prob_data >> 2;
  115|   253k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 109k, False: 143k]
  ------------------
  116|   109k|        uint8_t eb;
  117|   109k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 109k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   109k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   109k|      }
  124|   143k|      probability_table_[i] = prob;
  125|   143k|    }
  126|   191k|  }
  127|    161|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 66, False: 95]
  ------------------
  128|     66|    return false;
  129|     66|  }
  130|     95|  return true;
  131|    161|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|    106|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|     95|    DecoderBuffer *buffer) {
  136|     95|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     95|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     95|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     95|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 95]
  ------------------
  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|     95|#endif
  146|     95|  {
  147|     95|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 90]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|     95|  }
  151|     90|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 31, False: 59]
  ------------------
  152|     31|    return false;
  153|     31|  }
  154|     59|  const uint8_t *const data_head =
  155|     59|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     59|  buffer->Advance(bytes_encoded);
  158|     59|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 21, False: 38]
  ------------------
  159|     21|    return false;
  160|     21|  }
  161|     38|  return true;
  162|     59|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   303k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     38|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     38|  ans_.read_end();
  167|     38|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    288|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    288|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    288|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 288]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    288|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    288|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    288|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 24, False: 264]
  ------------------
   67|     24|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 23]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     24|  } else
   72|    264|#endif
   73|    264|  {
   74|    264|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 254]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    264|  }
   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|    277|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 25, False: 252]
  ------------------
   83|     25|    return false;
   84|     25|  }
   85|    252|  probability_table_.resize(num_symbols_);
   86|    252|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 245]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  34.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 34.4k, False: 162]
  ------------------
   91|  34.4k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  34.4k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 37, False: 34.4k]
  ------------------
   95|     37|      return false;
   96|     37|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  34.4k|    const int token = prob_data & 3;
  102|  34.4k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 17.2k, False: 17.1k]
  ------------------
  103|  17.2k|      const uint32_t offset = prob_data >> 2;
  104|  17.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 26, False: 17.2k]
  ------------------
  105|     26|        return false;
  106|     26|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   873k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 856k, False: 17.2k]
  ------------------
  109|   856k|        probability_table_[i + j] = 0;
  110|   856k|      }
  111|  17.2k|      i += offset;
  112|  17.2k|    } else {
  113|  17.1k|      const int extra_bytes = token;
  114|  17.1k|      uint32_t prob = prob_data >> 2;
  115|  26.4k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 9.34k, False: 17.1k]
  ------------------
  116|  9.34k|        uint8_t eb;
  117|  9.34k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 9.32k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  9.32k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  9.32k|      }
  124|  17.1k|      probability_table_[i] = prob;
  125|  17.1k|    }
  126|  34.4k|  }
  127|    162|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 29, False: 133]
  ------------------
  128|     29|    return false;
  129|     29|  }
  130|    133|  return true;
  131|    162|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    140|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    133|    DecoderBuffer *buffer) {
  136|    133|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    133|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    133|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    133|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 3, False: 130]
  ------------------
  140|      3|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 1]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|      3|  } else
  145|    130|#endif
  146|    130|  {
  147|    130|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 8, False: 122]
  ------------------
  148|      8|      return false;
  149|      8|    }
  150|    130|  }
  151|    123|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 40, False: 83]
  ------------------
  152|     40|    return false;
  153|     40|  }
  154|     83|  const uint8_t *const data_head =
  155|     83|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     83|  buffer->Advance(bytes_encoded);
  158|     83|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 58]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     58|  return true;
  162|     83|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  1.91M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     58|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     58|  ans_.read_end();
  167|     58|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    314|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    314|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    314|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 314]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    314|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    314|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    314|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 42, False: 272]
  ------------------
   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|    272|#endif
   73|    272|  {
   74|    272|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 270]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    272|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    311|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 6, False: 305]
  ------------------
   83|      6|    return false;
   84|      6|  }
   85|    305|  probability_table_.resize(num_symbols_);
   86|    305|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 16, False: 289]
  ------------------
   87|     16|    return true;
   88|     16|  }
   89|       |  // Decode the table.
   90|   224k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 224k, False: 196]
  ------------------
   91|   224k|    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|   224k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 47, False: 224k]
  ------------------
   95|     47|      return false;
   96|     47|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   224k|    const int token = prob_data & 3;
  102|   224k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 25.4k, False: 199k]
  ------------------
  103|  25.4k|      const uint32_t offset = prob_data >> 2;
  104|  25.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 25, False: 25.3k]
  ------------------
  105|     25|        return false;
  106|     25|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   990k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 964k, False: 25.3k]
  ------------------
  109|   964k|        probability_table_[i + j] = 0;
  110|   964k|      }
  111|  25.3k|      i += offset;
  112|   199k|    } else {
  113|   199k|      const int extra_bytes = token;
  114|   199k|      uint32_t prob = prob_data >> 2;
  115|   262k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 63.8k, False: 199k]
  ------------------
  116|  63.8k|        uint8_t eb;
  117|  63.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 63.8k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  63.8k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  63.8k|      }
  124|   199k|      probability_table_[i] = prob;
  125|   199k|    }
  126|   224k|  }
  127|    196|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 39, False: 157]
  ------------------
  128|     39|    return false;
  129|     39|  }
  130|    157|  return true;
  131|    196|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    173|  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: 31, False: 126]
  ------------------
  140|     31|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 30]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     31|  } else
  145|    126|#endif
  146|    126|  {
  147|    126|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 6, False: 120]
  ------------------
  148|      6|      return false;
  149|      6|    }
  150|    126|  }
  151|    150|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 53, False: 97]
  ------------------
  152|     53|    return false;
  153|     53|  }
  154|     97|  const uint8_t *const data_head =
  155|     97|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     97|  buffer->Advance(bytes_encoded);
  158|     97|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 30, False: 67]
  ------------------
  159|     30|    return false;
  160|     30|  }
  161|     67|  return true;
  162|     97|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  3.40M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     67|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     67|  ans_.read_end();
  167|     67|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    294|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    294|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    294|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 294]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    294|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    294|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    294|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 32, False: 262]
  ------------------
   67|     32|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 31]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     32|  } else
   72|    262|#endif
   73|    262|  {
   74|    262|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 251]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    262|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    282|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 25, False: 257]
  ------------------
   83|     25|    return false;
   84|     25|  }
   85|    257|  probability_table_.resize(num_symbols_);
   86|    257|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 253]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|  6.80k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 6.63k, False: 170]
  ------------------
   91|  6.63k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  6.63k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 39, False: 6.59k]
  ------------------
   95|     39|      return false;
   96|     39|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  6.59k|    const int token = prob_data & 3;
  102|  6.59k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.71k, False: 2.88k]
  ------------------
  103|  3.71k|      const uint32_t offset = prob_data >> 2;
  104|  3.71k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 25, False: 3.68k]
  ------------------
  105|     25|        return false;
  106|     25|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   132k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 129k, False: 3.68k]
  ------------------
  109|   129k|        probability_table_[i + j] = 0;
  110|   129k|      }
  111|  3.68k|      i += offset;
  112|  3.68k|    } else {
  113|  2.88k|      const int extra_bytes = token;
  114|  2.88k|      uint32_t prob = prob_data >> 2;
  115|  5.23k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.37k, False: 2.86k]
  ------------------
  116|  2.37k|        uint8_t eb;
  117|  2.37k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 19, False: 2.35k]
  ------------------
  118|     19|          return false;
  119|     19|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.35k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.35k|      }
  124|  2.86k|      probability_table_[i] = prob;
  125|  2.86k|    }
  126|  6.59k|  }
  127|    170|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 16, False: 154]
  ------------------
  128|     16|    return false;
  129|     16|  }
  130|    154|  return true;
  131|    170|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    158|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    154|    DecoderBuffer *buffer) {
  136|    154|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    154|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    154|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    154|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 138]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 14]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     16|  } else
  145|    138|#endif
  146|    138|  {
  147|    138|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 13, False: 125]
  ------------------
  148|     13|      return false;
  149|     13|    }
  150|    138|  }
  151|    139|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 54, False: 85]
  ------------------
  152|     54|    return false;
  153|     54|  }
  154|     85|  const uint8_t *const data_head =
  155|     85|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     85|  buffer->Advance(bytes_encoded);
  158|     85|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 27, False: 58]
  ------------------
  159|     27|    return false;
  160|     27|  }
  161|     58|  return true;
  162|     85|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  18.0M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     58|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     58|  ans_.read_end();
  167|     58|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    276|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    276|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    276|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 276]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    276|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    276|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    276|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 42, False: 234]
  ------------------
   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|    234|#endif
   73|    234|  {
   74|    234|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 231]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    234|  }
   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|    272|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 22, False: 250]
  ------------------
   83|     22|    return false;
   84|     22|  }
   85|    250|  probability_table_.resize(num_symbols_);
   86|    250|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 240]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|  9.91k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 9.76k, False: 154]
  ------------------
   91|  9.76k|    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.76k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 44, False: 9.71k]
  ------------------
   95|     44|      return false;
   96|     44|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  9.71k|    const int token = prob_data & 3;
  102|  9.71k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.89k, False: 5.82k]
  ------------------
  103|  3.89k|      const uint32_t offset = prob_data >> 2;
  104|  3.89k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 26, False: 3.87k]
  ------------------
  105|     26|        return false;
  106|     26|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   120k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 116k, False: 3.87k]
  ------------------
  109|   116k|        probability_table_[i + j] = 0;
  110|   116k|      }
  111|  3.87k|      i += offset;
  112|  5.82k|    } else {
  113|  5.82k|      const int extra_bytes = token;
  114|  5.82k|      uint32_t prob = prob_data >> 2;
  115|  10.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.45k, False: 5.80k]
  ------------------
  116|  4.45k|        uint8_t eb;
  117|  4.45k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 4.43k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.43k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.43k|      }
  124|  5.80k|      probability_table_[i] = prob;
  125|  5.80k|    }
  126|  9.71k|  }
  127|    154|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 20, False: 134]
  ------------------
  128|     20|    return false;
  129|     20|  }
  130|    134|  return true;
  131|    154|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    144|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    134|    DecoderBuffer *buffer) {
  136|    134|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    134|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    134|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    134|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 28, False: 106]
  ------------------
  140|     28|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 26]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     28|  } else
  145|    106|#endif
  146|    106|  {
  147|    106|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 104]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    106|  }
  151|    130|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 65, False: 65]
  ------------------
  152|     65|    return false;
  153|     65|  }
  154|     65|  const uint8_t *const data_head =
  155|     65|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     65|  buffer->Advance(bytes_encoded);
  158|     65|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 16, False: 49]
  ------------------
  159|     16|    return false;
  160|     16|  }
  161|     49|  return true;
  162|     65|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  15.7M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     49|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     49|  ans_.read_end();
  167|     49|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    259|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    259|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    259|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 259]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    259|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    259|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    259|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 54, False: 205]
  ------------------
   67|     54|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 53]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     54|  } else
   72|    205|#endif
   73|    205|  {
   74|    205|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 194]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    205|  }
   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|    247|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 20, False: 227]
  ------------------
   83|     20|    return false;
   84|     20|  }
   85|    227|  probability_table_.resize(num_symbols_);
   86|    227|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 222]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|  61.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 61.4k, False: 134]
  ------------------
   91|  61.4k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  61.4k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 48, False: 61.3k]
  ------------------
   95|     48|      return false;
   96|     48|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  61.3k|    const int token = prob_data & 3;
  102|  61.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 45.1k, False: 16.2k]
  ------------------
  103|  45.1k|      const uint32_t offset = prob_data >> 2;
  104|  45.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 45.1k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   437k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 391k, False: 45.1k]
  ------------------
  109|   391k|        probability_table_[i + j] = 0;
  110|   391k|      }
  111|  45.1k|      i += offset;
  112|  45.1k|    } else {
  113|  16.2k|      const int extra_bytes = token;
  114|  16.2k|      uint32_t prob = prob_data >> 2;
  115|  36.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 19.8k, False: 16.2k]
  ------------------
  116|  19.8k|        uint8_t eb;
  117|  19.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 18, False: 19.8k]
  ------------------
  118|     18|          return false;
  119|     18|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  19.8k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  19.8k|      }
  124|  16.2k|      probability_table_[i] = prob;
  125|  16.2k|    }
  126|  61.3k|  }
  127|    134|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 21, False: 113]
  ------------------
  128|     21|    return false;
  129|     21|  }
  130|    113|  return true;
  131|    134|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    118|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    113|    DecoderBuffer *buffer) {
  136|    113|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    113|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    113|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    113|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 41, False: 72]
  ------------------
  140|     41|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 40]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     41|  } else
  145|     72|#endif
  146|     72|  {
  147|     72|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 69]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|     72|  }
  151|    109|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 56, False: 53]
  ------------------
  152|     56|    return false;
  153|     56|  }
  154|     53|  const uint8_t *const data_head =
  155|     53|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     53|  buffer->Advance(bytes_encoded);
  158|     53|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 5, False: 48]
  ------------------
  159|      5|    return false;
  160|      5|  }
  161|     48|  return true;
  162|     53|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  25.4M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     48|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     48|  ans_.read_end();
  167|     48|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  8.70k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  8.70k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 19, False: 8.69k]
  ------------------
   35|     19|    return true;
   36|     19|  }
   37|       |  // Decode which scheme to use.
   38|  8.69k|  uint8_t scheme;
   39|  8.69k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 131, False: 8.55k]
  ------------------
   40|    131|    return false;
   41|    131|  }
   42|  8.55k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 818, False: 7.74k]
  ------------------
   43|    818|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|    818|                                                  src_buffer, out_values);
   45|  7.74k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 5.86k, False: 1.88k]
  ------------------
   46|  5.86k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  5.86k|                                               out_values);
   48|  5.86k|  }
   49|  1.88k|  return false;
   50|  8.55k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|    818|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|    818|  SymbolDecoderT<5> tag_decoder;
   57|    818|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 334, False: 484]
  ------------------
   58|    334|    return false;
   59|    334|  }
   60|       |
   61|    484|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 219, False: 265]
  ------------------
   62|    219|    return false;
   63|    219|  }
   64|       |
   65|    265|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 265, False: 0]
  |  Branch (65:25): [True: 58, False: 207]
  ------------------
   66|     58|    return false;  // Wrong number of symbols.
   67|     58|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    207|  src_buffer->StartBitDecoding(false, nullptr);
   72|    207|  int value_id = 0;
   73|   504k|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 504k, False: 207]
  ------------------
   74|       |    // Decode the tag.
   75|   504k|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  1.20M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 700k, False: 504k]
  ------------------
   78|   700k|      uint32_t val;
   79|   700k|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 0, False: 700k]
  ------------------
   80|      0|        return false;
   81|      0|      }
   82|   700k|      out_values[value_id++] = val;
   83|   700k|    }
   84|   504k|  }
   85|    207|  tag_decoder.EndDecoding();
   86|    207|  src_buffer->EndBitDecoding();
   87|    207|  return true;
   88|    207|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  5.86k|                      uint32_t *out_values) {
  117|  5.86k|  uint8_t max_bit_length;
  118|  5.86k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 31, False: 5.83k]
  ------------------
  119|     31|    return false;
  120|     31|  }
  121|  5.83k|  switch (max_bit_length) {
  122|    436|    case 1:
  ------------------
  |  Branch (122:5): [True: 436, False: 5.39k]
  ------------------
  123|    436|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    436|                                                         out_values);
  125|    494|    case 2:
  ------------------
  |  Branch (125:5): [True: 494, False: 5.33k]
  ------------------
  126|    494|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    494|                                                         out_values);
  128|    335|    case 3:
  ------------------
  |  Branch (128:5): [True: 335, False: 5.49k]
  ------------------
  129|    335|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    335|                                                         out_values);
  131|    237|    case 4:
  ------------------
  |  Branch (131:5): [True: 237, False: 5.59k]
  ------------------
  132|    237|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    237|                                                         out_values);
  134|    197|    case 5:
  ------------------
  |  Branch (134:5): [True: 197, False: 5.63k]
  ------------------
  135|    197|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    197|                                                         out_values);
  137|    329|    case 6:
  ------------------
  |  Branch (137:5): [True: 329, False: 5.50k]
  ------------------
  138|    329|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    329|                                                         out_values);
  140|    335|    case 7:
  ------------------
  |  Branch (140:5): [True: 335, False: 5.49k]
  ------------------
  141|    335|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    335|                                                         out_values);
  143|    343|    case 8:
  ------------------
  |  Branch (143:5): [True: 343, False: 5.48k]
  ------------------
  144|    343|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    343|                                                         out_values);
  146|    280|    case 9:
  ------------------
  |  Branch (146:5): [True: 280, False: 5.55k]
  ------------------
  147|    280|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    280|                                                         out_values);
  149|    264|    case 10:
  ------------------
  |  Branch (149:5): [True: 264, False: 5.56k]
  ------------------
  150|    264|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    264|          num_values, src_buffer, out_values);
  152|    315|    case 11:
  ------------------
  |  Branch (152:5): [True: 315, False: 5.51k]
  ------------------
  153|    315|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    315|          num_values, src_buffer, out_values);
  155|    324|    case 12:
  ------------------
  |  Branch (155:5): [True: 324, False: 5.50k]
  ------------------
  156|    324|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    324|          num_values, src_buffer, out_values);
  158|    260|    case 13:
  ------------------
  |  Branch (158:5): [True: 260, False: 5.57k]
  ------------------
  159|    260|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    260|          num_values, src_buffer, out_values);
  161|    288|    case 14:
  ------------------
  |  Branch (161:5): [True: 288, False: 5.54k]
  ------------------
  162|    288|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    288|          num_values, src_buffer, out_values);
  164|    314|    case 15:
  ------------------
  |  Branch (164:5): [True: 314, False: 5.51k]
  ------------------
  165|    314|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    314|          num_values, src_buffer, out_values);
  167|    294|    case 16:
  ------------------
  |  Branch (167:5): [True: 294, False: 5.53k]
  ------------------
  168|    294|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    294|          num_values, src_buffer, out_values);
  170|    276|    case 17:
  ------------------
  |  Branch (170:5): [True: 276, False: 5.55k]
  ------------------
  171|    276|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    276|          num_values, src_buffer, out_values);
  173|    259|    case 18:
  ------------------
  |  Branch (173:5): [True: 259, False: 5.57k]
  ------------------
  174|    259|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    259|          num_values, src_buffer, out_values);
  176|    250|    default:
  ------------------
  |  Branch (176:5): [True: 250, False: 5.58k]
  ------------------
  177|    250|      return false;
  178|  5.83k|  }
  179|  5.83k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    436|                              uint32_t *out_values) {
   93|    436|  SymbolDecoderT decoder;
   94|    436|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 253, False: 183]
  ------------------
   95|    253|    return false;
   96|    253|  }
   97|       |
   98|    183|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 183, False: 0]
  |  Branch (98:25): [True: 16, False: 167]
  ------------------
   99|     16|    return false;  // Wrong number of symbols.
  100|     16|  }
  101|       |
  102|    167|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 52, False: 115]
  ------------------
  103|     52|    return false;
  104|     52|  }
  105|  30.6M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 30.6M, False: 115]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  30.6M|    const uint32_t value = decoder.DecodeSymbol();
  108|  30.6M|    out_values[i] = value;
  109|  30.6M|  }
  110|    115|  decoder.EndDecoding();
  111|    115|  return true;
  112|    167|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    494|                              uint32_t *out_values) {
   93|    494|  SymbolDecoderT decoder;
   94|    494|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 167, False: 327]
  ------------------
   95|    167|    return false;
   96|    167|  }
   97|       |
   98|    327|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 327, False: 0]
  |  Branch (98:25): [True: 12, False: 315]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|    315|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 104, False: 211]
  ------------------
  103|    104|    return false;
  104|    104|  }
  105|  4.19M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.19M, False: 211]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.19M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.19M|    out_values[i] = value;
  109|  4.19M|  }
  110|    211|  decoder.EndDecoding();
  111|    211|  return true;
  112|    315|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    335|                              uint32_t *out_values) {
   93|    335|  SymbolDecoderT decoder;
   94|    335|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 124, False: 211]
  ------------------
   95|    124|    return false;
   96|    124|  }
   97|       |
   98|    211|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 211, False: 0]
  |  Branch (98:25): [True: 4, False: 207]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    207|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 122, False: 85]
  ------------------
  103|    122|    return false;
  104|    122|  }
  105|  11.9M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 11.9M, False: 85]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  11.9M|    const uint32_t value = decoder.DecodeSymbol();
  108|  11.9M|    out_values[i] = value;
  109|  11.9M|  }
  110|     85|  decoder.EndDecoding();
  111|     85|  return true;
  112|    207|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    237|                              uint32_t *out_values) {
   93|    237|  SymbolDecoderT decoder;
   94|    237|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 108, False: 129]
  ------------------
   95|    108|    return false;
   96|    108|  }
   97|       |
   98|    129|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 129, False: 0]
  |  Branch (98:25): [True: 7, False: 122]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    122|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 39, False: 83]
  ------------------
  103|     39|    return false;
  104|     39|  }
  105|  2.80M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.80M, False: 83]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.80M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.80M|    out_values[i] = value;
  109|  2.80M|  }
  110|     83|  decoder.EndDecoding();
  111|     83|  return true;
  112|    122|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    197|                              uint32_t *out_values) {
   93|    197|  SymbolDecoderT decoder;
   94|    197|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 24, False: 173]
  ------------------
   95|     24|    return false;
   96|     24|  }
   97|       |
   98|    173|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 173, False: 0]
  |  Branch (98:25): [True: 82, False: 91]
  ------------------
   99|     82|    return false;  // Wrong number of symbols.
  100|     82|  }
  101|       |
  102|     91|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 23, False: 68]
  ------------------
  103|     23|    return false;
  104|     23|  }
  105|   498k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 497k, False: 68]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   497k|    const uint32_t value = decoder.DecodeSymbol();
  108|   497k|    out_values[i] = value;
  109|   497k|  }
  110|     68|  decoder.EndDecoding();
  111|     68|  return true;
  112|     91|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    329|                              uint32_t *out_values) {
   93|    329|  SymbolDecoderT decoder;
   94|    329|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 126, False: 203]
  ------------------
   95|    126|    return false;
   96|    126|  }
   97|       |
   98|    203|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 203, False: 0]
  |  Branch (98:25): [True: 4, False: 199]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    199|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 103, False: 96]
  ------------------
  103|    103|    return false;
  104|    103|  }
  105|  8.23M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.23M, False: 96]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.23M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.23M|    out_values[i] = value;
  109|  8.23M|  }
  110|     96|  decoder.EndDecoding();
  111|     96|  return true;
  112|    199|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    335|                              uint32_t *out_values) {
   93|    335|  SymbolDecoderT decoder;
   94|    335|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 154, False: 181]
  ------------------
   95|    154|    return false;
   96|    154|  }
   97|       |
   98|    181|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 181, False: 0]
  |  Branch (98:25): [True: 13, False: 168]
  ------------------
   99|     13|    return false;  // Wrong number of symbols.
  100|     13|  }
  101|       |
  102|    168|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 86, False: 82]
  ------------------
  103|     86|    return false;
  104|     86|  }
  105|  8.01M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.01M, False: 82]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.01M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.01M|    out_values[i] = value;
  109|  8.01M|  }
  110|     82|  decoder.EndDecoding();
  111|     82|  return true;
  112|    168|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    343|                              uint32_t *out_values) {
   93|    343|  SymbolDecoderT decoder;
   94|    343|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 156, False: 187]
  ------------------
   95|    156|    return false;
   96|    156|  }
   97|       |
   98|    187|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 187, False: 0]
  |  Branch (98:25): [True: 3, False: 184]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|    184|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 123, False: 61]
  ------------------
  103|    123|    return false;
  104|    123|  }
  105|  2.01M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.01M, False: 61]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.01M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.01M|    out_values[i] = value;
  109|  2.01M|  }
  110|     61|  decoder.EndDecoding();
  111|     61|  return true;
  112|    184|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    280|                              uint32_t *out_values) {
   93|    280|  SymbolDecoderT decoder;
   94|    280|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 147, False: 133]
  ------------------
   95|    147|    return false;
   96|    147|  }
   97|       |
   98|    133|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 133, False: 0]
  |  Branch (98:25): [True: 11, False: 122]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    122|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 87, False: 35]
  ------------------
  103|     87|    return false;
  104|     87|  }
  105|  72.7k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 72.7k, False: 35]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  72.7k|    const uint32_t value = decoder.DecodeSymbol();
  108|  72.7k|    out_values[i] = value;
  109|  72.7k|  }
  110|     35|  decoder.EndDecoding();
  111|     35|  return true;
  112|    122|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    264|                              uint32_t *out_values) {
   93|    264|  SymbolDecoderT decoder;
   94|    264|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 148, False: 116]
  ------------------
   95|    148|    return false;
   96|    148|  }
   97|       |
   98|    116|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 116, False: 0]
  |  Branch (98:25): [True: 4, False: 112]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    112|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 63, False: 49]
  ------------------
  103|     63|    return false;
  104|     63|  }
  105|   364k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 364k, False: 49]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   364k|    const uint32_t value = decoder.DecodeSymbol();
  108|   364k|    out_values[i] = value;
  109|   364k|  }
  110|     49|  decoder.EndDecoding();
  111|     49|  return true;
  112|    112|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    315|                              uint32_t *out_values) {
   93|    315|  SymbolDecoderT decoder;
   94|    315|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 176, False: 139]
  ------------------
   95|    176|    return false;
   96|    176|  }
   97|       |
   98|    139|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 139, False: 0]
  |  Branch (98:25): [True: 4, False: 135]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    135|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 102, False: 33]
  ------------------
  103|    102|    return false;
  104|    102|  }
  105|  37.2k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 37.2k, False: 33]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  37.2k|    const uint32_t value = decoder.DecodeSymbol();
  108|  37.2k|    out_values[i] = value;
  109|  37.2k|  }
  110|     33|  decoder.EndDecoding();
  111|     33|  return true;
  112|    135|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    324|                              uint32_t *out_values) {
   93|    324|  SymbolDecoderT decoder;
   94|    324|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 182, False: 142]
  ------------------
   95|    182|    return false;
   96|    182|  }
   97|       |
   98|    142|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 142, False: 0]
  |  Branch (98:25): [True: 9, False: 133]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    133|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 85, False: 48]
  ------------------
  103|     85|    return false;
  104|     85|  }
  105|   131k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 130k, False: 48]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   130k|    const uint32_t value = decoder.DecodeSymbol();
  108|   130k|    out_values[i] = value;
  109|   130k|  }
  110|     48|  decoder.EndDecoding();
  111|     48|  return true;
  112|    133|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    260|                              uint32_t *out_values) {
   93|    260|  SymbolDecoderT decoder;
   94|    260|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 154, False: 106]
  ------------------
   95|    154|    return false;
   96|    154|  }
   97|       |
   98|    106|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 106, False: 0]
  |  Branch (98:25): [True: 11, False: 95]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|     95|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 57, False: 38]
  ------------------
  103|     57|    return false;
  104|     57|  }
  105|   303k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 303k, False: 38]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   303k|    const uint32_t value = decoder.DecodeSymbol();
  108|   303k|    out_values[i] = value;
  109|   303k|  }
  110|     38|  decoder.EndDecoding();
  111|     38|  return true;
  112|     95|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    288|                              uint32_t *out_values) {
   93|    288|  SymbolDecoderT decoder;
   94|    288|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 148, False: 140]
  ------------------
   95|    148|    return false;
   96|    148|  }
   97|       |
   98|    140|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 140, False: 0]
  |  Branch (98:25): [True: 7, False: 133]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    133|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 75, False: 58]
  ------------------
  103|     75|    return false;
  104|     75|  }
  105|  1.91M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.91M, False: 58]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.91M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.91M|    out_values[i] = value;
  109|  1.91M|  }
  110|     58|  decoder.EndDecoding();
  111|     58|  return true;
  112|    133|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    314|                              uint32_t *out_values) {
   93|    314|  SymbolDecoderT decoder;
   94|    314|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 141, False: 173]
  ------------------
   95|    141|    return false;
   96|    141|  }
   97|       |
   98|    173|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 173, False: 0]
  |  Branch (98:25): [True: 16, False: 157]
  ------------------
   99|     16|    return false;  // Wrong number of symbols.
  100|     16|  }
  101|       |
  102|    157|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 90, False: 67]
  ------------------
  103|     90|    return false;
  104|     90|  }
  105|  3.40M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.40M, False: 67]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.40M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.40M|    out_values[i] = value;
  109|  3.40M|  }
  110|     67|  decoder.EndDecoding();
  111|     67|  return true;
  112|    157|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    294|                              uint32_t *out_values) {
   93|    294|  SymbolDecoderT decoder;
   94|    294|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 136, False: 158]
  ------------------
   95|    136|    return false;
   96|    136|  }
   97|       |
   98|    158|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 158, False: 0]
  |  Branch (98:25): [True: 4, False: 154]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    154|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 96, False: 58]
  ------------------
  103|     96|    return false;
  104|     96|  }
  105|  18.0M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 18.0M, False: 58]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  18.0M|    const uint32_t value = decoder.DecodeSymbol();
  108|  18.0M|    out_values[i] = value;
  109|  18.0M|  }
  110|     58|  decoder.EndDecoding();
  111|     58|  return true;
  112|    154|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    276|                              uint32_t *out_values) {
   93|    276|  SymbolDecoderT decoder;
   94|    276|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 132, False: 144]
  ------------------
   95|    132|    return false;
   96|    132|  }
   97|       |
   98|    144|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 144, False: 0]
  |  Branch (98:25): [True: 10, False: 134]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    134|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 85, False: 49]
  ------------------
  103|     85|    return false;
  104|     85|  }
  105|  15.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 15.7M, False: 49]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  15.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  15.7M|    out_values[i] = value;
  109|  15.7M|  }
  110|     49|  decoder.EndDecoding();
  111|     49|  return true;
  112|    134|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    259|                              uint32_t *out_values) {
   93|    259|  SymbolDecoderT decoder;
   94|    259|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 141, False: 118]
  ------------------
   95|    141|    return false;
   96|    141|  }
   97|       |
   98|    118|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 118, False: 0]
  |  Branch (98:25): [True: 5, False: 113]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    113|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 65, False: 48]
  ------------------
  103|     65|    return false;
  104|     65|  }
  105|  25.4M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 25.4M, False: 48]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  25.4M|    const uint32_t value = decoder.DecodeSymbol();
  108|  25.4M|    out_values[i] = value;
  109|  25.4M|  }
  110|     48|  decoder.EndDecoding();
  111|     48|  return true;
  112|    113|}

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

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

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

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

_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEEC2Ev:
   48|  2.15k|    : decoder_(nullptr),
   49|  2.15k|      last_symbol_id_(-1),
   50|  2.15k|      last_vert_id_(-1),
   51|  2.15k|      last_face_id_(-1),
   52|  2.15k|      num_new_vertices_(0),
   53|  2.15k|      num_encoded_vertices_(0),
   54|  2.15k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.15k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.15k|  decoder_ = decoder;
   60|  2.15k|  return true;
   61|  2.15k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23GetAttributeCornerTableEi:
   66|  1.88k|    int att_id) const {
   67|  3.18k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 2.75k, False: 430]
  ------------------
   68|  2.75k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  2.75k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.29k, False: 1.45k]
  |  Branch (69:27): [True: 0, False: 1.45k]
  ------------------
   70|  1.29k|      continue;
   71|  1.29k|    }
   72|  1.45k|    const AttributesDecoderInterface *const dec =
   73|  1.45k|        decoder_->attributes_decoder(decoder_id);
   74|  3.08k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 3.08k, False: 0]
  ------------------
   75|  3.08k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 1.45k, False: 1.63k]
  ------------------
   76|  1.45k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 1.03k, False: 421]
  ------------------
   77|  1.03k|          return &attribute_data_[i].connectivity_data;
   78|  1.03k|        }
   79|    421|        return nullptr;
   80|  1.45k|      }
   81|  3.08k|    }
   82|  1.45k|  }
   83|    430|  return nullptr;
   84|  1.88k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE24GetAttributeEncodingDataEi:
   89|  1.88k|    int att_id) const {
   90|  3.18k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 2.75k, False: 430]
  ------------------
   91|  2.75k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  2.75k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.29k, False: 1.45k]
  |  Branch (92:27): [True: 0, False: 1.45k]
  ------------------
   93|  1.29k|      continue;
   94|  1.29k|    }
   95|  1.45k|    const AttributesDecoderInterface *const dec =
   96|  1.45k|        decoder_->attributes_decoder(decoder_id);
   97|  3.08k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 3.08k, False: 0]
  ------------------
   98|  3.08k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 1.45k, False: 1.63k]
  ------------------
   99|  1.45k|        return &attribute_data_[i].encoding_data;
  100|  1.45k|      }
  101|  3.08k|    }
  102|  1.45k|  }
  103|    430|  return &pos_encoding_data_;
  104|  1.88k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23CreateAttributesDecoderEi:
  130|  1.50k|    int32_t att_decoder_id) {
  131|  1.50k|  int8_t att_data_id;
  132|  1.50k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 11, False: 1.49k]
  ------------------
  133|     11|    return false;
  134|     11|  }
  135|  1.49k|  uint8_t decoder_type;
  136|  1.49k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 7, False: 1.48k]
  ------------------
  137|      7|    return false;
  138|      7|  }
  139|       |
  140|  1.48k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 1.11k, False: 375]
  ------------------
  141|  1.11k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 50, False: 1.06k]
  ------------------
  142|     50|      return false;  // Unexpected attribute data.
  143|     50|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  1.06k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 6, False: 1.05k]
  ------------------
  148|      6|      return false;
  149|      6|    }
  150|       |
  151|  1.05k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  1.05k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    375|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 1, False: 374]
  ------------------
  155|      1|      return false;  // Some other decoder is already using the data. Error.
  156|      1|    }
  157|    374|    pos_data_decoder_id_ = att_decoder_id;
  158|    374|  }
  159|       |
  160|  1.42k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  1.42k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.42k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 1.42k, False: 1]
  ------------------
  162|  1.42k|    uint8_t traversal_method_encoded;
  163|  1.42k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 13, False: 1.41k]
  ------------------
  164|     13|      return false;
  165|     13|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  1.41k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 38, False: 1.37k]
  ------------------
  168|     38|      return false;
  169|     38|    }
  170|  1.37k|    traversal_method =
  171|  1.37k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  1.37k|  }
  173|       |
  174|  1.37k|  const Mesh *mesh = decoder_->mesh();
  175|  1.37k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  1.37k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 618, False: 759]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    618|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    618|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 332, False: 286]
  ------------------
  182|    332|      encoding_data = &pos_encoding_data_;
  183|    332|    } else {
  184|    286|      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|    286|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    286|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    618|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 100, False: 518]
  ------------------
  191|    100|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    100|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    100|          AttTraverser;
  194|    100|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    518|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 518, False: 0]
  ------------------
  196|    518|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    518|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    518|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    518|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    759|  } else {
  203|    759|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 5, False: 754]
  ------------------
  204|      5|      return false;  // Unsupported method.
  205|      5|    }
  206|    754|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 3, False: 751]
  ------------------
  207|      3|      return false;  // Attribute data must be specified.
  208|      3|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    751|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    751|        AttObserver;
  214|    751|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    751|        AttTraverser;
  216|       |
  217|    751|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|    751|        &attribute_data_[att_data_id].encoding_data;
  219|    751|    const MeshAttributeCornerTable *const corner_table =
  220|    751|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    751|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    751|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    751|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    751|                             encoding_data);
  227|       |
  228|    751|    AttTraverser att_traverser;
  229|    751|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    751|    traversal_sequencer->SetTraverser(att_traverser);
  232|    751|    sequencer = std::move(traversal_sequencer);
  233|    751|  }
  234|       |
  235|  1.36k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 1.36k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  1.36k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  1.36k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  1.36k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  1.36k|                                        std::move(att_controller));
  244|  1.36k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEv:
  247|  2.15k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.15k|  num_new_vertices_ = 0;
  249|  2.15k|  new_to_parent_vertex_map_.clear();
  250|  2.15k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.15k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.15k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 464, False: 1.69k]
  ------------------
  252|    464|    uint32_t num_new_verts;
  253|    464|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    464|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 138, False: 326]
  ------------------
  254|    138|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 7, False: 131]
  ------------------
  255|      7|        return false;
  256|      7|      }
  257|    326|    } else {
  258|    326|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 326]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|    326|    }
  262|    457|    num_new_vertices_ = num_new_verts;
  263|    457|  }
  264|  2.15k|#endif
  265|       |
  266|  2.15k|  uint32_t num_encoded_vertices;
  267|  2.15k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.15k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.15k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 131, False: 2.02k]
  ------------------
  269|    131|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 4, False: 127]
  ------------------
  270|      4|      return false;
  271|      4|    }
  272|       |
  273|    131|  } else
  274|  2.02k|#endif
  275|  2.02k|  {
  276|  2.02k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 3, False: 2.01k]
  ------------------
  277|      3|      return false;
  278|      3|    }
  279|  2.02k|  }
  280|  2.14k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.14k|  uint32_t num_faces;
  283|  2.14k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.14k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.14k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 127, False: 2.01k]
  ------------------
  285|    127|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 3, False: 124]
  ------------------
  286|      3|      return false;
  287|      3|    }
  288|       |
  289|    127|  } else
  290|  2.01k|#endif
  291|  2.01k|  {
  292|  2.01k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 2.01k]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|  2.01k|  }
  296|  2.14k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 6, False: 2.13k]
  ------------------
  297|      6|    return false;  // Draco cannot handle this many faces.
  298|      6|  }
  299|       |
  300|  2.13k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 19, False: 2.11k]
  ------------------
  301|     19|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     19|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.11k|  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.11k|  const uint64_t num_encoded_vertices_64 =
  311|  2.11k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.11k|  const uint64_t max_num_vertex_edges =
  313|  2.11k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.11k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 7, False: 2.11k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      7|    return false;
  317|      7|  }
  318|       |
  319|  2.11k|  uint8_t num_attribute_data;
  320|  2.11k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 23, False: 2.08k]
  ------------------
  321|     23|    return false;
  322|     23|  }
  323|       |
  324|  2.08k|  uint32_t num_encoded_symbols;
  325|  2.08k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.08k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.08k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 107, False: 1.98k]
  ------------------
  327|    107|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 10, False: 97]
  ------------------
  328|     10|      return false;
  329|     10|    }
  330|       |
  331|    107|  } else
  332|  1.98k|#endif
  333|  1.98k|  {
  334|  1.98k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 4, False: 1.97k]
  ------------------
  335|      4|      return false;
  336|      4|    }
  337|  1.98k|  }
  338|       |
  339|  2.07k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 15, False: 2.05k]
  ------------------
  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|     15|    return false;
  344|     15|  }
  345|  2.05k|  const uint32_t max_encoded_faces =
  346|  2.05k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.05k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 30, False: 2.02k]
  ------------------
  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|     30|    return false;
  352|     30|  }
  353|       |
  354|  2.02k|  uint32_t num_encoded_split_symbols;
  355|  2.02k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.02k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.02k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 80, False: 1.94k]
  ------------------
  357|     80|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 1, False: 79]
  ------------------
  358|      1|      return false;
  359|      1|    }
  360|       |
  361|     80|  } else
  362|  1.94k|#endif
  363|  1.94k|  {
  364|  1.94k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 7, False: 1.94k]
  ------------------
  365|      7|      return false;
  366|      7|    }
  367|  1.94k|  }
  368|       |
  369|  2.02k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 19, False: 2.00k]
  ------------------
  370|     19|    return false;  // Split symbols are a sub-set of all symbols.
  371|     19|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.00k|  vertex_traversal_length_.clear();
  375|  2.00k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.00k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.00k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.00k|  processed_corner_ids_.clear();
  380|  2.00k|  processed_corner_ids_.reserve(num_faces);
  381|  2.00k|  processed_connectivity_corners_.clear();
  382|  2.00k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.00k|  topology_split_data_.clear();
  384|  2.00k|  hole_event_data_.clear();
  385|  2.00k|  init_face_configurations_.clear();
  386|  2.00k|  init_corners_.clear();
  387|       |
  388|  2.00k|  last_symbol_id_ = -1;
  389|  2.00k|  last_face_id_ = -1;
  390|  2.00k|  last_vert_id_ = -1;
  391|       |
  392|  2.00k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.00k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.00k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.00k]
  ------------------
  397|  2.00k|          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.00k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.00k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.00k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.00k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.00k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 392, False: 1.60k]
  ------------------
  411|    392|    uint32_t encoded_connectivity_size;
  412|    392|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    392|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 75, False: 317]
  ------------------
  413|     75|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 5, False: 70]
  ------------------
  414|      5|        return false;
  415|      5|      }
  416|    317|    } else {
  417|    317|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 1, False: 316]
  ------------------
  418|      1|        return false;
  419|      1|      }
  420|    317|    }
  421|    386|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 1, False: 385]
  ------------------
  422|    385|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 31, False: 354]
  ------------------
  423|     32|      return false;
  424|     32|    }
  425|    354|    DecoderBuffer event_buffer;
  426|    354|    event_buffer.Init(
  427|    354|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    354|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    354|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    354|    topology_split_decoded_bytes =
  432|    354|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    354|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 83, False: 271]
  ------------------
  434|     83|      return false;
  435|     83|    }
  436|       |
  437|    354|  } else
  438|  1.60k|#endif
  439|  1.60k|  {
  440|  1.60k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 57, False: 1.55k]
  ------------------
  441|     57|      return false;
  442|     57|    }
  443|  1.60k|  }
  444|       |
  445|  1.82k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  1.82k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  1.82k|                                           num_encoded_split_symbols);
  449|  1.82k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  1.82k|  DecoderBuffer traversal_end_buffer;
  452|  1.82k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 122, False: 1.70k]
  ------------------
  453|    122|    return false;
  454|    122|  }
  455|       |
  456|  1.70k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.70k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 204, False: 1.49k]
  ------------------
  458|    204|    return false;
  459|    204|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  1.49k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  1.49k|                           traversal_end_buffer.remaining_size(),
  464|  1.49k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  1.49k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  1.49k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.49k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 210, False: 1.28k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|    210|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|    210|  }
  471|  1.49k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  1.49k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 1.45k, False: 47]
  ------------------
  475|  1.45k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  1.45k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.45k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 206, False: 1.24k]
  ------------------
  477|  1.24k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 1.04k, False: 206]
  ------------------
  478|  1.04k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 1.04k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  1.04k|      }
  482|       |
  483|    206|    } else
  484|  1.24k|#endif
  485|  1.24k|    {
  486|   349k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 348k, False: 1.24k]
  ------------------
  487|   348k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 348k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   348k|      }
  491|  1.24k|    }
  492|  1.45k|  }
  493|  1.49k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  4.83k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 3.33k, False: 1.49k]
  ------------------
  498|  3.33k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  3.53M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 3.53M, False: 3.33k]
  ------------------
  501|  3.53M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  3.53M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  3.33k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 3.33k]
  ------------------
  505|  3.33k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  3.33k|  }
  509|       |
  510|  1.49k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  4.83k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 3.33k, False: 1.49k]
  ------------------
  512|       |    // For non-position attributes, preallocate the vertex to value mapping
  513|       |    // using the maximum number of vertices from the base corner table and the
  514|       |    // attribute corner table (since the attribute decoder may use either of
  515|       |    // it).
  516|  3.33k|    int32_t att_connectivity_verts =
  517|  3.33k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  3.33k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 181, False: 3.15k]
  ------------------
  519|    181|      att_connectivity_verts = corner_table_->num_vertices();
  520|    181|    }
  521|  3.33k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  3.33k|  }
  523|  1.49k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 4, False: 1.49k]
  ------------------
  524|      4|    return false;
  525|      4|  }
  526|  1.49k|  return true;
  527|  1.49k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE19OnAttributesDecodedEv:
  530|    347|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    347|  return true;
  532|    347|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEi:
  536|  1.70k|    int num_symbols) {
  537|       |  // Algorithm does the reverse decoding of the symbols encoded with the
  538|       |  // edgebreaker method. The reverse decoding always keeps track of the active
  539|       |  // edge identified by its opposite corner (active corner). New faces are
  540|       |  // always added to this active edge. There may be multiple active corners at
  541|       |  // one time that either correspond to separate mesh components or to
  542|       |  // sub-components of one mesh that are going to be merged together using the
  543|       |  // TOPOLOGY_S symbol. We can store these active edges on a stack, because the
  544|       |  // decoder always processes only the latest active edge. TOPOLOGY_S then
  545|       |  // removes the top edge from the stack and TOPOLOGY_E adds a new edge to the
  546|       |  // stack.
  547|  1.70k|  std::vector<CornerIndex> active_corner_stack;
  548|       |
  549|       |  // Additional active edges may be added as a result of topology split events.
  550|       |  // They can be added in arbitrary order, but we always know the split symbol
  551|       |  // id they belong to, so we can address them using this symbol id.
  552|  1.70k|  std::unordered_map<int, CornerIndex> topology_split_active_corners;
  553|       |
  554|       |  // Vector used for storing vertices that were marked as isolated during the
  555|       |  // decoding process. Currently used only when the mesh doesn't contain any
  556|       |  // non-position connectivity data.
  557|  1.70k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.70k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.70k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.70k|  int num_faces = 0;
  562|  8.15M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 8.15M, False: 1.53k]
  ------------------
  563|  8.15M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  8.15M|    bool check_topology_split = false;
  566|  8.15M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  8.15M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 3.83M, False: 4.32M]
  ------------------
  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.83M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 1, False: 3.83M]
  ------------------
  588|      1|        return -1;
  589|      1|      }
  590|       |
  591|  3.83M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  3.83M|      const VertexIndex vertex_x =
  593|  3.83M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  3.83M|      const CornerIndex corner_b =
  595|  3.83M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  3.83M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 120, False: 3.83M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    120|        return -1;
  600|    120|      }
  601|  3.83M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 3.83M]
  |  Branch (601:11): [True: 0, False: 3.83M]
  ------------------
  602|  3.83M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 3.83M]
  ------------------
  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.83M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  3.83M|      SetOppositeCorners(corner_a, corner + 1);
  612|  3.83M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  3.83M|      const VertexIndex vert_a_prev =
  616|  3.83M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  3.83M|      const VertexIndex vert_b_next =
  618|  3.83M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  3.83M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 3.83M]
  |  Branch (619:38): [True: 0, False: 3.83M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  3.83M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  3.83M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  3.83M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  3.83M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  3.83M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  3.83M|      active_corner_stack.back() = corner;
  631|  4.32M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 760k, False: 3.56M]
  |  Branch (631:40): [True: 376k, False: 3.18M]
  ------------------
  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.13M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 1.13M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  1.13M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  1.13M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 1.13M]
  ------------------
  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.13M|      const CornerIndex corner(3 * face.value());
  658|  1.13M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  1.13M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 760k, False: 376k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|   760k|        opp_corner = corner + 2;
  662|   760k|        corner_l = corner + 1;
  663|   760k|        corner_r = corner;
  664|   760k|      } else {
  665|       |        // "l" is the new first corner.
  666|   376k|        opp_corner = corner + 1;
  667|   376k|        corner_l = corner;
  668|   376k|        corner_r = corner + 2;
  669|   376k|      }
  670|  1.13M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  1.13M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  1.13M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 1, False: 1.13M]
  ------------------
  675|      1|        return -1;  // Unexpected number of decoded vertices.
  676|      1|      }
  677|       |
  678|  1.13M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  1.13M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  1.13M|      const VertexIndex vertex_r =
  682|  1.13M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  1.13M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  1.13M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  1.13M|      corner_table_->MapCornerToVertex(
  688|  1.13M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  1.13M|      active_corner_stack.back() = corner;
  690|  1.13M|      check_topology_split = true;
  691|  3.18M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 1.24M, False: 1.94M]
  ------------------
  692|       |      // Create a new face that merges two last active edges from the active
  693|       |      // stack. No new vertex is created, but two vertices at corners "p" and
  694|       |      // "n" need to be merged into a single vertex.
  695|       |      //
  696|       |      // *-------v-------*
  697|       |      //  \a   p/x\n   b/
  698|       |      //   \   /   \   /
  699|       |      //    \ /  S  \ /
  700|       |      //     *.......*
  701|       |      //
  702|  1.24M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 1, False: 1.24M]
  ------------------
  703|      1|        return -1;
  704|      1|      }
  705|  1.24M|      const CornerIndex corner_b = active_corner_stack.back();
  706|  1.24M|      active_corner_stack.pop_back();
  707|       |
  708|       |      // Corner "a" can correspond either to a normal active edge, or to an edge
  709|       |      // created from the topology split event.
  710|  1.24M|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  1.24M|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 39, False: 1.24M]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     39|        active_corner_stack.push_back(it->second);
  714|     39|      }
  715|  1.24M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 8, False: 1.24M]
  ------------------
  716|      8|        return -1;
  717|      8|      }
  718|  1.24M|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  1.24M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 1.24M]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  1.24M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 6, False: 1.24M]
  |  Branch (724:11): [True: 6, False: 1.24M]
  ------------------
  725|  1.24M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 1.24M]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      6|        return -1;
  729|      6|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  1.24M|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  1.24M|      SetOppositeCorners(corner_a, corner + 2);
  735|  1.24M|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  1.24M|      const VertexIndex vertex_p =
  739|  1.24M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  1.24M|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  1.24M|      corner_table_->MapCornerToVertex(
  742|  1.24M|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  1.24M|      const VertexIndex vert_b_prev =
  744|  1.24M|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  1.24M|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  1.24M|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  1.24M|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  1.24M|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  1.24M|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  1.24M|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  1.24M|                                       corner_table_->LeftMostCorner(vertex_n));
  753|       |
  754|       |      // Also update the vertex id at corner "n" and all corners that are
  755|       |      // connected to it in the CCW direction.
  756|  1.24M|      const CornerIndex first_corner = corner_n;
  757|  7.87M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 6.63M, False: 1.24M]
  ------------------
  758|  6.63M|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  6.63M|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  6.63M|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 2, False: 6.63M]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      2|          return -1;
  764|      2|        }
  765|  6.63M|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  1.24M|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  1.24M|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 16.1k, False: 1.22M]
  ------------------
  770|  16.1k|        invalid_vertices.push_back(vertex_n);
  771|  16.1k|      }
  772|  1.24M|      active_corner_stack.back() = corner;
  773|  1.94M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 1.94M, False: 0]
  ------------------
  774|  1.94M|      const CornerIndex corner(3 * face.value());
  775|  1.94M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  1.94M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  1.94M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  1.94M|                                       corner_table_->AddNewVertex());
  780|  1.94M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  1.94M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  1.94M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 3, False: 1.94M]
  ------------------
  784|      3|        return -1;  // Unexpected number of decoded vertices.
  785|      3|      }
  786|       |
  787|  1.94M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  1.94M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  1.94M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  1.94M|      active_corner_stack.push_back(corner);
  792|  1.94M|      check_topology_split = true;
  793|  1.94M|    } 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|  8.15M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  8.15M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 3.07M, False: 5.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.07M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  3.07M|      EdgeFaceName split_edge;
  812|  3.07M|      int encoder_split_symbol_id;
  813|  3.07M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.17k, False: 3.07M]
  ------------------
  814|  3.07M|                             &encoder_split_symbol_id)) {
  815|  1.17k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 19, False: 1.15k]
  ------------------
  816|     19|          return -1;  // Wrong split symbol id.
  817|     19|        }
  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.15k|        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.15k|        CornerIndex new_active_corner;
  831|  1.15k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 433, False: 725]
  ------------------
  832|    433|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    725|        } else {
  834|    725|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    725|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.15k|        const int decoder_split_symbol_id =
  839|  1.15k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.15k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.15k|            new_active_corner;
  842|  1.15k|      }
  843|  3.07M|    }
  844|  8.15M|  }
  845|  1.53k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 1.53k]
  ------------------
  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|  27.7k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 26.2k, False: 1.51k]
  ------------------
  850|  26.2k|    const CornerIndex corner = active_corner_stack.back();
  851|  26.2k|    active_corner_stack.pop_back();
  852|  26.2k|    const bool interior_face =
  853|  26.2k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  26.2k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 19.6k, False: 6.54k]
  ------------------
  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|  19.6k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 8, False: 19.6k]
  ------------------
  877|      8|        return -1;  // More faces than expected added to the mesh.
  878|      8|      }
  879|       |
  880|  19.6k|      const CornerIndex corner_a = corner;
  881|  19.6k|      const VertexIndex vert_n =
  882|  19.6k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  19.6k|      const CornerIndex corner_b =
  884|  19.6k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  19.6k|      const VertexIndex vert_x =
  887|  19.6k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  19.6k|      const CornerIndex corner_c =
  889|  19.6k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  19.6k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 10, False: 19.6k]
  |  Branch (891:33): [True: 6, False: 19.6k]
  |  Branch (891:55): [True: 0, False: 19.6k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     16|        return -1;
  894|     16|      }
  895|  19.6k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 1, False: 19.6k]
  |  Branch (895:11): [True: 1, False: 19.6k]
  ------------------
  896|  19.6k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 19.6k]
  ------------------
  897|  19.6k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 19.6k]
  ------------------
  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|  19.6k|      const VertexIndex vert_p =
  904|  19.6k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  19.6k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  19.6k|      const CornerIndex new_corner(3 * face.value());
  909|  19.6k|      SetOppositeCorners(new_corner, corner);
  910|  19.6k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  19.6k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  19.6k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  19.6k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  19.6k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  78.5k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 58.8k, False: 19.6k]
  ------------------
  920|  58.8k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  58.8k|      }
  922|       |
  923|  19.6k|      init_face_configurations_.push_back(true);
  924|  19.6k|      init_corners_.push_back(new_corner);
  925|  19.6k|    } 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|  6.54k|      init_face_configurations_.push_back(false);
  930|  6.54k|      init_corners_.push_back(corner);
  931|  6.54k|    }
  932|  26.2k|  }
  933|  1.51k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 16, False: 1.49k]
  ------------------
  934|     16|    return -1;  // Unexpected number of decoded faces.
  935|     16|  }
  936|       |
  937|  1.49k|  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.49k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 435, False: 1.49k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|    435|    VertexIndex src_vert(num_vertices - 1);
  943|    547|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 112, False: 435]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    112|      src_vert = VertexIndex(--num_vertices - 1);
  946|    112|    }
  947|    435|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 112, False: 323]
  ------------------
  948|    112|      continue;  // No need to swap anything.
  949|    112|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|    323|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  2.22k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 1.90k, False: 322]
  ------------------
  954|  1.90k|      const CornerIndex cid = vcit.Corner();
  955|  1.90k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 1, False: 1.89k]
  ------------------
  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|  1.89k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  1.89k|    }
  962|    322|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|    322|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|    322|    corner_table_->MakeVertexIsolated(src_vert);
  967|    322|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|    322|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|    322|    num_vertices--;
  972|    322|  }
  973|  1.49k|  return num_vertices;
  974|  1.49k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  1.96k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  1.96k|  uint32_t num_topology_splits;
  982|  1.96k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  1.96k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.96k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 61, False: 1.90k]
  ------------------
  984|     61|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 1, False: 60]
  ------------------
  985|      1|      return -1;
  986|      1|    }
  987|       |
  988|     61|  } else
  989|  1.90k|#endif
  990|  1.90k|  {
  991|  1.90k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 5, False: 1.89k]
  ------------------
  992|      5|      return -1;
  993|      5|    }
  994|  1.90k|  }
  995|  1.95k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 1.10k, False: 857]
  ------------------
  996|  1.10k|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 30, False: 1.07k]
  ------------------
  997|  1.10k|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     30|      return -1;
  999|     30|    }
 1000|  1.07k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|  1.07k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.07k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 22, False: 1.04k]
  ------------------
 1002|    737|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 729, False: 8]
  ------------------
 1003|    729|        TopologySplitEventData event_data;
 1004|    729|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 9, False: 720]
  ------------------
 1005|      9|          return -1;
 1006|      9|        }
 1007|    720|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 4, False: 716]
  ------------------
 1008|      4|          return -1;
 1009|      4|        }
 1010|    716|        uint8_t edge_data;
 1011|    716|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 1, False: 715]
  ------------------
 1012|      1|          return -1;
 1013|      1|        }
 1014|    715|        event_data.source_edge = edge_data & 1;
 1015|    715|        topology_split_data_.push_back(event_data);
 1016|    715|      }
 1017|       |
 1018|     22|    } else
 1019|  1.04k|#endif
 1020|  1.04k|    {
 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.04k|      int last_source_symbol_id = 0;
 1024|  4.69k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 3.66k, False: 1.02k]
  ------------------
 1025|  3.66k|        TopologySplitEventData event_data;
 1026|  3.66k|        uint32_t delta;
 1027|  3.66k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 5, False: 3.66k]
  ------------------
 1028|      5|          return -1;
 1029|      5|        }
 1030|  3.66k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  3.66k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 5, False: 3.65k]
  ------------------
 1032|      5|          return -1;
 1033|      5|        }
 1034|  3.65k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 17, False: 3.64k]
  ------------------
 1035|     17|          return -1;
 1036|     17|        }
 1037|  3.64k|        event_data.split_symbol_id =
 1038|  3.64k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  3.64k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  3.64k|        topology_split_data_.push_back(event_data);
 1041|  3.64k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|  1.02k|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  4.39k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 3.36k, False: 1.02k]
  ------------------
 1045|  3.36k|        uint32_t edge_data;
 1046|  3.36k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.36k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 387, False: 2.98k]
  ------------------
 1047|    387|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  2.98k|        } else {
 1049|  2.98k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  2.98k|        }
 1051|  3.36k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  3.36k|        event_data.source_edge = edge_data & 1;
 1053|  3.36k|      }
 1054|  1.02k|      decoder_buffer->EndBitDecoding();
 1055|  1.02k|    }
 1056|  1.07k|  }
 1057|  1.88k|  uint32_t num_hole_events = 0;
 1058|  1.88k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  1.88k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.88k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 45, False: 1.84k]
  ------------------
 1060|     45|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 6, False: 39]
  ------------------
 1061|      6|      return -1;
 1062|      6|    }
 1063|  1.84k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.84k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 282, False: 1.55k]
  ------------------
 1064|    282|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 7, False: 275]
  ------------------
 1065|      7|      return -1;
 1066|      7|    }
 1067|    282|  }
 1068|  1.87k|#endif
 1069|  1.87k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 57, False: 1.81k]
  ------------------
 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: 24, False: 33]
  ------------------
 1072|  1.44k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 1.44k, False: 1]
  ------------------
 1073|  1.44k|        HoleEventData event_data;
 1074|  1.44k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 23, False: 1.42k]
  ------------------
 1075|     23|          return -1;
 1076|     23|        }
 1077|  1.42k|        hole_event_data_.push_back(event_data);
 1078|  1.42k|      }
 1079|       |
 1080|     24|    } else
 1081|     33|#endif
 1082|     33|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     33|      int last_symbol_id = 0;
 1085|  11.2k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 11.2k, False: 6]
  ------------------
 1086|  11.2k|        HoleEventData event_data;
 1087|  11.2k|        uint32_t delta;
 1088|  11.2k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 27, False: 11.2k]
  ------------------
 1089|     27|          return -1;
 1090|     27|        }
 1091|  11.2k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  11.2k|        last_symbol_id = event_data.symbol_id;
 1093|  11.2k|        hole_event_data_.push_back(event_data);
 1094|  11.2k|      }
 1095|     33|    }
 1096|     57|  }
 1097|  1.82k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  1.87k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  1.04k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  1.04k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  1.04k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  4.16k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 3.12k, False: 1.04k]
  ------------------
 1109|  3.12k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  3.12k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 1.03k, False: 2.09k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  2.06k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 1.03k, False: 1.03k]
  ------------------
 1114|  1.03k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|  1.03k|      }
 1116|  1.03k|      continue;
 1117|  1.03k|    }
 1118|       |
 1119|  4.18k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 2.09k, False: 2.09k]
  ------------------
 1120|  2.09k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  2.09k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 1.53k, False: 556]
  ------------------
 1122|  1.53k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  1.53k|      }
 1124|  2.09k|    }
 1125|  2.09k|  }
 1126|  1.04k|  return true;
 1127|  1.04k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   348k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   348k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   348k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   348k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.39M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 1.04M, False: 348k]
  ------------------
 1139|  1.04M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  1.04M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 43.8k, False: 1.00M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   304k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 260k, False: 43.8k]
  ------------------
 1144|   260k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   260k|      }
 1146|  43.8k|      continue;
 1147|  43.8k|    }
 1148|  1.00M|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|  1.00M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 500k, False: 500k]
  ------------------
 1151|   500k|      continue;
 1152|   500k|    }
 1153|       |
 1154|  4.15M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 3.65M, False: 500k]
  ------------------
 1155|  3.65M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  3.65M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 3.27M, False: 381k]
  ------------------
 1157|  3.27M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  3.27M|      }
 1159|  3.65M|    }
 1160|   500k|  }
 1161|   348k|  return true;
 1162|   348k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE21AssignPointsToCornersEi:
 1166|  1.49k|    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.49k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  1.49k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 47, False: 1.45k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  3.13k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 3.08k, False: 47]
  ------------------
 1176|  3.08k|      Mesh::Face face;
 1177|  3.08k|      const CornerIndex start_corner(3 * f.value());
 1178|  12.3k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 9.25k, False: 3.08k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  9.25k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  9.25k|        face[c] = vert_id;
 1182|  9.25k|      }
 1183|  3.08k|      decoder_->mesh()->SetFace(f, face);
 1184|  3.08k|    }
 1185|     47|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     47|    return true;
 1187|     47|  }
 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.45k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  1.45k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   223k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 221k, False: 1.44k]
  ------------------
 1197|   221k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   221k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 13.6k, False: 207k]
  ------------------
 1199|  13.6k|      continue;  // Isolated vertex.
 1200|  13.6k|    }
 1201|   207k|    CornerIndex deduplication_first_corner = c;
 1202|   207k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 44.8k, False: 163k]
  ------------------
 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|  44.8k|      deduplication_first_corner = c;
 1206|   163k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   173k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 171k, False: 2.03k]
  ------------------
 1210|   171k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 5.83k, False: 166k]
  ------------------
 1211|  5.83k|          continue;  // No seam for this attribute, ignore it.
 1212|  5.83k|        }
 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|   166k|        const VertexIndex vert_id =
 1217|   166k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|   166k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|   166k|        bool seam_found = false;
 1220|   174k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 169k, False: 4.91k]
  ------------------
 1221|   169k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 4, False: 169k]
  ------------------
 1222|      4|            return false;
 1223|      4|          }
 1224|   169k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 161k, False: 8.26k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|   161k|            deduplication_first_corner = act_c;
 1227|   161k|            seam_found = true;
 1228|   161k|            break;
 1229|   161k|          }
 1230|  8.26k|          act_c = corner_table_->SwingRight(act_c);
 1231|  8.26k|        }
 1232|   166k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 161k, False: 4.91k]
  ------------------
 1233|   161k|          break;  // No reason to process other attributes if we found a seam.
 1234|   161k|        }
 1235|   166k|      }
 1236|   163k|    }
 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|   207k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   207k|    corner_to_point_map[c.value()] =
 1246|   207k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   207k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   207k|    CornerIndex prev_c = c;
 1250|   207k|    c = corner_table_->SwingRight(c);
 1251|  1.11M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 1.07M, False: 45.0k]
  |  Branch (1251:40): [True: 911k, False: 162k]
  ------------------
 1252|   911k|      bool attribute_seam = false;
 1253|   955k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 944k, False: 10.6k]
  ------------------
 1254|   944k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 901k, False: 43.5k]
  ------------------
 1255|   944k|            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|   901k|          attribute_seam = true;
 1259|   901k|          break;
 1260|   901k|        }
 1261|   944k|      }
 1262|   911k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 901k, False: 10.6k]
  ------------------
 1263|   901k|        corner_to_point_map[c.value()] =
 1264|   901k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   901k|        point_to_corner_map.push_back(c.value());
 1266|   901k|      } else {
 1267|  10.6k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  10.6k|      }
 1269|   911k|      prev_c = c;
 1270|   911k|      c = corner_table_->SwingRight(c);
 1271|   911k|    }
 1272|   207k|  }
 1273|       |  // Add faces.
 1274|   350k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 349k, False: 1.44k]
  ------------------
 1275|   349k|    Mesh::Face face;
 1276|  1.39M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 1.04M, False: 349k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  1.04M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  1.04M|    }
 1280|   349k|    decoder_->mesh()->SetFace(f, face);
 1281|   349k|  }
 1282|  1.44k|  decoder_->point_cloud()->set_num_points(
 1283|  1.44k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  1.44k|  return true;
 1285|  1.45k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEEC2Ev:
   48|  2.07k|    : decoder_(nullptr),
   49|  2.07k|      last_symbol_id_(-1),
   50|  2.07k|      last_vert_id_(-1),
   51|  2.07k|      last_face_id_(-1),
   52|  2.07k|      num_new_vertices_(0),
   53|  2.07k|      num_encoded_vertices_(0),
   54|  2.07k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.07k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.07k|  decoder_ = decoder;
   60|  2.07k|  return true;
   61|  2.07k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23GetAttributeCornerTableEi:
   66|  1.60k|    int att_id) const {
   67|  2.58k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 2.08k, False: 501]
  ------------------
   68|  2.08k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  2.08k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 983, False: 1.10k]
  |  Branch (69:27): [True: 0, False: 1.10k]
  ------------------
   70|    983|      continue;
   71|    983|    }
   72|  1.10k|    const AttributesDecoderInterface *const dec =
   73|  1.10k|        decoder_->attributes_decoder(decoder_id);
   74|  2.28k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 2.28k, False: 0]
  ------------------
   75|  2.28k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 1.10k, False: 1.18k]
  ------------------
   76|  1.10k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 693, False: 409]
  ------------------
   77|    693|          return &attribute_data_[i].connectivity_data;
   78|    693|        }
   79|    409|        return nullptr;
   80|  1.10k|      }
   81|  2.28k|    }
   82|  1.10k|  }
   83|    501|  return nullptr;
   84|  1.60k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE24GetAttributeEncodingDataEi:
   89|  1.60k|    int att_id) const {
   90|  2.58k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 2.08k, False: 501]
  ------------------
   91|  2.08k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  2.08k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 983, False: 1.10k]
  |  Branch (92:27): [True: 0, False: 1.10k]
  ------------------
   93|    983|      continue;
   94|    983|    }
   95|  1.10k|    const AttributesDecoderInterface *const dec =
   96|  1.10k|        decoder_->attributes_decoder(decoder_id);
   97|  2.28k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 2.28k, False: 0]
  ------------------
   98|  2.28k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 1.10k, False: 1.18k]
  ------------------
   99|  1.10k|        return &attribute_data_[i].encoding_data;
  100|  1.10k|      }
  101|  2.28k|    }
  102|  1.10k|  }
  103|    501|  return &pos_encoding_data_;
  104|  1.60k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23CreateAttributesDecoderEi:
  130|  1.40k|    int32_t att_decoder_id) {
  131|  1.40k|  int8_t att_data_id;
  132|  1.40k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 39, False: 1.36k]
  ------------------
  133|     39|    return false;
  134|     39|  }
  135|  1.36k|  uint8_t decoder_type;
  136|  1.36k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 19, False: 1.34k]
  ------------------
  137|     19|    return false;
  138|     19|  }
  139|       |
  140|  1.34k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 958, False: 390]
  ------------------
  141|    958|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 26, False: 932]
  ------------------
  142|     26|      return false;  // Unexpected attribute data.
  143|     26|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|    932|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 5, False: 927]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|       |
  151|    927|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|    927|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    390|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 1, False: 389]
  ------------------
  155|      1|      return false;  // Some other decoder is already using the data. Error.
  156|      1|    }
  157|    389|    pos_data_decoder_id_ = att_decoder_id;
  158|    389|  }
  159|       |
  160|  1.31k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  1.31k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.31k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 1.31k, False: 0]
  ------------------
  162|  1.31k|    uint8_t traversal_method_encoded;
  163|  1.31k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 8, False: 1.30k]
  ------------------
  164|      8|      return false;
  165|      8|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  1.30k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 14, False: 1.29k]
  ------------------
  168|     14|      return false;
  169|     14|    }
  170|  1.29k|    traversal_method =
  171|  1.29k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  1.29k|  }
  173|       |
  174|  1.29k|  const Mesh *mesh = decoder_->mesh();
  175|  1.29k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  1.29k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 700, False: 594]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    700|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    700|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 370, False: 330]
  ------------------
  182|    370|      encoding_data = &pos_encoding_data_;
  183|    370|    } else {
  184|    330|      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|    330|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    330|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    700|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 142, False: 558]
  ------------------
  191|    142|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    142|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    142|          AttTraverser;
  194|    142|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    558|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 558, False: 0]
  ------------------
  196|    558|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    558|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    558|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    558|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    700|  } else {
  203|    594|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 3, False: 591]
  ------------------
  204|      3|      return false;  // Unsupported method.
  205|      3|    }
  206|    591|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 5, False: 586]
  ------------------
  207|      5|      return false;  // Attribute data must be specified.
  208|      5|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    586|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    586|        AttObserver;
  214|    586|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    586|        AttTraverser;
  216|       |
  217|    586|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|    586|        &attribute_data_[att_data_id].encoding_data;
  219|    586|    const MeshAttributeCornerTable *const corner_table =
  220|    586|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    586|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    586|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    586|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    586|                             encoding_data);
  227|       |
  228|    586|    AttTraverser att_traverser;
  229|    586|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    586|    traversal_sequencer->SetTraverser(att_traverser);
  232|    586|    sequencer = std::move(traversal_sequencer);
  233|    586|  }
  234|       |
  235|  1.28k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 1.28k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  1.28k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  1.28k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  1.28k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  1.28k|                                        std::move(att_controller));
  244|  1.28k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEv:
  247|  2.07k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.07k|  num_new_vertices_ = 0;
  249|  2.07k|  new_to_parent_vertex_map_.clear();
  250|  2.07k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.07k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.07k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 268, False: 1.80k]
  ------------------
  252|    268|    uint32_t num_new_verts;
  253|    268|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    268|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 181, False: 87]
  ------------------
  254|    181|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 8, False: 173]
  ------------------
  255|      8|        return false;
  256|      8|      }
  257|    181|    } else {
  258|     87|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 2, False: 85]
  ------------------
  259|      2|        return false;
  260|      2|      }
  261|     87|    }
  262|    258|    num_new_vertices_ = num_new_verts;
  263|    258|  }
  264|  2.06k|#endif
  265|       |
  266|  2.06k|  uint32_t num_encoded_vertices;
  267|  2.06k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.06k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.06k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 173, False: 1.89k]
  ------------------
  269|    173|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 3, False: 170]
  ------------------
  270|      3|      return false;
  271|      3|    }
  272|       |
  273|    173|  } else
  274|  1.89k|#endif
  275|  1.89k|  {
  276|  1.89k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 1, False: 1.89k]
  ------------------
  277|      1|      return false;
  278|      1|    }
  279|  1.89k|  }
  280|  2.06k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.06k|  uint32_t num_faces;
  283|  2.06k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.06k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.06k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 170, False: 1.89k]
  ------------------
  285|    170|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 3, False: 167]
  ------------------
  286|      3|      return false;
  287|      3|    }
  288|       |
  289|    170|  } else
  290|  1.89k|#endif
  291|  1.89k|  {
  292|  1.89k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 1, False: 1.89k]
  ------------------
  293|      1|      return false;
  294|      1|    }
  295|  1.89k|  }
  296|  2.05k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 5, False: 2.05k]
  ------------------
  297|      5|    return false;  // Draco cannot handle this many faces.
  298|      5|  }
  299|       |
  300|  2.05k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 17, False: 2.03k]
  ------------------
  301|     17|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     17|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.03k|  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.03k|  const uint64_t num_encoded_vertices_64 =
  311|  2.03k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.03k|  const uint64_t max_num_vertex_edges =
  313|  2.03k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.03k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 13, False: 2.02k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|     13|    return false;
  317|     13|  }
  318|       |
  319|  2.02k|  uint8_t num_attribute_data;
  320|  2.02k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 28, False: 1.99k]
  ------------------
  321|     28|    return false;
  322|     28|  }
  323|       |
  324|  1.99k|  uint32_t num_encoded_symbols;
  325|  1.99k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  1.99k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.99k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 147, False: 1.84k]
  ------------------
  327|    147|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 11, False: 136]
  ------------------
  328|     11|      return false;
  329|     11|    }
  330|       |
  331|    147|  } else
  332|  1.84k|#endif
  333|  1.84k|  {
  334|  1.84k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 1.84k]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|  1.84k|  }
  338|       |
  339|  1.98k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 17, False: 1.96k]
  ------------------
  340|       |    // Number of faces needs to be the same or greater than the number of
  341|       |    // symbols (it can be greater because the initial face may not be encoded as
  342|       |    // a symbol).
  343|     17|    return false;
  344|     17|  }
  345|  1.96k|  const uint32_t max_encoded_faces =
  346|  1.96k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  1.96k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 34, False: 1.93k]
  ------------------
  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|     34|    return false;
  352|     34|  }
  353|       |
  354|  1.93k|  uint32_t num_encoded_split_symbols;
  355|  1.93k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  1.93k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.93k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 120, False: 1.81k]
  ------------------
  357|    120|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 3, False: 117]
  ------------------
  358|      3|      return false;
  359|      3|    }
  360|       |
  361|    120|  } else
  362|  1.81k|#endif
  363|  1.81k|  {
  364|  1.81k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 5, False: 1.80k]
  ------------------
  365|      5|      return false;
  366|      5|    }
  367|  1.81k|  }
  368|       |
  369|  1.92k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 25, False: 1.89k]
  ------------------
  370|     25|    return false;  // Split symbols are a sub-set of all symbols.
  371|     25|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  1.89k|  vertex_traversal_length_.clear();
  375|  1.89k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  1.89k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 1.89k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  1.89k|  processed_corner_ids_.clear();
  380|  1.89k|  processed_corner_ids_.reserve(num_faces);
  381|  1.89k|  processed_connectivity_corners_.clear();
  382|  1.89k|  processed_connectivity_corners_.reserve(num_faces);
  383|  1.89k|  topology_split_data_.clear();
  384|  1.89k|  hole_event_data_.clear();
  385|  1.89k|  init_face_configurations_.clear();
  386|  1.89k|  init_corners_.clear();
  387|       |
  388|  1.89k|  last_symbol_id_ = -1;
  389|  1.89k|  last_face_id_ = -1;
  390|  1.89k|  last_vert_id_ = -1;
  391|       |
  392|  1.89k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  1.89k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  1.89k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 1.89k]
  ------------------
  397|  1.89k|          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|  1.89k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  1.89k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  1.89k|  int32_t topology_split_decoded_bytes = -1;
  410|  1.89k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.89k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 196, False: 1.70k]
  ------------------
  411|    196|    uint32_t encoded_connectivity_size;
  412|    196|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    196|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 115, False: 81]
  ------------------
  413|    115|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 3, False: 112]
  ------------------
  414|      3|        return false;
  415|      3|      }
  416|    115|    } else {
  417|     81|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 2, False: 79]
  ------------------
  418|      2|        return false;
  419|      2|      }
  420|     81|    }
  421|    191|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 3, False: 188]
  ------------------
  422|    188|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 15, False: 173]
  ------------------
  423|     18|      return false;
  424|     18|    }
  425|    173|    DecoderBuffer event_buffer;
  426|    173|    event_buffer.Init(
  427|    173|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    173|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    173|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    173|    topology_split_decoded_bytes =
  432|    173|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    173|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 121, False: 52]
  ------------------
  434|    121|      return false;
  435|    121|    }
  436|       |
  437|    173|  } else
  438|  1.70k|#endif
  439|  1.70k|  {
  440|  1.70k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 55, False: 1.64k]
  ------------------
  441|     55|      return false;
  442|     55|    }
  443|  1.70k|  }
  444|       |
  445|  1.70k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  1.70k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  1.70k|                                           num_encoded_split_symbols);
  449|  1.70k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  1.70k|  DecoderBuffer traversal_end_buffer;
  452|  1.70k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 127, False: 1.57k]
  ------------------
  453|    127|    return false;
  454|    127|  }
  455|       |
  456|  1.57k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.57k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 126, False: 1.44k]
  ------------------
  458|    126|    return false;
  459|    126|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  1.44k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  1.44k|                           traversal_end_buffer.remaining_size(),
  464|  1.44k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  1.44k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  1.44k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.44k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 14, False: 1.43k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|     14|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|     14|  }
  471|  1.44k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  1.44k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 1.42k, False: 19]
  ------------------
  475|  1.42k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  1.42k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.42k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 14, False: 1.41k]
  ------------------
  477|  1.51k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 1.49k, False: 14]
  ------------------
  478|  1.49k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 1.49k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  1.49k|      }
  482|       |
  483|     14|    } else
  484|  1.41k|#endif
  485|  1.41k|    {
  486|  8.12M|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 8.12M, False: 1.41k]
  ------------------
  487|  8.12M|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 8.12M]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|  8.12M|      }
  491|  1.41k|    }
  492|  1.42k|  }
  493|  1.44k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  3.28k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 1.83k, False: 1.44k]
  ------------------
  498|  1.83k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  11.0M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 11.0M, False: 1.83k]
  ------------------
  501|  11.0M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  11.0M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  1.83k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 1.83k]
  ------------------
  505|  1.83k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  1.83k|  }
  509|       |
  510|  1.44k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  3.28k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 1.83k, False: 1.44k]
  ------------------
  512|       |    // For non-position attributes, preallocate the vertex to value mapping
  513|       |    // using the maximum number of vertices from the base corner table and the
  514|       |    // attribute corner table (since the attribute decoder may use either of
  515|       |    // it).
  516|  1.83k|    int32_t att_connectivity_verts =
  517|  1.83k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  1.83k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 138, False: 1.70k]
  ------------------
  519|    138|      att_connectivity_verts = corner_table_->num_vertices();
  520|    138|    }
  521|  1.83k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  1.83k|  }
  523|  1.44k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 10, False: 1.43k]
  ------------------
  524|     10|    return false;
  525|     10|  }
  526|  1.43k|  return true;
  527|  1.44k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE19OnAttributesDecodedEv:
  530|    471|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    471|  return true;
  532|    471|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEi:
  536|  1.57k|    int num_symbols) {
  537|       |  // Algorithm does the reverse decoding of the symbols encoded with the
  538|       |  // edgebreaker method. The reverse decoding always keeps track of the active
  539|       |  // edge identified by its opposite corner (active corner). New faces are
  540|       |  // always added to this active edge. There may be multiple active corners at
  541|       |  // one time that either correspond to separate mesh components or to
  542|       |  // sub-components of one mesh that are going to be merged together using the
  543|       |  // TOPOLOGY_S symbol. We can store these active edges on a stack, because the
  544|       |  // decoder always processes only the latest active edge. TOPOLOGY_S then
  545|       |  // removes the top edge from the stack and TOPOLOGY_E adds a new edge to the
  546|       |  // stack.
  547|  1.57k|  std::vector<CornerIndex> active_corner_stack;
  548|       |
  549|       |  // Additional active edges may be added as a result of topology split events.
  550|       |  // They can be added in arbitrary order, but we always know the split symbol
  551|       |  // id they belong to, so we can address them using this symbol id.
  552|  1.57k|  std::unordered_map<int, CornerIndex> topology_split_active_corners;
  553|       |
  554|       |  // Vector used for storing vertices that were marked as isolated during the
  555|       |  // decoding process. Currently used only when the mesh doesn't contain any
  556|       |  // non-position connectivity data.
  557|  1.57k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.57k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.57k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.57k|  int num_faces = 0;
  562|  46.9M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 46.9M, False: 1.49k]
  ------------------
  563|  46.9M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  46.9M|    bool check_topology_split = false;
  566|  46.9M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  46.9M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 23.3M, False: 23.5M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  23.3M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 1, False: 23.3M]
  ------------------
  588|      1|        return -1;
  589|      1|      }
  590|       |
  591|  23.3M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  23.3M|      const VertexIndex vertex_x =
  593|  23.3M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  23.3M|      const CornerIndex corner_b =
  595|  23.3M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  23.3M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 19, False: 23.3M]
  ------------------
  598|       |        // All matched corners must be different.
  599|     19|        return -1;
  600|     19|      }
  601|  23.3M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 23.3M]
  |  Branch (601:11): [True: 0, False: 23.3M]
  ------------------
  602|  23.3M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 23.3M]
  ------------------
  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|  23.3M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  23.3M|      SetOppositeCorners(corner_a, corner + 1);
  612|  23.3M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  23.3M|      const VertexIndex vert_a_prev =
  616|  23.3M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  23.3M|      const VertexIndex vert_b_next =
  618|  23.3M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  23.3M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 23.3M]
  |  Branch (619:38): [True: 0, False: 23.3M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  23.3M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  23.3M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  23.3M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  23.3M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  23.3M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  23.3M|      active_corner_stack.back() = corner;
  631|  23.5M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 23.5M, False: 21.5k]
  |  Branch (631:40): [True: 4.29k, False: 17.2k]
  ------------------
  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|  23.5M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 23.5M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  23.5M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  23.5M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 23.5M]
  ------------------
  651|       |        // Active corner is already opposite to an existing face, which should
  652|       |        // not happen unless the input was tampered with.
  653|      0|        return -1;
  654|      0|      }
  655|       |
  656|       |      // First corner on the new face is either corner "l" or "r".
  657|  23.5M|      const CornerIndex corner(3 * face.value());
  658|  23.5M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  23.5M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 23.5M, False: 4.29k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  23.5M|        opp_corner = corner + 2;
  662|  23.5M|        corner_l = corner + 1;
  663|  23.5M|        corner_r = corner;
  664|  23.5M|      } else {
  665|       |        // "l" is the new first corner.
  666|  4.29k|        opp_corner = corner + 1;
  667|  4.29k|        corner_l = corner;
  668|  4.29k|        corner_r = corner + 2;
  669|  4.29k|      }
  670|  23.5M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  23.5M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  23.5M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 11, False: 23.5M]
  ------------------
  675|     11|        return -1;  // Unexpected number of decoded vertices.
  676|     11|      }
  677|       |
  678|  23.5M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  23.5M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  23.5M|      const VertexIndex vertex_r =
  682|  23.5M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  23.5M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  23.5M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  23.5M|      corner_table_->MapCornerToVertex(
  688|  23.5M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  23.5M|      active_corner_stack.back() = corner;
  690|  23.5M|      check_topology_split = true;
  691|  23.5M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 5.55k, False: 11.7k]
  ------------------
  692|       |      // Create a new face that merges two last active edges from the active
  693|       |      // stack. No new vertex is created, but two vertices at corners "p" and
  694|       |      // "n" need to be merged into a single vertex.
  695|       |      //
  696|       |      // *-------v-------*
  697|       |      //  \a   p/x\n   b/
  698|       |      //   \   /   \   /
  699|       |      //    \ /  S  \ /
  700|       |      //     *.......*
  701|       |      //
  702|  5.55k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 1, False: 5.54k]
  ------------------
  703|      1|        return -1;
  704|      1|      }
  705|  5.54k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  5.54k|      active_corner_stack.pop_back();
  707|       |
  708|       |      // Corner "a" can correspond either to a normal active edge, or to an edge
  709|       |      // created from the topology split event.
  710|  5.54k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  5.54k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 26, False: 5.52k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     26|        active_corner_stack.push_back(it->second);
  714|     26|      }
  715|  5.54k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 9, False: 5.54k]
  ------------------
  716|      9|        return -1;
  717|      9|      }
  718|  5.54k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  5.54k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 5.54k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  5.54k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 8, False: 5.53k]
  |  Branch (724:11): [True: 8, False: 5.53k]
  ------------------
  725|  5.53k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 5.53k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      8|        return -1;
  729|      8|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  5.53k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  5.53k|      SetOppositeCorners(corner_a, corner + 2);
  735|  5.53k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  5.53k|      const VertexIndex vertex_p =
  739|  5.53k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  5.53k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  5.53k|      corner_table_->MapCornerToVertex(
  742|  5.53k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  5.53k|      const VertexIndex vert_b_prev =
  744|  5.53k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  5.53k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  5.53k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  5.53k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  5.53k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  5.53k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  5.53k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  5.53k|                                       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|  5.53k|      const CornerIndex first_corner = corner_n;
  757|  24.7k|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 19.1k, False: 5.53k]
  ------------------
  758|  19.1k|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  19.1k|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  19.1k|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 1, False: 19.1k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      1|          return -1;
  764|      1|        }
  765|  19.1k|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  5.53k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  5.53k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 2.11k, False: 3.42k]
  ------------------
  770|  2.11k|        invalid_vertices.push_back(vertex_n);
  771|  2.11k|      }
  772|  5.53k|      active_corner_stack.back() = corner;
  773|  11.7k|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 11.7k, False: 0]
  ------------------
  774|  11.7k|      const CornerIndex corner(3 * face.value());
  775|  11.7k|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  11.7k|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  11.7k|      corner_table_->MapCornerToVertex(corner + 1,
  779|  11.7k|                                       corner_table_->AddNewVertex());
  780|  11.7k|      corner_table_->MapCornerToVertex(corner + 2,
  781|  11.7k|                                       corner_table_->AddNewVertex());
  782|       |
  783|  11.7k|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 3, False: 11.7k]
  ------------------
  784|      3|        return -1;  // Unexpected number of decoded vertices.
  785|      3|      }
  786|       |
  787|  11.7k|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  11.7k|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  11.7k|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  11.7k|      active_corner_stack.push_back(corner);
  792|  11.7k|      check_topology_split = true;
  793|  11.7k|    } 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|  46.9M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  46.9M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 23.5M, False: 23.3M]
  ------------------
  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|  23.5M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  23.5M|      EdgeFaceName split_edge;
  812|  23.5M|      int encoder_split_symbol_id;
  813|  23.5M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.22k, False: 23.5M]
  ------------------
  814|  23.5M|                             &encoder_split_symbol_id)) {
  815|  1.22k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 21, False: 1.20k]
  ------------------
  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.20k|        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.20k|        CornerIndex new_active_corner;
  831|  1.20k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 392, False: 810]
  ------------------
  832|    392|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    810|        } else {
  834|    810|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    810|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.20k|        const int decoder_split_symbol_id =
  839|  1.20k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.20k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.20k|            new_active_corner;
  842|  1.20k|      }
  843|  23.5M|    }
  844|  46.9M|  }
  845|  1.49k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 1.49k]
  ------------------
  846|      0|    return -1;  // Unexpected number of decoded vertices.
  847|      0|  }
  848|       |  // Decode start faces and connect them to the faces from the active stack.
  849|  6.52k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 5.04k, False: 1.48k]
  ------------------
  850|  5.04k|    const CornerIndex corner = active_corner_stack.back();
  851|  5.04k|    active_corner_stack.pop_back();
  852|  5.04k|    const bool interior_face =
  853|  5.04k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  5.04k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 2.69k, False: 2.34k]
  ------------------
  855|       |      // The start face is interior, we need to find three corners that are
  856|       |      // opposite to it. The first opposite corner "a" is the corner from the
  857|       |      // top of the active corner stack and the remaining two corners "b" and
  858|       |      // "c" are then the next corners from the left-most corners of vertices
  859|       |      // "n" and "x" respectively.
  860|       |      //
  861|       |      //           *-------*
  862|       |      //          / \     / \
  863|       |      //         /   \   /   \
  864|       |      //        /     \ /     \
  865|       |      //       *-------p-------*
  866|       |      //      / \a    . .    c/ \
  867|       |      //     /   \   .   .   /   \
  868|       |      //    /     \ .  I  . /     \
  869|       |      //   *-------n.......x------*
  870|       |      //    \     / \     / \     /
  871|       |      //     \   /   \   /   \   /
  872|       |      //      \ /     \b/     \ /
  873|       |      //       *-------*-------*
  874|       |      //
  875|       |
  876|  2.69k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 4, False: 2.68k]
  ------------------
  877|      4|        return -1;  // More faces than expected added to the mesh.
  878|      4|      }
  879|       |
  880|  2.68k|      const CornerIndex corner_a = corner;
  881|  2.68k|      const VertexIndex vert_n =
  882|  2.68k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  2.68k|      const CornerIndex corner_b =
  884|  2.68k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  2.68k|      const VertexIndex vert_x =
  887|  2.68k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  2.68k|      const CornerIndex corner_c =
  889|  2.68k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  2.68k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 3, False: 2.68k]
  |  Branch (891:33): [True: 5, False: 2.68k]
  |  Branch (891:55): [True: 0, False: 2.68k]
  ------------------
  892|       |        // All matched corners must be different.
  893|      8|        return -1;
  894|      8|      }
  895|  2.68k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 1, False: 2.67k]
  |  Branch (895:11): [True: 1, False: 2.67k]
  ------------------
  896|  2.67k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 2.67k]
  ------------------
  897|  2.67k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 2.67k]
  ------------------
  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|  2.67k|      const VertexIndex vert_p =
  904|  2.67k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  2.67k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  2.67k|      const CornerIndex new_corner(3 * face.value());
  909|  2.67k|      SetOppositeCorners(new_corner, corner);
  910|  2.67k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  2.67k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  2.67k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  2.67k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  2.67k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  10.7k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 8.03k, False: 2.67k]
  ------------------
  920|  8.03k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  8.03k|      }
  922|       |
  923|  2.67k|      init_face_configurations_.push_back(true);
  924|  2.67k|      init_corners_.push_back(new_corner);
  925|  2.67k|    } else {
  926|       |      // The initial face wasn't interior and the traversal had to start from
  927|       |      // an open boundary. In this case no new face is added, but we need to
  928|       |      // keep record about the first opposite corner to this boundary.
  929|  2.34k|      init_face_configurations_.push_back(false);
  930|  2.34k|      init_corners_.push_back(corner);
  931|  2.34k|    }
  932|  5.04k|  }
  933|  1.48k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 34, False: 1.45k]
  ------------------
  934|     34|    return -1;  // Unexpected number of decoded faces.
  935|     34|  }
  936|       |
  937|  1.45k|  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.45k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 184, False: 1.44k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|    184|    VertexIndex src_vert(num_vertices - 1);
  943|    223|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 39, False: 184]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|     39|      src_vert = VertexIndex(--num_vertices - 1);
  946|     39|    }
  947|    184|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 39, False: 145]
  ------------------
  948|     39|      continue;  // No need to swap anything.
  949|     39|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|    145|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|    791|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 650, False: 141]
  ------------------
  954|    650|      const CornerIndex cid = vcit.Corner();
  955|    650|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 4, False: 646]
  ------------------
  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|    646|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|    646|    }
  962|    141|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|    141|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|    141|    corner_table_->MakeVertexIsolated(src_vert);
  967|    141|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|    141|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|    141|    num_vertices--;
  972|    141|  }
  973|  1.44k|  return num_vertices;
  974|  1.45k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  1.87k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  1.87k|  uint32_t num_topology_splits;
  982|  1.87k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  1.87k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.87k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 100, False: 1.77k]
  ------------------
  984|    100|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 1, False: 99]
  ------------------
  985|      1|      return -1;
  986|      1|    }
  987|       |
  988|    100|  } else
  989|  1.77k|#endif
  990|  1.77k|  {
  991|  1.77k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 11, False: 1.76k]
  ------------------
  992|     11|      return -1;
  993|     11|    }
  994|  1.77k|  }
  995|  1.86k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 645, False: 1.21k]
  ------------------
  996|    645|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 39, False: 606]
  ------------------
  997|    645|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     39|      return -1;
  999|     39|    }
 1000|    606|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    606|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    606|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 62, False: 544]
  ------------------
 1002|  39.3k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 39.3k, False: 28]
  ------------------
 1003|  39.3k|        TopologySplitEventData event_data;
 1004|  39.3k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 22, False: 39.3k]
  ------------------
 1005|     22|          return -1;
 1006|     22|        }
 1007|  39.3k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 8, False: 39.3k]
  ------------------
 1008|      8|          return -1;
 1009|      8|        }
 1010|  39.3k|        uint8_t edge_data;
 1011|  39.3k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 4, False: 39.3k]
  ------------------
 1012|      4|          return -1;
 1013|      4|        }
 1014|  39.3k|        event_data.source_edge = edge_data & 1;
 1015|  39.3k|        topology_split_data_.push_back(event_data);
 1016|  39.3k|      }
 1017|       |
 1018|     62|    } else
 1019|    544|#endif
 1020|    544|    {
 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|    544|      int last_source_symbol_id = 0;
 1024|  3.42k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 2.90k, False: 523]
  ------------------
 1025|  2.90k|        TopologySplitEventData event_data;
 1026|  2.90k|        uint32_t delta;
 1027|  2.90k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 7, False: 2.89k]
  ------------------
 1028|      7|          return -1;
 1029|      7|        }
 1030|  2.89k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  2.89k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 4, False: 2.89k]
  ------------------
 1032|      4|          return -1;
 1033|      4|        }
 1034|  2.89k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 10, False: 2.88k]
  ------------------
 1035|     10|          return -1;
 1036|     10|        }
 1037|  2.88k|        event_data.split_symbol_id =
 1038|  2.88k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  2.88k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  2.88k|        topology_split_data_.push_back(event_data);
 1041|  2.88k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    523|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  3.12k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 2.60k, False: 523]
  ------------------
 1045|  2.60k|        uint32_t edge_data;
 1046|  2.60k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.60k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 609, False: 1.99k]
  ------------------
 1047|    609|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  1.99k|        } else {
 1049|  1.99k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  1.99k|        }
 1051|  2.60k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  2.60k|        event_data.source_edge = edge_data & 1;
 1053|  2.60k|      }
 1054|    523|      decoder_buffer->EndBitDecoding();
 1055|    523|    }
 1056|    606|  }
 1057|  1.77k|  uint32_t num_hole_events = 0;
 1058|  1.77k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  1.77k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.77k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 55, False: 1.71k]
  ------------------
 1060|     55|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 2, False: 53]
  ------------------
 1061|      2|      return -1;
 1062|      2|    }
 1063|  1.71k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.71k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 61, False: 1.65k]
  ------------------
 1064|     61|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 6, False: 55]
  ------------------
 1065|      6|      return -1;
 1066|      6|    }
 1067|     61|  }
 1068|  1.76k|#endif
 1069|  1.76k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 70, False: 1.69k]
  ------------------
 1070|     70|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     70|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     70|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 44, False: 26]
  ------------------
 1072|   278k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 278k, False: 2]
  ------------------
 1073|   278k|        HoleEventData event_data;
 1074|   278k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 42, False: 277k]
  ------------------
 1075|     42|          return -1;
 1076|     42|        }
 1077|   277k|        hole_event_data_.push_back(event_data);
 1078|   277k|      }
 1079|       |
 1080|     44|    } else
 1081|     26|#endif
 1082|     26|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     26|      int last_symbol_id = 0;
 1085|  1.75k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 1.74k, False: 6]
  ------------------
 1086|  1.74k|        HoleEventData event_data;
 1087|  1.74k|        uint32_t delta;
 1088|  1.74k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 20, False: 1.72k]
  ------------------
 1089|     20|          return -1;
 1090|     20|        }
 1091|  1.72k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  1.72k|        last_symbol_id = event_data.symbol_id;
 1093|  1.72k|        hole_event_data_.push_back(event_data);
 1094|  1.72k|      }
 1095|     26|    }
 1096|     70|  }
 1097|  1.70k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  1.76k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  1.49k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  1.49k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  1.49k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  5.99k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 4.49k, False: 1.49k]
  ------------------
 1109|  4.49k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  4.49k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 626, False: 3.86k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  1.25k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 626, False: 626]
  ------------------
 1114|    626|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|    626|      }
 1116|    626|      continue;
 1117|    626|    }
 1118|       |
 1119|  7.73k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 3.86k, False: 3.86k]
  ------------------
 1120|  3.86k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  3.86k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 3.79k, False: 72]
  ------------------
 1122|  3.79k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  3.79k|      }
 1124|  3.86k|    }
 1125|  3.86k|  }
 1126|  1.49k|  return true;
 1127|  1.49k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|  8.12M|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|  8.12M|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|  8.12M|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|  8.12M|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  32.4M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 24.3M, False: 8.12M]
  ------------------
 1139|  24.3M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  24.3M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 110k, False: 24.2M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   224k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 114k, False: 110k]
  ------------------
 1144|   114k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   114k|      }
 1146|   110k|      continue;
 1147|   110k|    }
 1148|  24.2M|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|  24.2M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 12.1M, False: 12.1M]
  ------------------
 1151|  12.1M|      continue;
 1152|  12.1M|    }
 1153|       |
 1154|  24.5M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 12.4M, False: 12.1M]
  ------------------
 1155|  12.4M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  12.4M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 10.9M, False: 1.52M]
  ------------------
 1157|  10.9M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  10.9M|      }
 1159|  12.4M|    }
 1160|  12.1M|  }
 1161|  8.12M|  return true;
 1162|  8.12M|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE21AssignPointsToCornersEi:
 1166|  1.44k|    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.44k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  1.44k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 19, False: 1.42k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  15.4k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 15.3k, False: 19]
  ------------------
 1176|  15.3k|      Mesh::Face face;
 1177|  15.3k|      const CornerIndex start_corner(3 * f.value());
 1178|  61.5k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 46.1k, False: 15.3k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  46.1k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  46.1k|        face[c] = vert_id;
 1182|  46.1k|      }
 1183|  15.3k|      decoder_->mesh()->SetFace(f, face);
 1184|  15.3k|    }
 1185|     19|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     19|    return true;
 1187|     19|  }
 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.42k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  1.42k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|  4.11M|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 4.11M, False: 1.41k]
  ------------------
 1197|  4.11M|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|  4.11M|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 2.33k, False: 4.11M]
  ------------------
 1199|  2.33k|      continue;  // Isolated vertex.
 1200|  2.33k|    }
 1201|  4.11M|    CornerIndex deduplication_first_corner = c;
 1202|  4.11M|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 110k, False: 4.00M]
  ------------------
 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|   110k|      deduplication_first_corner = c;
 1206|  4.00M|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  4.46M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 4.00M, False: 453k]
  ------------------
 1210|  4.00M|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 443k, False: 3.56M]
  ------------------
 1211|   443k|          continue;  // No seam for this attribute, ignore it.
 1212|   443k|        }
 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|  3.56M|        const VertexIndex vert_id =
 1217|  3.56M|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  3.56M|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  3.56M|        bool seam_found = false;
 1220|  3.68M|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 3.67M, False: 12.4k]
  ------------------
 1221|  3.67M|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 10, False: 3.67M]
  ------------------
 1222|     10|            return false;
 1223|     10|          }
 1224|  3.67M|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 3.55M, False: 123k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  3.55M|            deduplication_first_corner = act_c;
 1227|  3.55M|            seam_found = true;
 1228|  3.55M|            break;
 1229|  3.55M|          }
 1230|   123k|          act_c = corner_table_->SwingRight(act_c);
 1231|   123k|        }
 1232|  3.56M|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 3.55M, False: 12.4k]
  ------------------
 1233|  3.55M|          break;  // No reason to process other attributes if we found a seam.
 1234|  3.55M|        }
 1235|  3.56M|      }
 1236|  4.00M|    }
 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|  4.11M|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|  4.11M|    corner_to_point_map[c.value()] =
 1246|  4.11M|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|  4.11M|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|  4.11M|    CornerIndex prev_c = c;
 1250|  4.11M|    c = corner_table_->SwingRight(c);
 1251|  24.3M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 24.2M, False: 111k]
  |  Branch (1251:40): [True: 20.2M, False: 4.00M]
  ------------------
 1252|  20.2M|      bool attribute_seam = false;
 1253|  22.6M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 20.2M, False: 2.36M]
  ------------------
 1254|  20.2M|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 17.8M, False: 2.38M]
  ------------------
 1255|  20.2M|            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|  17.8M|          attribute_seam = true;
 1259|  17.8M|          break;
 1260|  17.8M|        }
 1261|  20.2M|      }
 1262|  20.2M|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 17.8M, False: 2.36M]
  ------------------
 1263|  17.8M|        corner_to_point_map[c.value()] =
 1264|  17.8M|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  17.8M|        point_to_corner_map.push_back(c.value());
 1266|  17.8M|      } else {
 1267|  2.36M|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  2.36M|      }
 1269|  20.2M|      prev_c = c;
 1270|  20.2M|      c = corner_table_->SwingRight(c);
 1271|  20.2M|    }
 1272|  4.11M|  }
 1273|       |  // Add faces.
 1274|  8.05M|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 8.05M, False: 1.41k]
  ------------------
 1275|  8.05M|    Mesh::Face face;
 1276|  32.2M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 24.1M, False: 8.05M]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  24.1M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  24.1M|    }
 1280|  8.05M|    decoder_->mesh()->SetFace(f, face);
 1281|  8.05M|  }
 1282|  1.41k|  decoder_->point_cloud()->set_num_points(
 1283|  1.41k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  1.41k|  return true;
 1285|  1.42k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEEC2Ev:
   48|  1.96k|    : decoder_(nullptr),
   49|  1.96k|      last_symbol_id_(-1),
   50|  1.96k|      last_vert_id_(-1),
   51|  1.96k|      last_face_id_(-1),
   52|  1.96k|      num_new_vertices_(0),
   53|  1.96k|      num_encoded_vertices_(0),
   54|  1.96k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  1.96k|    MeshEdgebreakerDecoder *decoder) {
   59|  1.96k|  decoder_ = decoder;
   60|  1.96k|  return true;
   61|  1.96k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23GetAttributeCornerTableEi:
   66|    115|    int att_id) const {
   67|    194|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 143, False: 51]
  ------------------
   68|    143|    const int decoder_id = attribute_data_[i].decoder_id;
   69|    143|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 79, False: 64]
  |  Branch (69:27): [True: 0, False: 64]
  ------------------
   70|     79|      continue;
   71|     79|    }
   72|     64|    const AttributesDecoderInterface *const dec =
   73|     64|        decoder_->attributes_decoder(decoder_id);
   74|    694|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 694, False: 0]
  ------------------
   75|    694|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 64, False: 630]
  ------------------
   76|     64|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 49, False: 15]
  ------------------
   77|     49|          return &attribute_data_[i].connectivity_data;
   78|     49|        }
   79|     15|        return nullptr;
   80|     64|      }
   81|    694|    }
   82|     64|  }
   83|     51|  return nullptr;
   84|    115|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE24GetAttributeEncodingDataEi:
   89|    115|    int att_id) const {
   90|    194|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 143, False: 51]
  ------------------
   91|    143|    const int decoder_id = attribute_data_[i].decoder_id;
   92|    143|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 79, False: 64]
  |  Branch (92:27): [True: 0, False: 64]
  ------------------
   93|     79|      continue;
   94|     79|    }
   95|     64|    const AttributesDecoderInterface *const dec =
   96|     64|        decoder_->attributes_decoder(decoder_id);
   97|    694|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 694, False: 0]
  ------------------
   98|    694|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 64, False: 630]
  ------------------
   99|     64|        return &attribute_data_[i].encoding_data;
  100|     64|      }
  101|    694|    }
  102|     64|  }
  103|     51|  return &pos_encoding_data_;
  104|    115|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23CreateAttributesDecoderEi:
  130|    122|    int32_t att_decoder_id) {
  131|    122|  int8_t att_data_id;
  132|    122|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 4, False: 118]
  ------------------
  133|      4|    return false;
  134|      4|  }
  135|    118|  uint8_t decoder_type;
  136|    118|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 7, False: 111]
  ------------------
  137|      7|    return false;
  138|      7|  }
  139|       |
  140|    111|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 67, False: 44]
  ------------------
  141|     67|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 16, False: 51]
  ------------------
  142|     16|      return false;  // Unexpected attribute data.
  143|     16|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|     51|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 2, False: 49]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|       |
  151|     49|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|     49|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|     44|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 2, False: 42]
  ------------------
  155|      2|      return false;  // Some other decoder is already using the data. Error.
  156|      2|    }
  157|     42|    pos_data_decoder_id_ = att_decoder_id;
  158|     42|  }
  159|       |
  160|     91|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|     91|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     91|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 91, False: 0]
  ------------------
  162|     91|    uint8_t traversal_method_encoded;
  163|     91|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 3, False: 88]
  ------------------
  164|      3|      return false;
  165|      3|    }
  166|       |    // Check that decoded traversal method is valid.
  167|     88|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 15, False: 73]
  ------------------
  168|     15|      return false;
  169|     15|    }
  170|     73|    traversal_method =
  171|     73|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|     73|  }
  173|       |
  174|     73|  const Mesh *mesh = decoder_->mesh();
  175|     73|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|     73|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 37, False: 36]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|     37|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|     37|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 27, False: 10]
  ------------------
  182|     27|      encoding_data = &pos_encoding_data_;
  183|     27|    } else {
  184|     10|      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|     10|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|     10|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|     37|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 24, False: 13]
  ------------------
  191|     24|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|     24|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|     24|          AttTraverser;
  194|     24|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|     24|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 13, False: 0]
  ------------------
  196|     13|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|     13|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|     13|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|     13|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|     37|  } else {
  203|     36|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 3, False: 33]
  ------------------
  204|      3|      return false;  // Unsupported method.
  205|      3|    }
  206|     33|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 2, False: 31]
  ------------------
  207|      2|      return false;  // Attribute data must be specified.
  208|      2|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|     31|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|     31|        AttObserver;
  214|     31|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|     31|        AttTraverser;
  216|       |
  217|     31|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|     31|        &attribute_data_[att_data_id].encoding_data;
  219|     31|    const MeshAttributeCornerTable *const corner_table =
  220|     31|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|     31|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|     31|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|     31|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|     31|                             encoding_data);
  227|       |
  228|     31|    AttTraverser att_traverser;
  229|     31|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|     31|    traversal_sequencer->SetTraverser(att_traverser);
  232|     31|    sequencer = std::move(traversal_sequencer);
  233|     31|  }
  234|       |
  235|     68|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 68]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|     68|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|     68|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|     68|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|     68|                                        std::move(att_controller));
  244|     68|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEv:
  247|  1.96k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  1.96k|  num_new_vertices_ = 0;
  249|  1.96k|  new_to_parent_vertex_map_.clear();
  250|  1.96k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  1.96k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.96k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 317, False: 1.64k]
  ------------------
  252|    317|    uint32_t num_new_verts;
  253|    317|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    317|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 169, False: 148]
  ------------------
  254|    169|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 7, False: 162]
  ------------------
  255|      7|        return false;
  256|      7|      }
  257|    169|    } else {
  258|    148|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 1, False: 147]
  ------------------
  259|      1|        return false;
  260|      1|      }
  261|    148|    }
  262|    309|    num_new_vertices_ = num_new_verts;
  263|    309|  }
  264|  1.95k|#endif
  265|       |
  266|  1.95k|  uint32_t num_encoded_vertices;
  267|  1.95k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  1.95k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.95k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 162, False: 1.79k]
  ------------------
  269|    162|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 3, False: 159]
  ------------------
  270|      3|      return false;
  271|      3|    }
  272|       |
  273|    162|  } else
  274|  1.79k|#endif
  275|  1.79k|  {
  276|  1.79k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 2, False: 1.79k]
  ------------------
  277|      2|      return false;
  278|      2|    }
  279|  1.79k|  }
  280|  1.95k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  1.95k|  uint32_t num_faces;
  283|  1.95k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  1.95k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.95k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 159, False: 1.79k]
  ------------------
  285|    159|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 1, False: 158]
  ------------------
  286|      1|      return false;
  287|      1|    }
  288|       |
  289|    159|  } else
  290|  1.79k|#endif
  291|  1.79k|  {
  292|  1.79k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 3, False: 1.78k]
  ------------------
  293|      3|      return false;
  294|      3|    }
  295|  1.79k|  }
  296|  1.94k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 3, False: 1.94k]
  ------------------
  297|      3|    return false;  // Draco cannot handle this many faces.
  298|      3|  }
  299|       |
  300|  1.94k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 12, False: 1.93k]
  ------------------
  301|     12|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     12|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  1.93k|  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|  1.93k|  const uint64_t num_encoded_vertices_64 =
  311|  1.93k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  1.93k|  const uint64_t max_num_vertex_edges =
  313|  1.93k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  1.93k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 12, False: 1.92k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|     12|    return false;
  317|     12|  }
  318|       |
  319|  1.92k|  uint8_t num_attribute_data;
  320|  1.92k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 19, False: 1.90k]
  ------------------
  321|     19|    return false;
  322|     19|  }
  323|       |
  324|  1.90k|  uint32_t num_encoded_symbols;
  325|  1.90k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  1.90k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.90k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 150, False: 1.75k]
  ------------------
  327|    150|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 7, False: 143]
  ------------------
  328|      7|      return false;
  329|      7|    }
  330|       |
  331|    150|  } else
  332|  1.75k|#endif
  333|  1.75k|  {
  334|  1.75k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 5, False: 1.74k]
  ------------------
  335|      5|      return false;
  336|      5|    }
  337|  1.75k|  }
  338|       |
  339|  1.88k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 11, False: 1.87k]
  ------------------
  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|     11|    return false;
  344|     11|  }
  345|  1.87k|  const uint32_t max_encoded_faces =
  346|  1.87k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  1.87k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 31, False: 1.84k]
  ------------------
  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|     31|    return false;
  352|     31|  }
  353|       |
  354|  1.84k|  uint32_t num_encoded_split_symbols;
  355|  1.84k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  1.84k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.84k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 131, False: 1.71k]
  ------------------
  357|    131|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 1, False: 130]
  ------------------
  358|      1|      return false;
  359|      1|    }
  360|       |
  361|    131|  } else
  362|  1.71k|#endif
  363|  1.71k|  {
  364|  1.71k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 4, False: 1.71k]
  ------------------
  365|      4|      return false;
  366|      4|    }
  367|  1.71k|  }
  368|       |
  369|  1.84k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 19, False: 1.82k]
  ------------------
  370|     19|    return false;  // Split symbols are a sub-set of all symbols.
  371|     19|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  1.82k|  vertex_traversal_length_.clear();
  375|  1.82k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  1.82k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 1.82k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  1.82k|  processed_corner_ids_.clear();
  380|  1.82k|  processed_corner_ids_.reserve(num_faces);
  381|  1.82k|  processed_connectivity_corners_.clear();
  382|  1.82k|  processed_connectivity_corners_.reserve(num_faces);
  383|  1.82k|  topology_split_data_.clear();
  384|  1.82k|  hole_event_data_.clear();
  385|  1.82k|  init_face_configurations_.clear();
  386|  1.82k|  init_corners_.clear();
  387|       |
  388|  1.82k|  last_symbol_id_ = -1;
  389|  1.82k|  last_face_id_ = -1;
  390|  1.82k|  last_vert_id_ = -1;
  391|       |
  392|  1.82k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  1.82k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  1.82k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 1.82k]
  ------------------
  397|  1.82k|          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|  1.82k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  1.82k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  1.82k|  int32_t topology_split_decoded_bytes = -1;
  410|  1.82k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.82k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 267, False: 1.55k]
  ------------------
  411|    267|    uint32_t encoded_connectivity_size;
  412|    267|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    267|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 128, False: 139]
  ------------------
  413|    128|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 4, False: 124]
  ------------------
  414|      4|        return false;
  415|      4|      }
  416|    139|    } else {
  417|    139|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 1, False: 138]
  ------------------
  418|      1|        return false;
  419|      1|      }
  420|    139|    }
  421|    262|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 1, False: 261]
  ------------------
  422|    261|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 19, False: 242]
  ------------------
  423|     20|      return false;
  424|     20|    }
  425|    242|    DecoderBuffer event_buffer;
  426|    242|    event_buffer.Init(
  427|    242|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    242|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    242|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    242|    topology_split_decoded_bytes =
  432|    242|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    242|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 66, False: 176]
  ------------------
  434|     66|      return false;
  435|     66|    }
  436|       |
  437|    242|  } else
  438|  1.55k|#endif
  439|  1.55k|  {
  440|  1.55k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 75, False: 1.48k]
  ------------------
  441|     75|      return false;
  442|     75|    }
  443|  1.55k|  }
  444|       |
  445|  1.65k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  1.65k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  1.65k|                                           num_encoded_split_symbols);
  449|  1.65k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  1.65k|  DecoderBuffer traversal_end_buffer;
  452|  1.65k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 871, False: 786]
  ------------------
  453|    871|    return false;
  454|    871|  }
  455|       |
  456|    786|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|    786|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 653, False: 133]
  ------------------
  458|    653|    return false;
  459|    653|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|    133|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|    133|                           traversal_end_buffer.remaining_size(),
  464|    133|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|    133|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|    133|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    133|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 5, False: 128]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|      5|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|      5|  }
  471|    133|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|    133|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 115, False: 18]
  ------------------
  475|    115|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|    115|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|    115|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 4, False: 111]
  ------------------
  477|     12|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 8, False: 4]
  ------------------
  478|      8|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 8]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|      8|      }
  482|       |
  483|      4|    } else
  484|    111|#endif
  485|    111|    {
  486|   279k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 278k, False: 111]
  ------------------
  487|   278k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 278k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   278k|      }
  491|    111|    }
  492|    115|  }
  493|    133|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|    318|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 185, False: 133]
  ------------------
  498|    185|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|   316k|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 316k, False: 185]
  ------------------
  501|   316k|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|   316k|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|    185|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 185]
  ------------------
  505|    185|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|    185|  }
  509|       |
  510|    133|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|    318|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 185, False: 133]
  ------------------
  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|    185|    int32_t att_connectivity_verts =
  517|    185|        attribute_data_[i].connectivity_data.num_vertices();
  518|    185|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 1, False: 184]
  ------------------
  519|      1|      att_connectivity_verts = corner_table_->num_vertices();
  520|      1|    }
  521|    185|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|    185|  }
  523|    133|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 14, False: 119]
  ------------------
  524|     14|    return false;
  525|     14|  }
  526|    119|  return true;
  527|    133|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE19OnAttributesDecodedEv:
  530|     11|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|     11|  return true;
  532|     11|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEi:
  536|    786|    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|    786|  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|    786|  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|    786|  std::vector<VertexIndex> invalid_vertices;
  558|    786|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|    786|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|    786|  int num_faces = 0;
  562|  39.3M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 39.3M, False: 215]
  ------------------
  563|  39.3M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  39.3M|    bool check_topology_split = false;
  566|  39.3M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  39.3M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 3.69M, 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.69M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 39, False: 3.69M]
  ------------------
  588|     39|        return -1;
  589|     39|      }
  590|       |
  591|  3.69M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  3.69M|      const VertexIndex vertex_x =
  593|  3.69M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  3.69M|      const CornerIndex corner_b =
  595|  3.69M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  3.69M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 256, False: 3.69M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    256|        return -1;
  600|    256|      }
  601|  3.69M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 3.69M]
  |  Branch (601:11): [True: 0, False: 3.69M]
  ------------------
  602|  3.69M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 3.69M]
  ------------------
  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.69M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  3.69M|      SetOppositeCorners(corner_a, corner + 1);
  612|  3.69M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  3.69M|      const VertexIndex vert_a_prev =
  616|  3.69M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  3.69M|      const VertexIndex vert_b_next =
  618|  3.69M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  3.69M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 3.69M]
  |  Branch (619:38): [True: 0, False: 3.69M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  3.69M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  3.69M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  3.69M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  3.69M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  3.69M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  3.69M|      active_corner_stack.back() = corner;
  631|  35.6M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 1.49k, False: 35.6M]
  |  Branch (631:40): [True: 29.7M, False: 5.83M]
  ------------------
  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|  29.7M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 0, False: 29.7M]
  ------------------
  647|      0|        return -1;
  648|      0|      }
  649|  29.7M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  29.7M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 29.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|  29.7M|      const CornerIndex corner(3 * face.value());
  658|  29.7M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  29.7M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 1.49k, False: 29.7M]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  1.49k|        opp_corner = corner + 2;
  662|  1.49k|        corner_l = corner + 1;
  663|  1.49k|        corner_r = corner;
  664|  29.7M|      } else {
  665|       |        // "l" is the new first corner.
  666|  29.7M|        opp_corner = corner + 1;
  667|  29.7M|        corner_l = corner;
  668|  29.7M|        corner_r = corner + 2;
  669|  29.7M|      }
  670|  29.7M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  29.7M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  29.7M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 10, False: 29.7M]
  ------------------
  675|     10|        return -1;  // Unexpected number of decoded vertices.
  676|     10|      }
  677|       |
  678|  29.7M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  29.7M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  29.7M|      const VertexIndex vertex_r =
  682|  29.7M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  29.7M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  29.7M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  29.7M|      corner_table_->MapCornerToVertex(
  688|  29.7M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  29.7M|      active_corner_stack.back() = corner;
  690|  29.7M|      check_topology_split = true;
  691|  29.7M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 37.8k, False: 5.79M]
  ------------------
  692|       |      // Create a new face that merges two last active edges from the active
  693|       |      // stack. No new vertex is created, but two vertices at corners "p" and
  694|       |      // "n" need to be merged into a single vertex.
  695|       |      //
  696|       |      // *-------v-------*
  697|       |      //  \a   p/x\n   b/
  698|       |      //   \   /   \   /
  699|       |      //    \ /  S  \ /
  700|       |      //     *.......*
  701|       |      //
  702|  37.8k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 0, False: 37.8k]
  ------------------
  703|      0|        return -1;
  704|      0|      }
  705|  37.8k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  37.8k|      active_corner_stack.pop_back();
  707|       |
  708|       |      // Corner "a" can correspond either to a normal active edge, or to an edge
  709|       |      // created from the topology split event.
  710|  37.8k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  37.8k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 17, False: 37.8k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     17|        active_corner_stack.push_back(it->second);
  714|     17|      }
  715|  37.8k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 44, False: 37.8k]
  ------------------
  716|     44|        return -1;
  717|     44|      }
  718|  37.8k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  37.8k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 37.8k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  37.8k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 3, False: 37.8k]
  |  Branch (724:11): [True: 3, False: 37.8k]
  ------------------
  725|  37.8k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 37.8k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      3|        return -1;
  729|      3|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  37.8k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  37.8k|      SetOppositeCorners(corner_a, corner + 2);
  735|  37.8k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  37.8k|      const VertexIndex vertex_p =
  739|  37.8k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  37.8k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  37.8k|      corner_table_->MapCornerToVertex(
  742|  37.8k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  37.8k|      const VertexIndex vert_b_prev =
  744|  37.8k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  37.8k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  37.8k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  37.8k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  37.8k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  37.8k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  37.8k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  37.8k|                                       corner_table_->LeftMostCorner(vertex_n));
  753|       |
  754|       |      // Also update the vertex id at corner "n" and all corners that are
  755|       |      // connected to it in the CCW direction.
  756|  37.8k|      const CornerIndex first_corner = corner_n;
  757|  10.3M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 10.2M, False: 37.8k]
  ------------------
  758|  10.2M|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  10.2M|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  10.2M|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 1, False: 10.2M]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      1|          return -1;
  764|      1|        }
  765|  10.2M|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  37.8k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  37.8k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 37.7k, False: 50]
  ------------------
  770|  37.7k|        invalid_vertices.push_back(vertex_n);
  771|  37.7k|      }
  772|  37.8k|      active_corner_stack.back() = corner;
  773|  5.79M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 5.79M, False: 173]
  ------------------
  774|  5.79M|      const CornerIndex corner(3 * face.value());
  775|  5.79M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  5.79M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  5.79M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  5.79M|                                       corner_table_->AddNewVertex());
  780|  5.79M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  5.79M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  5.79M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 16, False: 5.79M]
  ------------------
  784|     16|        return -1;  // Unexpected number of decoded vertices.
  785|     16|      }
  786|       |
  787|  5.79M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  5.79M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  5.79M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  5.79M|      active_corner_stack.push_back(corner);
  792|  5.79M|      check_topology_split = true;
  793|  5.79M|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|    173|      return -1;
  796|    173|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  39.3M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  39.3M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 35.5M, False: 3.73M]
  ------------------
  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.5M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  35.5M|      EdgeFaceName split_edge;
  812|  35.5M|      int encoder_split_symbol_id;
  813|  35.5M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 937, False: 35.5M]
  ------------------
  814|  35.5M|                             &encoder_split_symbol_id)) {
  815|    937|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 29, False: 908]
  ------------------
  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|    908|        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|    908|        CornerIndex new_active_corner;
  831|    908|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 332, False: 576]
  ------------------
  832|    332|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    576|        } else {
  834|    576|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    576|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|    908|        const int decoder_split_symbol_id =
  839|    908|            num_symbols - encoder_split_symbol_id - 1;
  840|    908|        topology_split_active_corners[decoder_split_symbol_id] =
  841|    908|            new_active_corner;
  842|    908|      }
  843|  35.5M|    }
  844|  39.3M|  }
  845|    215|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 215]
  ------------------
  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|  3.40M|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 3.40M, False: 186]
  ------------------
  850|  3.40M|    const CornerIndex corner = active_corner_stack.back();
  851|  3.40M|    active_corner_stack.pop_back();
  852|  3.40M|    const bool interior_face =
  853|  3.40M|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  3.40M|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 3.39M, False: 15.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|  3.39M|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 27, False: 3.39M]
  ------------------
  877|     27|        return -1;  // More faces than expected added to the mesh.
  878|     27|      }
  879|       |
  880|  3.39M|      const CornerIndex corner_a = corner;
  881|  3.39M|      const VertexIndex vert_n =
  882|  3.39M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  3.39M|      const CornerIndex corner_b =
  884|  3.39M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  3.39M|      const VertexIndex vert_x =
  887|  3.39M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  3.39M|      const CornerIndex corner_c =
  889|  3.39M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  3.39M|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 2, False: 3.39M]
  |  Branch (891:33): [True: 0, False: 3.39M]
  |  Branch (891:55): [True: 0, False: 3.39M]
  ------------------
  892|       |        // All matched corners must be different.
  893|      2|        return -1;
  894|      2|      }
  895|  3.39M|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 0, False: 3.39M]
  |  Branch (895:11): [True: 0, False: 3.39M]
  ------------------
  896|  3.39M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 3.39M]
  ------------------
  897|  3.39M|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 3.39M]
  ------------------
  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|  3.39M|      const VertexIndex vert_p =
  904|  3.39M|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  3.39M|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  3.39M|      const CornerIndex new_corner(3 * face.value());
  909|  3.39M|      SetOppositeCorners(new_corner, corner);
  910|  3.39M|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  3.39M|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  3.39M|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  3.39M|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  3.39M|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  13.5M|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 10.1M, False: 3.39M]
  ------------------
  920|  10.1M|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  10.1M|      }
  922|       |
  923|  3.39M|      init_face_configurations_.push_back(true);
  924|  3.39M|      init_corners_.push_back(new_corner);
  925|  3.39M|    } 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|  15.9k|      init_face_configurations_.push_back(false);
  930|  15.9k|      init_corners_.push_back(corner);
  931|  15.9k|    }
  932|  3.40M|  }
  933|    186|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 50, False: 136]
  ------------------
  934|     50|    return -1;  // Unexpected number of decoded faces.
  935|     50|  }
  936|       |
  937|    136|  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.47k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 2.47k, False: 133]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  2.47k|    VertexIndex src_vert(num_vertices - 1);
  943|  3.05k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 574, False: 2.47k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    574|      src_vert = VertexIndex(--num_vertices - 1);
  946|    574|    }
  947|  2.47k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 441, False: 2.03k]
  ------------------
  948|    441|      continue;  // No need to swap anything.
  949|    441|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  2.03k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  8.10k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 6.07k, False: 2.03k]
  ------------------
  954|  6.07k|      const CornerIndex cid = vcit.Corner();
  955|  6.07k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 3, False: 6.07k]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      3|        return -1;
  959|      3|      }
  960|  6.07k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  6.07k|    }
  962|  2.03k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  2.03k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  2.03k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  2.03k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  2.03k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  2.03k|    num_vertices--;
  972|  2.03k|  }
  973|    133|  return num_vertices;
  974|    136|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  1.79k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  1.79k|  uint32_t num_topology_splits;
  982|  1.79k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  1.79k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.79k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 109, False: 1.68k]
  ------------------
  984|    109|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 1, False: 108]
  ------------------
  985|      1|      return -1;
  986|      1|    }
  987|       |
  988|    109|  } else
  989|  1.68k|#endif
  990|  1.68k|  {
  991|  1.68k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 10, False: 1.67k]
  ------------------
  992|     10|      return -1;
  993|     10|    }
  994|  1.68k|  }
  995|  1.78k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 365, False: 1.42k]
  ------------------
  996|    365|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 33, False: 332]
  ------------------
  997|    365|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     33|      return -1;
  999|     33|    }
 1000|    332|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    332|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    332|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 24, False: 308]
  ------------------
 1002|  30.3k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 30.3k, False: 5]
  ------------------
 1003|  30.3k|        TopologySplitEventData event_data;
 1004|  30.3k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 11, False: 30.3k]
  ------------------
 1005|     11|          return -1;
 1006|     11|        }
 1007|  30.3k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 5, False: 30.3k]
  ------------------
 1008|      5|          return -1;
 1009|      5|        }
 1010|  30.3k|        uint8_t edge_data;
 1011|  30.3k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 3, False: 30.3k]
  ------------------
 1012|      3|          return -1;
 1013|      3|        }
 1014|  30.3k|        event_data.source_edge = edge_data & 1;
 1015|  30.3k|        topology_split_data_.push_back(event_data);
 1016|  30.3k|      }
 1017|       |
 1018|     24|    } else
 1019|    308|#endif
 1020|    308|    {
 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|    308|      int last_source_symbol_id = 0;
 1024|  3.11k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 2.85k, False: 260]
  ------------------
 1025|  2.85k|        TopologySplitEventData event_data;
 1026|  2.85k|        uint32_t delta;
 1027|  2.85k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 18, False: 2.83k]
  ------------------
 1028|     18|          return -1;
 1029|     18|        }
 1030|  2.83k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  2.83k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 10, False: 2.82k]
  ------------------
 1032|     10|          return -1;
 1033|     10|        }
 1034|  2.82k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 20, False: 2.80k]
  ------------------
 1035|     20|          return -1;
 1036|     20|        }
 1037|  2.80k|        event_data.split_symbol_id =
 1038|  2.80k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  2.80k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  2.80k|        topology_split_data_.push_back(event_data);
 1041|  2.80k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    260|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  2.41k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 2.15k, False: 260]
  ------------------
 1045|  2.15k|        uint32_t edge_data;
 1046|  2.15k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.15k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 430, False: 1.72k]
  ------------------
 1047|    430|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  1.72k|        } else {
 1049|  1.72k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  1.72k|        }
 1051|  2.15k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  2.15k|        event_data.source_edge = edge_data & 1;
 1053|  2.15k|      }
 1054|    260|      decoder_buffer->EndBitDecoding();
 1055|    260|    }
 1056|    332|  }
 1057|  1.68k|  uint32_t num_hole_events = 0;
 1058|  1.68k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  1.68k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.68k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 79, False: 1.60k]
  ------------------
 1060|     79|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 3, False: 76]
  ------------------
 1061|      3|      return -1;
 1062|      3|    }
 1063|  1.60k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.60k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 126, False: 1.48k]
  ------------------
 1064|    126|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 9, False: 117]
  ------------------
 1065|      9|      return -1;
 1066|      9|    }
 1067|    126|  }
 1068|  1.67k|#endif
 1069|  1.67k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 36, False: 1.63k]
  ------------------
 1070|     36|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     36|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     36|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 13, False: 23]
  ------------------
 1072|   157k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 157k, False: 2]
  ------------------
 1073|   157k|        HoleEventData event_data;
 1074|   157k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 11, False: 157k]
  ------------------
 1075|     11|          return -1;
 1076|     11|        }
 1077|   157k|        hole_event_data_.push_back(event_data);
 1078|   157k|      }
 1079|       |
 1080|     13|    } else
 1081|     23|#endif
 1082|     23|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     23|      int last_symbol_id = 0;
 1085|    638|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 622, False: 16]
  ------------------
 1086|    622|        HoleEventData event_data;
 1087|    622|        uint32_t delta;
 1088|    622|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 7, False: 615]
  ------------------
 1089|      7|          return -1;
 1090|      7|        }
 1091|    615|        event_data.symbol_id = delta + last_symbol_id;
 1092|    615|        last_symbol_id = event_data.symbol_id;
 1093|    615|        hole_event_data_.push_back(event_data);
 1094|    615|      }
 1095|     23|    }
 1096|     36|  }
 1097|  1.65k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  1.67k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|      8|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|      8|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|      8|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|     32|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 24, False: 8]
  ------------------
 1109|     24|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|     24|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 8, False: 16]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|     16|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 8, False: 8]
  ------------------
 1114|      8|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|      8|      }
 1116|      8|      continue;
 1117|      8|    }
 1118|       |
 1119|     32|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 16, False: 16]
  ------------------
 1120|     16|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|     16|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 6, False: 10]
  ------------------
 1122|      6|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|      6|      }
 1124|     16|    }
 1125|     16|  }
 1126|      8|  return true;
 1127|      8|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   278k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   278k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   278k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   278k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.11M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 836k, False: 278k]
  ------------------
 1139|   836k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   836k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 163k, False: 673k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   326k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 163k, False: 163k]
  ------------------
 1144|   163k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   163k|      }
 1146|   163k|      continue;
 1147|   163k|    }
 1148|   673k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   673k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 336k, False: 336k]
  ------------------
 1151|   336k|      continue;
 1152|   336k|    }
 1153|       |
 1154|   673k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 337k, False: 336k]
  ------------------
 1155|   337k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|   337k|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 152k, False: 184k]
  ------------------
 1157|   152k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|   152k|      }
 1159|   337k|    }
 1160|   336k|  }
 1161|   278k|  return true;
 1162|   278k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE21AssignPointsToCornersEi:
 1166|    133|    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|    133|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|    133|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 18, False: 115]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  80.5k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 80.5k, False: 18]
  ------------------
 1176|  80.5k|      Mesh::Face face;
 1177|  80.5k|      const CornerIndex start_corner(3 * f.value());
 1178|   322k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 241k, False: 80.5k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   241k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   241k|        face[c] = vert_id;
 1182|   241k|      }
 1183|  80.5k|      decoder_->mesh()->SetFace(f, face);
 1184|  80.5k|    }
 1185|     18|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     18|    return true;
 1187|     18|  }
 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|    115|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|    115|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   217k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 217k, False: 101]
  ------------------
 1197|   217k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   217k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 45, False: 217k]
  ------------------
 1199|     45|      continue;  // Isolated vertex.
 1200|     45|    }
 1201|   217k|    CornerIndex deduplication_first_corner = c;
 1202|   217k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 162k, False: 55.6k]
  ------------------
 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|   162k|      deduplication_first_corner = c;
 1206|   162k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  63.3k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 55.6k, False: 7.71k]
  ------------------
 1210|  55.6k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 7.58k, False: 48.0k]
  ------------------
 1211|  7.58k|          continue;  // No seam for this attribute, ignore it.
 1212|  7.58k|        }
 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|  48.0k|        const VertexIndex vert_id =
 1217|  48.0k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  48.0k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  48.0k|        bool seam_found = false;
 1220|  51.5k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 51.3k, False: 179]
  ------------------
 1221|  51.3k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 14, False: 51.3k]
  ------------------
 1222|     14|            return false;
 1223|     14|          }
 1224|  51.3k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 47.8k, False: 3.46k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  47.8k|            deduplication_first_corner = act_c;
 1227|  47.8k|            seam_found = true;
 1228|  47.8k|            break;
 1229|  47.8k|          }
 1230|  3.46k|          act_c = corner_table_->SwingRight(act_c);
 1231|  3.46k|        }
 1232|  48.0k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 47.8k, False: 179]
  ------------------
 1233|  47.8k|          break;  // No reason to process other attributes if we found a seam.
 1234|  47.8k|        }
 1235|  48.0k|      }
 1236|  55.6k|    }
 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|   217k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   217k|    corner_to_point_map[c.value()] =
 1246|   217k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   217k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   217k|    CornerIndex prev_c = c;
 1250|   217k|    c = corner_table_->SwingRight(c);
 1251|   756k|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 594k, False: 162k]
  |  Branch (1251:40): [True: 539k, False: 55.2k]
  ------------------
 1252|   539k|      bool attribute_seam = false;
 1253|   987k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 539k, False: 448k]
  ------------------
 1254|   539k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 90.6k, False: 448k]
  ------------------
 1255|   539k|            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|  90.6k|          attribute_seam = true;
 1259|  90.6k|          break;
 1260|  90.6k|        }
 1261|   539k|      }
 1262|   539k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 90.6k, False: 448k]
  ------------------
 1263|  90.6k|        corner_to_point_map[c.value()] =
 1264|  90.6k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  90.6k|        point_to_corner_map.push_back(c.value());
 1266|   448k|      } else {
 1267|   448k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|   448k|      }
 1269|   539k|      prev_c = c;
 1270|   539k|      c = corner_table_->SwingRight(c);
 1271|   539k|    }
 1272|   217k|  }
 1273|       |  // Add faces.
 1274|  78.2k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 78.1k, False: 101]
  ------------------
 1275|  78.1k|    Mesh::Face face;
 1276|   312k|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 234k, False: 78.1k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   234k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   234k|    }
 1280|  78.1k|    decoder_->mesh()->SetFace(f, face);
 1281|  78.1k|  }
 1282|    101|  decoder_->point_cloud()->set_num_points(
 1283|    101|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|    101|  return true;
 1285|    115|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    100|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    100|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    100|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    100|  const Mesh *mesh = decoder_->mesh();
  115|    100|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    100|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    100|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    100|                           encoding_data);
  120|       |
  121|    100|  TraverserT att_traverser;
  122|    100|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    100|  traversal_sequencer->SetTraverser(att_traverser);
  125|    100|  return std::move(traversal_sequencer);
  126|    100|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    518|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    518|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    518|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    518|  const Mesh *mesh = decoder_->mesh();
  115|    518|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    518|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    518|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    518|                           encoding_data);
  120|       |
  121|    518|  TraverserT att_traverser;
  122|    518|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    518|  traversal_sequencer->SetTraverser(att_traverser);
  125|    518|  return std::move(traversal_sequencer);
  126|    518|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    142|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    142|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    142|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    142|  const Mesh *mesh = decoder_->mesh();
  115|    142|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    142|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    142|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    142|                           encoding_data);
  120|       |
  121|    142|  TraverserT att_traverser;
  122|    142|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    142|  traversal_sequencer->SetTraverser(att_traverser);
  125|    142|  return std::move(traversal_sequencer);
  126|    142|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    558|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    558|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    558|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    558|  const Mesh *mesh = decoder_->mesh();
  115|    558|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    558|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    558|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    558|                           encoding_data);
  120|       |
  121|    558|  TraverserT att_traverser;
  122|    558|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    558|  traversal_sequencer->SetTraverser(att_traverser);
  125|    558|  return std::move(traversal_sequencer);
  126|    558|}
_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|     13|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|     13|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     13|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     13|  const Mesh *mesh = decoder_->mesh();
  115|     13|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     13|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     13|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     13|                           encoding_data);
  120|       |
  121|     13|  TraverserT att_traverser;
  122|     13|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     13|  traversal_sequencer->SetTraverser(att_traverser);
  125|     13|  return std::move(traversal_sequencer);
  126|     13|}

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  5.46k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  1.88k|  const CornerTable *GetCornerTable() const override {
   67|  1.88k|    return corner_table_.get();
   68|  1.88k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  3.07M|                       int *out_encoder_split_symbol_id) {
   87|  3.07M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 18.4k, False: 3.06M]
  ------------------
   88|  18.4k|      return false;
   89|  18.4k|    }
   90|  3.06M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 19, False: 3.06M]
  ------------------
   91|  3.06M|        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|     19|      *out_encoder_split_symbol_id = -1;
   98|     19|      return true;
   99|     19|    }
  100|  3.06M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 3.06M, False: 1.15k]
  ------------------
  101|  3.06M|      return false;
  102|  3.06M|    }
  103|  1.15k|    *out_face_edge =
  104|  1.15k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.15k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.15k|    topology_split_data_.pop_back();
  108|  1.15k|    return true;
  109|  3.06M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  11.3M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  11.3M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  11.3M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  11.3M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  10.2k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  5.10k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  3.30k|  const CornerTable *GetCornerTable() const override {
   67|  3.30k|    return corner_table_.get();
   68|  3.30k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  23.5M|                       int *out_encoder_split_symbol_id) {
   87|  23.5M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 23.5M, False: 51.8k]
  ------------------
   88|  23.5M|      return false;
   89|  23.5M|    }
   90|  51.8k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 21, False: 51.8k]
  ------------------
   91|  51.8k|        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|  51.8k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 50.6k, False: 1.20k]
  ------------------
  101|  50.6k|      return false;
  102|  50.6k|    }
  103|  1.20k|    *out_face_edge =
  104|  1.20k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.20k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.20k|    topology_split_data_.pop_back();
  108|  1.20k|    return true;
  109|  51.8k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  70.2M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  70.2M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  70.2M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  70.2M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  6.32k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  8.98k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  1.77k|  const CornerTable *GetCornerTable() const override {
   67|  1.77k|    return corner_table_.get();
   68|  1.77k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  35.5M|                       int *out_encoder_split_symbol_id) {
   87|  35.5M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 35.1M, False: 386k]
  ------------------
   88|  35.1M|      return false;
   89|  35.1M|    }
   90|   386k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 29, False: 386k]
  ------------------
   91|   386k|        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|   386k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 385k, False: 908]
  ------------------
  101|   385k|      return false;
  102|   385k|    }
  103|    908|    *out_face_edge =
  104|    908|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|    908|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|    908|    topology_split_data_.pop_back();
  108|    908|    return true;
  109|   386k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  47.4M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  47.4M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  47.4M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  47.4M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  9.49k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  6.19k|      : attribute_connectivity_decoders_(nullptr),
   34|  6.19k|        num_attribute_data_(0),
   35|  6.19k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  5.18k|  void Init(MeshEdgebreakerDecoderImplInterface *decoder) {
   37|  5.18k|    decoder_impl_ = decoder;
   38|  5.18k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  5.18k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  5.18k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  5.18k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  4.01k|  uint16_t BitstreamVersion() const {
   45|  4.01k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  4.01k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  1.82k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  5.18k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  3.52k|  bool Start(DecoderBuffer *out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  3.52k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 106, False: 3.41k]
  ------------------
   63|    106|      return false;
   64|    106|    }
   65|       |
   66|  3.41k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 81, False: 3.33k]
  ------------------
   67|     81|      return false;
   68|     81|    }
   69|       |
   70|  3.33k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 19, False: 3.31k]
  ------------------
   71|     19|      return false;
   72|     19|    }
   73|  3.31k|    *out_buffer = buffer_;
   74|  3.31k|    return true;
   75|  3.33k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  3.43M|  inline bool DecodeStartFaceConfiguration() {
   79|  3.43M|    uint32_t face_configuration;
   80|  3.43M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  3.43M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.43M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 435, False: 3.43M]
  ------------------
   82|    435|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|    435|    } else
   85|  3.43M|#endif
   86|  3.43M|    {
   87|  3.43M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  3.43M|    }
   89|  3.43M|    return face_configuration;
   90|  3.43M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  8.20M|  inline uint32_t DecodeSymbol() {
   94|  8.20M|    uint32_t symbol;
   95|  8.20M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  8.20M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 3.86M, False: 4.34M]
  ------------------
   97|  3.86M|      return symbol;
   98|  3.86M|    }
   99|       |    // Else decode two additional bits.
  100|  4.34M|    uint32_t symbol_suffix;
  101|  4.34M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  4.34M|    symbol |= (symbol_suffix << 1);
  103|  4.34M|    return symbol;
  104|  8.20M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  8.15M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|  1.24M|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  16.4M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  16.4M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  16.4M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  3.07k|  void Done() {
  123|  3.07k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 2.94k, False: 128]
  ------------------
  124|  2.94k|      symbol_buffer_.EndBitDecoding();
  125|  2.94k|    }
  126|  3.07k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  3.07k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.07k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 229, False: 2.84k]
  ------------------
  128|    229|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    229|    } else
  131|  2.84k|#endif
  132|  2.84k|    {
  133|  2.84k|      start_face_decoder_.EndDecoding();
  134|  2.84k|    }
  135|  3.07k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|  1.51k|  DecoderBuffer *buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  3.69k|  bool DecodeTraversalSymbols() {
  141|  3.69k|    uint64_t traversal_size;
  142|  3.69k|    symbol_buffer_ = buffer_;
  143|  3.69k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 39, False: 3.66k]
  ------------------
  144|     39|      return false;
  145|     39|    }
  146|  3.66k|    buffer_ = symbol_buffer_;
  147|  3.66k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 115, False: 3.54k]
  ------------------
  148|    115|      return false;
  149|    115|    }
  150|  3.54k|    buffer_.Advance(traversal_size);
  151|  3.54k|    return true;
  152|  3.66k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  5.02k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  5.02k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  5.02k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  5.02k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 426, False: 4.60k]
  ------------------
  158|    426|      start_face_buffer_ = buffer_;
  159|    426|      uint64_t traversal_size;
  160|    426|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 4, False: 422]
  ------------------
  161|      4|        return false;
  162|      4|      }
  163|    422|      buffer_ = start_face_buffer_;
  164|    422|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 124, False: 298]
  ------------------
  165|    124|        return false;
  166|    124|      }
  167|    298|      buffer_.Advance(traversal_size);
  168|    298|      return true;
  169|    422|    }
  170|  4.60k|#endif
  171|  4.60k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  5.02k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  4.86k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  4.86k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 3.22k, False: 1.63k]
  ------------------
  177|  3.22k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  3.22k|          new BinaryDecoder[num_attribute_data_]);
  179|  8.93k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 5.73k, False: 3.19k]
  ------------------
  180|  5.73k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 32, False: 5.70k]
  ------------------
  181|     32|          return false;
  182|     32|        }
  183|  5.73k|      }
  184|  3.22k|    }
  185|  4.83k|    return true;
  186|  4.86k|  }

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

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

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

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.05k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.12M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.12M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 2.12M, False: 2.52k]
  ------------------
   61|  2.12M|      return true;  // Already traversed.
   62|  2.12M|    }
   63|       |
   64|  2.52k|    corner_traversal_stack_.clear();
   65|  2.52k|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  2.52k|    const VertexIndex next_vert =
   69|  2.52k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  2.52k|    const VertexIndex prev_vert =
   71|  2.52k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  2.52k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.52k]
  |  Branch (72:45): [True: 0, False: 2.52k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  2.52k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 1.98k, False: 538]
  ------------------
   76|  1.98k|      this->MarkVertexVisited(next_vert);
   77|  1.98k|      this->traversal_observer().OnNewVertexVisited(
   78|  1.98k|          next_vert, this->corner_table()->Next(corner_id));
   79|  1.98k|    }
   80|  2.52k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.17k, False: 348]
  ------------------
   81|  2.17k|      this->MarkVertexVisited(prev_vert);
   82|  2.17k|      this->traversal_observer().OnNewVertexVisited(
   83|  2.17k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.17k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  17.0k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 14.4k, False: 2.52k]
  ------------------
   88|       |      // Currently processed corner.
   89|  14.4k|      corner_id = corner_traversal_stack_.back();
   90|  14.4k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  14.4k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 14.4k]
  |  Branch (92:47): [True: 759, False: 13.7k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    759|        corner_traversal_stack_.pop_back();
   95|    759|        continue;
   96|    759|      }
   97|  2.12M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 2.12M, Folded]
  ------------------
   98|  2.12M|        this->MarkFaceVisited(face_id);
   99|  2.12M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.12M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.12M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.12M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.12M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.07M, False: 1.05M]
  ------------------
  105|  1.07M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.07M|          this->MarkVertexVisited(vert_id);
  107|  1.07M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.07M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 1.04M, False: 26.5k]
  ------------------
  109|  1.04M|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  1.04M|            face_id = FaceIndex(corner_id.value() / 3);
  111|  1.04M|            continue;
  112|  1.04M|          }
  113|  1.07M|        }
  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.07M|        const CornerIndex right_corner_id =
  118|  1.07M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.07M|        const CornerIndex left_corner_id =
  120|  1.07M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.07M|        const FaceIndex right_face_id(
  122|  1.07M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 17.7k, False: 1.06M]
  ------------------
  123|  1.07M|                 ? kInvalidFaceIndex
  124|  1.07M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.07M|        const FaceIndex left_face_id(
  126|  1.07M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 10.2k, False: 1.06M]
  ------------------
  127|  1.07M|                 ? kInvalidFaceIndex
  128|  1.07M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.07M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.05M, False: 26.4k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.05M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 7.75k, False: 1.04M]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  7.75k|            corner_traversal_stack_.pop_back();
  134|  7.75k|            break;  // Break from the while (true) loop.
  135|  1.04M|          } else {
  136|       |            // Go to the left face.
  137|  1.04M|            corner_id = left_corner_id;
  138|  1.04M|            face_id = left_face_id;
  139|  1.04M|          }
  140|  1.05M|        } else {
  141|       |          // Right face was not visited.
  142|  26.4k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 20.4k, False: 5.98k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  20.4k|            corner_id = right_corner_id;
  145|  20.4k|            face_id = right_face_id;
  146|  20.4k|          } 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|  5.98k|            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|  5.98k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  5.98k|            break;
  159|  5.98k|          }
  160|  26.4k|        }
  161|  1.07M|      }
  162|  13.7k|    }
  163|  2.52k|    return true;
  164|  2.52k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.05k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.17k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.31k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.97M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.97M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 705k, False: 2.27M]
  ------------------
   61|   705k|      return true;  // Already traversed.
   62|   705k|    }
   63|       |
   64|  2.27M|    corner_traversal_stack_.clear();
   65|  2.27M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  2.27M|    const VertexIndex next_vert =
   69|  2.27M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  2.27M|    const VertexIndex prev_vert =
   71|  2.27M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  2.27M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.27M]
  |  Branch (72:45): [True: 0, False: 2.27M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  2.27M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.27M, False: 1.17k]
  ------------------
   76|  2.27M|      this->MarkVertexVisited(next_vert);
   77|  2.27M|      this->traversal_observer().OnNewVertexVisited(
   78|  2.27M|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.27M|    }
   80|  2.27M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.27M, False: 1.02k]
  ------------------
   81|  2.27M|      this->MarkVertexVisited(prev_vert);
   82|  2.27M|      this->traversal_observer().OnNewVertexVisited(
   83|  2.27M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.27M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  4.59M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 2.32M, False: 2.27M]
  ------------------
   88|       |      // Currently processed corner.
   89|  2.32M|      corner_id = corner_traversal_stack_.back();
   90|  2.32M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  2.32M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 2.32M]
  |  Branch (92:47): [True: 4.25k, False: 2.32M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  4.25k|        corner_traversal_stack_.pop_back();
   95|  4.25k|        continue;
   96|  4.25k|      }
   97|  2.97M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 2.97M, Folded]
  ------------------
   98|  2.97M|        this->MarkFaceVisited(face_id);
   99|  2.97M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.97M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.97M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.97M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.97M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 2.64M, False: 336k]
  ------------------
  105|  2.64M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  2.64M|          this->MarkVertexVisited(vert_id);
  107|  2.64M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  2.64M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 325k, False: 2.31M]
  ------------------
  109|   325k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   325k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   325k|            continue;
  112|   325k|          }
  113|  2.64M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  2.65M|        const CornerIndex right_corner_id =
  118|  2.65M|            this->corner_table()->GetRightCorner(corner_id);
  119|  2.65M|        const CornerIndex left_corner_id =
  120|  2.65M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  2.65M|        const FaceIndex right_face_id(
  122|  2.65M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 2.29M, False: 356k]
  ------------------
  123|  2.65M|                 ? kInvalidFaceIndex
  124|  2.65M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  2.65M|        const FaceIndex left_face_id(
  126|  2.65M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 2.29M, False: 360k]
  ------------------
  127|  2.65M|                 ? kInvalidFaceIndex
  128|  2.65M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  2.65M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 2.61M, False: 41.5k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  2.61M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 2.29M, False: 316k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  2.29M|            corner_traversal_stack_.pop_back();
  134|  2.29M|            break;  // Break from the while (true) loop.
  135|  2.29M|          } else {
  136|       |            // Go to the left face.
  137|   316k|            corner_id = left_corner_id;
  138|   316k|            face_id = left_face_id;
  139|   316k|          }
  140|  2.61M|        } else {
  141|       |          // Right face was not visited.
  142|  41.5k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 15.0k, False: 26.4k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  15.0k|            corner_id = right_corner_id;
  145|  15.0k|            face_id = right_face_id;
  146|  26.4k|          } 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|  26.4k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  26.4k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  26.4k|            break;
  159|  26.4k|          }
  160|  41.5k|        }
  161|  2.65M|      }
  162|  2.32M|    }
  163|  2.27M|    return true;
  164|  2.27M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.31k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.73k|  DepthFirstTraverser() {}

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

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    266|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|    818|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|    818|    const auto *corner_table = traverser_.corner_table();
   50|    818|    attribute->SetExplicitMapping(mesh_->num_points());
   51|    818|    const size_t num_faces = mesh_->num_faces();
   52|    818|    const size_t num_points = mesh_->num_points();
   53|  2.93M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 2.93M, False: 818]
  ------------------
   54|  2.93M|      const auto &face = mesh_->face(f);
   55|  11.7M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 8.79M, False: 2.93M]
  ------------------
   56|  8.79M|        const PointIndex point_id = face[p];
   57|  8.79M|        const VertexIndex vert_id =
   58|  8.79M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  8.79M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 8.79M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  8.79M|        const AttributeValueIndex att_entry_id(
   63|  8.79M|            encoding_data_
   64|  8.79M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  8.79M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 8.79M]
  |  Branch (65:13): [True: 0, False: 8.79M]
  |  Branch (65:39): [True: 0, False: 8.79M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  8.79M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  8.79M|      }
   71|  2.93M|    }
   72|    818|    return true;
   73|    818|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    244|  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|    244|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    244|    traverser_.OnTraversalStart();
   82|    244|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 244]
  ------------------
   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|    244|    } else {
   89|    244|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  1.77M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 1.77M, False: 244]
  ------------------
   91|  1.77M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 1.77M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  1.77M|      }
   95|    244|    }
   96|    244|    traverser_.OnTraversalEnd();
   97|    244|    return true;
   98|    244|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.77M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  1.77M|    return traverser_.TraverseFromCorner(corner_id);
  103|  1.77M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    266|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.08k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  4.36k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  4.36k|    const auto *corner_table = traverser_.corner_table();
   50|  4.36k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  4.36k|    const size_t num_faces = mesh_->num_faces();
   52|  4.36k|    const size_t num_points = mesh_->num_points();
   53|  3.49M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 3.49M, False: 4.36k]
  ------------------
   54|  3.49M|      const auto &face = mesh_->face(f);
   55|  13.9M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 10.4M, False: 3.49M]
  ------------------
   56|  10.4M|        const PointIndex point_id = face[p];
   57|  10.4M|        const VertexIndex vert_id =
   58|  10.4M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  10.4M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 10.4M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  10.4M|        const AttributeValueIndex att_entry_id(
   63|  10.4M|            encoding_data_
   64|  10.4M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  10.4M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 10.4M]
  |  Branch (65:13): [True: 0, False: 10.4M]
  |  Branch (65:39): [True: 0, False: 10.4M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  10.4M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  10.4M|      }
   71|  3.49M|    }
   72|  4.36k|    return true;
   73|  4.36k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.05k|  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.05k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.05k|    traverser_.OnTraversalStart();
   82|  1.05k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.05k]
  ------------------
   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.05k|    } else {
   89|  1.05k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.12M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.12M, False: 1.05k]
  ------------------
   91|  2.12M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.12M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.12M|      }
   95|  1.05k|    }
   96|  1.05k|    traverser_.OnTraversalEnd();
   97|  1.05k|    return true;
   98|  1.05k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.12M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.12M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.12M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.08k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.36k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  5.49k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  5.49k|    const auto *corner_table = traverser_.corner_table();
   50|  5.49k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  5.49k|    const size_t num_faces = mesh_->num_faces();
   52|  5.49k|    const size_t num_points = mesh_->num_points();
   53|  4.50M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 4.49M, False: 5.49k]
  ------------------
   54|  4.49M|      const auto &face = mesh_->face(f);
   55|  17.9M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 13.4M, False: 4.49M]
  ------------------
   56|  13.4M|        const PointIndex point_id = face[p];
   57|  13.4M|        const VertexIndex vert_id =
   58|  13.4M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  13.4M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 13.4M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  13.4M|        const AttributeValueIndex att_entry_id(
   63|  13.4M|            encoding_data_
   64|  13.4M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  13.4M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 13.4M]
  |  Branch (65:13): [True: 0, False: 13.4M]
  |  Branch (65:39): [True: 0, False: 13.4M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  13.4M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  13.4M|      }
   71|  4.49M|    }
   72|  5.49k|    return true;
   73|  5.49k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.31k|  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.31k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.31k|    traverser_.OnTraversalStart();
   82|  1.31k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.31k]
  ------------------
   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.31k|    } else {
   89|  1.31k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.97M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.97M, False: 1.31k]
  ------------------
   91|  2.97M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.97M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.97M|      }
   95|  1.31k|    }
   96|  1.31k|    traverser_.OnTraversalEnd();
   97|  1.31k|    return true;
   98|  1.31k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.97M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.97M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.97M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.36k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  2.73k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  23.2M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  11.8M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  11.8M|    return is_vertex_visited_[vert_id.value()];
   65|  11.8M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  1.98M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  1.98M|    is_vertex_visited_[vert_id.value()] = true;
   68|  1.98M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  5.88M|  inline TraversalObserverT &traversal_observer() {
   75|  5.88M|    return traversal_observer_;
   76|  5.88M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  9.11M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  9.11M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 55.9k, False: 9.05M]
  ------------------
   47|  55.9k|      return true;  // Invalid faces are always considered as visited.
   48|  55.9k|    }
   49|  9.05M|    return is_face_visited_[face_id.value()];
   50|  9.11M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  3.90M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  3.90M|    is_face_visited_[face_id.value()] = true;
   62|  3.90M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  2.71k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  2.71k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.35k|                    TraversalObserver traversal_observer) {
   37|  1.35k|    corner_table_ = corner_table;
   38|  1.35k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.35k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.35k|    traversal_observer_ = traversal_observer;
   41|  1.35k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.12M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.12M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.12M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.12M|    return is_face_visited_[corner_id.value() / 3];
   58|  2.12M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  24.8M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.97M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.97M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.97M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.97M|    return is_face_visited_[corner_id.value() / 3];
   58|  2.97M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  7.52M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  7.52M|    return is_vertex_visited_[vert_id.value()];
   65|  7.52M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  7.18M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  7.18M|    is_vertex_visited_[vert_id.value()] = true;
   68|  7.18M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  10.1M|  inline TraversalObserverT &traversal_observer() {
   75|  10.1M|    return traversal_observer_;
   76|  10.1M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  7.62M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  7.62M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 4.58M, False: 3.04M]
  ------------------
   47|  4.58M|      return true;  // Invalid faces are always considered as visited.
   48|  4.58M|    }
   49|  3.04M|    return is_face_visited_[face_id.value()];
   50|  7.62M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  2.97M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  2.97M|    is_face_visited_[face_id.value()] = true;
   62|  2.97M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  2.73k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.36k|                    TraversalObserver traversal_observer) {
   37|  1.36k|    corner_table_ = corner_table;
   38|  1.36k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.36k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.36k|    traversal_observer_ = traversal_observer;
   41|  1.36k|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    202|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    202|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 13, False: 189]
  ------------------
  187|     13|    return false;
  188|     13|  }
  189|    189|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 8, False: 181]
  ------------------
  190|      8|    return false;
  191|      8|  }
  192|    181|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 4, False: 177]
  ------------------
  193|      4|    return false;
  194|      4|  }
  195|    177|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 69, False: 108]
  ------------------
  196|     69|    return true;
  197|     69|  }
  198|    108|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 21, False: 87]
  ------------------
  199|     21|    return false;
  200|     21|  }
  201|     87|  num_decoded_points_ = 0;
  202|       |
  203|     87|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 19, False: 68]
  ------------------
  204|     19|    return false;
  205|     19|  }
  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: 1, False: 63]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     63|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 4, False: 59]
  ------------------
  213|      4|    return false;
  214|      4|  }
  215|       |
  216|     59|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 41, False: 18]
  ------------------
  217|     41|    return false;
  218|     41|  }
  219|       |
  220|     18|  numbers_decoder_.EndDecoding();
  221|     18|  remaining_bits_decoder_.EndDecoding();
  222|     18|  axis_decoder_.EndDecoding();
  223|     18|  half_decoder_.EndDecoding();
  224|       |
  225|     18|  return true;
  226|     59|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     59|    uint32_t num_points, OutputIteratorT &oit) {
  254|     59|  typedef DecodingStatus Status;
  255|     59|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     59|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     59|  DecodingStatus init_status(num_points, 0, 0);
  258|     59|  std::stack<Status> status_stack;
  259|     59|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  3.16M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 3.16M, False: 18]
  ------------------
  263|  3.16M|    const DecodingStatus status = status_stack.top();
  264|  3.16M|    status_stack.pop();
  265|       |
  266|  3.16M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  3.16M|    const uint32_t last_axis = status.last_axis;
  268|  3.16M|    const uint32_t stack_pos = status.stack_pos;
  269|  3.16M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  3.16M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  3.16M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 3.16M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  3.16M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  3.16M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 3.16M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  3.16M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  3.16M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.58M, False: 1.58M]
  ------------------
  285|   313M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 311M, False: 1.58M]
  ------------------
  286|   311M|        *oit = old_base;
  287|   311M|        ++oit;
  288|   311M|        ++num_decoded_points_;
  289|   311M|      }
  290|  1.58M|      continue;
  291|  1.58M|    }
  292|       |
  293|  1.58M|    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.58M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.31k, False: 1.58M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.31k|      axes_[0] = axis;
  300|  7.66k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 6.35k, False: 1.31k]
  ------------------
  301|  6.35k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  6.35k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 414, False: 5.93k]
  |  |  ------------------
  ------------------
  302|  6.35k|      }
  303|  3.56k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.26k, False: 1.29k]
  ------------------
  304|  15.2k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 13.0k, False: 2.24k]
  ------------------
  305|  13.0k|          p_[axes_[j]] = 0;
  306|  13.0k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  13.0k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.36k, False: 9.63k]
  ------------------
  308|  3.36k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 22, False: 3.34k]
  ------------------
  309|  3.36k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     22|              return false;
  311|     22|            }
  312|  3.36k|          }
  313|  12.9k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  12.9k|        }
  315|  2.24k|        *oit = p_;
  316|  2.24k|        ++oit;
  317|  2.24k|        ++num_decoded_points_;
  318|  2.24k|      }
  319|  1.29k|      continue;
  320|  1.31k|    }
  321|       |
  322|  1.58M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.58M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.58M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.58M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.58M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.58M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.58M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.58M|    uint32_t number = 0;
  334|  1.58M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.58M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.58M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 19, False: 1.58M]
  ------------------
  338|       |      // Invalid |number|.
  339|     19|      return false;
  340|     19|    }
  341|  1.58M|    first_half -= number;
  342|  1.58M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.58M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 850k, False: 731k]
  ------------------
  345|   850k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 848k, False: 1.88k]
  ------------------
  346|   848k|        std::swap(first_half, second_half);
  347|   848k|      }
  348|   850k|    }
  349|       |
  350|  1.58M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.58M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.58M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.58M, False: 33]
  ------------------
  353|  1.58M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.58M|    }
  355|  1.58M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.58M, False: 88]
  ------------------
  356|  1.58M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.58M|    }
  358|  1.58M|  }
  359|     18|  return true;
  360|     59|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  134|  3.49M|        : num_remaining_points(num_remaining_points_),
  135|  3.49M|          last_axis(last_axis_),
  136|  3.49M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|  1.74M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.74M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.74M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|     69|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|    300|      : bit_length_(0),
   87|    300|        num_points_(0),
   88|    300|        num_decoded_points_(0),
   89|    300|        dimension_(dimension),
   90|    300|        p_(dimension, 0),
   91|    300|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    300|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    300|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    153|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    153|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 7, False: 146]
  ------------------
  187|      7|    return false;
  188|      7|  }
  189|    146|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 8, False: 138]
  ------------------
  190|      8|    return false;
  191|      8|  }
  192|    138|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 3, False: 135]
  ------------------
  193|      3|    return false;
  194|      3|  }
  195|    135|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 34, False: 101]
  ------------------
  196|     34|    return true;
  197|     34|  }
  198|    101|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 15, False: 86]
  ------------------
  199|     15|    return false;
  200|     15|  }
  201|     86|  num_decoded_points_ = 0;
  202|       |
  203|     86|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 20, False: 66]
  ------------------
  204|     20|    return false;
  205|     20|  }
  206|     66|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 66]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     66|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 63]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     63|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 61]
  ------------------
  213|      2|    return false;
  214|      2|  }
  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|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  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|  2.37M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.37M, False: 16]
  ------------------
  263|  2.37M|    const DecodingStatus status = status_stack.top();
  264|  2.37M|    status_stack.pop();
  265|       |
  266|  2.37M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.37M|    const uint32_t last_axis = status.last_axis;
  268|  2.37M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.37M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.37M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.37M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.37M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.37M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.37M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.37M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.37M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.37M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.18M, False: 1.18M]
  ------------------
  285|   298M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 297M, False: 1.18M]
  ------------------
  286|   297M|        *oit = old_base;
  287|   297M|        ++oit;
  288|   297M|        ++num_decoded_points_;
  289|   297M|      }
  290|  1.18M|      continue;
  291|  1.18M|    }
  292|       |
  293|  1.18M|    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.18M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.29k, False: 1.18M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.29k|      axes_[0] = axis;
  300|  8.36k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 7.06k, False: 1.29k]
  ------------------
  301|  7.06k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  7.06k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 303, False: 6.76k]
  |  |  ------------------
  ------------------
  302|  7.06k|      }
  303|  3.54k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.27k, False: 1.26k]
  ------------------
  304|  16.6k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 14.4k, False: 2.24k]
  ------------------
  305|  14.4k|          p_[axes_[j]] = 0;
  306|  14.4k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  14.4k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.12k, False: 11.2k]
  ------------------
  308|  3.12k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 27, False: 3.10k]
  ------------------
  309|  3.12k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     27|              return false;
  311|     27|            }
  312|  3.12k|          }
  313|  14.3k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  14.3k|        }
  315|  2.24k|        *oit = p_;
  316|  2.24k|        ++oit;
  317|  2.24k|        ++num_decoded_points_;
  318|  2.24k|      }
  319|  1.26k|      continue;
  320|  1.29k|    }
  321|       |
  322|  1.18M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.18M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.18M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.18M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.18M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.18M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.18M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.18M|    uint32_t number = 0;
  334|  1.18M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.18M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.18M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 18, False: 1.18M]
  ------------------
  338|       |      // Invalid |number|.
  339|     18|      return false;
  340|     18|    }
  341|  1.18M|    first_half -= number;
  342|  1.18M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.18M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 638k, False: 549k]
  ------------------
  345|   638k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 636k, False: 2.08k]
  ------------------
  346|   636k|        std::swap(first_half, second_half);
  347|   636k|      }
  348|   638k|    }
  349|       |
  350|  1.18M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.18M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.18M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.18M, False: 38]
  ------------------
  353|  1.18M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.18M|    }
  355|  1.18M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.18M, False: 204]
  ------------------
  356|  1.18M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.18M|    }
  358|  1.18M|  }
  359|     16|  return true;
  360|     61|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  134|  3.75M|        : num_remaining_points(num_remaining_points_),
  135|  3.75M|          last_axis(last_axis_),
  136|  3.75M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  3.75M|    uint32_t last_axis) {
  232|  3.75M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 3.75M, Folded]
  ------------------
  233|  3.75M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  3.75M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.56M, False: 1.19M]
  |  |  ------------------
  ------------------
  234|  3.75M|  }
  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.75M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  1.87M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.87M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.87M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|     32|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    138|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    138|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 4, False: 134]
  ------------------
  187|      4|    return false;
  188|      4|  }
  189|    134|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 15, False: 119]
  ------------------
  190|     15|    return false;
  191|     15|  }
  192|    119|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 118]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    118|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 15, False: 103]
  ------------------
  196|     15|    return true;
  197|     15|  }
  198|    103|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 10, False: 93]
  ------------------
  199|     10|    return false;
  200|     10|  }
  201|     93|  num_decoded_points_ = 0;
  202|       |
  203|     93|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 11, False: 82]
  ------------------
  204|     11|    return false;
  205|     11|  }
  206|     82|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 7, False: 75]
  ------------------
  207|      7|    return false;
  208|      7|  }
  209|     75|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 74]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     74|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 72]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     72|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 66, False: 6]
  ------------------
  217|     66|    return false;
  218|     66|  }
  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|     72|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     72|    uint32_t num_points, OutputIteratorT &oit) {
  254|     72|  typedef DecodingStatus Status;
  255|     72|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     72|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     72|  DecodingStatus init_status(num_points, 0, 0);
  258|     72|  std::stack<Status> status_stack;
  259|     72|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  25.7k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 25.7k, False: 6]
  ------------------
  263|  25.7k|    const DecodingStatus status = status_stack.top();
  264|  25.7k|    status_stack.pop();
  265|       |
  266|  25.7k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  25.7k|    const uint32_t last_axis = status.last_axis;
  268|  25.7k|    const uint32_t stack_pos = status.stack_pos;
  269|  25.7k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  25.7k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  25.7k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 25.7k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  25.7k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  25.7k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 25.7k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  25.7k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  25.7k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 4.71k, False: 21.0k]
  ------------------
  285|  3.91G|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 3.91G, False: 4.71k]
  ------------------
  286|  3.91G|        *oit = old_base;
  287|  3.91G|        ++oit;
  288|  3.91G|        ++num_decoded_points_;
  289|  3.91G|      }
  290|  4.71k|      continue;
  291|  4.71k|    }
  292|       |
  293|  21.0k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  21.0k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.62k, False: 19.4k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.62k|      axes_[0] = axis;
  300|  3.75k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.12k, False: 1.62k]
  ------------------
  301|  2.12k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.12k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 386, False: 1.74k]
  |  |  ------------------
  ------------------
  302|  2.12k|      }
  303|  4.29k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.68k, False: 1.60k]
  ------------------
  304|  8.76k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 6.09k, False: 2.66k]
  ------------------
  305|  6.09k|          p_[axes_[j]] = 0;
  306|  6.09k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  6.09k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 4.57k, False: 1.52k]
  ------------------
  308|  4.57k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 19, False: 4.55k]
  ------------------
  309|  4.57k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     19|              return false;
  311|     19|            }
  312|  4.57k|          }
  313|  6.07k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  6.07k|        }
  315|  2.66k|        *oit = p_;
  316|  2.66k|        ++oit;
  317|  2.66k|        ++num_decoded_points_;
  318|  2.66k|      }
  319|  1.60k|      continue;
  320|  1.62k|    }
  321|       |
  322|  19.4k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 19.4k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  19.4k|    const int num_remaining_bits = bit_length_ - level;
  327|  19.4k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  19.4k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  19.4k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  19.4k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  19.4k|    uint32_t number = 0;
  334|  19.4k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  19.4k|    uint32_t first_half = num_remaining_points / 2;
  337|  19.4k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 47, False: 19.3k]
  ------------------
  338|       |      // Invalid |number|.
  339|     47|      return false;
  340|     47|    }
  341|  19.3k|    first_half -= number;
  342|  19.3k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  19.3k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 16.6k, False: 2.72k]
  ------------------
  345|  16.6k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 14.8k, False: 1.78k]
  ------------------
  346|  14.8k|        std::swap(first_half, second_half);
  347|  14.8k|      }
  348|  16.6k|    }
  349|       |
  350|  19.3k|    levels_stack_[stack_pos][axis] += 1;
  351|  19.3k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  19.3k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 18.7k, False: 627]
  ------------------
  353|  18.7k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  18.7k|    }
  355|  19.3k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 7.72k, False: 11.6k]
  ------------------
  356|  7.72k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  7.72k|    }
  358|  19.3k|  }
  359|      6|  return true;
  360|     72|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  134|  4.23M|        : num_remaining_points(num_remaining_points_),
  135|  4.23M|          last_axis(last_axis_),
  136|  4.23M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  127|  2.12M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.12M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.12M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  118|     14|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|    225|      : bit_length_(0),
   87|    225|        num_points_(0),
   88|    225|        num_decoded_points_(0),
   89|    225|        dimension_(dimension),
   90|    225|        p_(dimension, 0),
   91|    225|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    225|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    225|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    122|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    122|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 121]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    121|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 10, False: 111]
  ------------------
  190|     10|    return false;
  191|     10|  }
  192|    111|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 110]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    110|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 12, False: 98]
  ------------------
  196|     12|    return true;
  197|     12|  }
  198|     98|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 8, False: 90]
  ------------------
  199|      8|    return false;
  200|      8|  }
  201|     90|  num_decoded_points_ = 0;
  202|       |
  203|     90|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 15, False: 75]
  ------------------
  204|     15|    return false;
  205|     15|  }
  206|     75|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 73]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     73|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 6, False: 67]
  ------------------
  210|      6|    return false;
  211|      6|  }
  212|     67|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 65]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     65|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 59, False: 6]
  ------------------
  217|     59|    return false;
  218|     59|  }
  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|     65|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     65|    uint32_t num_points, OutputIteratorT &oit) {
  254|     65|  typedef DecodingStatus Status;
  255|     65|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     65|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     65|  DecodingStatus init_status(num_points, 0, 0);
  258|     65|  std::stack<Status> status_stack;
  259|     65|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  20.5k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 20.5k, False: 6]
  ------------------
  263|  20.5k|    const DecodingStatus status = status_stack.top();
  264|  20.5k|    status_stack.pop();
  265|       |
  266|  20.5k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  20.5k|    const uint32_t last_axis = status.last_axis;
  268|  20.5k|    const uint32_t stack_pos = status.stack_pos;
  269|  20.5k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  20.5k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  20.5k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 20.5k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  20.5k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  20.5k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 20.5k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  20.5k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  20.5k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 3.87k, False: 16.6k]
  ------------------
  285|  23.1M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 23.1M, False: 3.87k]
  ------------------
  286|  23.1M|        *oit = old_base;
  287|  23.1M|        ++oit;
  288|  23.1M|        ++num_decoded_points_;
  289|  23.1M|      }
  290|  3.87k|      continue;
  291|  3.87k|    }
  292|       |
  293|  16.6k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  16.6k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.41k, False: 15.2k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.41k|      axes_[0] = axis;
  300|  3.53k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.11k, False: 1.41k]
  ------------------
  301|  2.11k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.11k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 427, False: 1.69k]
  |  |  ------------------
  ------------------
  302|  2.11k|      }
  303|  3.80k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.40k, False: 1.39k]
  ------------------
  304|  8.40k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 6.01k, False: 2.38k]
  ------------------
  305|  6.01k|          p_[axes_[j]] = 0;
  306|  6.01k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  6.01k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.95k, False: 2.05k]
  ------------------
  308|  3.95k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 21, False: 3.93k]
  ------------------
  309|  3.95k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     21|              return false;
  311|     21|            }
  312|  3.95k|          }
  313|  5.99k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  5.99k|        }
  315|  2.38k|        *oit = p_;
  316|  2.38k|        ++oit;
  317|  2.38k|        ++num_decoded_points_;
  318|  2.38k|      }
  319|  1.39k|      continue;
  320|  1.41k|    }
  321|       |
  322|  15.2k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 15.2k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  15.2k|    const int num_remaining_bits = bit_length_ - level;
  327|  15.2k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  15.2k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  15.2k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  15.2k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  15.2k|    uint32_t number = 0;
  334|  15.2k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  15.2k|    uint32_t first_half = num_remaining_points / 2;
  337|  15.2k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 38, False: 15.2k]
  ------------------
  338|       |      // Invalid |number|.
  339|     38|      return false;
  340|     38|    }
  341|  15.2k|    first_half -= number;
  342|  15.2k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  15.2k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 12.8k, False: 2.39k]
  ------------------
  345|  12.8k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 11.1k, False: 1.70k]
  ------------------
  346|  11.1k|        std::swap(first_half, second_half);
  347|  11.1k|      }
  348|  12.8k|    }
  349|       |
  350|  15.2k|    levels_stack_[stack_pos][axis] += 1;
  351|  15.2k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  15.2k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 14.2k, False: 934]
  ------------------
  353|  14.2k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  14.2k|    }
  355|  15.2k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 6.84k, False: 8.38k]
  ------------------
  356|  6.84k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  6.84k|    }
  358|  15.2k|  }
  359|      6|  return true;
  360|     65|}
_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.11M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.11M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.11M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  118|     12|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    123|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    123|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 120]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|    120|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 9, False: 111]
  ------------------
  190|      9|    return false;
  191|      9|  }
  192|    111|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 110]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    110|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 19, False: 91]
  ------------------
  196|     19|    return true;
  197|     19|  }
  198|     91|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 18, False: 73]
  ------------------
  199|     18|    return false;
  200|     18|  }
  201|     73|  num_decoded_points_ = 0;
  202|       |
  203|     73|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 13, False: 60]
  ------------------
  204|     13|    return false;
  205|     13|  }
  206|     60|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 59]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     59|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 58]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     58|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 58]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     58|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 24, False: 34]
  ------------------
  217|     24|    return false;
  218|     24|  }
  219|       |
  220|     34|  numbers_decoder_.EndDecoding();
  221|     34|  remaining_bits_decoder_.EndDecoding();
  222|     34|  axis_decoder_.EndDecoding();
  223|     34|  half_decoder_.EndDecoding();
  224|       |
  225|     34|  return true;
  226|     58|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     58|    uint32_t num_points, OutputIteratorT &oit) {
  254|     58|  typedef DecodingStatus Status;
  255|     58|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     58|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     58|  DecodingStatus init_status(num_points, 0, 0);
  258|     58|  std::stack<Status> status_stack;
  259|     58|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.31M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.31M, False: 34]
  ------------------
  263|  1.31M|    const DecodingStatus status = status_stack.top();
  264|  1.31M|    status_stack.pop();
  265|       |
  266|  1.31M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.31M|    const uint32_t last_axis = status.last_axis;
  268|  1.31M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.31M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.31M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.31M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.31M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.31M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.31M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.31M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.31M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.31M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 589k, False: 721k]
  ------------------
  285|  54.0M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 53.4M, False: 589k]
  ------------------
  286|  53.4M|        *oit = old_base;
  287|  53.4M|        ++oit;
  288|  53.4M|        ++num_decoded_points_;
  289|  53.4M|      }
  290|   589k|      continue;
  291|   589k|    }
  292|       |
  293|   721k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   721k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 45.6k, False: 676k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  45.6k|      axes_[0] = axis;
  300|  73.1k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 27.5k, False: 45.6k]
  ------------------
  301|  27.5k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  27.5k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 8.67k, False: 18.8k]
  |  |  ------------------
  ------------------
  302|  27.5k|      }
  303|   116k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 70.9k, False: 45.5k]
  ------------------
  304|   179k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 108k, False: 70.9k]
  ------------------
  305|   108k|          p_[axes_[j]] = 0;
  306|   108k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   108k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 93.0k, False: 15.2k]
  ------------------
  308|  93.0k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 21, False: 93.0k]
  ------------------
  309|  93.0k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     21|              return false;
  311|     21|            }
  312|  93.0k|          }
  313|   108k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   108k|        }
  315|  70.9k|        *oit = p_;
  316|  70.9k|        ++oit;
  317|  70.9k|        ++num_decoded_points_;
  318|  70.9k|      }
  319|  45.5k|      continue;
  320|  45.6k|    }
  321|       |
  322|   676k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 676k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   676k|    const int num_remaining_bits = bit_length_ - level;
  327|   676k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   676k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   676k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   676k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   676k|    uint32_t number = 0;
  334|   676k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   676k|    uint32_t first_half = num_remaining_points / 2;
  337|   676k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 3, False: 676k]
  ------------------
  338|       |      // Invalid |number|.
  339|      3|      return false;
  340|      3|    }
  341|   676k|    first_half -= number;
  342|   676k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   676k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 642k, False: 33.9k]
  ------------------
  345|   642k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 616k, False: 25.6k]
  ------------------
  346|   616k|        std::swap(first_half, second_half);
  347|   616k|      }
  348|   642k|    }
  349|       |
  350|   676k|    levels_stack_[stack_pos][axis] += 1;
  351|   676k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   676k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 666k, False: 9.24k]
  ------------------
  353|   666k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   666k|    }
  355|   676k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 644k, False: 31.9k]
  ------------------
  356|   644k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   644k|    }
  358|   676k|  }
  359|     34|  return true;
  360|     58|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  134|  1.31M|        : num_remaining_points(num_remaining_points_),
  135|  1.31M|          last_axis(last_axis_),
  136|  1.31M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|   676k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   676k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   676k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     52|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|    172|      : bit_length_(0),
   87|    172|        num_points_(0),
   88|    172|        num_decoded_points_(0),
   89|    172|        dimension_(dimension),
   90|    172|        p_(dimension, 0),
   91|    172|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    172|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    172|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    117|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    117|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 114]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|    114|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 6, False: 108]
  ------------------
  190|      6|    return false;
  191|      6|  }
  192|    108|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 107]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    107|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 2, False: 105]
  ------------------
  196|      2|    return true;
  197|      2|  }
  198|    105|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 10, False: 95]
  ------------------
  199|     10|    return false;
  200|     10|  }
  201|     95|  num_decoded_points_ = 0;
  202|       |
  203|     95|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 20, False: 75]
  ------------------
  204|     20|    return false;
  205|     20|  }
  206|     75|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 75]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     75|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 72]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     72|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 70]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     70|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 47, False: 23]
  ------------------
  217|     47|    return false;
  218|     47|  }
  219|       |
  220|     23|  numbers_decoder_.EndDecoding();
  221|     23|  remaining_bits_decoder_.EndDecoding();
  222|     23|  axis_decoder_.EndDecoding();
  223|     23|  half_decoder_.EndDecoding();
  224|       |
  225|     23|  return true;
  226|     70|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     70|    uint32_t num_points, OutputIteratorT &oit) {
  254|     70|  typedef DecodingStatus Status;
  255|     70|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     70|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     70|  DecodingStatus init_status(num_points, 0, 0);
  258|     70|  std::stack<Status> status_stack;
  259|     70|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.03M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.03M, False: 23]
  ------------------
  263|  2.03M|    const DecodingStatus status = status_stack.top();
  264|  2.03M|    status_stack.pop();
  265|       |
  266|  2.03M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.03M|    const uint32_t last_axis = status.last_axis;
  268|  2.03M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.03M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.03M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.03M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.03M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.03M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.03M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.03M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.03M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.03M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 917k, False: 1.11M]
  ------------------
  285|   103M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 102M, False: 917k]
  ------------------
  286|   102M|        *oit = old_base;
  287|   102M|        ++oit;
  288|   102M|        ++num_decoded_points_;
  289|   102M|      }
  290|   917k|      continue;
  291|   917k|    }
  292|       |
  293|  1.11M|    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.11M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 66.9k, False: 1.04M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  66.9k|      axes_[0] = axis;
  300|   196k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 129k, False: 66.9k]
  ------------------
  301|   129k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   129k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 11.9k, False: 118k]
  |  |  ------------------
  ------------------
  302|   129k|      }
  303|   162k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 95.3k, False: 66.9k]
  ------------------
  304|   408k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 313k, False: 95.3k]
  ------------------
  305|   313k|          p_[axes_[j]] = 0;
  306|   313k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   313k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 124k, False: 189k]
  ------------------
  308|   124k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 46, False: 124k]
  ------------------
  309|   124k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     46|              return false;
  311|     46|            }
  312|   124k|          }
  313|   313k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   313k|        }
  315|  95.3k|        *oit = p_;
  316|  95.3k|        ++oit;
  317|  95.3k|        ++num_decoded_points_;
  318|  95.3k|      }
  319|  66.9k|      continue;
  320|  66.9k|    }
  321|       |
  322|  1.04M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.04M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.04M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.04M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.04M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.04M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.04M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.04M|    uint32_t number = 0;
  334|  1.04M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.04M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.04M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 1.04M]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|  1.04M|    first_half -= number;
  342|  1.04M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.04M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.02M, False: 19.0k]
  ------------------
  345|  1.02M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 996k, False: 33.2k]
  ------------------
  346|   996k|        std::swap(first_half, second_half);
  347|   996k|      }
  348|  1.02M|    }
  349|       |
  350|  1.04M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.04M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.04M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.04M, False: 8.08k]
  ------------------
  353|  1.04M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.04M|    }
  355|  1.04M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 992k, False: 55.7k]
  ------------------
  356|   992k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   992k|    }
  358|  1.04M|  }
  359|     23|  return true;
  360|     70|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  134|  2.03M|        : num_remaining_points(num_remaining_points_),
  135|  2.03M|          last_axis(last_axis_),
  136|  2.03M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.03M|    uint32_t last_axis) {
  232|  2.03M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.03M, Folded]
  ------------------
  233|  2.03M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.03M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 733k, False: 1.30M]
  |  |  ------------------
  ------------------
  234|  2.03M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  2.03M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|  1.04M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.04M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.04M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     25|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    126|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    126|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 123]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|    123|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 6, False: 117]
  ------------------
  190|      6|    return false;
  191|      6|  }
  192|    117|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 115]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|    115|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 35, False: 80]
  ------------------
  196|     35|    return true;
  197|     35|  }
  198|     80|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 11, False: 69]
  ------------------
  199|     11|    return false;
  200|     11|  }
  201|     69|  num_decoded_points_ = 0;
  202|       |
  203|     69|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 31, False: 38]
  ------------------
  204|     31|    return false;
  205|     31|  }
  206|     38|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 36]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     36|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 35]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     35|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 35]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     35|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 25, False: 10]
  ------------------
  217|     25|    return false;
  218|     25|  }
  219|       |
  220|     10|  numbers_decoder_.EndDecoding();
  221|     10|  remaining_bits_decoder_.EndDecoding();
  222|     10|  axis_decoder_.EndDecoding();
  223|     10|  half_decoder_.EndDecoding();
  224|       |
  225|     10|  return true;
  226|     35|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     35|    uint32_t num_points, OutputIteratorT &oit) {
  254|     35|  typedef DecodingStatus Status;
  255|     35|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     35|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     35|  DecodingStatus init_status(num_points, 0, 0);
  258|     35|  std::stack<Status> status_stack;
  259|     35|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  84.0k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 84.0k, False: 10]
  ------------------
  263|  84.0k|    const DecodingStatus status = status_stack.top();
  264|  84.0k|    status_stack.pop();
  265|       |
  266|  84.0k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  84.0k|    const uint32_t last_axis = status.last_axis;
  268|  84.0k|    const uint32_t stack_pos = status.stack_pos;
  269|  84.0k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  84.0k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  84.0k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 84.0k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  84.0k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  84.0k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 7, False: 84.0k]
  ------------------
  278|      7|      return false;
  279|      7|    }
  280|       |
  281|  84.0k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  84.0k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 78, False: 83.9k]
  ------------------
  285|  2.16M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 2.16M, False: 78]
  ------------------
  286|  2.16M|        *oit = old_base;
  287|  2.16M|        ++oit;
  288|  2.16M|        ++num_decoded_points_;
  289|  2.16M|      }
  290|     78|      continue;
  291|     78|    }
  292|       |
  293|  83.9k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  83.9k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 116, False: 83.8k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    116|      axes_[0] = axis;
  300|  5.95k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 5.84k, False: 116]
  ------------------
  301|  5.84k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  5.84k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 93, False: 5.74k]
  |  |  ------------------
  ------------------
  302|  5.84k|      }
  303|    264|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 157, False: 107]
  ------------------
  304|  7.45k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 7.31k, False: 148]
  ------------------
  305|  7.31k|          p_[axes_[j]] = 0;
  306|  7.31k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  7.31k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 7.12k, False: 190]
  ------------------
  308|  7.12k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 9, False: 7.11k]
  ------------------
  309|  7.12k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      9|              return false;
  311|      9|            }
  312|  7.12k|          }
  313|  7.30k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  7.30k|        }
  315|    148|        *oit = p_;
  316|    148|        ++oit;
  317|    148|        ++num_decoded_points_;
  318|    148|      }
  319|    107|      continue;
  320|    116|    }
  321|       |
  322|  83.8k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 83.8k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  83.8k|    const int num_remaining_bits = bit_length_ - level;
  327|  83.8k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  83.8k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  83.8k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  83.8k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  83.8k|    uint32_t number = 0;
  334|  83.8k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  83.8k|    uint32_t first_half = num_remaining_points / 2;
  337|  83.8k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 9, False: 83.8k]
  ------------------
  338|       |      // Invalid |number|.
  339|      9|      return false;
  340|      9|    }
  341|  83.8k|    first_half -= number;
  342|  83.8k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  83.8k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 83.8k, False: 10]
  ------------------
  345|  83.8k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 69.3k, False: 14.4k]
  ------------------
  346|  69.3k|        std::swap(first_half, second_half);
  347|  69.3k|      }
  348|  83.8k|    }
  349|       |
  350|  83.8k|    levels_stack_[stack_pos][axis] += 1;
  351|  83.8k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  83.8k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 69.4k, False: 14.4k]
  ------------------
  353|  69.4k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  69.4k|    }
  355|  83.8k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 14.6k, False: 69.1k]
  ------------------
  356|  14.6k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  14.6k|    }
  358|  83.8k|  }
  359|     10|  return true;
  360|     35|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  134|  84.0k|        : num_remaining_points(num_remaining_points_),
  135|  84.0k|          last_axis(last_axis_),
  136|  84.0k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|  83.8k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  83.8k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  83.8k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     44|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|    141|      : bit_length_(0),
   87|    141|        num_points_(0),
   88|    141|        num_decoded_points_(0),
   89|    141|        dimension_(dimension),
   90|    141|        p_(dimension, 0),
   91|    141|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    141|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    141|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     83|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     83|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     83|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|    228|      : bit_length_(0),
   87|    228|        num_points_(0),
   88|    228|        num_decoded_points_(0),
   89|    228|        dimension_(dimension),
   90|    228|        p_(dimension, 0),
   91|    228|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    228|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    228|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     89|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     89|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     89|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     94|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     94|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     94|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|    231|      : bit_length_(0),
   87|    231|        num_points_(0),
   88|    231|        num_decoded_points_(0),
   89|    231|        dimension_(dimension),
   90|    231|        p_(dimension, 0),
   91|    231|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    231|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    231|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     81|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     81|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     81|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      6|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      6|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      6|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|    147|      : bit_length_(0),
   87|    147|        num_points_(0),
   88|    147|        num_decoded_points_(0),
   89|    147|        dimension_(dimension),
   90|    147|        p_(dimension, 0),
   91|    147|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    147|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    147|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      4|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      4|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      4|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      4|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      4|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      4|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  3.49M|    uint32_t last_axis) {
  232|  3.49M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 3.49M, Folded]
  ------------------
  233|  3.49M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  3.49M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 3.24M, False: 246k]
  |  |  ------------------
  ------------------
  234|  3.49M|  }
  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.49M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  4.23M|    uint32_t last_axis) {
  232|  4.23M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 4.23M, Folded]
  ------------------
  233|  4.23M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.23M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.20M, False: 3.02M]
  |  |  ------------------
  ------------------
  234|  4.23M|  }
  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.23M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  1.31M|    uint32_t last_axis) {
  232|  1.31M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 1.31M, Folded]
  ------------------
  233|  1.31M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  1.31M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.18M, False: 127k]
  |  |  ------------------
  ------------------
  234|  1.31M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  1.31M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  84.0k|    uint32_t last_axis) {
  232|  84.0k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded, False: 84.0k]
  ------------------
  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|  84.0k|  uint32_t best_axis = 0;
  237|  84.0k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 83.9k, False: 87]
  ------------------
  238|  11.1M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 11.0M, False: 83.9k]
  ------------------
  239|  11.0M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 82.9k, False: 10.9M]
  ------------------
  240|  82.9k|        best_axis = axis;
  241|  82.9k|      }
  242|  11.0M|    }
  243|  83.9k|  } else {
  244|     87|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|     87|  }
  246|       |
  247|  84.0k|  return best_axis;
  248|  84.0k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     98|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     98|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     98|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     98|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     98|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 95]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|     95|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 12, False: 83]
  ------------------
  190|     12|    return false;
  191|     12|  }
  192|     83|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 82]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     82|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 81]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     81|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 81]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     81|  num_decoded_points_ = 0;
  202|       |
  203|     81|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 21, False: 60]
  ------------------
  204|     21|    return false;
  205|     21|  }
  206|     60|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 56]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     56|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 55]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     55|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 54]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     54|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 40, False: 14]
  ------------------
  217|     40|    return false;
  218|     40|  }
  219|       |
  220|     14|  numbers_decoder_.EndDecoding();
  221|     14|  remaining_bits_decoder_.EndDecoding();
  222|     14|  axis_decoder_.EndDecoding();
  223|     14|  half_decoder_.EndDecoding();
  224|       |
  225|     14|  return true;
  226|     54|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     54|    uint32_t num_points, OutputIteratorT &oit) {
  254|     54|  typedef DecodingStatus Status;
  255|     54|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     54|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     54|  DecodingStatus init_status(num_points, 0, 0);
  258|     54|  std::stack<Status> status_stack;
  259|     54|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   330k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 330k, False: 14]
  ------------------
  263|   330k|    const DecodingStatus status = status_stack.top();
  264|   330k|    status_stack.pop();
  265|       |
  266|   330k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   330k|    const uint32_t last_axis = status.last_axis;
  268|   330k|    const uint32_t stack_pos = status.stack_pos;
  269|   330k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   330k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   330k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 330k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   330k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   330k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 330k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   330k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   330k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 164k, False: 166k]
  ------------------
  285|  73.2M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 73.0M, False: 164k]
  ------------------
  286|  73.0M|        *oit = old_base;
  287|  73.0M|        ++oit;
  288|  73.0M|        ++num_decoded_points_;
  289|  73.0M|      }
  290|   164k|      continue;
  291|   164k|    }
  292|       |
  293|   166k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   166k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 604, False: 165k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    604|      axes_[0] = axis;
  300|  1.81k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.20k, False: 604]
  ------------------
  301|  1.20k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.20k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 247, False: 961]
  |  |  ------------------
  ------------------
  302|  1.20k|      }
  303|  1.59k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.01k, False: 580]
  ------------------
  304|  3.98k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 2.99k, False: 986]
  ------------------
  305|  2.99k|          p_[axes_[j]] = 0;
  306|  2.99k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  2.99k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.70k, False: 1.28k]
  ------------------
  308|  1.70k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 24, False: 1.68k]
  ------------------
  309|  1.70k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     24|              return false;
  311|     24|            }
  312|  1.70k|          }
  313|  2.97k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  2.97k|        }
  315|    986|        *oit = p_;
  316|    986|        ++oit;
  317|    986|        ++num_decoded_points_;
  318|    986|      }
  319|    580|      continue;
  320|    604|    }
  321|       |
  322|   165k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 165k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   165k|    const int num_remaining_bits = bit_length_ - level;
  327|   165k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   165k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   165k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   165k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   165k|    uint32_t number = 0;
  334|   165k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   165k|    uint32_t first_half = num_remaining_points / 2;
  337|   165k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 16, False: 165k]
  ------------------
  338|       |      // Invalid |number|.
  339|     16|      return false;
  340|     16|    }
  341|   165k|    first_half -= number;
  342|   165k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   165k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 91.8k, False: 73.6k]
  ------------------
  345|  91.8k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 91.0k, False: 808]
  ------------------
  346|  91.0k|        std::swap(first_half, second_half);
  347|  91.0k|      }
  348|  91.8k|    }
  349|       |
  350|   165k|    levels_stack_[stack_pos][axis] += 1;
  351|   165k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   165k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 165k, False: 51]
  ------------------
  353|   165k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   165k|    }
  355|   165k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 165k, False: 84]
  ------------------
  356|   165k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   165k|    }
  358|   165k|  }
  359|     14|  return true;
  360|     54|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     75|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     75|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     75|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     75|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     75|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 74]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     74|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 8, False: 66]
  ------------------
  190|      8|    return false;
  191|      8|  }
  192|     66|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 65]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     65|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 64]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     64|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 64]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     64|  num_decoded_points_ = 0;
  202|       |
  203|     64|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 12, False: 52]
  ------------------
  204|     12|    return false;
  205|     12|  }
  206|     52|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 50]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     50|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 48]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     48|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 48]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     48|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 35, False: 13]
  ------------------
  217|     35|    return false;
  218|     35|  }
  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|     48|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     48|    uint32_t num_points, OutputIteratorT &oit) {
  254|     48|  typedef DecodingStatus Status;
  255|     48|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     48|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     48|  DecodingStatus init_status(num_points, 0, 0);
  258|     48|  std::stack<Status> status_stack;
  259|     48|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.37M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.37M, False: 13]
  ------------------
  263|  1.37M|    const DecodingStatus status = status_stack.top();
  264|  1.37M|    status_stack.pop();
  265|       |
  266|  1.37M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.37M|    const uint32_t last_axis = status.last_axis;
  268|  1.37M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.37M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.37M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.37M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.37M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.37M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.37M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.37M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.37M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.37M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 687k, False: 689k]
  ------------------
  285|  39.9M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 39.2M, False: 687k]
  ------------------
  286|  39.2M|        *oit = old_base;
  287|  39.2M|        ++oit;
  288|  39.2M|        ++num_decoded_points_;
  289|  39.2M|      }
  290|   687k|      continue;
  291|   687k|    }
  292|       |
  293|   689k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   689k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 797, False: 688k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    797|      axes_[0] = axis;
  300|  2.39k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.59k, False: 797]
  ------------------
  301|  1.59k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.59k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 215, False: 1.37k]
  |  |  ------------------
  ------------------
  302|  1.59k|      }
  303|  2.08k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.30k, False: 773]
  ------------------
  304|  5.17k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 3.89k, False: 1.28k]
  ------------------
  305|  3.89k|          p_[axes_[j]] = 0;
  306|  3.89k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  3.89k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.97k, False: 1.91k]
  ------------------
  308|  1.97k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 24, False: 1.95k]
  ------------------
  309|  1.97k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     24|              return false;
  311|     24|            }
  312|  1.97k|          }
  313|  3.86k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  3.86k|        }
  315|  1.28k|        *oit = p_;
  316|  1.28k|        ++oit;
  317|  1.28k|        ++num_decoded_points_;
  318|  1.28k|      }
  319|    773|      continue;
  320|    797|    }
  321|       |
  322|   688k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 688k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   688k|    const int num_remaining_bits = bit_length_ - level;
  327|   688k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   688k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   688k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   688k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   688k|    uint32_t number = 0;
  334|   688k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   688k|    uint32_t first_half = num_remaining_points / 2;
  337|   688k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 11, False: 688k]
  ------------------
  338|       |      // Invalid |number|.
  339|     11|      return false;
  340|     11|    }
  341|   688k|    first_half -= number;
  342|   688k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   688k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 363k, False: 325k]
  ------------------
  345|   363k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 363k, False: 355]
  ------------------
  346|   363k|        std::swap(first_half, second_half);
  347|   363k|      }
  348|   363k|    }
  349|       |
  350|   688k|    levels_stack_[stack_pos][axis] += 1;
  351|   688k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   688k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 688k, False: 15]
  ------------------
  353|   688k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   688k|    }
  355|   688k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 688k, False: 44]
  ------------------
  356|   688k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   688k|    }
  358|   688k|  }
  359|     13|  return true;
  360|     48|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     87|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     87|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     87|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     87|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     87|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 86]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     86|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 5, False: 81]
  ------------------
  190|      5|    return false;
  191|      5|  }
  192|     81|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 81]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     81|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 80]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     80|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 80]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     80|  num_decoded_points_ = 0;
  202|       |
  203|     80|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 30, False: 50]
  ------------------
  204|     30|    return false;
  205|     30|  }
  206|     50|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 48]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     48|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 46]
  ------------------
  210|      2|    return false;
  211|      2|  }
  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: 41, False: 3]
  ------------------
  217|     41|    return false;
  218|     41|  }
  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|     44|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  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|  4.20M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 4.20M, False: 3]
  ------------------
  263|  4.20M|    const DecodingStatus status = status_stack.top();
  264|  4.20M|    status_stack.pop();
  265|       |
  266|  4.20M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  4.20M|    const uint32_t last_axis = status.last_axis;
  268|  4.20M|    const uint32_t stack_pos = status.stack_pos;
  269|  4.20M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  4.20M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  4.20M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 4.20M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  4.20M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  4.20M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 4.20M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  4.20M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  4.20M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.10M, False: 2.10M]
  ------------------
  285|  9.48M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 7.37M, False: 2.10M]
  ------------------
  286|  7.37M|        *oit = old_base;
  287|  7.37M|        ++oit;
  288|  7.37M|        ++num_decoded_points_;
  289|  7.37M|      }
  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: 380, False: 2.10M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    380|      axes_[0] = axis;
  300|  1.14k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 760, False: 380]
  ------------------
  301|    760|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    760|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 160, False: 600]
  |  |  ------------------
  ------------------
  302|    760|      }
  303|  1.01k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 647, False: 369]
  ------------------
  304|  2.56k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 1.92k, False: 636]
  ------------------
  305|  1.92k|          p_[axes_[j]] = 0;
  306|  1.92k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  1.92k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.25k, False: 671]
  ------------------
  308|  1.25k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 11, False: 1.24k]
  ------------------
  309|  1.25k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     11|              return false;
  311|     11|            }
  312|  1.25k|          }
  313|  1.91k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  1.91k|        }
  315|    636|        *oit = p_;
  316|    636|        ++oit;
  317|    636|        ++num_decoded_points_;
  318|    636|      }
  319|    369|      continue;
  320|    380|    }
  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: 30, False: 2.10M]
  ------------------
  338|       |      // Invalid |number|.
  339|     30|      return false;
  340|     30|    }
  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: 724k, False: 1.38M]
  ------------------
  345|   724k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 723k, False: 1.28k]
  ------------------
  346|   723k|        std::swap(first_half, second_half);
  347|   723k|      }
  348|   724k|    }
  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: 63]
  ------------------
  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: 84]
  ------------------
  356|  2.10M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.10M|    }
  358|  2.10M|  }
  359|      3|  return true;
  360|     44|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|    109|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    109|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    109|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|    109|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    109|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 108]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    108|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 15, False: 93]
  ------------------
  190|     15|    return false;
  191|     15|  }
  192|     93|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 91]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|     91|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 91]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     91|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 91]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     91|  num_decoded_points_ = 0;
  202|       |
  203|     91|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 34, False: 57]
  ------------------
  204|     34|    return false;
  205|     34|  }
  206|     57|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 55]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     55|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 53]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     53|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 52]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     52|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 50, False: 2]
  ------------------
  217|     50|    return false;
  218|     50|  }
  219|       |
  220|      2|  numbers_decoder_.EndDecoding();
  221|      2|  remaining_bits_decoder_.EndDecoding();
  222|      2|  axis_decoder_.EndDecoding();
  223|      2|  half_decoder_.EndDecoding();
  224|       |
  225|      2|  return true;
  226|     52|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     52|    uint32_t num_points, OutputIteratorT &oit) {
  254|     52|  typedef DecodingStatus Status;
  255|     52|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     52|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     52|  DecodingStatus init_status(num_points, 0, 0);
  258|     52|  std::stack<Status> status_stack;
  259|     52|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  4.20M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 4.20M, False: 2]
  ------------------
  263|  4.20M|    const DecodingStatus status = status_stack.top();
  264|  4.20M|    status_stack.pop();
  265|       |
  266|  4.20M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  4.20M|    const uint32_t last_axis = status.last_axis;
  268|  4.20M|    const uint32_t stack_pos = status.stack_pos;
  269|  4.20M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  4.20M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  4.20M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 4.20M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  4.20M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  4.20M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 4.20M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  4.20M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  4.20M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.10M, False: 2.10M]
  ------------------
  285|  9.28M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 7.17M, False: 2.10M]
  ------------------
  286|  7.17M|        *oit = old_base;
  287|  7.17M|        ++oit;
  288|  7.17M|        ++num_decoded_points_;
  289|  7.17M|      }
  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: 794, False: 2.10M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    794|      axes_[0] = axis;
  300|  2.38k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.58k, False: 794]
  ------------------
  301|  1.58k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.58k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 493, False: 1.09k]
  |  |  ------------------
  ------------------
  302|  1.58k|      }
  303|  2.15k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.37k, False: 778]
  ------------------
  304|  5.45k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 4.09k, False: 1.35k]
  ------------------
  305|  4.09k|          p_[axes_[j]] = 0;
  306|  4.09k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  4.09k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.33k, False: 768]
  ------------------
  308|  3.33k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 16, False: 3.31k]
  ------------------
  309|  3.33k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     16|              return false;
  311|     16|            }
  312|  3.33k|          }
  313|  4.08k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  4.08k|        }
  315|  1.35k|        *oit = p_;
  316|  1.35k|        ++oit;
  317|  1.35k|        ++num_decoded_points_;
  318|  1.35k|      }
  319|    778|      continue;
  320|    794|    }
  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: 34, False: 2.10M]
  ------------------
  338|       |      // Invalid |number|.
  339|     34|      return false;
  340|     34|    }
  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: 724k, False: 1.37M]
  ------------------
  345|   724k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 723k, False: 799]
  ------------------
  346|   723k|        std::swap(first_half, second_half);
  347|   723k|      }
  348|   724k|    }
  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: 27]
  ------------------
  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: 55]
  ------------------
  356|  2.10M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.10M|    }
  358|  2.10M|  }
  359|      2|  return true;
  360|     52|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     49|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     49|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     49|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     49|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     49|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 48]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     48|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 10, False: 38]
  ------------------
  190|     10|    return false;
  191|     10|  }
  192|     38|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 38]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     38|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 5, False: 33]
  ------------------
  196|      5|    return true;
  197|      5|  }
  198|     33|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 33]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     33|  num_decoded_points_ = 0;
  202|       |
  203|     33|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 33, False: 0]
  ------------------
  204|     33|    return false;
  205|     33|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     30|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     30|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     30|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     30|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     30|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 29]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     29|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 8, False: 21]
  ------------------
  190|      8|    return false;
  191|      8|  }
  192|     21|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 20]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     20|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 19]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     19|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 19]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     19|  num_decoded_points_ = 0;
  202|       |
  203|     19|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 19, False: 0]
  ------------------
  204|     19|    return false;
  205|     19|  }
  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|     15|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     15|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     15|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     15|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 14]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     14|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 11]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|     11|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 10]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     10|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 9]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|      9|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 9]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      9|  num_decoded_points_ = 0;
  202|       |
  203|      9|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 9, False: 0]
  ------------------
  204|      9|    return false;
  205|      9|  }
  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|    518|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|    518|  qinfo_.quantization_bits = 0;
   67|    518|  qinfo_.range = 0;
   68|    518|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|    492|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|    492|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 1, False: 491]
  ------------------
   73|      1|    return false;
   74|      1|  }
   75|    491|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 2, False: 489]
  ------------------
   76|      2|    return false;
   77|      2|  }
   78|    489|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 1, False: 488]
  ------------------
   79|      1|    return false;
   80|      1|  }
   81|    488|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 1, False: 487]
  ------------------
   82|      1|    return false;
   83|      1|  }
   84|    487|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 26, False: 461]
  |  Branch (84:38): [True: 12, False: 14]
  ------------------
   85|     12|    return false;
   86|     12|  }
   87|    475|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 2, False: 473]
  ------------------
   88|      2|    return false;
   89|      2|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|    473|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 8, False: 465]
  ------------------
   93|      8|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|      8|#define DRACO_LOGE printf
  ------------------
   94|      8|               compression_level_);
   95|      8|    return false;
   96|      8|  }
   97|       |
   98|    465|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|    465|      std::back_inserter(*qpoints);
  100|    465|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|    465|                           Converter>
  102|    465|      oit(oit_qpoints);
  103|    465|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 463, False: 2]
  ------------------
  104|    463|    qpoints->reserve(num_points_);
  105|    463|    switch (compression_level_) {
  106|     98|      case 0: {
  ------------------
  |  Branch (106:7): [True: 98, False: 365]
  ------------------
  107|     98|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|     98|        qpoints_decoder.DecodePoints(buffer, oit);
  109|     98|        break;
  110|      0|      }
  111|     75|      case 1: {
  ------------------
  |  Branch (111:7): [True: 75, False: 388]
  ------------------
  112|     75|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|     75|        qpoints_decoder.DecodePoints(buffer, oit);
  114|     75|        break;
  115|      0|      }
  116|     87|      case 2: {
  ------------------
  |  Branch (116:7): [True: 87, False: 376]
  ------------------
  117|     87|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|     87|        qpoints_decoder.DecodePoints(buffer, oit);
  119|     87|        break;
  120|      0|      }
  121|    109|      case 3: {
  ------------------
  |  Branch (121:7): [True: 109, False: 354]
  ------------------
  122|    109|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|    109|        qpoints_decoder.DecodePoints(buffer, oit);
  124|    109|        break;
  125|      0|      }
  126|     49|      case 4: {
  ------------------
  |  Branch (126:7): [True: 49, False: 414]
  ------------------
  127|     49|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     49|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     49|        break;
  130|      0|      }
  131|     30|      case 5: {
  ------------------
  |  Branch (131:7): [True: 30, False: 433]
  ------------------
  132|     30|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|     30|        qpoints_decoder.DecodePoints(buffer, oit);
  134|     30|        break;
  135|      0|      }
  136|     15|      case 6: {
  ------------------
  |  Branch (136:7): [True: 15, False: 448]
  ------------------
  137|     15|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|     15|        qpoints_decoder.DecodePoints(buffer, oit);
  139|     15|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 463]
  ------------------
  142|      0|        return false;
  143|    463|    }
  144|    463|  }
  145|       |
  146|    465|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 453, False: 12]
  ------------------
  147|    453|    return false;
  148|    453|  }
  149|     12|  return true;
  150|    465|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|    465|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|   126M|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|   126M|  const Self &operator=(const SourceType &source) {
   56|   126M|    *oit_ = Converter()(source);
   57|   126M|    return *this;
   58|   126M|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|   126M|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|   126M|    return Point3ui(v[0], v[1], v[2]);
   31|   126M|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|   126M|  const Self &operator++() {
   46|   126M|    ++oit_;
   47|   126M|    return *this;
   48|   126M|  }

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

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

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

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

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

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

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

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

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

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

_ZN5draco13DecoderBufferC2Ev:
   23|  36.2k|    : data_(nullptr),
   24|  36.2k|      data_size_(0),
   25|  36.2k|      pos_(0),
   26|  36.2k|      bit_mode_(false),
   27|  36.2k|      bitstream_version_(0) {}
_ZN5draco13DecoderBuffer4InitEPKcm:
   29|  11.6k|void DecoderBuffer::Init(const char *data, size_t data_size) {
   30|  11.6k|  Init(data, data_size, bitstream_version_);
   31|  11.6k|}
_ZN5draco13DecoderBuffer4InitEPKcmt:
   33|  20.7k|void DecoderBuffer::Init(const char *data, size_t data_size, uint16_t version) {
   34|  20.7k|  data_ = data;
   35|  20.7k|  data_size_ = data_size;
   36|  20.7k|  bitstream_version_ = version;
   37|  20.7k|  pos_ = 0;
   38|  20.7k|}
_ZN5draco13DecoderBuffer16StartBitDecodingEbPm:
   40|  6.13k|bool DecoderBuffer::StartBitDecoding(bool decode_size, uint64_t *out_size) {
   41|  6.13k|  if (decode_size) {
  ------------------
  |  Branch (41:7): [True: 4.12k, False: 2.01k]
  ------------------
   42|  4.12k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   43|  4.12k|    if (bitstream_version_ < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.12k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (43:9): [True: 925, False: 3.20k]
  ------------------
   44|    925|      if (!Decode(out_size)) {
  ------------------
  |  Branch (44:11): [True: 10, False: 915]
  ------------------
   45|     10|        return false;
   46|     10|      }
   47|    925|    } else
   48|  3.20k|#endif
   49|  3.20k|    {
   50|  3.20k|      if (!DecodeVarint(out_size, this)) {
  ------------------
  |  Branch (50:11): [True: 33, False: 3.16k]
  ------------------
   51|     33|        return false;
   52|     33|      }
   53|  3.20k|    }
   54|  4.12k|  }
   55|  6.09k|  bit_mode_ = true;
   56|  6.09k|  bit_decoder_.reset(data_head(), remaining_size());
   57|  6.09k|  return true;
   58|  6.13k|}
_ZN5draco13DecoderBuffer14EndBitDecodingEv:
   60|  5.18k|void DecoderBuffer::EndBitDecoding() {
   61|  5.18k|  bit_mode_ = false;
   62|  5.18k|  const uint64_t bits_decoded = bit_decoder_.BitsDecoded();
   63|  5.18k|  const uint64_t bytes_decoded = (bits_decoded + 7) / 8;
   64|  5.18k|  pos_ += bytes_decoded;
   65|  5.18k|}
_ZN5draco13DecoderBuffer10BitDecoderC2Ev:
   68|  36.2k|    : bit_buffer_(nullptr), bit_buffer_end_(nullptr), bit_offset_(0) {}
_ZN5draco13DecoderBuffer10BitDecoderD2Ev:
   70|  59.5k|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|   818M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|   818M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 239, False: 818M]
  ------------------
   78|    239|      return false;  // Buffer overflow.
   79|    239|    }
   80|   818M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|   818M|    pos_ += size_to_decode;
   82|   818M|    return true;
   83|   818M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  26.6k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  11.6k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  37.7k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   152k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  5.18k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  13.2M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  3.49M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  6.09k|    inline void reset(const void *b, size_t s) {
  131|  6.09k|      bit_offset_ = 0;
  132|  6.09k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  6.09k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  6.09k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  5.18k|    inline uint64_t BitsDecoded() const {
  138|  5.18k|      return static_cast<uint64_t>(bit_offset_);
  139|  5.18k|    }
_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|  30.3M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 17.0M, False: 13.2M]
  ------------------
  166|  17.0M|        value |= GetBit() << bit;
  167|  17.0M|      }
  168|  13.2M|      *x = value;
  169|  13.2M|      return true;
  170|  13.2M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  17.0M|    inline int GetBit() {
  176|  17.0M|      const size_t off = bit_offset_;
  177|  17.0M|      const size_t byte_offset = off >> 3;
  178|  17.0M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  17.0M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 16.5M, False: 518k]
  ------------------
  180|  16.5M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  16.5M|        bit_offset_ = off + 1;
  182|  16.5M|        return bit;
  183|  16.5M|      }
  184|   518k|      return 0;
  185|  17.0M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  5.45M|  bool Decode(T *out_val) {
   69|  5.45M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 3.33k, False: 5.45M]
  ------------------
   70|  3.33k|      return false;
   71|  3.33k|    }
   72|  5.45M|    pos_ += sizeof(T);
   73|  5.45M|    return true;
   74|  5.45M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  5.45M|  bool Peek(T *out_val) {
   88|  5.45M|    const size_t size_to_decode = sizeof(T);
   89|  5.45M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 3.33k, False: 5.45M]
  ------------------
   90|  3.33k|      return false;  // Buffer overflow.
   91|  3.33k|    }
   92|  5.45M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  5.45M|    return true;
   94|  5.45M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  10.8k|  bool Decode(T *out_val) {
   69|  10.8k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 121, False: 10.6k]
  ------------------
   70|    121|      return false;
   71|    121|    }
   72|  10.6k|    pos_ += sizeof(T);
   73|  10.6k|    return true;
   74|  10.8k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  10.8k|  bool Peek(T *out_val) {
   88|  10.8k|    const size_t size_to_decode = sizeof(T);
   89|  10.8k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 121, False: 10.6k]
  ------------------
   90|    121|      return false;  // Buffer overflow.
   91|    121|    }
   92|  10.6k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  10.6k|    return true;
   94|  10.8k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   155k|  bool Decode(T *out_val) {
   69|   155k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 372, False: 155k]
  ------------------
   70|    372|      return false;
   71|    372|    }
   72|   155k|    pos_ += sizeof(T);
   73|   155k|    return true;
   74|   155k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   155k|  bool Peek(T *out_val) {
   88|   155k|    const size_t size_to_decode = sizeof(T);
   89|   155k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 372, False: 155k]
  ------------------
   90|    372|      return false;  // Buffer overflow.
   91|    372|    }
   92|   155k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   155k|    return true;
   94|   155k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  16.1k|  bool Decode(T *out_val) {
   69|  16.1k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 105, False: 16.0k]
  ------------------
   70|    105|      return false;
   71|    105|    }
   72|  16.0k|    pos_ += sizeof(T);
   73|  16.0k|    return true;
   74|  16.1k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  16.1k|  bool Peek(T *out_val) {
   88|  16.1k|    const size_t size_to_decode = sizeof(T);
   89|  16.1k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 105, False: 16.0k]
  ------------------
   90|    105|      return false;  // Buffer overflow.
   91|    105|    }
   92|  16.0k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  16.0k|    return true;
   94|  16.1k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   436k|  bool Decode(T *out_val) {
   69|   436k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 76, False: 436k]
  ------------------
   70|     76|      return false;
   71|     76|    }
   72|   436k|    pos_ += sizeof(T);
   73|   436k|    return true;
   74|   436k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   436k|  bool Peek(T *out_val) {
   88|   436k|    const size_t size_to_decode = sizeof(T);
   89|   436k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 76, False: 436k]
  ------------------
   90|     76|      return false;  // Buffer overflow.
   91|     76|    }
   92|   436k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   436k|    return true;
   94|   436k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|   101k|  bool Decode(T *out_val) {
   69|   101k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 22, False: 101k]
  ------------------
   70|     22|      return false;
   71|     22|    }
   72|   101k|    pos_ += sizeof(T);
   73|   101k|    return true;
   74|   101k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|   101k|  bool Peek(T *out_val) {
   88|   101k|    const size_t size_to_decode = sizeof(T);
   89|   101k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 22, False: 101k]
  ------------------
   90|     22|      return false;  // Buffer overflow.
   91|     22|    }
   92|   101k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   101k|    return true;
   94|   101k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  1.25k|  bool Decode(T *out_val) {
   69|  1.25k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 45, False: 1.21k]
  ------------------
   70|     45|      return false;
   71|     45|    }
   72|  1.21k|    pos_ += sizeof(T);
   73|  1.21k|    return true;
   74|  1.25k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  1.25k|  bool Peek(T *out_val) {
   88|  1.25k|    const size_t size_to_decode = sizeof(T);
   89|  1.25k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 45, False: 1.21k]
  ------------------
   90|     45|      return false;  // Buffer overflow.
   91|     45|    }
   92|  1.21k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.21k|    return true;
   94|  1.25k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    648|  bool Decode(T *out_val) {
   69|    648|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 8, False: 640]
  ------------------
   70|      8|      return false;
   71|      8|    }
   72|    640|    pos_ += sizeof(T);
   73|    640|    return true;
   74|    648|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    648|  bool Peek(T *out_val) {
   88|    648|    const size_t size_to_decode = sizeof(T);
   89|    648|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 8, False: 640]
  ------------------
   90|      8|      return false;  // Buffer overflow.
   91|      8|    }
   92|    640|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    640|    return true;
   94|    648|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   274M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|  4.78G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  8.58M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  8.58M|    return value_ >= val;
  100|  8.58M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   203M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  2.64G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  19.5M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|  83.9M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  83.9M|    value_ = i.value_;
  153|  83.9M|    return *this;
  154|  83.9M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   906M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   906M|    value_ = i.value_;
  153|   906M|    return *this;
  154|   906M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  19.5M|  inline ThisIndexType &operator++() {
  103|  19.5M|    ++value_;
  104|  19.5M|    return *this;
  105|  19.5M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  1.97G|  constexpr bool operator==(const IndexType &i) const {
   76|  1.97G|    return value_ == i.value_;
   77|  1.97G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   745M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  3.09k|  constexpr bool operator<(const IndexType &i) const {
   88|  3.09k|    return value_ < i.value_;
   89|  3.09k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   104M|  constexpr bool operator==(const IndexType &i) const {
   76|   104M|    return value_ == i.value_;
   77|   104M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   167M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   167M|    return ThisIndexType(value_ - val);
  133|   167M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   581M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   581M|    return ThisIndexType(value_ + val);
  127|   581M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  16.7M|  constexpr bool operator==(const IndexType &i) const {
   76|  16.7M|    return value_ == i.value_;
   77|  16.7M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   191M|  constexpr bool operator!=(const IndexType &i) const {
   82|   191M|    return value_ != i.value_;
   83|   191M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   304M|  constexpr bool operator!=(const IndexType &i) const {
   82|   304M|    return value_ != i.value_;
   83|   304M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   441M|  inline ThisIndexType &operator++() {
  103|   441M|    ++value_;
  104|   441M|    return *this;
  105|   441M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   344M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   344M|    value_ = i.value_;
  153|   344M|    return *this;
  154|   344M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|   821M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   821M|    value_ = i.value_;
  153|   821M|    return *this;
  154|   821M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  32.7M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  32.7M|    return value_ >= val;
  100|  32.7M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  8.75M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|   901M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  15.4G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   156M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  11.4G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   172M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  15.5M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  15.5M|    return ThisIndexType(value_ + val);
  127|  15.5M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   131M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  25.9M|  constexpr bool operator<(const IndexType &i) const {
   88|  25.9M|    return value_ < i.value_;
   89|  25.9M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|  4.88G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   906M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  54.6M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|  4.76G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   428M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  4.54M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  4.54M|    value_ = i.value_;
  153|  4.54M|    return *this;
  154|  4.54M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  8.75M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  8.75M|    value_ += val;
  141|  8.75M|    return *this;
  142|  8.75M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  25.8M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  25.8M|    value_ = val;
  157|  25.8M|    return *this;
  158|  25.8M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|   880M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  6.12M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  6.11M|  inline ThisIndexType &operator++() {
  103|  6.11M|    ++value_;
  104|  6.11M|    return *this;
  105|  6.11M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  20.2M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|  10.1M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|  4.72G|  inline ThisIndexType &operator++() {
  103|  4.72G|    ++value_;
  104|  4.72G|    return *this;
  105|  4.72G|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|  10.1M|  inline ThisIndexType &operator++() {
  103|  10.1M|    ++value_;
  104|  10.1M|    return *this;
  105|  10.1M|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|  4.70G|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  4.70G|    return value_ >= val;
  100|  4.70G|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  30.3M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  30.3M|    return vector_[index.value()];
   75|  30.3M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  20.2M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  10.3k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  13.6k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  53.0M|  inline reference operator[](const IndexTypeT &index) {
   71|  53.0M|    return vector_[index.value()];
   72|  53.0M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  23.9k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  17.1M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  3.07k|  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|  8.58M|  inline reference operator[](const IndexTypeT &index) {
   71|  8.58M|    return vector_[index.value()];
   72|  8.58M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  20.0M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  20.0M|    return vector_[index.value()];
   75|  20.0M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   150M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  12.2M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   271M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   271M|    return vector_[index.value()];
   75|   271M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   656M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   656M|    return vector_[index.value()];
   75|   656M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   310M|  inline reference operator[](const IndexTypeT &index) {
   71|   310M|    return vector_[index.value()];
   72|   310M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  50.7M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  50.7M|    return vector_[index.value()];
   75|  50.7M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   258M|  inline reference operator[](const IndexTypeT &index) {
   71|   258M|    return vector_[index.value()];
   72|   258M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  77.7M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   166M|  inline reference operator[](const IndexTypeT &index) {
   71|   166M|    return vector_[index.value()];
   72|   166M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  1.74k|  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|  45.3k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  1.77M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  42.8k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  5.72k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  5.72k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  5.72k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  5.72k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  11.0k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  11.0k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  11.0k|    vector_.swap(arg.vector_);
   57|  11.0k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  11.0k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  11.0k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  11.0k|    vector_.swap(arg.vector_);
   57|  11.0k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  5.72k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  5.72k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  5.72k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  9.83k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  24.6k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  48.8k|int32_t DataTypeLength(DataType dt) {
   20|  48.8k|  switch (dt) {
   21|  15.8k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 15.8k, False: 33.0k]
  ------------------
   22|  19.1k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 3.30k, False: 45.5k]
  ------------------
   23|  19.1k|      return 1;
   24|  2.85k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 2.85k, False: 46.0k]
  ------------------
   25|  4.04k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 1.18k, False: 47.6k]
  ------------------
   26|  4.04k|      return 2;
   27|  20.6k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 20.6k, False: 28.1k]
  ------------------
   28|  21.9k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 1.22k, False: 47.6k]
  ------------------
   29|  21.9k|      return 4;
   30|    176|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 176, False: 48.6k]
  ------------------
   31|    534|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 358, False: 48.5k]
  ------------------
   32|    534|      return 8;
   33|  3.02k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 3.02k, False: 45.8k]
  ------------------
   34|  3.02k|      return 4;
   35|     82|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 82, False: 48.7k]
  ------------------
   36|     82|      return 8;
   37|    159|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 159, False: 48.7k]
  ------------------
   38|    159|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 48.8k]
  ------------------
   40|      0|      return -1;
   41|  48.8k|  }
   42|  48.8k|}

_ZN5draco7IntSqrtEm:
   31|  2.67k|inline uint64_t IntSqrt(uint64_t number) {
   32|  2.67k|  if (number == 0) {
  ------------------
  |  Branch (32:7): [True: 395, False: 2.27k]
  ------------------
   33|    395|    return 0;
   34|    395|  }
   35|       |  // First estimate good initial value of the square root as log2(number).
   36|  2.27k|  uint64_t act_number = number;
   37|  2.27k|  uint64_t square_root = 1;
   38|  38.8k|  while (act_number >= 2) {
  ------------------
  |  Branch (38:10): [True: 36.5k, False: 2.27k]
  ------------------
   39|       |    // Double the square root until |square_root * square_root > number|.
   40|  36.5k|    square_root *= 2;
   41|  36.5k|    act_number /= 4;
   42|  36.5k|  }
   43|       |  // Perform Newton's (or Babylonian) method to find the true floor(sqrt()).
   44|  5.95k|  do {
   45|       |    // New |square_root| estimate is computed as the average between
   46|       |    // |square_root| and |number / square_root|.
   47|  5.95k|    square_root = (square_root + number / square_root) / 2;
   48|       |
   49|       |    // Note that after the first iteration, the estimate is always going to be
   50|       |    // larger or equal to the true square root value. Therefore to check
   51|       |    // convergence, we can simply detect condition when the square of the
   52|       |    // estimated square root is larger than the input.
   53|  5.95k|  } while (square_root * square_root > number);
  ------------------
  |  Branch (53:12): [True: 3.67k, False: 2.27k]
  ------------------
   54|  2.27k|  return square_root;
   55|  2.67k|}
_ZN5draco13AddAsUnsignedIiTnPNSt3__19enable_ifIXaasr3std11is_integralIT_EE5valuesr3std9is_signedIS3_EE5valueEvE4typeELPv0EEES3_S3_S3_:
   63|  35.1M|inline DataTypeT AddAsUnsigned(DataTypeT a, DataTypeT b) {
   64|  35.1M|  typedef typename std::make_unsigned<DataTypeT>::type DataTypeUT;
   65|  35.1M|  return static_cast<DataTypeT>(static_cast<DataTypeUT>(a) +
   66|  35.1M|                                static_cast<DataTypeUT>(b));
   67|  35.1M|}

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  1.79k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|      9|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  9.83k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|      6|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2ERKNS_6StatusE:
   37|     29|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|  11.6k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|  11.6k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE6statusEv:
   43|     29|  const Status &status() const { return status_; }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  10.5k|  StatusOr(const Status &status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|  11.6k|  T &&value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  1.12k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  1.80k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|      9|  const Status &status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  1.79k|  T &&value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  9.83k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|      6|  const Status &status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  9.83k|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   239k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   239k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 239k, Folded]
  ------------------
   65|   239k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 1.25k, False: 238k]
  ------------------
   66|  1.25k|      return false;
   67|  1.25k|    }
   68|   239k|  } 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|   238k|  return true;
   77|   239k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  85.5k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  85.5k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  85.5k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 52, False: 85.5k]
  ------------------
   33|     52|    return false;
   34|     52|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  85.5k|  uint8_t in;
   39|  85.5k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 785, False: 84.7k]
  ------------------
   40|    785|    return false;
   41|    785|  }
   42|  84.7k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 16.2k, False: 68.4k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  16.2k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 404, False: 15.8k]
  ------------------
   45|    404|      return false;
   46|    404|    }
   47|       |    // Append decoded info from this byte.
   48|  15.8k|    *out_val <<= 7;
   49|  15.8k|    *out_val |= in & ((1 << 7) - 1);
   50|  68.4k|  } else {
   51|       |    // Last byte reached
   52|  68.4k|    *out_val = in;
   53|  68.4k|  }
   54|  84.3k|  return true;
   55|  84.7k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  6.19k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  6.19k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  6.19k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 6.19k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  6.19k|  uint8_t in;
   39|  6.19k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 19, False: 6.17k]
  ------------------
   40|     19|    return false;
   41|     19|  }
   42|  6.17k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 379, False: 5.79k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    379|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 21, False: 358]
  ------------------
   45|     21|      return false;
   46|     21|    }
   47|       |    // Append decoded info from this byte.
   48|    358|    *out_val <<= 7;
   49|    358|    *out_val |= in & ((1 << 7) - 1);
   50|  5.79k|  } else {
   51|       |    // Last byte reached
   52|  5.79k|    *out_val = in;
   53|  5.79k|  }
   54|  6.15k|  return true;
   55|  6.17k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  6.09k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  6.09k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 6.09k, Folded]
  ------------------
   65|  6.09k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 136, False: 5.95k]
  ------------------
   66|    136|      return false;
   67|    136|    }
   68|  6.09k|  } 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|  5.95k|  return true;
   77|  6.09k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  3.45k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.45k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.45k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 3.45k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.45k|  uint8_t in;
   39|  3.45k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 32, False: 3.42k]
  ------------------
   40|     32|    return false;
   41|     32|  }
   42|  3.42k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 254, False: 3.16k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    254|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 28, False: 226]
  ------------------
   45|     28|      return false;
   46|     28|    }
   47|       |    // Append decoded info from this byte.
   48|    226|    *out_val <<= 7;
   49|    226|    *out_val |= in & ((1 << 7) - 1);
   50|  3.16k|  } else {
   51|       |    // Last byte reached
   52|  3.16k|    *out_val = in;
   53|  3.16k|  }
   54|  3.39k|  return true;
   55|  3.42k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   113k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   113k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   113k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 16, False: 113k]
  ------------------
   33|     16|    return false;
   34|     16|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   113k|  uint8_t in;
   39|   113k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 100, False: 113k]
  ------------------
   40|    100|    return false;
   41|    100|  }
   42|   113k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.97k, False: 110k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.97k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 93, False: 2.87k]
  ------------------
   45|     93|      return false;
   46|     93|    }
   47|       |    // Append decoded info from this byte.
   48|  2.87k|    *out_val <<= 7;
   49|  2.87k|    *out_val |= in & ((1 << 7) - 1);
   50|   110k|  } else {
   51|       |    // Last byte reached
   52|   110k|    *out_val = in;
   53|   110k|  }
   54|   113k|  return true;
   55|   113k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  3.41k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  3.41k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 3.41k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  3.41k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  3.41k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  3.41k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 39, False: 3.37k]
  ------------------
   72|     39|      return false;
   73|     39|    }
   74|  3.37k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  3.37k|  }
   76|  3.37k|  return true;
   77|  3.41k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.73k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.73k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.73k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 8, False: 3.72k]
  ------------------
   33|      8|    return false;
   34|      8|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.72k|  uint8_t in;
   39|  3.72k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 31, False: 3.69k]
  ------------------
   40|     31|    return false;
   41|     31|  }
   42|  3.69k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 317, False: 3.37k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    317|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 50, False: 267]
  ------------------
   45|     50|      return false;
   46|     50|    }
   47|       |    // Append decoded info from this byte.
   48|    267|    *out_val <<= 7;
   49|    267|    *out_val |= in & ((1 << 7) - 1);
   50|  3.37k|  } else {
   51|       |    // Last byte reached
   52|  3.37k|    *out_val = in;
   53|  3.37k|  }
   54|  3.64k|  return true;
   55|  3.69k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.11k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.11k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.11k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 5, False: 3.11k]
  ------------------
   33|      5|    return false;
   34|      5|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.11k|  uint8_t in;
   39|  3.11k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 19, False: 3.09k]
  ------------------
   40|     19|    return false;
   41|     19|  }
   42|  3.09k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 676, False: 2.41k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    676|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 35, False: 641]
  ------------------
   45|     35|      return false;
   46|     35|    }
   47|       |    // Append decoded info from this byte.
   48|    641|    *out_val <<= 7;
   49|    641|    *out_val |= in & ((1 << 7) - 1);
   50|  2.41k|  } else {
   51|       |    // Last byte reached
   52|  2.41k|    *out_val = in;
   53|  2.41k|  }
   54|  3.05k|  return true;
   55|  3.09k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  20.3k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  20.3k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  20.3k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 4, False: 20.3k]
  ------------------
   33|      4|    return false;
   34|      4|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  20.3k|  uint8_t in;
   39|  20.3k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 33, False: 20.3k]
  ------------------
   40|     33|    return false;
   41|     33|  }
   42|  20.3k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 386, False: 19.9k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    386|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 28, False: 358]
  ------------------
   45|     28|      return false;
   46|     28|    }
   47|       |    // Append decoded info from this byte.
   48|    358|    *out_val <<= 7;
   49|    358|    *out_val |= in & ((1 << 7) - 1);
   50|  19.9k|  } else {
   51|       |    // Last byte reached
   52|  19.9k|    *out_val = in;
   53|  19.9k|  }
   54|  20.3k|  return true;
   55|  20.3k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  7.52k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  7.52k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  7.52k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 59, False: 7.46k]
  ------------------
   33|     59|    return false;
   34|     59|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  7.46k|  uint8_t in;
   39|  7.46k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 93, False: 7.37k]
  ------------------
   40|     93|    return false;
   41|     93|  }
   42|  7.37k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.78k, False: 5.58k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.78k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 334, False: 1.44k]
  ------------------
   45|    334|      return false;
   46|    334|    }
   47|       |    // Append decoded info from this byte.
   48|  1.44k|    *out_val <<= 7;
   49|  1.44k|    *out_val |= in & ((1 << 7) - 1);
   50|  5.58k|  } else {
   51|       |    // Last byte reached
   52|  5.58k|    *out_val = in;
   53|  5.58k|  }
   54|  7.03k|  return true;
   55|  7.37k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  6.74k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  6.74k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  6.74k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 31, False: 6.71k]
  ------------------
   33|     31|    return false;
   34|     31|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  6.71k|  uint8_t in;
   39|  6.71k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 72, False: 6.64k]
  ------------------
   40|     72|    return false;
   41|     72|  }
   42|  6.64k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 3.85k, False: 2.78k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  3.85k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 383, False: 3.47k]
  ------------------
   45|    383|      return false;
   46|    383|    }
   47|       |    // Append decoded info from this byte.
   48|  3.47k|    *out_val <<= 7;
   49|  3.47k|    *out_val |= in & ((1 << 7) - 1);
   50|  3.47k|  } else {
   51|       |    // Last byte reached
   52|  2.78k|    *out_val = in;
   53|  2.78k|  }
   54|  6.26k|  return true;
   55|  6.64k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  27.8k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  27.8k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  27.8k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 7, False: 27.8k]
  ------------------
   33|      7|    return false;
   34|      7|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  27.8k|  uint8_t in;
   39|  27.8k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 60, False: 27.7k]
  ------------------
   40|     60|    return false;
   41|     60|  }
   42|  27.7k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.58k, False: 25.1k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.58k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 55, False: 2.53k]
  ------------------
   45|     55|      return false;
   46|     55|    }
   47|       |    // Append decoded info from this byte.
   48|  2.53k|    *out_val <<= 7;
   49|  2.53k|    *out_val |= in & ((1 << 7) - 1);
   50|  25.1k|  } else {
   51|       |    // Last byte reached
   52|  25.1k|    *out_val = in;
   53|  25.1k|  }
   54|  27.7k|  return true;
   55|  27.7k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|  77.5k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|  98.1k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  8.18k|  Self operator-(const Self &o) const {
  138|  8.18k|    Self ret;
  139|  32.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 24.5k, False: 8.18k]
  ------------------
  140|  24.5k|      ret[i] = (*this)[i] - o[i];
  141|  24.5k|    }
  142|  8.18k|    return ret;
  143|  8.18k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  20.2k|  VectorD() {
   41|  81.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 60.8k, False: 20.2k]
  ------------------
   42|  60.8k|      (*this)[i] = Scalar(0);
   43|  60.8k|    }
   44|  20.2k|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|   831M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIfLi3EEC2ERKfS3_S3_:
   59|     44|      : v_({{c0, c1, c2}}) {
   60|     44|    DRACO_DCHECK_EQ(dimension, 3);
   61|     44|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|   101M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  8.40M|  Self operator-(const Self &o) const {
  138|  8.40M|    Self ret;
  139|  33.6M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 25.2M, False: 8.40M]
  ------------------
  140|  25.2M|      ret[i] = (*this)[i] - o[i];
  141|  25.2M|    }
  142|  8.40M|    return ret;
  143|  8.40M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  4.19M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  4.19M|  static_assert(std::is_signed<ScalarT>::value,
  321|  4.19M|                "ScalarT must be a signed type. ");
  322|  4.19M|  VectorD<ScalarT, 3> r;
  323|  4.19M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  4.19M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  4.19M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  4.19M|  return r;
  327|  4.19M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  4.19M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  4.19M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  1.63M|  Scalar AbsSum() const {
  238|  1.63M|    Scalar result(0);
  239|  6.54M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 4.91M, False: 1.62M]
  ------------------
  240|  4.91M|      Scalar next_value = std::abs(v_[i]);
  241|  4.91M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 10.3k, False: 4.90M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  10.3k|        return std::numeric_limits<Scalar>::max();
  244|  10.3k|      }
  245|  4.90M|      result += next_value;
  246|  4.90M|    }
  247|  1.62M|    return result;
  248|  1.63M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   186k|  Self operator/(const Scalar &o) const {
  183|   186k|    Self ret;
  184|   744k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 558k, False: 186k]
  ------------------
  185|   558k|      ret[i] = (*this)[i] / o;
  186|   558k|    }
  187|   186k|    return ret;
  188|   186k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   126M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  8.10M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  4.91M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  1.35M|  Self operator-() const {
  121|  1.35M|    Self ret;
  122|  5.40M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 4.05M, False: 1.35M]
  ------------------
  123|  4.05M|      ret[i] = -(*this)[i];
  124|  4.05M|    }
  125|  1.35M|    return ret;
  126|  1.35M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  4.05M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|   501k|  Self operator-(const Self &o) const {
  138|   501k|    Self ret;
  139|  1.50M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.00M, False: 501k]
  ------------------
  140|  1.00M|      ret[i] = (*this)[i] - o[i];
  141|  1.00M|    }
  142|   501k|    return ret;
  143|   501k|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  6.02M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  9.03M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  21.7M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  1.00M|  Self operator+(const Self &o) const {
  130|  1.00M|    Self ret;
  131|  3.01M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.00M, False: 1.00M]
  ------------------
  132|  2.00M|      ret[i] = (*this)[i] + o[i];
  133|  2.00M|    }
  134|  1.00M|    return ret;
  135|  1.00M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  19.7M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|   604k|  Self operator-(const Self &o) const {
  138|   604k|    Self ret;
  139|  1.81M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.20M, False: 604k]
  ------------------
  140|  1.20M|      ret[i] = (*this)[i] - o[i];
  141|  1.20M|    }
  142|   604k|    return ret;
  143|   604k|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|   604k|  Self operator+(const Self &o) const {
  130|   604k|    Self ret;
  131|  1.81M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.20M, False: 604k]
  ------------------
  132|  1.20M|      ret[i] = (*this)[i] + o[i];
  133|  1.20M|    }
  134|   604k|    return ret;
  135|   604k|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   381k|  bool operator==(const Self &o) const {
  207|  1.13M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 759k, False: 377k]
  ------------------
  208|   759k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 3.92k, False: 755k]
  ------------------
  209|  3.92k|        return false;
  210|  3.92k|      }
  211|   759k|    }
  212|   377k|    return true;
  213|   381k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  4.57M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  4.25k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  4.57k|  Scalar Dot(const Self &o) const {
  251|  4.57k|    Scalar ret(0);
  252|  18.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 13.7k, False: 4.57k]
  ------------------
  253|  13.7k|      ret += (*this)[i] * o[i];
  254|  13.7k|    }
  255|  4.57k|    return ret;
  256|  4.57k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    323|  Self operator*(const Scalar &o) const {
  175|    323|    Self ret;
  176|  1.29k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 969, False: 323]
  ------------------
  177|    969|      ret[i] = (*this)[i] * o;
  178|    969|    }
  179|    323|    return ret;
  180|    323|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  3.92k|  Self operator-(const Self &o) const {
  138|  3.92k|    Self ret;
  139|  11.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 7.85k, False: 3.92k]
  ------------------
  140|  7.85k|      ret[i] = (*this)[i] - o[i];
  141|  7.85k|    }
  142|  3.92k|    return ret;
  143|  3.92k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  7.85k|  VectorD() {
   41|  23.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 15.7k, False: 7.85k]
  ------------------
   42|  15.7k|      (*this)[i] = Scalar(0);
   43|  15.7k|    }
   44|  7.85k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   766k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   766k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   766k|    v_[0] = c0;
   55|   766k|    v_[1] = c1;
   56|   766k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  31.3k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   212k|  bool operator==(const Self &o) const {
  207|   606k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 409k, False: 196k]
  ------------------
  208|   409k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 15.9k, False: 393k]
  ------------------
  209|  15.9k|        return false;
  210|  15.9k|      }
  211|   409k|    }
  212|   196k|    return true;
  213|   212k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  1.28M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  24.5M|  VectorD() {
   41|  98.0M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 73.5M, False: 24.5M]
  ------------------
   42|  73.5M|      (*this)[i] = Scalar(0);
   43|  73.5M|    }
   44|  24.5M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  18.6k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  21.3k|  Scalar Dot(const Self &o) const {
  251|  21.3k|    Scalar ret(0);
  252|  85.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 64.0k, False: 21.3k]
  ------------------
  253|  64.0k|      ret += (*this)[i] * o[i];
  254|  64.0k|    }
  255|  21.3k|    return ret;
  256|  21.3k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  2.75k|  Self operator-(const Self &o) const {
  138|  2.75k|    Self ret;
  139|  8.27k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 5.51k, False: 2.75k]
  ------------------
  140|  5.51k|      ret[i] = (*this)[i] - o[i];
  141|  5.51k|    }
  142|  2.75k|    return ret;
  143|  2.75k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  8.03k|  Self operator*(const Scalar &o) const {
  175|  8.03k|    Self ret;
  176|  24.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 16.0k, False: 8.03k]
  ------------------
  177|  16.0k|      ret[i] = (*this)[i] * o;
  178|  16.0k|    }
  179|  8.03k|    return ret;
  180|  8.03k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  2.68k|  Self operator+(const Self &o) const {
  130|  2.68k|    Self ret;
  131|  8.05k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 5.36k, False: 2.68k]
  ------------------
  132|  5.36k|      ret[i] = (*this)[i] + o[i];
  133|  5.36k|    }
  134|  2.68k|    return ret;
  135|  2.68k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.68k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.68k|  return v * o;
  294|  2.68k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  2.67k|  Self operator+(const Self &o) const {
  130|  2.67k|    Self ret;
  131|  10.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 8.01k, False: 2.67k]
  ------------------
  132|  8.01k|      ret[i] = (*this)[i] + o[i];
  133|  8.01k|    }
  134|  2.67k|    return ret;
  135|  2.67k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.67k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.67k|  return v * o;
  294|  2.67k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  2.67k|  Self operator*(const Scalar &o) const {
  175|  2.67k|    Self ret;
  176|  10.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 8.01k, False: 2.67k]
  ------------------
  177|  8.01k|      ret[i] = (*this)[i] * o;
  178|  8.01k|    }
  179|  2.67k|    return ret;
  180|  2.67k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   427k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   427k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   427k|    v_[0] = c0;
   55|   427k|    v_[1] = c1;
   56|   427k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  18.8k|  VectorD() {
   41|  56.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 37.6k, False: 18.8k]
  ------------------
   42|  37.6k|      (*this)[i] = Scalar(0);
   43|  37.6k|    }
   44|  18.8k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  5.32k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  15.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 10.6k, False: 5.32k]
  ------------------
  104|  10.6k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 10.6k, False: 0]
  ------------------
  105|  10.6k|        v_[i] = Scalar(src_vector[i]);
  106|  10.6k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  10.6k|    }
  110|  5.32k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|    696|  Self operator+(const Self &o) const {
  130|    696|    Self ret;
  131|  2.08k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.39k, False: 696]
  ------------------
  132|  1.39k|      ret[i] = (*this)[i] + o[i];
  133|  1.39k|    }
  134|    696|    return ret;
  135|    696|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  2.66k|  VectorD() {
   41|  7.98k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 5.32k, False: 2.66k]
  ------------------
   42|  5.32k|      (*this)[i] = Scalar(0);
   43|  5.32k|    }
   44|  2.66k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  15.9k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  10.6k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  2.66k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  7.98k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 5.32k, False: 2.66k]
  ------------------
  104|  5.32k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 5.32k, False: 0]
  ------------------
  105|  5.32k|        v_[i] = Scalar(src_vector[i]);
  106|  5.32k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  5.32k|    }
  110|  2.66k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  2.66k|  Self operator/(const Scalar &o) const {
  183|  2.66k|    Self ret;
  184|  7.98k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 5.32k, False: 2.66k]
  ------------------
  185|  5.32k|      ret[i] = (*this)[i] / o;
  186|  5.32k|    }
  187|  2.66k|    return ret;
  188|  2.66k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  1.96k|  Self operator-(const Self &o) const {
  138|  1.96k|    Self ret;
  139|  5.90k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 3.93k, False: 1.96k]
  ------------------
  140|  3.93k|      ret[i] = (*this)[i] - o[i];
  141|  3.93k|    }
  142|  1.96k|    return ret;
  143|  1.96k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  75.2k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  1.35M|  VectorD() {
   41|  5.40M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 4.05M, False: 1.35M]
  ------------------
   42|  4.05M|      (*this)[i] = Scalar(0);
   43|  4.05M|    }
   44|  1.35M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  4.30M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  4.30M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  4.30M|    v_[0] = c0;
   55|  4.30M|    v_[1] = c1;
   56|  4.30M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  3.01M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  9.03M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 6.02M, False: 3.01M]
  ------------------
  104|  6.02M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 6.02M, False: 0]
  ------------------
  105|  6.02M|        v_[i] = Scalar(src_vector[i]);
  106|  6.02M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  6.02M|    }
  110|  3.01M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  1.50M|  VectorD() {
   41|  4.51M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.01M, False: 1.50M]
  ------------------
   42|  3.01M|      (*this)[i] = Scalar(0);
   43|  3.01M|    }
   44|  1.50M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  1.50M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  4.51M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 3.01M, False: 1.50M]
  ------------------
  104|  3.01M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 3.01M, False: 0]
  ------------------
  105|  3.01M|        v_[i] = Scalar(src_vector[i]);
  106|  3.01M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  3.01M|    }
  110|  1.50M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  2.69M|  VectorD(const Self &o) {
   89|  8.07M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 5.38M, False: 2.69M]
  ------------------
   90|  5.38M|      (*this)[i] = o[i];
   91|  5.38M|    }
   92|  2.69M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  1.20M|  VectorD() {
   41|  3.62M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 2.41M, False: 1.20M]
  ------------------
   42|  2.41M|      (*this)[i] = Scalar(0);
   43|  2.41M|    }
   44|  1.20M|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|   277M|  VectorD(const Self &o) {
   89|  1.10G|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 831M, False: 277M]
  ------------------
   90|   831M|      (*this)[i] = o[i];
   91|   831M|    }
   92|   277M|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|   831M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|   126M|      : v_({{c0, c1, c2}}) {
   60|   126M|    DRACO_DCHECK_EQ(dimension, 3);
   61|   126M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|  72.9M|  inline int num_vertices() const {
   74|  72.9M|    return static_cast<int>(vertex_corners_.size());
   75|  72.9M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  8.77M|  inline int num_corners() const {
   77|  8.77M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  8.77M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  3.43M|  inline int num_faces() const {
   80|  3.43M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  3.43M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   271M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   271M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 271M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   271M|    return opposite_corners_[corner];
   88|   271M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   452M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   452M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 10.9M, False: 441M]
  ------------------
   91|  10.9M|      return corner;
   92|  10.9M|    }
   93|   441M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 388M, False: 53.2M]
  ------------------
   94|   452M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   374M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   374M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 3.80M, False: 370M]
  ------------------
   97|  3.80M|      return corner;
   98|  3.80M|    }
   99|   370M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 114M, False: 256M]
  ------------------
  100|   374M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   656M|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|   656M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 656M]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|   656M|    return ConfidentVertex(corner);
  106|   656M|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|   656M|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|   656M|    DRACO_DCHECK_GE(corner.value(), 0);
  109|   656M|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|   656M|    return corner_to_vertex_map_[corner];
  111|   656M|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  34.6M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  34.6M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 34.6M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  34.6M|    return FaceIndex(corner.value() / 3);
  117|  34.6M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|   811M|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  50.7M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  50.7M|    return vertex_corners_[v];
  152|  50.7M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|  1.07M|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|  1.07M|    const CornerIndex corner = LeftMostCorner(vert);
  187|  1.07M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 26.5k, False: 1.04M]
  ------------------
  188|  26.5k|      return true;
  189|  26.5k|    }
  190|  1.04M|    return false;
  191|  1.07M|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  67.1M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  67.1M|    return Previous(Opposite(Previous(corner)));
  202|  67.1M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  20.9M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  20.9M|    return Next(Opposite(Next(corner)));
  207|  20.9M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  2.85M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  2.85M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 2.85M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  2.85M|    return Opposite(Previous(corner_id));
  222|  2.85M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  3.90M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  3.90M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 3.90M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  3.90M|    return Opposite(Next(corner_id));
  228|  3.90M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   258M|                                CornerIndex opp_corner_id) {
  249|   258M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   258M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   258M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   310M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   310M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   310M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   310M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|  77.7M|  VertexIndex AddNewVertex() {
  271|  77.7M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|  77.7M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|  77.7M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|  77.7M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   165M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   165M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   165M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 165M, False: 0]
  ------------------
  295|   165M|      vertex_corners_[vert] = corner;
  296|   165M|    }
  297|   165M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|  1.28M|  void MakeVertexIsolated(VertexIndex vert) {
  329|  1.28M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|  1.28M|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|  1.28M|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  2.50k|      : corner_table_(table),
  229|  2.50k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  2.50k|        corner_(start_corner_),
  231|  2.50k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  2.99M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  8.61k|  VertexCornersIterator &operator++() {
  268|  8.61k|    Next();
  269|  8.61k|    return *this;
  270|  8.61k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  2.55M|  void Next() {
  248|  2.55M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 2.53M, False: 19.1k]
  ------------------
  249|  2.53M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  2.53M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 17.3k, False: 2.51M]
  ------------------
  251|       |        // Open boundary reached.
  252|  17.3k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  17.3k|        left_traversal_ = false;
  254|  2.51M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 419k, False: 2.10M]
  ------------------
  255|       |        // End reached.
  256|   419k|        corner_ = kInvalidCornerIndex;
  257|   419k|      }
  258|  2.53M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  19.1k|      corner_ = corner_table_->SwingRight(corner_);
  262|  19.1k|    }
  263|  2.55M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  5.10M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  2.85M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  3.28M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  1.64M|  void Next() {
  248|  1.64M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 1.62M, False: 17.2k]
  ------------------
  249|  1.62M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  1.62M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 1.12M, False: 506k]
  ------------------
  251|       |        // Open boundary reached.
  252|  1.12M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  1.12M|        left_traversal_ = false;
  254|  1.12M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 82.5k, False: 423k]
  ------------------
  255|       |        // End reached.
  256|  82.5k|        corner_ = kInvalidCornerIndex;
  257|  82.5k|      }
  258|  1.62M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  17.2k|      corner_ = corner_table_->SwingRight(corner_);
  262|  17.2k|    }
  263|  1.64M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  1.20M|      : corner_table_(table),
  236|  1.20M|        start_corner_(corner_id),
  237|  1.20M|        corner_(start_corner_),
  238|  1.20M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   434k|      : corner_table_(table),
  236|   434k|        start_corner_(corner_id),
  237|   434k|        corner_(start_corner_),
  238|   434k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  51.5M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  51.5M|    return is_edge_on_seam_[corner.value()];
   47|  51.5M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  23.4M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  23.4M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 23.4M]
  |  Branch (50:42): [True: 20.3M, False: 3.09M]
  ------------------
   51|  20.3M|      return kInvalidCornerIndex;
   52|  20.3M|    }
   53|  3.09M|    return corner_table_->Opposite(corner);
   54|  23.4M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  32.2M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  32.2M|    return corner_table_->Next(corner);
   58|  32.2M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  16.6M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  16.6M|    return corner_table_->Previous(corner);
   62|  16.6M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  4.23M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  4.23M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  4.23M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.65M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  2.65M|    return Opposite(Previous(corner));
   73|  2.65M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  2.97M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  2.97M|    return Opposite(Next(corner));
   76|  2.97M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  3.23M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  3.23M|    return Previous(Opposite(Previous(corner)));
   81|  3.23M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  10.8M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  10.8M|    return Next(Opposite(Next(corner)));
   86|  10.8M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  8.04k|  int num_vertices() const {
   89|  8.04k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  8.04k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  2.68k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  1.18k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|  79.9M|  VertexIndex Vertex(CornerIndex corner) const {
   95|  79.9M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|  79.9M|    return ConfidentVertex(corner);
   97|  79.9M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|  79.9M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|  79.9M|    return corner_to_vertex_map_[corner.value()];
  100|  79.9M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  2.64M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  2.64M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  2.64M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  2.64M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  2.64M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  2.64M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 2.64M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  2.64M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 2.31M, False: 325k]
  ------------------
  128|  2.31M|      return true;
  129|  2.31M|    }
  130|   325k|    return false;
  131|  2.64M|  }

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

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

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

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

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

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

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

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

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

