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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  2.60k|      : quantization_bits_(-1),
   54|  2.60k|        max_quantized_value_(-1),
   55|  2.60k|        max_value_(-1),
   56|  2.60k|        dequantization_scale_(1.f),
   57|  2.60k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  2.36k|  bool SetQuantizationBits(int32_t q) {
   60|  2.36k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 710, False: 1.65k]
  |  Branch (60:18): [True: 174, False: 1.47k]
  ------------------
   61|    884|      return false;
   62|    884|    }
   63|  1.47k|    quantization_bits_ = q;
   64|  1.47k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.47k|    max_value_ = max_quantized_value_ - 1;
   66|  1.47k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.47k|    center_value_ = max_value_ / 2;
   68|  1.47k|    return true;
   69|  2.36k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  2.24M|                                           int32_t *out_t) const {
   77|  2.24M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 5.35k, False: 2.23M]
  |  Branch (77:20): [True: 0, False: 5.35k]
  |  Branch (77:32): [True: 5.35k, False: 2.23M]
  |  Branch (77:42): [True: 0, False: 5.35k]
  ------------------
   78|  2.24M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 1.46M, False: 772k]
  |  Branch (78:29): [True: 5.00k, False: 1.46M]
  ------------------
   79|  5.00k|      s = max_value_;
   80|  5.00k|      t = max_value_;
   81|  2.23M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 5.35k, False: 2.23M]
  |  Branch (81:26): [True: 1.77k, False: 3.57k]
  ------------------
   82|  1.77k|      t = center_value_ - (t - center_value_);
   83|  2.23M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 1.46M, False: 770k]
  |  Branch (83:35): [True: 5.24k, False: 1.45M]
  ------------------
   84|  5.24k|      t = center_value_ + (center_value_ - t);
   85|  2.22M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 1.46M, False: 769k]
  |  Branch (85:35): [True: 632, False: 1.45M]
  ------------------
   86|    632|      s = center_value_ + (center_value_ - s);
   87|  2.22M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 5.65k, False: 2.22M]
  |  Branch (87:26): [True: 2.00k, False: 3.64k]
  ------------------
   88|  2.00k|      s = center_value_ - (s - center_value_);
   89|  2.00k|    }
   90|       |
   91|  2.24M|    *out_s = s;
   92|  2.24M|    *out_t = t;
   93|  2.24M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  2.24M|                                                       int32_t *out_t) const {
  100|  2.24M|    DRACO_DCHECK_EQ(
  101|  2.24M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  2.24M|        center_value_);
  103|  2.24M|    int32_t s, t;
  104|  2.24M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 1.43M, False: 803k]
  ------------------
  105|       |      // Right hemisphere.
  106|  1.43M|      s = (int_vec[1] + center_value_);
  107|  1.43M|      t = (int_vec[2] + center_value_);
  108|  1.43M|    } else {
  109|       |      // Left hemisphere.
  110|   803k|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 60.0k, False: 743k]
  ------------------
  111|  60.0k|        s = std::abs(int_vec[2]);
  112|   743k|      } else {
  113|   743k|        s = (max_value_ - std::abs(int_vec[2]));
  114|   743k|      }
  115|   803k|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 64.9k, False: 738k]
  ------------------
  116|  64.9k|        t = std::abs(int_vec[1]);
  117|   738k|      } else {
  118|   738k|        t = (max_value_ - std::abs(int_vec[1]));
  119|   738k|      }
  120|   803k|    }
  121|  2.24M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  2.24M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|   133k|                                                    float *out_vector) const {
  199|   133k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|   133k|                                 in_t * dequantization_scale_ - 1.f,
  201|   133k|                                 out_vector);
  202|   133k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  1.69M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  1.69M|    DRACO_DCHECK_LE(s, center_value_);
  208|  1.69M|    DRACO_DCHECK_LE(t, center_value_);
  209|  1.69M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  1.69M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  1.69M|    const uint32_t st =
  212|  1.69M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  1.69M|    return st <= center_value_;
  214|  1.69M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  2.10M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  2.10M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  2.10M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  2.10M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  2.10M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  2.10M|    int32_t sign_s = 0;
  223|  2.10M|    int32_t sign_t = 0;
  224|  2.10M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 1.86M, False: 243k]
  |  Branch (224:20): [True: 1.71M, False: 145k]
  ------------------
  225|  1.71M|      sign_s = 1;
  226|  1.71M|      sign_t = 1;
  227|  1.71M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 268k, False: 120k]
  |  Branch (227:27): [True: 151k, False: 116k]
  ------------------
  228|   151k|      sign_s = -1;
  229|   151k|      sign_t = -1;
  230|   237k|    } else {
  231|   237k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 120k, False: 116k]
  ------------------
  232|   237k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 116k, False: 120k]
  ------------------
  233|   237k|    }
  234|       |
  235|       |    // Perform the addition and subtraction using unsigned integers to avoid
  236|       |    // signed integer overflows for bad data. Note that the result will be
  237|       |    // unchanged for non-overflowing cases.
  238|  2.10M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  2.10M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  2.10M|    uint32_t us = *s;
  241|  2.10M|    uint32_t ut = *t;
  242|  2.10M|    us = us + us - corner_point_s;
  243|  2.10M|    ut = ut + ut - corner_point_t;
  244|  2.10M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 1.86M, False: 237k]
  ------------------
  245|  1.86M|      uint32_t temp = us;
  246|  1.86M|      us = -ut;
  247|  1.86M|      ut = -temp;
  248|  1.86M|    } else {
  249|   237k|      std::swap(us, ut);
  250|   237k|    }
  251|  2.10M|    us = us + corner_point_s;
  252|  2.10M|    ut = ut + corner_point_t;
  253|       |
  254|  2.10M|    *s = us;
  255|  2.10M|    *t = ut;
  256|  2.10M|    *s /= 2;
  257|  2.10M|    *t /= 2;
  258|  2.10M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  3.39M|  int32_t ModMax(int32_t x) const {
  273|  3.39M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 5.90k, False: 3.38M]
  ------------------
  274|  5.90k|      return x - this->max_quantized_value();
  275|  5.90k|    }
  276|  3.38M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 3.13k, False: 3.38M]
  ------------------
  277|  3.13k|      return x + this->max_quantized_value();
  278|  3.13k|    }
  279|  3.38M|    return x;
  280|  3.38M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.39k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  9.04k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  10.1M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|   133k|                                           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|   133k|    float y = in_s_scaled;
  329|   133k|    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|   133k|    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|   133k|    float x_offset = -x;
  342|   133k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 23.7k, False: 109k]
  ------------------
  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|   133k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 31.8k, False: 101k]
  ------------------
  348|   133k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 31.7k, False: 101k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|   133k|    const float norm_squared = x * x + y * y + z * z;
  352|   133k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 133k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|   133k|    } else {
  357|   133k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|   133k|      out_vector[0] = x * d;
  359|   133k|      out_vector[1] = y * d;
  360|   133k|      out_vector[2] = z * d;
  361|   133k|    }
  362|   133k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  2.24M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  2.24M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  2.24M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  2.24M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  2.24M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  2.24M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  2.24M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 1.93M, False: 310k]
  ------------------
  181|  1.93M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  1.93M|    } else {
  183|   310k|      vec[0] =
  184|   310k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   310k|          abs_sum;
  186|   310k|      vec[1] =
  187|   310k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   310k|          abs_sum;
  189|   310k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 166k, False: 143k]
  ------------------
  190|   166k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   166k|      } else {
  192|   143k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   143k|      }
  194|   310k|    }
  195|  2.24M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    371|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    371|            attribute, transform, mesh_data),
   52|    371|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    355|                                                                *buffer) {
  194|    355|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    355|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    355|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 7, False: 348]
  ------------------
  196|       |    // Decode prediction mode.
  197|      7|    uint8_t mode;
  198|      7|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 7]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      7|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 4, False: 3]
  ------------------
  203|       |      // Unsupported mode.
  204|      4|      return false;
  205|      4|    }
  206|      7|  }
  207|    351|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.60k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.31k, False: 289]
  ------------------
  211|  1.31k|    uint32_t num_flags;
  212|  1.31k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 13, False: 1.30k]
  ------------------
  213|     13|      return false;
  214|     13|    }
  215|  1.30k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 28, False: 1.27k]
  ------------------
  216|     28|      return false;
  217|     28|    }
  218|  1.27k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 517, False: 756]
  ------------------
  219|    517|      is_crease_edge_[i].resize(num_flags);
  220|    517|      RAnsBitDecoder decoder;
  221|    517|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 21, False: 496]
  ------------------
  222|     21|        return false;
  223|     21|      }
  224|  3.06M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 3.06M, False: 496]
  ------------------
  225|  3.06M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  3.06M|      }
  227|    496|      decoder.EndDecoding();
  228|    496|    }
  229|  1.27k|  }
  230|    289|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    289|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    351|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    259|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    259|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    259|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.29k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.03k, False: 259]
  ------------------
   93|  1.03k|    pred_vals[i].resize(num_components, 0);
   94|  1.03k|  }
   95|    259|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    259|                                         out_data);
   97|       |
   98|    259|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    259|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    259|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    259|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    259|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    259|  const int corner_map_size =
  109|    259|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  1.31M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 1.31M, False: 161]
  ------------------
  111|  1.31M|    const CornerIndex start_corner_id =
  112|  1.31M|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  1.31M|    CornerIndex corner_id(start_corner_id);
  115|  1.31M|    int num_parallelograms = 0;
  116|  1.31M|    bool first_pass = true;
  117|  2.88M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 1.63M, False: 1.25M]
  ------------------
  118|  1.63M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 127k, False: 1.50M]
  ------------------
  119|  1.63M|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  1.63M|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   127k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   127k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 1.12k, False: 126k]
  ------------------
  127|  1.12k|          break;
  128|  1.12k|        }
  129|   127k|      }
  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.63M|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 1.62M, False: 13.4k]
  ------------------
  134|  1.62M|        corner_id = table->SwingLeft(corner_id);
  135|  1.62M|      } else {
  136|  13.4k|        corner_id = table->SwingRight(corner_id);
  137|  13.4k|      }
  138|  1.63M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 59.6k, False: 1.57M]
  ------------------
  139|  59.6k|        break;
  140|  59.6k|      }
  141|  1.57M|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 1.25M, False: 318k]
  |  Branch (141:47): [True: 1.25M, False: 5.83k]
  ------------------
  142|  1.25M|        first_pass = false;
  143|  1.25M|        corner_id = table->SwingRight(start_corner_id);
  144|  1.25M|      }
  145|  1.57M|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  1.31M|    int num_used_parallelograms = 0;
  150|  1.31M|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 69.4k, False: 1.24M]
  ------------------
  151|  8.59M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 8.52M, False: 69.4k]
  ------------------
  152|  8.52M|        multi_pred_vals[i] = 0;
  153|  8.52M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   197k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 127k, False: 69.3k]
  ------------------
  156|   127k|        const int context = num_parallelograms - 1;
  157|   127k|        const int pos = is_crease_edge_pos[context]++;
  158|   127k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 98, False: 127k]
  ------------------
  159|     98|          return false;
  160|     98|        }
  161|   127k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   127k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 33.9k, False: 93.7k]
  ------------------
  163|  33.9k|          ++num_used_parallelograms;
  164|  4.23M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 4.20M, False: 33.9k]
  ------------------
  165|  4.20M|            multi_pred_vals[j] =
  166|  4.20M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  4.20M|          }
  168|  33.9k|        }
  169|   127k|      }
  170|  69.4k|    }
  171|  1.31M|    const int dst_offset = p * num_components;
  172|  1.31M|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 1.29M, False: 13.1k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  1.29M|      const int src_offset = (p - 1) * num_components;
  176|  1.29M|      this->transform().ComputeOriginalValue(
  177|  1.29M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  1.29M|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|  1.59M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 1.58M, False: 13.1k]
  ------------------
  181|  1.58M|        multi_pred_vals[c] /= num_used_parallelograms;
  182|  1.58M|      }
  183|  13.1k|      this->transform().ComputeOriginalValue(
  184|  13.1k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  13.1k|    }
  186|  1.31M|  }
  187|    161|  return true;
  188|    259|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    404|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    404|            attribute, transform, mesh_data),
   52|    404|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    383|                                                                *buffer) {
  194|    383|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    383|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    383|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 3, False: 380]
  ------------------
  196|       |    // Decode prediction mode.
  197|      3|    uint8_t mode;
  198|      3|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 3]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      3|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 2, False: 1]
  ------------------
  203|       |      // Unsupported mode.
  204|      2|      return false;
  205|      2|    }
  206|      3|  }
  207|    381|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.67k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.37k, False: 297]
  ------------------
  211|  1.37k|    uint32_t num_flags;
  212|  1.37k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 14, False: 1.36k]
  ------------------
  213|     14|      return false;
  214|     14|    }
  215|  1.36k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 41, False: 1.32k]
  ------------------
  216|     41|      return false;
  217|     41|    }
  218|  1.32k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 631, False: 692]
  ------------------
  219|    631|      is_crease_edge_[i].resize(num_flags);
  220|    631|      RAnsBitDecoder decoder;
  221|    631|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 29, False: 602]
  ------------------
  222|     29|        return false;
  223|     29|      }
  224|  1.86M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.86M, False: 602]
  ------------------
  225|  1.86M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.86M|      }
  227|    602|      decoder.EndDecoding();
  228|    602|    }
  229|  1.32k|  }
  230|    297|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    297|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    381|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    251|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    251|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    251|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.25k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.00k, False: 251]
  ------------------
   93|  1.00k|    pred_vals[i].resize(num_components, 0);
   94|  1.00k|  }
   95|    251|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    251|                                         out_data);
   97|       |
   98|    251|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    251|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    251|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    251|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    251|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    251|  const int corner_map_size =
  109|    251|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   123k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 123k, False: 93]
  ------------------
  111|   123k|    const CornerIndex start_corner_id =
  112|   123k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   123k|    CornerIndex corner_id(start_corner_id);
  115|   123k|    int num_parallelograms = 0;
  116|   123k|    bool first_pass = true;
  117|   720k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 714k, False: 6.30k]
  ------------------
  118|   714k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 230k, False: 484k]
  ------------------
  119|   714k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   714k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   230k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   230k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 362, False: 229k]
  ------------------
  127|    362|          break;
  128|    362|        }
  129|   230k|      }
  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|   714k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 707k, False: 7.03k]
  ------------------
  134|   707k|        corner_id = table->SwingLeft(corner_id);
  135|   707k|      } else {
  136|  7.03k|        corner_id = table->SwingRight(corner_id);
  137|  7.03k|      }
  138|   714k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 116k, False: 597k]
  ------------------
  139|   116k|        break;
  140|   116k|      }
  141|   597k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 9.80k, False: 587k]
  |  Branch (141:47): [True: 6.31k, False: 3.49k]
  ------------------
  142|  6.31k|        first_pass = false;
  143|  6.31k|        corner_id = table->SwingRight(start_corner_id);
  144|  6.31k|      }
  145|   597k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   123k|    int num_used_parallelograms = 0;
  150|   123k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 119k, False: 3.23k]
  ------------------
  151|  8.80M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 8.68M, False: 119k]
  ------------------
  152|  8.68M|        multi_pred_vals[i] = 0;
  153|  8.68M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   349k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 230k, False: 119k]
  ------------------
  156|   230k|        const int context = num_parallelograms - 1;
  157|   230k|        const int pos = is_crease_edge_pos[context]++;
  158|   230k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 158, False: 229k]
  ------------------
  159|    158|          return false;
  160|    158|        }
  161|   229k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   229k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 27.3k, False: 202k]
  ------------------
  163|  27.3k|          ++num_used_parallelograms;
  164|  1.57M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 1.54M, False: 27.3k]
  ------------------
  165|  1.54M|            multi_pred_vals[j] =
  166|  1.54M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  1.54M|          }
  168|  27.3k|        }
  169|   229k|      }
  170|   119k|    }
  171|   123k|    const int dst_offset = p * num_components;
  172|   123k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 109k, False: 13.9k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   109k|      const int src_offset = (p - 1) * num_components;
  176|   109k|      this->transform().ComputeOriginalValue(
  177|   109k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   109k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   796k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 782k, False: 13.9k]
  ------------------
  181|   782k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   782k|      }
  183|  13.9k|      this->transform().ComputeOriginalValue(
  184|  13.9k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  13.9k|    }
  186|   123k|  }
  187|     93|  return true;
  188|    251|}

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

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   612k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   216k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   388k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   216k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.80k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.80k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  9.98M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.13k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.13k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  3.41M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    151|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    151|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    122|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    122|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    149|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    149|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    138|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    138|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    301|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    151|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    151|    DRACO_DCHECK_EQ(i, 0);
   70|    151|    (void)i;
   71|    151|    return GeometryAttribute::POSITION;
   72|    151|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    151|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    151|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 151]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    151|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 150]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    150|    predictor_.SetPositionAttribute(*att);
   82|    150|    return true;
   83|    151|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    150|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    150|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 9, False: 141]
  ------------------
  145|      9|    return false;
  146|      9|  }
  147|       |
  148|    141|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    141|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    141|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 32, False: 109]
  ------------------
  150|     32|    uint8_t prediction_mode;
  151|     32|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 32]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     32|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 31]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     31|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 31]
  ------------------
  160|     31|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     31|  }
  164|    140|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    140|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 10, False: 130]
  ------------------
  168|     10|    return false;
  169|     10|  }
  170|       |
  171|    130|  return true;
  172|    140|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    130|                                      const PointIndex *entry_to_point_id_map) {
  103|    130|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    130|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    130|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    130|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    130|  const int corner_map_size =
  111|    130|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    130|  VectorD<int32_t, 3> pred_normal_3d;
  114|    130|  int32_t pred_normal_oct[2];
  115|       |
  116|   612k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 612k, False: 130]
  ------------------
  117|   612k|    const CornerIndex corner_id =
  118|   612k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   612k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   612k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   612k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   612k|                    octahedron_tool_box_.center_value());
  125|   612k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 163k, False: 448k]
  ------------------
  126|   163k|      pred_normal_3d = -pred_normal_3d;
  127|   163k|    }
  128|   612k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   612k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   612k|    const int data_offset = data_id * 2;
  132|   612k|    this->transform().ComputeOriginalValue(
  133|   612k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   612k|  }
  135|    130|  flip_normal_bit_decoder_.EndDecoding();
  136|    130|  return true;
  137|    130|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    130|  void SetQuantizationBits(int q) {
   85|    130|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    130|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    243|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    122|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    122|    DRACO_DCHECK_EQ(i, 0);
   70|    122|    (void)i;
   71|    122|    return GeometryAttribute::POSITION;
   72|    122|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    122|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    122|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 122]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    122|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 121]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    121|    predictor_.SetPositionAttribute(*att);
   82|    121|    return true;
   83|    122|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    121|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    121|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 116]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|       |
  148|    116|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    116|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    116|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 10, False: 106]
  ------------------
  150|     10|    uint8_t prediction_mode;
  151|     10|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 10]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     10|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 9]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|      9|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 9]
  ------------------
  160|      9|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|      9|  }
  164|    115|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    115|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 2, False: 113]
  ------------------
  168|      2|    return false;
  169|      2|  }
  170|       |
  171|    113|  return true;
  172|    115|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    113|                                      const PointIndex *entry_to_point_id_map) {
  103|    113|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    113|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    113|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    113|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    113|  const int corner_map_size =
  111|    113|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    113|  VectorD<int32_t, 3> pred_normal_3d;
  114|    113|  int32_t pred_normal_oct[2];
  115|       |
  116|   216k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 215k, False: 113]
  ------------------
  117|   215k|    const CornerIndex corner_id =
  118|   215k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   215k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   215k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   215k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   215k|                    octahedron_tool_box_.center_value());
  125|   215k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 208k, False: 7.67k]
  ------------------
  126|   208k|      pred_normal_3d = -pred_normal_3d;
  127|   208k|    }
  128|   215k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   215k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   215k|    const int data_offset = data_id * 2;
  132|   215k|    this->transform().ComputeOriginalValue(
  133|   215k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   215k|  }
  135|    113|  flip_normal_bit_decoder_.EndDecoding();
  136|    113|  return true;
  137|    113|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    113|  void SetQuantizationBits(int q) {
   85|    113|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    113|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    296|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    149|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    149|    DRACO_DCHECK_EQ(i, 0);
   70|    149|    (void)i;
   71|    149|    return GeometryAttribute::POSITION;
   72|    149|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    148|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    148|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 148]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    148|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 147]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    147|    predictor_.SetPositionAttribute(*att);
   82|    147|    return true;
   83|    148|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    146|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    146|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 141]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|       |
  148|    141|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    141|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    141|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 42, False: 99]
  ------------------
  150|     42|    uint8_t prediction_mode;
  151|     42|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 42]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     42|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 10, False: 32]
  ------------------
  155|       |      // Invalid prediction mode.
  156|     10|      return false;
  157|     10|    }
  158|       |
  159|     32|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 32]
  ------------------
  160|     32|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     32|  }
  164|    131|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    131|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 6, False: 125]
  ------------------
  168|      6|    return false;
  169|      6|  }
  170|       |
  171|    125|  return true;
  172|    131|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    125|                                      const PointIndex *entry_to_point_id_map) {
  103|    125|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    125|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    125|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    125|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    125|  const int corner_map_size =
  111|    125|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    125|  VectorD<int32_t, 3> pred_normal_3d;
  114|    125|  int32_t pred_normal_oct[2];
  115|       |
  116|   388k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 388k, False: 125]
  ------------------
  117|   388k|    const CornerIndex corner_id =
  118|   388k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   388k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   388k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   388k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   388k|                    octahedron_tool_box_.center_value());
  125|   388k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 357k, False: 31.5k]
  ------------------
  126|   357k|      pred_normal_3d = -pred_normal_3d;
  127|   357k|    }
  128|   388k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   388k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   388k|    const int data_offset = data_id * 2;
  132|   388k|    this->transform().ComputeOriginalValue(
  133|   388k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   388k|  }
  135|    125|  flip_normal_bit_decoder_.EndDecoding();
  136|    125|  return true;
  137|    125|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    125|  void SetQuantizationBits(int q) {
   85|    125|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    125|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    274|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    138|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    138|    DRACO_DCHECK_EQ(i, 0);
   70|    138|    (void)i;
   71|    138|    return GeometryAttribute::POSITION;
   72|    138|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    138|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    138|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 138]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    138|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 136]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    136|    predictor_.SetPositionAttribute(*att);
   82|    136|    return true;
   83|    138|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    136|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    136|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 8, False: 128]
  ------------------
  145|      8|    return false;
  146|      8|  }
  147|       |
  148|    128|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    128|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    128|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 21, False: 107]
  ------------------
  150|     21|    uint8_t prediction_mode;
  151|     21|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 21]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     21|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 2, False: 19]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      2|      return false;
  157|      2|    }
  158|       |
  159|     19|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 19]
  ------------------
  160|     19|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     19|  }
  164|    126|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    126|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 5, False: 121]
  ------------------
  168|      5|    return false;
  169|      5|  }
  170|       |
  171|    121|  return true;
  172|    126|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    121|                                      const PointIndex *entry_to_point_id_map) {
  103|    121|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    121|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    121|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    121|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    121|  const int corner_map_size =
  111|    121|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    121|  VectorD<int32_t, 3> pred_normal_3d;
  114|    121|  int32_t pred_normal_oct[2];
  115|       |
  116|   216k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 215k, False: 121]
  ------------------
  117|   215k|    const CornerIndex corner_id =
  118|   215k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   215k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   215k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   215k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   215k|                    octahedron_tool_box_.center_value());
  125|   215k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 214k, False: 933]
  ------------------
  126|   214k|      pred_normal_3d = -pred_normal_3d;
  127|   214k|    }
  128|   215k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   215k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   215k|    const int data_offset = data_id * 2;
  132|   215k|    this->transform().ComputeOriginalValue(
  133|   215k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   215k|  }
  135|    121|  flip_normal_bit_decoder_.EndDecoding();
  136|    121|  return true;
  137|    121|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    121|  void SetQuantizationBits(int q) {
   85|    121|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    121|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    246|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    246|            attribute, transform, mesh_data),
   37|    246|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    488|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    246|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    246|    DRACO_DCHECK_EQ(i, 0);
   70|    246|    (void)i;
   71|    246|    return GeometryAttribute::POSITION;
   72|    246|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    244|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    244|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 244]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    244|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 242]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    242|    predictor_.SetPositionAttribute(*att);
   82|    242|    return true;
   83|    244|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    240|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    240|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 14, False: 226]
  ------------------
  145|     14|    return false;
  146|     14|  }
  147|       |
  148|    226|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    226|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    226|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 64, False: 162]
  ------------------
  150|     64|    uint8_t prediction_mode;
  151|     64|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 64]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     64|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 4, False: 60]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      4|      return false;
  157|      4|    }
  158|       |
  159|     60|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 60]
  ------------------
  160|     60|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     60|  }
  164|    222|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    222|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 7, False: 215]
  ------------------
  168|      7|    return false;
  169|      7|  }
  170|       |
  171|    215|  return true;
  172|    222|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    215|                                      const PointIndex *entry_to_point_id_map) {
  103|    215|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    215|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    215|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    215|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    215|  const int corner_map_size =
  111|    215|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    215|  VectorD<int32_t, 3> pred_normal_3d;
  114|    215|  int32_t pred_normal_oct[2];
  115|       |
  116|   662k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 662k, False: 215]
  ------------------
  117|   662k|    const CornerIndex corner_id =
  118|   662k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   662k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   662k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   662k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   662k|                    octahedron_tool_box_.center_value());
  125|   662k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 658k, False: 4.03k]
  ------------------
  126|   658k|      pred_normal_3d = -pred_normal_3d;
  127|   658k|    }
  128|   662k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   662k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   662k|    const int data_offset = data_id * 2;
  132|   662k|    this->transform().ComputeOriginalValue(
  133|   662k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   662k|  }
  135|    215|  flip_normal_bit_decoder_.EndDecoding();
  136|    215|  return true;
  137|    215|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    215|  void SetQuantizationBits(int q) {
   85|    215|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    215|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    422|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    422|            attribute, transform, mesh_data),
   37|    422|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    842|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    422|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    422|    DRACO_DCHECK_EQ(i, 0);
   70|    422|    (void)i;
   71|    422|    return GeometryAttribute::POSITION;
   72|    422|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    421|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    421|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 421]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    421|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 420]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    420|    predictor_.SetPositionAttribute(*att);
   82|    420|    return true;
   83|    421|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    417|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    417|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 20, False: 397]
  ------------------
  145|     20|    return false;
  146|     20|  }
  147|       |
  148|    397|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    397|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    397|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 102, False: 295]
  ------------------
  150|    102|    uint8_t prediction_mode;
  151|    102|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 11, False: 91]
  ------------------
  152|     11|      return false;
  153|     11|    }
  154|     91|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 90]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     90|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 90]
  ------------------
  160|     90|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     90|  }
  164|    385|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    385|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 21, False: 364]
  ------------------
  168|     21|    return false;
  169|     21|  }
  170|       |
  171|    364|  return true;
  172|    385|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    364|                                      const PointIndex *entry_to_point_id_map) {
  103|    364|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    364|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    364|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    364|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    364|  const int corner_map_size =
  111|    364|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    364|  VectorD<int32_t, 3> pred_normal_3d;
  114|    364|  int32_t pred_normal_oct[2];
  115|       |
  116|   147k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 146k, False: 364]
  ------------------
  117|   146k|    const CornerIndex corner_id =
  118|   146k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   146k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   146k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   146k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   146k|                    octahedron_tool_box_.center_value());
  125|   146k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 137k, False: 9.43k]
  ------------------
  126|   137k|      pred_normal_3d = -pred_normal_3d;
  127|   137k|    }
  128|   146k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   146k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   146k|    const int data_offset = data_id * 2;
  132|   146k|    this->transform().ComputeOriginalValue(
  133|   146k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   146k|  }
  135|    364|  flip_normal_bit_decoder_.EndDecoding();
  136|    364|  return true;
  137|    364|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    364|  void SetQuantizationBits(int q) {
   85|    364|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    364|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    151|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    151|            attribute, transform, mesh_data),
   37|    151|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    122|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    122|            attribute, transform, mesh_data),
   37|    122|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    149|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    149|            attribute, transform, mesh_data),
   37|    149|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    138|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    138|            attribute, transform, mesh_data),
   37|    138|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    182|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    182|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 30, False: 152]
  ------------------
  105|     30|      this->normal_prediction_mode_ = mode;
  106|     30|      return true;
  107|    152|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 152, False: 0]
  ------------------
  108|    152|      this->normal_prediction_mode_ = mode;
  109|    152|      return true;
  110|    152|    }
  111|      0|    return false;
  112|    182|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   612k|                             DataTypeT *prediction) override {
   42|   612k|    DRACO_DCHECK(this->IsInitialized());
   43|   612k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   612k|    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|   612k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   612k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   612k|    VectorD<int64_t, 3> normal;
   53|   612k|    CornerIndex c_next, c_prev;
   54|  1.36M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 756k, False: 612k]
  ------------------
   55|       |      // Getting corners.
   56|   756k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 162, False: 756k]
  ------------------
   57|    162|        c_next = corner_table->Next(corner_id);
   58|    162|        c_prev = corner_table->Previous(corner_id);
   59|   756k|      } else {
   60|   756k|        c_next = corner_table->Next(cit.Corner());
   61|   756k|        c_prev = corner_table->Previous(cit.Corner());
   62|   756k|      }
   63|   756k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   756k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   756k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   756k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   756k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   756k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   756k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   756k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   756k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   756k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   756k|      cit.Next();
   81|   756k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   612k|    constexpr int64_t upper_bound = 1 << 29;
   85|   612k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 108, False: 611k]
  ------------------
   86|    108|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    108|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 54, False: 54]
  ------------------
   88|     54|        const int64_t quotient = abs_sum / upper_bound;
   89|     54|        normal = normal / quotient;
   90|     54|      }
   91|   611k|    } else {
   92|   611k|      const int64_t abs_sum = normal.AbsSum();
   93|   611k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.93k, False: 609k]
  ------------------
   94|  1.93k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.93k|        normal = normal / quotient;
   96|  1.93k|      }
   97|   611k|    }
   98|   612k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   612k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   612k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   612k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   612k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    131|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    131|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 8, False: 123]
  ------------------
  105|      8|      this->normal_prediction_mode_ = mode;
  106|      8|      return true;
  107|    123|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 123, False: 0]
  ------------------
  108|    123|      this->normal_prediction_mode_ = mode;
  109|    123|      return true;
  110|    123|    }
  111|      0|    return false;
  112|    131|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   215k|                             DataTypeT *prediction) override {
   42|   215k|    DRACO_DCHECK(this->IsInitialized());
   43|   215k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   215k|    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|   215k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   215k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   215k|    VectorD<int64_t, 3> normal;
   53|   215k|    CornerIndex c_next, c_prev;
   54|  1.50M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.28M, False: 215k]
  ------------------
   55|       |      // Getting corners.
   56|  1.28M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 42, False: 1.28M]
  ------------------
   57|     42|        c_next = corner_table->Next(corner_id);
   58|     42|        c_prev = corner_table->Previous(corner_id);
   59|  1.28M|      } else {
   60|  1.28M|        c_next = corner_table->Next(cit.Corner());
   61|  1.28M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.28M|      }
   63|  1.28M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.28M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.28M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.28M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.28M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.28M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.28M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.28M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.28M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.28M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.28M|      cit.Next();
   81|  1.28M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   215k|    constexpr int64_t upper_bound = 1 << 29;
   85|   215k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 28, False: 215k]
  ------------------
   86|     28|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     28|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 11, False: 17]
  ------------------
   88|     11|        const int64_t quotient = abs_sum / upper_bound;
   89|     11|        normal = normal / quotient;
   90|     11|      }
   91|   215k|    } else {
   92|   215k|      const int64_t abs_sum = normal.AbsSum();
   93|   215k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 148k, False: 67.3k]
  ------------------
   94|   148k|        const int64_t quotient = abs_sum / upper_bound;
   95|   148k|        normal = normal / quotient;
   96|   148k|      }
   97|   215k|    }
   98|   215k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   215k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   215k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   215k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   215k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    181|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    181|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 30, False: 151]
  ------------------
  105|     30|      this->normal_prediction_mode_ = mode;
  106|     30|      return true;
  107|    151|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 151, False: 0]
  ------------------
  108|    151|      this->normal_prediction_mode_ = mode;
  109|    151|      return true;
  110|    151|    }
  111|      0|    return false;
  112|    181|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   388k|                             DataTypeT *prediction) override {
   42|   388k|    DRACO_DCHECK(this->IsInitialized());
   43|   388k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   388k|    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|   388k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   388k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   388k|    VectorD<int64_t, 3> normal;
   53|   388k|    CornerIndex c_next, c_prev;
   54|  1.18M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 794k, False: 388k]
  ------------------
   55|       |      // Getting corners.
   56|   794k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 162, False: 793k]
  ------------------
   57|    162|        c_next = corner_table->Next(corner_id);
   58|    162|        c_prev = corner_table->Previous(corner_id);
   59|   793k|      } else {
   60|   793k|        c_next = corner_table->Next(cit.Corner());
   61|   793k|        c_prev = corner_table->Previous(cit.Corner());
   62|   793k|      }
   63|   794k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   794k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   794k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   794k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   794k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   794k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   794k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   794k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   794k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   794k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   794k|      cit.Next();
   81|   794k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   388k|    constexpr int64_t upper_bound = 1 << 29;
   85|   388k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 108, False: 388k]
  ------------------
   86|    108|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    108|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 47, False: 61]
  ------------------
   88|     47|        const int64_t quotient = abs_sum / upper_bound;
   89|     47|        normal = normal / quotient;
   90|     47|      }
   91|   388k|    } else {
   92|   388k|      const int64_t abs_sum = normal.AbsSum();
   93|   388k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.95k, False: 386k]
  ------------------
   94|  1.95k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.95k|        normal = normal / quotient;
   96|  1.95k|      }
   97|   388k|    }
   98|   388k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   388k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   388k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   388k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   388k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    157|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    157|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 17, False: 140]
  ------------------
  105|     17|      this->normal_prediction_mode_ = mode;
  106|     17|      return true;
  107|    140|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 140, False: 0]
  ------------------
  108|    140|      this->normal_prediction_mode_ = mode;
  109|    140|      return true;
  110|    140|    }
  111|      0|    return false;
  112|    157|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   215k|                             DataTypeT *prediction) override {
   42|   215k|    DRACO_DCHECK(this->IsInitialized());
   43|   215k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   215k|    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|   215k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   215k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   215k|    VectorD<int64_t, 3> normal;
   53|   215k|    CornerIndex c_next, c_prev;
   54|  1.50M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.28M, False: 215k]
  ------------------
   55|       |      // Getting corners.
   56|  1.28M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 96, False: 1.28M]
  ------------------
   57|     96|        c_next = corner_table->Next(corner_id);
   58|     96|        c_prev = corner_table->Previous(corner_id);
   59|  1.28M|      } else {
   60|  1.28M|        c_next = corner_table->Next(cit.Corner());
   61|  1.28M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.28M|      }
   63|  1.28M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.28M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.28M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.28M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.28M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.28M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.28M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.28M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.28M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.28M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.28M|      cit.Next();
   81|  1.28M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   215k|    constexpr int64_t upper_bound = 1 << 29;
   85|   215k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 64, False: 215k]
  ------------------
   86|     64|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     64|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 20, False: 44]
  ------------------
   88|     20|        const int64_t quotient = abs_sum / upper_bound;
   89|     20|        normal = normal / quotient;
   90|     20|      }
   91|   215k|    } else {
   92|   215k|      const int64_t abs_sum = normal.AbsSum();
   93|   215k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 137k, False: 78.7k]
  ------------------
   94|   137k|        const int64_t quotient = abs_sum / upper_bound;
   95|   137k|        normal = normal / quotient;
   96|   137k|      }
   97|   215k|    }
   98|   215k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   215k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   215k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   215k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   215k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    246|      : Base(md) {
   35|    246|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    246|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    306|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    306|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 59, False: 247]
  ------------------
  105|     59|      this->normal_prediction_mode_ = mode;
  106|     59|      return true;
  107|    247|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 247, False: 0]
  ------------------
  108|    247|      this->normal_prediction_mode_ = mode;
  109|    247|      return true;
  110|    247|    }
  111|      0|    return false;
  112|    306|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   662k|                             DataTypeT *prediction) override {
   42|   662k|    DRACO_DCHECK(this->IsInitialized());
   43|   662k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   662k|    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|   662k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   662k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   662k|    VectorD<int64_t, 3> normal;
   53|   662k|    CornerIndex c_next, c_prev;
   54|  1.35M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 689k, False: 662k]
  ------------------
   55|       |      // Getting corners.
   56|   689k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 330, False: 689k]
  ------------------
   57|    330|        c_next = corner_table->Next(corner_id);
   58|    330|        c_prev = corner_table->Previous(corner_id);
   59|   689k|      } else {
   60|   689k|        c_next = corner_table->Next(cit.Corner());
   61|   689k|        c_prev = corner_table->Previous(cit.Corner());
   62|   689k|      }
   63|   689k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   689k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   689k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   689k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   689k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   689k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   689k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   689k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   689k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   689k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   689k|      cit.Next();
   81|   689k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   662k|    constexpr int64_t upper_bound = 1 << 29;
   85|   662k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 282, False: 661k]
  ------------------
   86|    282|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    282|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 93, False: 189]
  ------------------
   88|     93|        const int64_t quotient = abs_sum / upper_bound;
   89|     93|        normal = normal / quotient;
   90|     93|      }
   91|   661k|    } else {
   92|   661k|      const int64_t abs_sum = normal.AbsSum();
   93|   661k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.35k, False: 659k]
  ------------------
   94|  2.35k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.35k|        normal = normal / quotient;
   96|  2.35k|      }
   97|   661k|    }
   98|   662k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   662k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   662k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   662k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   662k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    422|      : Base(md) {
   35|    422|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    422|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    512|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    512|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 88, False: 424]
  ------------------
  105|     88|      this->normal_prediction_mode_ = mode;
  106|     88|      return true;
  107|    424|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 424, False: 0]
  ------------------
  108|    424|      this->normal_prediction_mode_ = mode;
  109|    424|      return true;
  110|    424|    }
  111|      0|    return false;
  112|    512|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   146k|                             DataTypeT *prediction) override {
   42|   146k|    DRACO_DCHECK(this->IsInitialized());
   43|   146k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   146k|    const CornerTable *const corner_table = this->mesh_data_.corner_table();
   45|       |    // Going to compute the predicted normal from the surrounding triangles
   46|       |    // according to the connectivity of the given corner table.
   47|   146k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   146k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   146k|    VectorD<int64_t, 3> normal;
   53|   146k|    CornerIndex c_next, c_prev;
   54|   960k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 813k, False: 146k]
  ------------------
   55|       |      // Getting corners.
   56|   813k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 486, False: 813k]
  ------------------
   57|    486|        c_next = corner_table->Next(corner_id);
   58|    486|        c_prev = corner_table->Previous(corner_id);
   59|   813k|      } else {
   60|   813k|        c_next = corner_table->Next(cit.Corner());
   61|   813k|        c_prev = corner_table->Previous(cit.Corner());
   62|   813k|      }
   63|   813k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   813k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   813k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   813k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   813k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   813k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   813k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   813k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   813k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   813k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   813k|      cit.Next();
   81|   813k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   146k|    constexpr int64_t upper_bound = 1 << 29;
   85|   146k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 468, False: 146k]
  ------------------
   86|    468|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    468|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 173, False: 295]
  ------------------
   88|    173|        const int64_t quotient = abs_sum / upper_bound;
   89|    173|        normal = normal / quotient;
   90|    173|      }
   91|   146k|    } else {
   92|   146k|      const int64_t abs_sum = normal.AbsSum();
   93|   146k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.92k, False: 143k]
  ------------------
   94|  2.92k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.92k|        normal = normal / quotient;
   96|  2.92k|      }
   97|   146k|    }
   98|   146k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   146k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   146k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   146k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   146k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    151|      : Base(md) {
   35|    151|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    151|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    122|      : Base(md) {
   35|    122|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    122|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    149|      : Base(md) {
   35|    149|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    149|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    138|      : Base(md) {
   35|    138|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    138|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.12M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.12M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.12M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.12M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.12M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.12M|    return GetPositionForDataId(data_id);
   77|  2.12M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.12M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.12M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.12M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.12M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.12M|    VectorD<int64_t, 3> pos;
   68|  2.12M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.12M|    return pos;
   70|  2.12M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    150|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    150|    pos_attribute_ = &position_attribute;
   43|    150|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    130|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    130|    entry_to_point_id_map_ = map;
   46|    130|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.79M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.79M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.79M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.79M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.79M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.79M|    return GetPositionForDataId(data_id);
   77|  2.79M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.79M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.79M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.79M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.79M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.79M|    VectorD<int64_t, 3> pos;
   68|  2.79M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.79M|    return pos;
   70|  2.79M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    121|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    121|    pos_attribute_ = &position_attribute;
   43|    121|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    113|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    113|    entry_to_point_id_map_ = map;
   46|    113|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.97M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.97M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.97M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.97M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.97M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.97M|    return GetPositionForDataId(data_id);
   77|  1.97M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.97M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.97M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.97M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.97M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.97M|    VectorD<int64_t, 3> pos;
   68|  1.97M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.97M|    return pos;
   70|  1.97M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    147|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    147|    pos_attribute_ = &position_attribute;
   43|    147|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    125|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    125|    entry_to_point_id_map_ = map;
   46|    125|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.79M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.79M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.79M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.79M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.79M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.79M|    return GetPositionForDataId(data_id);
   77|  2.79M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.79M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.79M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.79M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.79M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.79M|    VectorD<int64_t, 3> pos;
   68|  2.79M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.79M|    return pos;
   70|  2.79M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    136|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    136|    pos_attribute_ = &position_attribute;
   43|    136|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    121|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    121|    entry_to_point_id_map_ = map;
   46|    121|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    246|      : pos_attribute_(nullptr),
   36|    246|        entry_to_point_id_map_(nullptr),
   37|    246|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    246|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.04M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.04M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.04M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.04M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.04M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.04M|    return GetPositionForDataId(data_id);
   77|  2.04M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.04M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.04M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.04M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.04M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.04M|    VectorD<int64_t, 3> pos;
   68|  2.04M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.04M|    return pos;
   70|  2.04M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    242|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    242|    pos_attribute_ = &position_attribute;
   43|    242|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    215|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    215|    entry_to_point_id_map_ = map;
   46|    215|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    422|      : pos_attribute_(nullptr),
   36|    422|        entry_to_point_id_map_(nullptr),
   37|    422|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    422|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.77M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.77M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.77M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.77M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.77M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.77M|    return GetPositionForDataId(data_id);
   77|  1.77M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.77M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.77M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.77M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.77M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.77M|    VectorD<int64_t, 3> pos;
   68|  1.77M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.77M|    return pos;
   70|  1.77M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    420|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    420|    pos_attribute_ = &position_attribute;
   43|    420|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    364|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    364|    entry_to_point_id_map_ = map;
   46|    364|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    151|      : pos_attribute_(nullptr),
   36|    151|        entry_to_point_id_map_(nullptr),
   37|    151|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    151|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    122|      : pos_attribute_(nullptr),
   36|    122|        entry_to_point_id_map_(nullptr),
   37|    122|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    122|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    149|      : pos_attribute_(nullptr),
   36|    149|        entry_to_point_id_map_(nullptr),
   37|    149|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    149|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    138|      : pos_attribute_(nullptr),
   36|    138|        entry_to_point_id_map_(nullptr),
   37|    138|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    138|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    324|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    324|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    309|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    309|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    309|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    309|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    309|      new DataTypeT[num_components]());
   70|       |
   71|    309|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    309|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    309|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    309|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    309|  const int corner_map_size =
   78|    309|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|  1.37M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 1.37M, False: 309]
  ------------------
   80|  1.37M|    const CornerIndex start_corner_id =
   81|  1.37M|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|  1.37M|    CornerIndex corner_id(start_corner_id);
   84|  1.37M|    int num_parallelograms = 0;
   85|   107M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 106M, False: 1.37M]
  ------------------
   86|   106M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|   106M|    }
   88|  3.11M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 1.74M, False: 1.37M]
  ------------------
   89|  1.74M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 150k, False: 1.59M]
  ------------------
   90|  1.74M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  1.74M|              num_components, parallelogram_pred_vals.get())) {
   92|  12.9M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 12.7M, False: 150k]
  ------------------
   93|  12.7M|          pred_vals[c] =
   94|  12.7M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  12.7M|        }
   96|   150k|        ++num_parallelograms;
   97|   150k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  1.74M|      corner_id = table->SwingRight(corner_id);
  101|  1.74M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 70.0k, False: 1.67M]
  ------------------
  102|  70.0k|        corner_id = kInvalidCornerIndex;
  103|  70.0k|      }
  104|  1.74M|    }
  105|       |
  106|  1.37M|    const int dst_offset = p * num_components;
  107|  1.37M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 1.29M, False: 80.8k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  1.29M|      const int src_offset = (p - 1) * num_components;
  111|  1.29M|      this->transform().ComputeOriginalValue(
  112|  1.29M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|  1.29M|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  6.91M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 6.83M, False: 80.8k]
  ------------------
  116|  6.83M|        pred_vals[c] /= num_parallelograms;
  117|  6.83M|      }
  118|  80.8k|      this->transform().ComputeOriginalValue(
  119|  80.8k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|  80.8k|    }
  121|  1.37M|  }
  122|    309|  return true;
  123|    309|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    396|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    396|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    369|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    369|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    369|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    369|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    369|      new DataTypeT[num_components]());
   70|       |
   71|    369|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    369|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    369|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    369|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    369|  const int corner_map_size =
   78|    369|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   807k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 806k, False: 369]
  ------------------
   80|   806k|    const CornerIndex start_corner_id =
   81|   806k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   806k|    CornerIndex corner_id(start_corner_id);
   84|   806k|    int num_parallelograms = 0;
   85|  20.5M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 19.7M, False: 806k]
  ------------------
   86|  19.7M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  19.7M|    }
   88|  5.59M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 4.78M, False: 806k]
  ------------------
   89|  4.78M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 1.57M, False: 3.21M]
  ------------------
   90|  4.78M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  4.78M|              num_components, parallelogram_pred_vals.get())) {
   92|  40.3M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 38.7M, False: 1.57M]
  ------------------
   93|  38.7M|          pred_vals[c] =
   94|  38.7M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  38.7M|        }
   96|  1.57M|        ++num_parallelograms;
   97|  1.57M|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  4.78M|      corner_id = table->SwingRight(corner_id);
  101|  4.78M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 794k, False: 3.99M]
  ------------------
  102|   794k|        corner_id = kInvalidCornerIndex;
  103|   794k|      }
  104|  4.78M|    }
  105|       |
  106|   806k|    const int dst_offset = p * num_components;
  107|   806k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 1.21k, False: 805k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  1.21k|      const int src_offset = (p - 1) * num_components;
  111|  1.21k|      this->transform().ComputeOriginalValue(
  112|  1.21k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   805k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  20.5M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 19.7M, False: 805k]
  ------------------
  116|  19.7M|        pred_vals[c] /= num_parallelograms;
  117|  19.7M|      }
  118|   805k|      this->transform().ComputeOriginalValue(
  119|   805k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   805k|    }
  121|   806k|  }
  122|    369|  return true;
  123|    369|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  4.44M|    int num_components, DataTypeT *out_prediction) {
   49|  4.44M|  const CornerIndex oci = table->Opposite(ci);
   50|  4.44M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 3.58M, False: 866k]
  ------------------
   51|  3.58M|    return false;
   52|  3.58M|  }
   53|   866k|  int vert_opp, vert_next, vert_prev;
   54|   866k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   866k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   866k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 450k, False: 415k]
  |  Branch (56:35): [True: 341k, False: 109k]
  ------------------
   57|   341k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 317k, False: 24.5k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   317k|    const int v_opp_off = vert_opp * num_components;
   60|   317k|    const int v_next_off = vert_next * num_components;
   61|   317k|    const int v_prev_off = vert_prev * num_components;
   62|  32.6M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 32.3M, False: 317k]
  ------------------
   63|  32.3M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  32.3M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  32.3M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  32.3M|      const int64_t result =
   67|  32.3M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  32.3M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  32.3M|    }
   71|   317k|    return true;
   72|   317k|  }
   73|   549k|  return false;  // Not all data is available for prediction
   74|   866k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   866k|    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|   866k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   866k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   866k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   866k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  6.05M|    int num_components, DataTypeT *out_prediction) {
   49|  6.05M|  const CornerIndex oci = table->Opposite(ci);
   50|  6.05M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 19.1k, False: 6.03M]
  ------------------
   51|  19.1k|    return false;
   52|  19.1k|  }
   53|  6.03M|  int vert_opp, vert_next, vert_prev;
   54|  6.03M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  6.03M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  6.03M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 3.27M, False: 2.76M]
  |  Branch (56:35): [True: 2.51M, False: 762k]
  ------------------
   57|  2.51M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 2.35M, False: 159k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  2.35M|    const int v_opp_off = vert_opp * num_components;
   60|  2.35M|    const int v_next_off = vert_next * num_components;
   61|  2.35M|    const int v_prev_off = vert_prev * num_components;
   62|  82.8M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 80.4M, False: 2.35M]
  ------------------
   63|  80.4M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  80.4M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  80.4M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  80.4M|      const int64_t result =
   67|  80.4M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  80.4M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  80.4M|    }
   71|  2.35M|    return true;
   72|  2.35M|  }
   73|  3.68M|  return false;  // Not all data is available for prediction
   74|  6.03M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  6.03M|    int *next_entry, int *prev_entry) {
   32|       |  // One vertex of the input |table| correspond to exactly one attribute value
   33|       |  // entry. The |table| can be either CornerTable for per-vertex attributes,
   34|       |  // or MeshAttributeCornerTable for attributes with interior seams.
   35|  6.03M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  6.03M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  6.03M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  6.03M|}

_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|    131|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|    131|            attribute, transform, mesh_data),
   46|    131|        pos_attribute_(nullptr),
   47|    131|        entry_to_point_id_map_(nullptr),
   48|    131|        num_components_(0),
   49|    131|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   71|    261|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   73|    131|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|    131|    DRACO_DCHECK_EQ(i, 0);
   75|    131|    (void)i;
   76|    131|    return GeometryAttribute::POSITION;
   77|    131|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|    131|  bool SetParentAttribute(const PointAttribute *att) override {
   80|    131|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 131]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|    131|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 131]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|    131|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 1, False: 130]
  ------------------
   87|      1|      return false;  // Currently works only for 3 component positions.
   88|      1|    }
   89|    130|    pos_attribute_ = att;
   90|    130|    return true;
   91|    131|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  153|    128|    DecodePredictionData(DecoderBuffer *buffer) {
  154|       |  // Decode the delta coded orientations.
  155|    128|  uint32_t num_orientations = 0;
  156|    128|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    128|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (156:7): [True: 6, False: 122]
  ------------------
  157|      6|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (157:9): [True: 0, False: 6]
  ------------------
  158|      0|      return false;
  159|      0|    }
  160|    122|  } else {
  161|    122|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (161:9): [True: 1, False: 121]
  ------------------
  162|      1|      return false;
  163|      1|    }
  164|    122|  }
  165|    127|  if (num_orientations == 0) {
  ------------------
  |  Branch (165:7): [True: 2, False: 125]
  ------------------
  166|      2|    return false;
  167|      2|  }
  168|    125|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (168:7): [True: 12, False: 113]
  ------------------
  169|       |    // We can't have more orientations than the maximum number of decoded
  170|       |    // values.
  171|     12|    return false;
  172|     12|  }
  173|    113|  orientations_.resize(num_orientations);
  174|    113|  bool last_orientation = true;
  175|    113|  RAnsBitDecoder decoder;
  176|    113|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (176:7): [True: 1, False: 112]
  ------------------
  177|      1|    return false;
  178|      1|  }
  179|  72.5k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (179:24): [True: 72.3k, False: 112]
  ------------------
  180|  72.3k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (180:9): [True: 3.73k, False: 68.6k]
  ------------------
  181|  3.73k|      last_orientation = !last_orientation;
  182|  3.73k|    }
  183|  72.3k|    orientations_[i] = last_orientation;
  184|  72.3k|  }
  185|    112|  decoder.EndDecoding();
  186|    112|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  187|    112|                                     MeshDataT>::DecodePredictionData(buffer);
  188|    113|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|     88|                          const PointIndex *entry_to_point_id_map) {
  126|     88|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 6, False: 82]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      6|    return false;
  129|      6|  }
  130|     82|  num_components_ = num_components;
  131|     82|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|     82|  predicted_value_ =
  133|     82|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|     82|  this->transform().Init(num_components);
  135|       |
  136|     82|  const int corner_map_size =
  137|     82|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|   739k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (138:19): [True: 739k, False: 61]
  ------------------
  139|   739k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  140|   739k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (140:9): [True: 21, False: 739k]
  ------------------
  141|     21|      return false;
  142|     21|    }
  143|       |
  144|   739k|    const int dst_offset = p * num_components;
  145|   739k|    this->transform().ComputeOriginalValue(
  146|   739k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  147|   739k|  }
  148|     61|  return true;
  149|     82|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  193|   739k|                          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|   739k|  const CornerIndex next_corner_id =
  198|   739k|      this->mesh_data().corner_table()->Next(corner_id);
  199|   739k|  const CornerIndex prev_corner_id =
  200|   739k|      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|   739k|  int next_data_id, prev_data_id;
  204|       |
  205|   739k|  int next_vert_id, prev_vert_id;
  206|   739k|  next_vert_id =
  207|   739k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  208|   739k|  prev_vert_id =
  209|   739k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  210|       |
  211|   739k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  212|   739k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  213|       |
  214|   739k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (214:7): [True: 508k, False: 231k]
  |  Branch (214:33): [True: 276k, False: 231k]
  ------------------
  215|       |    // Both other corners have available UV coordinates for prediction.
  216|   276k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  217|   276k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  218|   276k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (218:9): [True: 274k, False: 1.88k]
  ------------------
  219|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  220|       |      // Technically floats > INT_MAX are undefined, but compilers will
  221|       |      // convert those values to INT_MIN. We are being explicit here for asan.
  222|   549k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (222:24): [True: 549k, False: 274k]
  ------------------
  223|   549k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (223:13): [True: 0, False: 549k]
  |  Branch (223:36): [True: 86, False: 549k]
  ------------------
  224|   549k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (224:13): [True: 0, False: 549k]
  ------------------
  225|     86|          predicted_value_[i] = INT_MIN;
  226|   549k|        } else {
  227|   549k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  228|   549k|        }
  229|   549k|      }
  230|   274k|      return true;
  231|   274k|    }
  232|       |
  233|       |    // Get positions at all corners.
  234|  1.88k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  235|  1.88k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  236|  1.88k|    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.88k|    const Vector3f pn = prev_pos - next_pos;
  261|  1.88k|    const Vector3f cn = tip_pos - next_pos;
  262|  1.88k|    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.88k|    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.88k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  3.76k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (273:9): [True: 0, False: 1.88k]
  |  Branch (273:53): [True: 107, False: 1.77k]
  ------------------
  274|    107|      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|    107|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  279|  1.77k|    } else {
  280|  1.77k|      s = 0;
  281|  1.77k|      t = 0;
  282|  1.77k|    }
  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.88k|    const Vector2f pn_uv = p_uv - n_uv;
  299|  1.88k|    const float pnus = pn_uv[0] * s + n_uv[0];
  300|  1.88k|    const float pnut = pn_uv[0] * t;
  301|  1.88k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  302|  1.88k|    const float pnvt = pn_uv[1] * t;
  303|  1.88k|    Vector2f predicted_uv;
  304|  1.88k|    if (orientations_.empty()) {
  ------------------
  |  Branch (304:9): [True: 21, False: 1.86k]
  ------------------
  305|     21|      return false;
  306|     21|    }
  307|       |
  308|       |    // When decoding the data, we already know which orientation to use.
  309|  1.86k|    const bool orientation = orientations_.back();
  310|  1.86k|    orientations_.pop_back();
  311|  1.86k|    if (orientation) {
  ------------------
  |  Branch (311:9): [True: 614, False: 1.24k]
  ------------------
  312|    614|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  313|  1.24k|    } else {
  314|  1.24k|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  315|  1.24k|    }
  316|  1.86k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (316:9): [True: 1.86k, 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.86k|      const double u = floor(predicted_uv[0] + 0.5);
  321|  1.86k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (321:11): [True: 0, False: 1.86k]
  |  Branch (321:28): [True: 49, False: 1.81k]
  |  Branch (321:43): [True: 15, False: 1.79k]
  ------------------
  322|     64|        predicted_value_[0] = INT_MIN;
  323|  1.79k|      } else {
  324|  1.79k|        predicted_value_[0] = static_cast<int>(u);
  325|  1.79k|      }
  326|  1.86k|      const double v = floor(predicted_uv[1] + 0.5);
  327|  1.86k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (327:11): [True: 0, False: 1.86k]
  |  Branch (327:28): [True: 51, False: 1.81k]
  |  Branch (327:43): [True: 18, False: 1.79k]
  ------------------
  328|     69|        predicted_value_[1] = INT_MIN;
  329|  1.79k|      } else {
  330|  1.79k|        predicted_value_[1] = static_cast<int>(v);
  331|  1.79k|      }
  332|  1.86k|    } 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.86k|    return true;
  338|  1.88k|  }
  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|   462k|  int data_offset = 0;
  343|   462k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (343:7): [True: 231k, False: 231k]
  ------------------
  344|       |    // Use the value on the previous corner as the prediction.
  345|   231k|    data_offset = prev_data_id * num_components_;
  346|   231k|  }
  347|   462k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (347:7): [True: 7, False: 462k]
  ------------------
  348|       |    // Use the value on the next corner as the prediction.
  349|      7|    data_offset = next_data_id * num_components_;
  350|   462k|  } else {
  351|       |    // None of the other corners have a valid value. Use the last encoded value
  352|       |    // as the prediction if possible.
  353|   462k|    if (data_id > 0) {
  ------------------
  |  Branch (353:9): [True: 462k, False: 82]
  ------------------
  354|   462k|      data_offset = (data_id - 1) * num_components_;
  355|   462k|    } else {
  356|       |      // We are encoding the first value. Predict 0.
  357|    246|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (357:23): [True: 164, False: 82]
  ------------------
  358|    164|        predicted_value_[i] = 0;
  359|    164|      }
  360|     82|      return true;
  361|     82|    }
  362|   462k|  }
  363|  1.38M|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (363:19): [True: 924k, False: 462k]
  ------------------
  364|   924k|    predicted_value_[i] = data[data_offset + i];
  365|   924k|  }
  366|   462k|  return true;
  367|   462k|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   553k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT *data) const {
  103|   553k|    const int data_offset = entry_id * num_components_;
  104|   553k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   553k|                    static_cast<float>(data[data_offset + 1]));
  106|   553k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   94|  5.64k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  5.64k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  5.64k|    Vector3f pos;
   97|  5.64k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  5.64k|                                 &pos[0]);
   99|  5.64k|    return pos;
  100|  5.64k|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|    125|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|    125|            attribute, transform, mesh_data),
   46|    125|        pos_attribute_(nullptr),
   47|    125|        entry_to_point_id_map_(nullptr),
   48|    125|        num_components_(0),
   49|    125|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   71|    248|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   73|    125|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|    125|    DRACO_DCHECK_EQ(i, 0);
   75|    125|    (void)i;
   76|    125|    return GeometryAttribute::POSITION;
   77|    125|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|    124|  bool SetParentAttribute(const PointAttribute *att) override {
   80|    124|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 124]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|    124|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 124]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|    124|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 1, False: 123]
  ------------------
   87|      1|      return false;  // Currently works only for 3 component positions.
   88|      1|    }
   89|    123|    pos_attribute_ = att;
   90|    123|    return true;
   91|    124|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  153|    120|    DecodePredictionData(DecoderBuffer *buffer) {
  154|       |  // Decode the delta coded orientations.
  155|    120|  uint32_t num_orientations = 0;
  156|    120|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    120|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (156:7): [True: 0, False: 120]
  ------------------
  157|      0|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (157:9): [True: 0, False: 0]
  ------------------
  158|      0|      return false;
  159|      0|    }
  160|    120|  } else {
  161|    120|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (161:9): [True: 1, False: 119]
  ------------------
  162|      1|      return false;
  163|      1|    }
  164|    120|  }
  165|    119|  if (num_orientations == 0) {
  ------------------
  |  Branch (165:7): [True: 1, False: 118]
  ------------------
  166|      1|    return false;
  167|      1|  }
  168|    118|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (168:7): [True: 8, False: 110]
  ------------------
  169|       |    // We can't have more orientations than the maximum number of decoded
  170|       |    // values.
  171|      8|    return false;
  172|      8|  }
  173|    110|  orientations_.resize(num_orientations);
  174|    110|  bool last_orientation = true;
  175|    110|  RAnsBitDecoder decoder;
  176|    110|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (176:7): [True: 1, False: 109]
  ------------------
  177|      1|    return false;
  178|      1|  }
  179|  52.2k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (179:24): [True: 52.1k, False: 109]
  ------------------
  180|  52.1k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (180:9): [True: 33.3k, False: 18.8k]
  ------------------
  181|  33.3k|      last_orientation = !last_orientation;
  182|  33.3k|    }
  183|  52.1k|    orientations_[i] = last_orientation;
  184|  52.1k|  }
  185|    109|  decoder.EndDecoding();
  186|    109|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  187|    109|                                     MeshDataT>::DecodePredictionData(buffer);
  188|    110|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|     98|                          const PointIndex *entry_to_point_id_map) {
  126|     98|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 3, False: 95]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      3|    return false;
  129|      3|  }
  130|     95|  num_components_ = num_components;
  131|     95|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|     95|  predicted_value_ =
  133|     95|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|     95|  this->transform().Init(num_components);
  135|       |
  136|     95|  const int corner_map_size =
  137|     95|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|   217k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (138:19): [True: 217k, False: 68]
  ------------------
  139|   217k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  140|   217k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (140:9): [True: 27, False: 217k]
  ------------------
  141|     27|      return false;
  142|     27|    }
  143|       |
  144|   217k|    const int dst_offset = p * num_components;
  145|   217k|    this->transform().ComputeOriginalValue(
  146|   217k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  147|   217k|  }
  148|     68|  return true;
  149|     95|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  193|   217k|                          int data_id) {
  194|       |  // Compute the predicted UV coordinate from the positions on all corners
  195|       |  // of the processed triangle. For the best prediction, the UV coordinates
  196|       |  // on the next/previous corners need to be already encoded/decoded.
  197|   217k|  const CornerIndex next_corner_id =
  198|   217k|      this->mesh_data().corner_table()->Next(corner_id);
  199|   217k|  const CornerIndex prev_corner_id =
  200|   217k|      this->mesh_data().corner_table()->Previous(corner_id);
  201|       |  // Get the encoded data ids from the next and previous corners.
  202|       |  // The data id is the encoding order of the UV coordinates.
  203|   217k|  int next_data_id, prev_data_id;
  204|       |
  205|   217k|  int next_vert_id, prev_vert_id;
  206|   217k|  next_vert_id =
  207|   217k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  208|   217k|  prev_vert_id =
  209|   217k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  210|       |
  211|   217k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  212|   217k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  213|       |
  214|   217k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (214:7): [True: 217k, False: 158]
  |  Branch (214:33): [True: 217k, False: 155]
  ------------------
  215|       |    // Both other corners have available UV coordinates for prediction.
  216|   217k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  217|   217k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  218|   217k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (218:9): [True: 212k, False: 5.00k]
  ------------------
  219|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  220|       |      // Technically floats > INT_MAX are undefined, but compilers will
  221|       |      // convert those values to INT_MIN. We are being explicit here for asan.
  222|   424k|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (222:24): [True: 424k, False: 212k]
  ------------------
  223|   424k|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (223:13): [True: 0, False: 424k]
  |  Branch (223:36): [True: 104, False: 424k]
  ------------------
  224|   424k|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (224:13): [True: 0, False: 424k]
  ------------------
  225|    104|          predicted_value_[i] = INT_MIN;
  226|   424k|        } else {
  227|   424k|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  228|   424k|        }
  229|   424k|      }
  230|   212k|      return true;
  231|   212k|    }
  232|       |
  233|       |    // Get positions at all corners.
  234|  5.00k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  235|  5.00k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  236|  5.00k|    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|  5.00k|    const Vector3f pn = prev_pos - next_pos;
  261|  5.00k|    const Vector3f cn = tip_pos - next_pos;
  262|  5.00k|    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|  5.00k|    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|  5.00k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  10.0k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (273:9): [True: 0, False: 5.00k]
  |  Branch (273:53): [True: 207, False: 4.79k]
  ------------------
  274|    207|      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|    207|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  279|  4.79k|    } else {
  280|  4.79k|      s = 0;
  281|  4.79k|      t = 0;
  282|  4.79k|    }
  283|       |
  284|       |    // Now we need to transform the point (s, t) to the texture coordinate space
  285|       |    // UV. We know the UV coordinates on points N and P (N_UV and P_UV). Lets
  286|       |    // denote P_UV - N_UV = PN_UV. PN_UV is then 2 dimensional vector that can
  287|       |    // be used to define transformation from the normalized coordinate system
  288|       |    // to the texture coordinate system using a 3x3 affine matrix M:
  289|       |    //
  290|       |    //  M = | PN_UV[0]  -PN_UV[1]  N_UV[0] |
  291|       |    //      | PN_UV[1]   PN_UV[0]  N_UV[1] |
  292|       |    //      | 0          0         1       |
  293|       |    //
  294|       |    // The predicted point C_UV in the texture space is then equal to
  295|       |    // C_UV = M * (s, t, 1). Because the triangle in UV space may be flipped
  296|       |    // around the PN_UV axis, we also need to consider point C_UV' = M * (s, -t)
  297|       |    // as the prediction.
  298|  5.00k|    const Vector2f pn_uv = p_uv - n_uv;
  299|  5.00k|    const float pnus = pn_uv[0] * s + n_uv[0];
  300|  5.00k|    const float pnut = pn_uv[0] * t;
  301|  5.00k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  302|  5.00k|    const float pnvt = pn_uv[1] * t;
  303|  5.00k|    Vector2f predicted_uv;
  304|  5.00k|    if (orientations_.empty()) {
  ------------------
  |  Branch (304:9): [True: 27, False: 4.97k]
  ------------------
  305|     27|      return false;
  306|     27|    }
  307|       |
  308|       |    // When decoding the data, we already know which orientation to use.
  309|  4.97k|    const bool orientation = orientations_.back();
  310|  4.97k|    orientations_.pop_back();
  311|  4.97k|    if (orientation) {
  ------------------
  |  Branch (311:9): [True: 2.67k, False: 2.29k]
  ------------------
  312|  2.67k|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  313|  2.67k|    } else {
  314|  2.29k|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  315|  2.29k|    }
  316|  4.97k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (316:9): [True: 4.97k, Folded]
  ------------------
  317|       |      // Round the predicted value for integer types.
  318|       |      // Technically floats > INT_MAX are undefined, but compilers will
  319|       |      // convert those values to INT_MIN. We are being explicit here for asan.
  320|  4.97k|      const double u = floor(predicted_uv[0] + 0.5);
  321|  4.97k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (321:11): [True: 0, False: 4.97k]
  |  Branch (321:28): [True: 69, False: 4.90k]
  |  Branch (321:43): [True: 10, False: 4.89k]
  ------------------
  322|     79|        predicted_value_[0] = INT_MIN;
  323|  4.89k|      } else {
  324|  4.89k|        predicted_value_[0] = static_cast<int>(u);
  325|  4.89k|      }
  326|  4.97k|      const double v = floor(predicted_uv[1] + 0.5);
  327|  4.97k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (327:11): [True: 0, False: 4.97k]
  |  Branch (327:28): [True: 52, False: 4.92k]
  |  Branch (327:43): [True: 8, False: 4.91k]
  ------------------
  328|     60|        predicted_value_[1] = INT_MIN;
  329|  4.91k|      } else {
  330|  4.91k|        predicted_value_[1] = static_cast<int>(v);
  331|  4.91k|      }
  332|  4.97k|    } else {
  333|      0|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  334|      0|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  335|      0|    }
  336|       |
  337|  4.97k|    return true;
  338|  5.00k|  }
  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|    313|  int data_offset = 0;
  343|    313|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (343:7): [True: 155, False: 158]
  ------------------
  344|       |    // Use the value on the previous corner as the prediction.
  345|    155|    data_offset = prev_data_id * num_components_;
  346|    155|  }
  347|    313|  if (next_data_id < data_id) {
  ------------------
  |  Branch (347:7): [True: 8, False: 305]
  ------------------
  348|       |    // Use the value on the next corner as the prediction.
  349|      8|    data_offset = next_data_id * num_components_;
  350|    305|  } else {
  351|       |    // None of the other corners have a valid value. Use the last encoded value
  352|       |    // as the prediction if possible.
  353|    305|    if (data_id > 0) {
  ------------------
  |  Branch (353:9): [True: 210, False: 95]
  ------------------
  354|    210|      data_offset = (data_id - 1) * num_components_;
  355|    210|    } else {
  356|       |      // We are encoding the first value. Predict 0.
  357|    285|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (357:23): [True: 190, False: 95]
  ------------------
  358|    190|        predicted_value_[i] = 0;
  359|    190|      }
  360|     95|      return true;
  361|     95|    }
  362|    305|  }
  363|    654|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (363:19): [True: 436, False: 218]
  ------------------
  364|    436|    predicted_value_[i] = data[data_offset + i];
  365|    436|  }
  366|    218|  return true;
  367|    313|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|   434k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT *data) const {
  103|   434k|    const int data_offset = entry_id * num_components_;
  104|   434k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|   434k|                    static_cast<float>(data[data_offset + 1]));
  106|   434k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   94|  15.0k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  15.0k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  15.0k|    Vector3f pos;
   97|  15.0k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  15.0k|                                 &pos[0]);
   99|  15.0k|    return pos;
  100|  15.0k|  }

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

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    207|      : pos_attribute_(nullptr),
   39|    207|        entry_to_point_id_map_(nullptr),
   40|    207|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    205|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    205|    pos_attribute_ = &position_attribute;
   43|    205|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    191|  void ResizeOrientations(int num_orientations) {
   74|    191|    orientations_.resize(num_orientations);
   75|    191|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|  3.21G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    158|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    158|    entry_to_point_id_map_ = map;
   46|    158|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   385k|                                                 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|   385k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   385k|  const CornerIndex prev_corner_id =
   99|   385k|      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|   385k|  int next_data_id, prev_data_id;
  103|       |
  104|   385k|  int next_vert_id, prev_vert_id;
  105|   385k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   385k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   385k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   385k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   385k|  typedef VectorD<int64_t, 2> Vec2;
  112|   385k|  typedef VectorD<int64_t, 3> Vec3;
  113|   385k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   385k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 262k, False: 122k]
  |  Branch (115:33): [True: 139k, False: 122k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   139k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   139k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   139k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 125k, False: 14.4k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   125k|      predicted_value_[0] = p_uv[0];
  122|   125k|      predicted_value_[1] = p_uv[1];
  123|   125k|      return true;
  124|   125k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  14.4k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  14.4k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  14.4k|    const Vec3 prev_pos = GetPositionForEntryId(prev_data_id);
  130|       |    // We use the positions of the above triangle to predict the texture
  131|       |    // coordinate on the tip corner C.
  132|       |    // To convert the triangle into the UV coordinate system we first compute
  133|       |    // position X on the vector |prev_pos - next_pos| that is the projection of
  134|       |    // point C onto vector |prev_pos - next_pos|:
  135|       |    //
  136|       |    //              C
  137|       |    //             /.  \
  138|       |    //            / .     \
  139|       |    //           /  .        \
  140|       |    //          N---X----------P
  141|       |    //
  142|       |    // Where next_pos is point (N), prev_pos is point (P) and tip_pos is the
  143|       |    // position of predicted coordinate (C).
  144|       |    //
  145|  14.4k|    const Vec3 pn = prev_pos - next_pos;
  146|  14.4k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  14.4k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.75k, False: 12.6k]
  ------------------
  148|       |      // Compute the projection of C onto PN by computing dot product of CN with
  149|       |      // PN and normalizing it by length of PN. This gives us a factor |s| where
  150|       |      // |s = PN.Dot(CN) / PN.SquaredNorm2()|. This factor can be used to
  151|       |      // compute X in UV space |X_UV| as |X_UV = N_UV + s * PN_UV|.
  152|  1.75k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.75k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.75k|      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.75k|      const int64_t n_uv_absmax_element =
  164|  1.75k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.75k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 25, False: 1.73k]
  ------------------
  166|  1.75k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     25|        return false;
  169|     25|      }
  170|  1.73k|      const int64_t pn_uv_absmax_element =
  171|  1.73k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.73k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 18, False: 1.71k]
  ------------------
  173|  1.73k|          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.71k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.71k|      const int64_t pn_absmax_element =
  179|  1.71k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.71k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 10, False: 1.70k]
  ------------------
  181|  1.71k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|     10|        return false;
  184|     10|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.70k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.70k|      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.70k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.70k|      const uint64_t norm_squared =
  207|  1.70k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.70k|      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.70k|      Vec2 predicted_uv;
  214|  1.70k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.70k]
  ------------------
  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.70k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.70k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 9, False: 1.69k]
  ------------------
  233|      9|          return false;
  234|      9|        }
  235|  1.69k|        const bool orientation = orientations_.back();
  236|  1.69k|        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.69k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 581, False: 1.11k]
  ------------------
  240|    581|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|  1.11k|        } else {
  242|  1.11k|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|  1.11k|        }
  244|  1.69k|      }
  245|  1.69k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.69k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.69k|      return true;
  248|  1.70k|    }
  249|  14.4k|  }
  250|       |  // Else we don't have available textures on both corners or the position data
  251|       |  // is invalid. For such cases we can't use positions for predicting the uv
  252|       |  // value and we resort to delta coding.
  253|   258k|  int data_offset = 0;
  254|   258k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 135k, False: 122k]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|   135k|    data_offset = prev_data_id * kNumComponents;
  257|   135k|  }
  258|   258k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 12.6k, False: 245k]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  12.6k|    data_offset = next_data_id * kNumComponents;
  261|   245k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|   245k|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 245k, False: 158]
  ------------------
  265|   245k|      data_offset = (data_id - 1) * kNumComponents;
  266|   245k|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    474|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 316, False: 158]
  ------------------
  269|    316|        predicted_value_[i] = 0;
  270|    316|      }
  271|    158|      return true;
  272|    158|    }
  273|   245k|  }
  274|   774k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 516k, False: 258k]
  ------------------
  275|   516k|    predicted_value_[i] = data[data_offset + i];
  276|   516k|  }
  277|   258k|  return true;
  278|   258k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   279k|                                            const DataTypeT *data) const {
   59|   279k|    const int data_offset = entry_id * kNumComponents;
   60|   279k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   279k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  43.2k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  43.2k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  43.2k|    VectorD<int64_t, 3> pos;
   52|  43.2k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  43.2k|                                 &pos[0]);
   54|  43.2k|    return pos;
   55|  43.2k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|   385k|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    228|      : pos_attribute_(nullptr),
   39|    228|        entry_to_point_id_map_(nullptr),
   40|    228|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    223|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    223|    pos_attribute_ = &position_attribute;
   43|    223|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    214|  void ResizeOrientations(int num_orientations) {
   74|    214|    orientations_.resize(num_orientations);
   75|    214|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  1.98G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    162|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    162|    entry_to_point_id_map_ = map;
   46|    162|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   258k|                                                 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|   258k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   258k|  const CornerIndex prev_corner_id =
   99|   258k|      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|   258k|  int next_data_id, prev_data_id;
  103|       |
  104|   258k|  int next_vert_id, prev_vert_id;
  105|   258k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   258k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   258k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   258k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   258k|  typedef VectorD<int64_t, 2> Vec2;
  112|   258k|  typedef VectorD<int64_t, 3> Vec3;
  113|   258k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   258k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 257k, False: 269]
  |  Branch (115:33): [True: 257k, False: 259]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   257k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   257k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   257k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 246k, False: 11.1k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   246k|      predicted_value_[0] = p_uv[0];
  122|   246k|      predicted_value_[1] = p_uv[1];
  123|   246k|      return true;
  124|   246k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  11.1k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  11.1k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  11.1k|    const Vec3 prev_pos = GetPositionForEntryId(prev_data_id);
  130|       |    // We use the positions of the above triangle to predict the texture
  131|       |    // coordinate on the tip corner C.
  132|       |    // To convert the triangle into the UV coordinate system we first compute
  133|       |    // position X on the vector |prev_pos - next_pos| that is the projection of
  134|       |    // point C onto vector |prev_pos - next_pos|:
  135|       |    //
  136|       |    //              C
  137|       |    //             /.  \
  138|       |    //            / .     \
  139|       |    //           /  .        \
  140|       |    //          N---X----------P
  141|       |    //
  142|       |    // Where next_pos is point (N), prev_pos is point (P) and tip_pos is the
  143|       |    // position of predicted coordinate (C).
  144|       |    //
  145|  11.1k|    const Vec3 pn = prev_pos - next_pos;
  146|  11.1k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  11.1k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.21k, False: 9.93k]
  ------------------
  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.21k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.21k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.21k|      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.21k|      const int64_t n_uv_absmax_element =
  164|  1.21k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.21k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 28, False: 1.18k]
  ------------------
  166|  1.21k|          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.18k|      const int64_t pn_uv_absmax_element =
  171|  1.18k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.18k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 9, False: 1.17k]
  ------------------
  173|  1.18k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      9|        return false;
  176|      9|      }
  177|  1.17k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.17k|      const int64_t pn_absmax_element =
  179|  1.17k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.17k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 8, False: 1.17k]
  ------------------
  181|  1.17k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|      8|        return false;
  184|      8|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.17k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.17k|      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.17k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.17k|      const uint64_t norm_squared =
  207|  1.17k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.17k|      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.17k|      Vec2 predicted_uv;
  214|  1.17k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.17k]
  ------------------
  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.17k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.17k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 5, False: 1.16k]
  ------------------
  233|      5|          return false;
  234|      5|        }
  235|  1.16k|        const bool orientation = orientations_.back();
  236|  1.16k|        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.16k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 242, False: 923]
  ------------------
  240|    242|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    923|        } else {
  242|    923|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    923|        }
  244|  1.16k|      }
  245|  1.16k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.16k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.16k|      return true;
  248|  1.17k|    }
  249|  11.1k|  }
  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|  10.4k|  int data_offset = 0;
  254|  10.4k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 10.1k, False: 269]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  10.1k|    data_offset = prev_data_id * kNumComponents;
  257|  10.1k|  }
  258|  10.4k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 9.95k, False: 511]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  9.95k|    data_offset = next_data_id * kNumComponents;
  261|  9.95k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|    511|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 349, False: 162]
  ------------------
  265|    349|      data_offset = (data_id - 1) * kNumComponents;
  266|    349|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    486|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 324, False: 162]
  ------------------
  269|    324|        predicted_value_[i] = 0;
  270|    324|      }
  271|    162|      return true;
  272|    162|    }
  273|    511|  }
  274|  30.9k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 20.6k, False: 10.3k]
  ------------------
  275|  20.6k|    predicted_value_[i] = data[data_offset + i];
  276|  20.6k|  }
  277|  10.3k|  return true;
  278|  10.4k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   515k|                                            const DataTypeT *data) const {
   59|   515k|    const int data_offset = entry_id * kNumComponents;
   60|   515k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   515k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|  33.4k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  33.4k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  33.4k|    VectorD<int64_t, 3> pos;
   52|  33.4k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  33.4k|                                 &pos[0]);
   54|  33.4k|    return pos;
   55|  33.4k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   258k|  const DataTypeT *predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    158|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    418|  bool AreCorrectionsPositive() override {
   71|    418|    return transform_.AreCorrectionsPositive();
   72|    418|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    147|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    147|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 29, False: 118]
  ------------------
   50|     29|      return false;
   51|     29|    }
   52|    118|    return true;
   53|    147|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|   854k|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    219|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    486|  bool AreCorrectionsPositive() override {
   71|    486|    return transform_.AreCorrectionsPositive();
   72|    486|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    204|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    204|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 22, False: 182]
  ------------------
   50|     22|      return false;
   51|     22|    }
   52|    182|    return true;
   53|    204|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|   842k|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  4.28k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  2.92k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  4.09k|  bool AreCorrectionsPositive() override {
   71|  4.09k|    return transform_.AreCorrectionsPositive();
   72|  4.09k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  3.22k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  3.22k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 252, False: 2.97k]
  ------------------
   50|    252|      return false;
   51|    252|    }
   52|  2.97k|    return true;
   53|  3.22k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  26.4M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    431|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    506|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    431|                                 const PointCloudDecoder *decoder) {
  188|    431|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    431|      method, att_id, decoder, TransformT());
  190|    431|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    431|                                 const TransformT &transform) {
  156|    431|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 431]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    431|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    431|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 411, 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|    411|    const MeshDecoder *const mesh_decoder =
  167|    411|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    411|    auto ret = CreateMeshPredictionScheme<
  170|    411|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    411|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    411|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    411|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 273, False: 138]
  ------------------
  174|    273|      return ret;
  175|    273|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    411|  }
  178|       |  // Create delta decoder.
  179|    158|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    158|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    431|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    153|      uint16_t bitstream_version) {
  143|    153|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    153|        method, attribute, transform, mesh_data, bitstream_version);
  145|    153|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    153|        uint16_t bitstream_version) {
  127|    153|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 151, False: 2]
  ------------------
  128|    151|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    151|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    151|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    151|                                                  mesh_data));
  132|    151|      }
  133|      2|      return nullptr;
  134|    153|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    124|      uint16_t bitstream_version) {
  143|    124|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    124|        method, attribute, transform, mesh_data, bitstream_version);
  145|    124|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    124|        uint16_t bitstream_version) {
  127|    124|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 122, False: 2]
  ------------------
  128|    122|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    122|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    122|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    122|                                                  mesh_data));
  132|    122|      }
  133|      2|      return nullptr;
  134|    124|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    506|                                 const PointCloudDecoder *decoder) {
  188|    506|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    506|      method, att_id, decoder, TransformT());
  190|    506|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    506|                                 const TransformT &transform) {
  156|    506|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 506]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    506|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    506|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 505, 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|    505|    const MeshDecoder *const mesh_decoder =
  167|    505|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    505|    auto ret = CreateMeshPredictionScheme<
  170|    505|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    505|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    505|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    505|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 287, False: 218]
  ------------------
  174|    287|      return ret;
  175|    287|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    505|  }
  178|       |  // Create delta decoder.
  179|    219|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    219|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    506|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    167|      uint16_t bitstream_version) {
  143|    167|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    167|        method, attribute, transform, mesh_data, bitstream_version);
  145|    167|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    167|        uint16_t bitstream_version) {
  111|    167|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 149, False: 18]
  ------------------
  112|    149|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    149|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    149|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    149|                                                  mesh_data));
  116|    149|      }
  117|     18|      return nullptr;
  118|    167|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__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_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    139|        uint16_t bitstream_version) {
  111|    139|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 138, False: 1]
  ------------------
  112|    138|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    138|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    138|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    138|                                                  mesh_data));
  116|    138|      }
  117|      1|      return nullptr;
  118|    139|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  4.28k|                                 const PointCloudDecoder *decoder) {
  188|  4.28k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  4.28k|      method, att_id, decoder, TransformT());
  190|  4.28k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  4.28k|                                 const TransformT &transform) {
  156|  4.28k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 4.28k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  4.28k|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|  4.28k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 4.26k, False: 21]
  ------------------
  161|       |    // Cast the decoder to mesh decoder. This is not necessarily safe if there
  162|       |    // is some other decoder decides to use TRIANGULAR_MESH as the return type,
  163|       |    // but unfortunately there is not nice work around for this without using
  164|       |    // RTTI (double dispatch and similar concepts will not work because of the
  165|       |    // template nature of the prediction schemes).
  166|  4.26k|    const MeshDecoder *const mesh_decoder =
  167|  4.26k|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|  4.26k|    auto ret = CreateMeshPredictionScheme<
  170|  4.26k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  4.26k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  4.26k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  4.26k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 3.93k, False: 325]
  ------------------
  174|  3.93k|      return ret;
  175|  3.93k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  4.26k|  }
  178|       |  // Create delta decoder.
  179|    346|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    346|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  4.28k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  1.80k|      uint16_t bitstream_version) {
  143|  1.80k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  1.80k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  1.80k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  1.80k|        uint16_t bitstream_version) {
   53|  1.80k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 526, False: 1.27k]
  ------------------
   54|    526|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    526|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    526|                                                         MeshDataT>(
   57|    526|                attribute, transform, mesh_data));
   58|    526|      }
   59|  1.27k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.27k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 324, False: 955]
  ------------------
   61|    324|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    324|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    324|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    324|                                                  mesh_data));
   65|    324|      }
   66|    955|#endif
   67|    955|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 371, False: 584]
  ------------------
   68|    371|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    371|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    371|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    371|                                                  mesh_data));
   72|    371|      }
   73|    584|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    584|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 131, False: 453]
  ------------------
   75|    131|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    131|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    131|                                                     MeshDataT>(
   78|    131|                attribute, transform, mesh_data, bitstream_version));
   79|    131|      }
   80|    453|#endif
   81|    453|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 207, False: 246]
  ------------------
   82|    207|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    207|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    207|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    207|                                                  mesh_data));
   86|    207|      }
   87|    246|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    246|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 246, False: 0]
  ------------------
   89|    246|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    246|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    246|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    246|                                                  mesh_data));
   93|    246|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  1.80k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.13k|      uint16_t bitstream_version) {
  143|  2.13k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.13k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.13k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.13k|        uint16_t bitstream_version) {
   53|  2.13k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 555, False: 1.57k]
  ------------------
   54|    555|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    555|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    555|                                                         MeshDataT>(
   57|    555|                attribute, transform, mesh_data));
   58|    555|      }
   59|  1.57k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.57k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 396, False: 1.17k]
  ------------------
   61|    396|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    396|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    396|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    396|                                                  mesh_data));
   65|    396|      }
   66|  1.17k|#endif
   67|  1.17k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 404, False: 775]
  ------------------
   68|    404|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    404|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    404|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    404|                                                  mesh_data));
   72|    404|      }
   73|    775|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    775|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 125, False: 650]
  ------------------
   75|    125|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    125|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    125|                                                     MeshDataT>(
   78|    125|                attribute, transform, mesh_data, bitstream_version));
   79|    125|      }
   80|    650|#endif
   81|    650|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 228, False: 422]
  ------------------
   82|    228|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    228|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    228|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    228|                                                  mesh_data));
   86|    228|      }
   87|    422|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    422|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 422, False: 0]
  ------------------
   89|    422|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    422|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    422|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    422|                                                  mesh_data));
   93|    422|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.13k|    }

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

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    411|    uint16_t bitstream_version) {
   38|    411|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    411|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 411, False: 0]
  ------------------
   40|    411|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 4, False: 407]
  ------------------
   41|    407|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 26, False: 381]
  ------------------
   42|    381|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 381]
  ------------------
   43|    381|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 26, False: 355]
  ------------------
   44|    355|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 291, False: 64]
  ------------------
   45|    397|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 50, False: 14]
  ------------------
   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: 120, False: 277]
  |  Branch (49:26): [True: 0, False: 277]
  ------------------
   50|       |      // No connectivity data found.
   51|    120|      return nullptr;
   52|    120|    }
   53|       |    // Connectivity data exists.
   54|    277|    const MeshAttributeCornerTable *const att_ct =
   55|    277|        source->GetAttributeCornerTable(att_id);
   56|    277|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 153, False: 124]
  ------------------
   57|    153|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    153|      MeshData md;
   59|    153|      md.Set(source->mesh(), att_ct,
   60|    153|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    153|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    153|      MeshPredictionSchemeFactoryT factory;
   63|    153|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    153|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 151, False: 2]
  ------------------
   65|    151|        return ret;
   66|    151|      }
   67|    153|    } else {
   68|    124|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    124|      MeshData md;
   70|    124|      md.Set(source->mesh(), ct,
   71|    124|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    124|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    124|      MeshPredictionSchemeFactoryT factory;
   74|    124|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    124|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 122, False: 2]
  ------------------
   76|    122|        return ret;
   77|    122|      }
   78|    124|    }
   79|    277|  }
   80|     18|  return nullptr;
   81|    411|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    505|    uint16_t bitstream_version) {
   38|    505|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    505|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 505, False: 0]
  ------------------
   40|    505|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 41, False: 464]
  ------------------
   41|    464|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 16, False: 448]
  ------------------
   42|    448|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 3, False: 445]
  ------------------
   43|    445|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 46, False: 399]
  ------------------
   44|    399|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 331, False: 68]
  ------------------
   45|    492|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 55, False: 13]
  ------------------
   46|    492|    const CornerTable *const ct = source->GetCornerTable();
   47|    492|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    492|        source->GetAttributeEncodingData(att_id);
   49|    492|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 186, False: 306]
  |  Branch (49:26): [True: 0, False: 306]
  ------------------
   50|       |      // No connectivity data found.
   51|    186|      return nullptr;
   52|    186|    }
   53|       |    // Connectivity data exists.
   54|    306|    const MeshAttributeCornerTable *const att_ct =
   55|    306|        source->GetAttributeCornerTable(att_id);
   56|    306|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 167, False: 139]
  ------------------
   57|    167|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    167|      MeshData md;
   59|    167|      md.Set(source->mesh(), att_ct,
   60|    167|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    167|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    167|      MeshPredictionSchemeFactoryT factory;
   63|    167|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    167|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 149, False: 18]
  ------------------
   65|    149|        return ret;
   66|    149|      }
   67|    167|    } else {
   68|    139|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    139|      MeshData md;
   70|    139|      md.Set(source->mesh(), ct,
   71|    139|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    139|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    139|      MeshPredictionSchemeFactoryT factory;
   74|    139|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    139|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 138, False: 1]
  ------------------
   76|    138|        return ret;
   77|    138|      }
   78|    139|    }
   79|    306|  }
   80|     32|  return nullptr;
   81|    505|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  4.26k|    uint16_t bitstream_version) {
   38|  4.26k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  4.26k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 4.26k, False: 0]
  ------------------
   40|  4.26k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 1.17k, False: 3.08k]
  ------------------
   41|  3.08k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 732, False: 2.35k]
  ------------------
   42|  2.35k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 799, False: 1.55k]
  ------------------
   43|  1.55k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 449, False: 1.10k]
  ------------------
   44|  1.10k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 680, False: 424]
  ------------------
   45|  4.09k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 261, False: 163]
  ------------------
   46|  4.09k|    const CornerTable *const ct = source->GetCornerTable();
   47|  4.09k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  4.09k|        source->GetAttributeEncodingData(att_id);
   49|  4.09k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 162, False: 3.93k]
  |  Branch (49:26): [True: 0, False: 3.93k]
  ------------------
   50|       |      // No connectivity data found.
   51|    162|      return nullptr;
   52|    162|    }
   53|       |    // Connectivity data exists.
   54|  3.93k|    const MeshAttributeCornerTable *const att_ct =
   55|  3.93k|        source->GetAttributeCornerTable(att_id);
   56|  3.93k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 1.80k, False: 2.13k]
  ------------------
   57|  1.80k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  1.80k|      MeshData md;
   59|  1.80k|      md.Set(source->mesh(), att_ct,
   60|  1.80k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  1.80k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  1.80k|      MeshPredictionSchemeFactoryT factory;
   63|  1.80k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  1.80k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 1.80k, False: 0]
  ------------------
   65|  1.80k|        return ret;
   66|  1.80k|      }
   67|  2.13k|    } else {
   68|  2.13k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  2.13k|      MeshData md;
   70|  2.13k|      md.Set(source->mesh(), ct,
   71|  2.13k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  2.13k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  2.13k|      MeshPredictionSchemeFactoryT factory;
   74|  2.13k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  2.13k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 2.13k, False: 0]
  ------------------
   76|  2.13k|        return ret;
   77|  2.13k|      }
   78|  2.13k|    }
   79|  3.93k|  }
   80|    163|  return nullptr;
   81|  4.26k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|   841k|  bool IsInBottomLeft(const Point2 &p) const {
   93|   841k|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 543k, False: 297k]
  |  Branch (93:22): [True: 491k, False: 52.5k]
  ------------------
   94|   491k|      return true;
   95|   491k|    }
   96|   350k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 113k, False: 236k]
  |  Branch (96:25): [True: 55.1k, False: 58.7k]
  ------------------
   97|   841k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|   841k|  int32_t GetRotationCount(Point2 pred) const {
   51|   841k|    const DataType sign_x = pred[0];
   52|   841k|    const DataType sign_y = pred[1];
   53|       |
   54|   841k|    int32_t rotation_count = 0;
   55|   841k|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 543k, False: 297k]
  ------------------
   56|   543k|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 491k, False: 52.5k]
  ------------------
   57|   491k|        rotation_count = 0;
   58|   491k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 26.6k, False: 25.8k]
  ------------------
   59|  26.6k|        rotation_count = 3;
   60|  26.6k|      } else {
   61|  25.8k|        rotation_count = 1;
   62|  25.8k|      }
   63|   543k|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 183k, False: 113k]
  ------------------
   64|   183k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 125k, False: 58.2k]
  ------------------
   65|   125k|        rotation_count = 2;
   66|   125k|      } else {
   67|  58.2k|        rotation_count = 1;
   68|  58.2k|      }
   69|   183k|    } else {
   70|   113k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 55.1k, False: 58.7k]
  ------------------
   71|  55.1k|        rotation_count = 0;
   72|  58.7k|      } else {
   73|  58.7k|        rotation_count = 3;
   74|  58.7k|      }
   75|   113k|    }
   76|   841k|    return rotation_count;
   77|   841k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   590k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   590k|    switch (rotation_count) {
   81|   169k|      case 1:
  ------------------
  |  Branch (81:7): [True: 169k, False: 420k]
  ------------------
   82|   169k|        return Point2(p[1], -p[0]);
   83|   251k|      case 2:
  ------------------
  |  Branch (83:7): [True: 251k, False: 338k]
  ------------------
   84|   251k|        return Point2(-p[0], -p[1]);
   85|   169k|      case 3:
  ------------------
  |  Branch (85:7): [True: 169k, False: 420k]
  ------------------
   86|   169k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 590k]
  ------------------
   88|      0|        return p;
   89|   590k|    }
   90|   590k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    506|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

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

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

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  6.92k|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|   103M|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  5.21k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  24.2k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  7.89k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  7.89k|    portable_attribute_ = std::move(att);
   71|  7.89k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  26.3k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  15.5k|  virtual ~SequentialAttributeDecoder() = default;

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  26.0k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  4.89k|    DecoderBuffer *buffer) {
   30|  4.89k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 265, False: 4.62k]
  ------------------
   31|    265|    return false;
   32|    265|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  4.62k|  const int32_t num_attributes = GetNumAttributes();
   35|  4.62k|  sequential_decoders_.resize(num_attributes);
   36|  20.1k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 15.6k, False: 4.59k]
  ------------------
   37|  15.6k|    uint8_t decoder_type;
   38|  15.6k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 9, False: 15.5k]
  ------------------
   39|      9|      return false;
   40|      9|    }
   41|       |    // Create the decoder from the id.
   42|  15.5k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  15.5k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 17, False: 15.5k]
  ------------------
   44|     17|      return false;
   45|     17|    }
   46|  15.5k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 10, False: 15.5k]
  ------------------
   47|     10|      return false;
   48|     10|    }
   49|  15.5k|  }
   50|  4.59k|  return true;
   51|  4.62k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  4.26k|    DecoderBuffer *buffer) {
   55|  4.26k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 4.26k]
  |  Branch (55:22): [True: 7, False: 4.26k]
  ------------------
   56|      7|    return false;
   57|      7|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  4.26k|  const int32_t num_attributes = GetNumAttributes();
   60|  19.3k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 15.0k, False: 4.26k]
  ------------------
   61|  15.0k|    PointAttribute *const pa =
   62|  15.0k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  15.0k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 0, False: 15.0k]
  ------------------
   64|      0|      return false;
   65|      0|    }
   66|  15.0k|  }
   67|  4.26k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  4.26k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  4.26k|    DecoderBuffer *in_buffer) {
   72|  4.26k|  const int32_t num_attributes = GetNumAttributes();
   73|  11.4k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 9.10k, False: 2.36k]
  ------------------
   74|  9.10k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 1.89k, False: 7.20k]
  ------------------
   75|  9.10k|                                                          in_buffer)) {
   76|  1.89k|      return false;
   77|  1.89k|    }
   78|  9.10k|  }
   79|  2.36k|  return true;
   80|  4.26k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  2.36k|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|  2.36k|  const int32_t num_attributes = GetNumAttributes();
   85|  6.05k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 4.09k, False: 1.95k]
  ------------------
   86|  4.09k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 405, False: 3.68k]
  ------------------
   87|  4.09k|            point_ids_, in_buffer)) {
   88|    405|      return false;
   89|    405|    }
   90|  4.09k|  }
   91|  1.95k|  return true;
   92|  2.36k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  1.95k|    TransformAttributesToOriginalFormat() {
   96|  1.95k|  const int32_t num_attributes = GetNumAttributes();
   97|  4.91k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 3.34k, False: 1.57k]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  3.34k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 3.34k, False: 0]
  ------------------
  100|  3.34k|      const PointAttribute *const attribute =
  101|  3.34k|          sequential_decoders_[i]->attribute();
  102|  3.34k|      const PointAttribute *const portable_attribute =
  103|  3.34k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  3.34k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 2.97k, False: 371]
  |  Branch (104:11): [True: 993, False: 2.34k]
  ------------------
  105|  2.97k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 993, False: 1.97k]
  ------------------
  106|  2.97k|              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|    993|        sequential_decoders_[i]->attribute()->CopyFrom(*portable_attribute);
  113|    993|        continue;
  114|    993|      }
  115|  3.34k|    }
  116|  2.34k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 388, False: 1.96k]
  ------------------
  117|  2.34k|            point_ids_)) {
  118|    388|      return false;
  119|    388|    }
  120|  2.34k|  }
  121|  1.57k|  return true;
  122|  1.95k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  15.5k|    uint8_t decoder_type) {
  127|  15.5k|  switch (decoder_type) {
  128|  1.95k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 1.95k, False: 13.6k]
  ------------------
  129|  1.95k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  1.95k|          new SequentialAttributeDecoder());
  131|  12.3k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 12.3k, False: 3.25k]
  ------------------
  132|  12.3k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  12.3k|          new SequentialIntegerAttributeDecoder());
  134|    181|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 181, False: 15.4k]
  ------------------
  135|    181|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    181|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|  1.09k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 1.09k, False: 14.4k]
  ------------------
  139|  1.09k|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|  1.09k|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|     17|    default:
  ------------------
  |  Branch (142:5): [True: 17, False: 15.5k]
  ------------------
  143|     17|      break;
  144|  15.5k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|     17|  return nullptr;
  147|  15.5k|}

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  13.6k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() {}
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   26|  13.6k|                                             int attribute_id) {
   27|  13.6k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (27:7): [True: 0, False: 13.6k]
  ------------------
   28|      0|    return false;
   29|      0|  }
   30|  13.6k|  return true;
   31|  13.6k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   34|  1.97k|    const std::vector<PointIndex> &point_ids) {
   35|  1.97k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  1.97k|  if (decoder() &&
  ------------------
  |  Branch (36:7): [True: 1.97k, False: 0]
  ------------------
   37|  1.97k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.97k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (37:7): [True: 0, False: 1.97k]
  ------------------
   38|      0|    return true;  // Don't revert the transform here for older files.
   39|      0|  }
   40|  1.97k|#endif
   41|  1.97k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   42|  1.97k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   45|  8.29k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   46|       |  // Decode prediction scheme.
   47|  8.29k|  int8_t prediction_scheme_method;
   48|  8.29k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (48:7): [True: 38, False: 8.25k]
  ------------------
   49|     38|    return false;
   50|     38|  }
   51|       |  // Check that decoded prediction scheme method type is valid.
   52|  8.25k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (52:7): [True: 58, False: 8.19k]
  ------------------
   53|  8.19k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (53:7): [True: 145, False: 8.05k]
  ------------------
   54|    203|    return false;
   55|    203|  }
   56|  8.05k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (56:7): [True: 8.04k, False: 8]
  ------------------
   57|  8.04k|    int8_t prediction_transform_type;
   58|  8.04k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (58:9): [True: 24, False: 8.02k]
  ------------------
   59|     24|      return false;
   60|     24|    }
   61|       |    // Check that decoded prediction scheme transform type is valid.
   62|  8.02k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (62:9): [True: 23, False: 7.99k]
  ------------------
   63|  7.99k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (63:9): [True: 94, False: 7.90k]
  ------------------
   64|    117|      return false;
   65|    117|    }
   66|  7.90k|    prediction_scheme_ = CreateIntPredictionScheme(
   67|  7.90k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   68|  7.90k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   69|  7.90k|  }
   70|       |
   71|  7.91k|  if (prediction_scheme_) {
  ------------------
  |  Branch (71:7): [True: 5.21k, False: 2.69k]
  ------------------
   72|  5.21k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (72:9): [True: 22, False: 5.19k]
  ------------------
   73|     22|      return false;
   74|     22|    }
   75|  5.21k|  }
   76|       |
   77|  7.89k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (77:7): [True: 1.41k, False: 6.48k]
  ------------------
   78|  1.41k|    return false;
   79|  1.41k|  }
   80|       |
   81|  6.48k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   82|  6.48k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   83|  6.48k|  if (decoder() &&
  ------------------
  |  Branch (83:7): [True: 6.48k, False: 0]
  ------------------
   84|  6.48k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  6.48k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:7): [True: 0, False: 6.48k]
  ------------------
   85|       |    // For older files, revert the transform right after we decode the data.
   86|      0|    if (!StoreValues(num_values)) {
  ------------------
  |  Branch (86:9): [True: 0, False: 0]
  ------------------
   87|      0|      return false;
   88|      0|    }
   89|      0|  }
   90|  6.48k|#endif
   91|  6.48k|  return true;
   92|  6.48k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   97|  6.93k|    PredictionSchemeTransformType transform_type) {
   98|  6.93k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (98:7): [True: 2.65k, False: 4.28k]
  ------------------
   99|  2.65k|    return nullptr;  // For now we support only wrap transform.
  100|  2.65k|  }
  101|  4.28k|  return CreatePredictionSchemeForDecoder<
  102|  4.28k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  103|  4.28k|      method, attribute_id(), decoder());
  104|  6.93k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  107|  7.89k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  108|  7.89k|  const int num_components = GetNumValueComponents();
  109|  7.89k|  if (num_components <= 0) {
  ------------------
  |  Branch (109:7): [True: 0, False: 7.89k]
  ------------------
  110|      0|    return false;
  111|      0|  }
  112|  7.89k|  const size_t num_entries = point_ids.size();
  113|  7.89k|  const size_t num_values = num_entries * num_components;
  114|  7.89k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  115|  7.89k|  int32_t *const portable_attribute_data = GetPortableAttributeData();
  116|  7.89k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (116:7): [True: 5, False: 7.88k]
  ------------------
  117|      5|    return false;
  118|      5|  }
  119|  7.88k|  uint8_t compressed;
  120|  7.88k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (120:7): [True: 16, False: 7.87k]
  ------------------
  121|     16|    return false;
  122|     16|  }
  123|  7.87k|  if (compressed > 0) {
  ------------------
  |  Branch (123:7): [True: 580, False: 7.29k]
  ------------------
  124|       |    // Decode compressed values.
  125|    580|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (125:9): [True: 205, False: 375]
  ------------------
  126|    580|                       in_buffer,
  127|    580|                       reinterpret_cast<uint32_t *>(portable_attribute_data))) {
  128|    205|      return false;
  129|    205|    }
  130|  7.29k|  } else {
  131|       |    // Decode the integer data directly.
  132|       |    // Get the number of bytes for a given entry.
  133|  7.29k|    uint8_t num_bytes;
  134|  7.29k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (134:9): [True: 8, False: 7.28k]
  ------------------
  135|      8|      return false;
  136|      8|    }
  137|  7.28k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (137:9): [True: 402, False: 6.88k]
  ------------------
  138|    402|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (138:11): [True: 0, False: 402]
  ------------------
  139|    402|          sizeof(int32_t) * num_values) {
  140|      0|        return false;
  141|      0|      }
  142|    402|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (142:11): [True: 9, False: 393]
  ------------------
  143|    402|                             sizeof(int32_t) * num_values)) {
  144|      9|        return false;
  145|      9|      }
  146|  6.88k|    } else {
  147|  6.88k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (147:11): [True: 30, False: 6.85k]
  ------------------
  148|  6.88k|          num_bytes * num_values) {
  149|     30|        return false;
  150|     30|      }
  151|  6.85k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (151:11): [True: 38, False: 6.81k]
  ------------------
  152|  6.85k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  153|     38|        return false;
  154|     38|      }
  155|   985M|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (155:26): [True: 985M, False: 6.81k]
  ------------------
  156|   985M|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (156:13): [True: 0, False: 985M]
  ------------------
  157|      0|          return false;
  158|      0|        }
  159|   985M|      }
  160|  6.81k|    }
  161|  7.28k|  }
  162|       |
  163|  7.58k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (163:7): [True: 7.58k, False: 0]
  |  Branch (163:26): [True: 2.57k, False: 5.00k]
  ------------------
  164|  6.67k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (164:26): [True: 4.09k, False: 904]
  ------------------
  165|       |    // Convert the values back to the original signed format.
  166|  6.67k|    ConvertSymbolsToSignedInts(
  167|  6.67k|        reinterpret_cast<const uint32_t *>(portable_attribute_data),
  168|  6.67k|        static_cast<int>(num_values), portable_attribute_data);
  169|  6.67k|  }
  170|       |
  171|       |  // If the data was encoded with a prediction scheme, we must revert it.
  172|  7.58k|  if (prediction_scheme_) {
  ------------------
  |  Branch (172:7): [True: 5.00k, False: 2.57k]
  ------------------
  173|  5.00k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (173:9): [True: 658, False: 4.34k]
  ------------------
  174|    658|      return false;
  175|    658|    }
  176|       |
  177|  4.34k|    if (num_values > 0) {
  ------------------
  |  Branch (177:9): [True: 4.34k, False: 0]
  ------------------
  178|  4.34k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (178:11): [True: 441, False: 3.90k]
  ------------------
  179|  4.34k|              portable_attribute_data, portable_attribute_data,
  180|  4.34k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  181|    441|        return false;
  182|    441|      }
  183|  4.34k|    }
  184|  4.34k|  }
  185|  6.48k|  return true;
  186|  7.58k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  188|  1.50k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  189|  1.50k|  switch (attribute()->data_type()) {
  190|    146|    case DT_UINT8:
  ------------------
  |  Branch (190:5): [True: 146, False: 1.35k]
  ------------------
  191|    146|      StoreTypedValues<uint8_t>(num_values);
  192|    146|      break;
  193|    671|    case DT_INT8:
  ------------------
  |  Branch (193:5): [True: 671, False: 831]
  ------------------
  194|    671|      StoreTypedValues<int8_t>(num_values);
  195|    671|      break;
  196|     93|    case DT_UINT16:
  ------------------
  |  Branch (196:5): [True: 93, False: 1.40k]
  ------------------
  197|     93|      StoreTypedValues<uint16_t>(num_values);
  198|     93|      break;
  199|    222|    case DT_INT16:
  ------------------
  |  Branch (199:5): [True: 222, False: 1.28k]
  ------------------
  200|    222|      StoreTypedValues<int16_t>(num_values);
  201|    222|      break;
  202|    153|    case DT_UINT32:
  ------------------
  |  Branch (202:5): [True: 153, False: 1.34k]
  ------------------
  203|    153|      StoreTypedValues<uint32_t>(num_values);
  204|    153|      break;
  205|    107|    case DT_INT32:
  ------------------
  |  Branch (205:5): [True: 107, False: 1.39k]
  ------------------
  206|    107|      StoreTypedValues<int32_t>(num_values);
  207|    107|      break;
  208|    110|    default:
  ------------------
  |  Branch (208:5): [True: 110, False: 1.39k]
  ------------------
  209|    110|      return false;
  210|  1.50k|  }
  211|  1.39k|  return true;
  212|  1.50k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  236|  7.89k|    int num_entries, int num_components) {
  237|  7.89k|  GeometryAttribute ga;
  238|  7.89k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  239|  7.89k|          false, num_components * DataTypeLength(DT_INT32), 0);
  240|  7.89k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  241|  7.89k|  port_att->SetIdentityMapping();
  242|  7.89k|  port_att->Reset(num_entries);
  243|  7.89k|  port_att->set_unique_id(attribute()->unique_id());
  244|  7.89k|  SetPortableAttribute(std::move(port_att));
  245|  7.89k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  215|    146|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    146|  const int num_components = attribute()->num_components();
  217|    146|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    146|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    146|      new AttributeTypeT[num_components]);
  220|    146|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    146|  int val_id = 0;
  222|    146|  int out_byte_pos = 0;
  223|   400k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 400k, False: 146]
  ------------------
  224|  21.3M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 20.9M, False: 400k]
  ------------------
  225|  20.9M|      const AttributeTypeT value =
  226|  20.9M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  20.9M|      att_val[c] = value;
  228|  20.9M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   400k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   400k|    out_byte_pos += entry_size;
  232|   400k|  }
  233|    146|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  215|    671|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    671|  const int num_components = attribute()->num_components();
  217|    671|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    671|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    671|      new AttributeTypeT[num_components]);
  220|    671|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    671|  int val_id = 0;
  222|    671|  int out_byte_pos = 0;
  223|  88.9M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 88.9M, False: 671]
  ------------------
  224|   242M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 153M, False: 88.9M]
  ------------------
  225|   153M|      const AttributeTypeT value =
  226|   153M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   153M|      att_val[c] = value;
  228|   153M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  88.9M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  88.9M|    out_byte_pos += entry_size;
  232|  88.9M|  }
  233|    671|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  215|     93|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     93|  const int num_components = attribute()->num_components();
  217|     93|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     93|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     93|      new AttributeTypeT[num_components]);
  220|     93|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     93|  int val_id = 0;
  222|     93|  int out_byte_pos = 0;
  223|   940k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 940k, False: 93]
  ------------------
  224|  50.8M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 49.8M, False: 940k]
  ------------------
  225|  49.8M|      const AttributeTypeT value =
  226|  49.8M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  49.8M|      att_val[c] = value;
  228|  49.8M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   940k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   940k|    out_byte_pos += entry_size;
  232|   940k|  }
  233|     93|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  215|    222|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    222|  const int num_components = attribute()->num_components();
  217|    222|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    222|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    222|      new AttributeTypeT[num_components]);
  220|    222|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    222|  int val_id = 0;
  222|    222|  int out_byte_pos = 0;
  223|   741k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 740k, False: 222]
  ------------------
  224|  42.8M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 42.1M, False: 740k]
  ------------------
  225|  42.1M|      const AttributeTypeT value =
  226|  42.1M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  42.1M|      att_val[c] = value;
  228|  42.1M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   740k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   740k|    out_byte_pos += entry_size;
  232|   740k|  }
  233|    222|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  215|    153|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    153|  const int num_components = attribute()->num_components();
  217|    153|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    153|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    153|      new AttributeTypeT[num_components]);
  220|    153|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    153|  int val_id = 0;
  222|    153|  int out_byte_pos = 0;
  223|  1.13M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 1.13M, False: 153]
  ------------------
  224|   137M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 136M, False: 1.13M]
  ------------------
  225|   136M|      const AttributeTypeT value =
  226|   136M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   136M|      att_val[c] = value;
  228|   136M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  1.13M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  1.13M|    out_byte_pos += entry_size;
  232|  1.13M|  }
  233|    153|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  215|    107|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    107|  const int num_components = attribute()->num_components();
  217|    107|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    107|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    107|      new AttributeTypeT[num_components]);
  220|    107|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    107|  int val_id = 0;
  222|    107|  int out_byte_pos = 0;
  223|  11.1M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 11.1M, False: 107]
  ------------------
  224|  81.9M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 70.7M, False: 11.1M]
  ------------------
  225|  70.7M|      const AttributeTypeT value =
  226|  70.7M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  70.7M|      att_val[c] = value;
  228|  70.7M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  11.1M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  11.1M|    out_byte_pos += entry_size;
  232|  11.1M|  }
  233|    107|}

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

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

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

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

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

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|  6.20M|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|  6.20M|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|  6.20M|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|  6.20M|    const int remaining = 32 - num_used_bits_;
   54|  6.20M|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 4.24M, False: 1.95M]
  ------------------
   55|  4.24M|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 3.90M, False: 341k]
  ------------------
   56|  3.90M|        return false;
   57|  3.90M|      }
   58|   341k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   341k|      num_used_bits_ += nbits;
   60|   341k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 11.1k, False: 330k]
  ------------------
   61|  11.1k|        ++pos_;
   62|  11.1k|        num_used_bits_ = 0;
   63|  11.1k|      }
   64|  1.95M|    } else {
   65|  1.95M|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 1.94M, False: 11.3k]
  ------------------
   66|  1.94M|        return false;
   67|  1.94M|      }
   68|  11.3k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  11.3k|      num_used_bits_ = nbits - remaining;
   70|  11.3k|      ++pos_;
   71|  11.3k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  11.3k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  11.3k|    }
   74|   353k|    return true;
   75|  6.20M|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  7.57M|  bool DecodeNextBit() {
   35|  7.57M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  7.57M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 7.19M, False: 383k]
  ------------------
   37|  7.19M|      return false;
   38|  7.19M|    }
   39|   383k|    const bool bit = *pos_ & selector;
   40|   383k|    ++num_used_bits_;
   41|   383k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 11.8k, False: 371k]
  ------------------
   42|  11.8k|      ++pos_;
   43|  11.8k|      num_used_bits_ = 0;
   44|  11.8k|    }
   45|   383k|    return bit;
   46|  7.57M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    647|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    567|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    380|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  8.98k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 8.74k, False: 243]
  ------------------
   35|  8.74k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 137, False: 8.60k]
  ------------------
   36|    137|        return false;
   37|    137|      }
   38|  8.74k|    }
   39|    243|    return bit_decoder_.StartDecoding(source_buffer);
   40|    380|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  2.47M|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|  2.47M|    uint32_t result = 0;
   49|  15.6M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 13.1M, False: 2.47M]
  ------------------
   50|  13.1M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  13.1M|      result = (result << 1) + bit;
   52|  13.1M|    }
   53|  2.47M|    *value = result;
   54|  2.47M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|    102|  void EndDecoding() {
   57|  3.36k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 3.26k, False: 102]
  ------------------
   58|  3.26k|      folded_number_decoders_[i].EndDecoding();
   59|  3.26k|    }
   60|    102|    bit_decoder_.EndDecoding();
   61|    102|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    567|  FoldedBit32Decoder() {}

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  50.6k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  26.9k|                                const uint8_t *const buf, int offset) {
  301|  26.9k|  unsigned x;
  302|  26.9k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 45, False: 26.9k]
  ------------------
  303|     45|    return 1;
  304|     45|  }
  305|  26.9k|  ans->buf = buf;
  306|  26.9k|  x = buf[offset - 1] >> 6;
  307|  26.9k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 23.4k, False: 3.50k]
  ------------------
  308|  23.4k|    ans->buf_offset = offset - 1;
  309|  23.4k|    ans->state = buf[offset - 1] & 0x3F;
  310|  23.4k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 3.20k, False: 300]
  ------------------
  311|  3.20k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 6, False: 3.20k]
  ------------------
  312|      6|      return 1;
  313|      6|    }
  314|  3.20k|    ans->buf_offset = offset - 2;
  315|  3.20k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  3.20k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 283, False: 17]
  ------------------
  317|    283|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 2, False: 281]
  ------------------
  318|      2|      return 1;
  319|      2|    }
  320|    281|    ans->buf_offset = offset - 3;
  321|    281|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    281|  } else {
  323|     17|    return 1;
  324|     17|  }
  325|  26.8k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  26.8k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  26.8k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  26.8k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  26.8k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 4, False: 26.8k]
  ------------------
  327|      4|    return 1;
  328|      4|  }
  329|  26.8k|  return 0;
  330|  26.8k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  3.20k|static uint32_t mem_get_le16(const void *vmem) {
   68|  3.20k|  uint32_t val;
   69|  3.20k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  3.20k|  val = mem[1] << 8;
   72|  3.20k|  val |= mem[0];
   73|  3.20k|  return val;
   74|  3.20k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    281|static uint32_t mem_get_le24(const void *vmem) {
   77|    281|  uint32_t val;
   78|    281|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    281|  val = mem[2] << 16;
   81|    281|  val |= mem[1] << 8;
   82|    281|  val |= mem[0];
   83|    281|  return val;
   84|    281|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  5.34G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  5.34G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  5.34G|  unsigned quot, rem, x, xn;
  172|  5.34G|#endif
  173|  5.34G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  5.34G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  5.34G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  10.6G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 4.78G, False: 560M]
  |  Branch (174:40): [True: 204k, False: 4.78G]
  ------------------
  175|   204k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   204k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   204k|  }
  177|       |#if DRACO_ANS_IMPL1
  178|       |  val = ans->state % DRACO_ANS_P8_PRECISION < p;
  179|       |  l_s = val ? p : p0;
  180|       |  ans->state = (ans->state / DRACO_ANS_P8_PRECISION) * l_s +
  181|       |               ans->state % DRACO_ANS_P8_PRECISION - (!val * p);
  182|       |#else
  183|  5.34G|  x = ans->state;
  184|  5.34G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  5.34G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  5.34G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  5.34G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  5.34G|  xn = quot * p;
  187|  5.34G|  val = rem < p;
  188|  5.34G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  10.6G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 4.78G, False: 554M]
  |  |  ------------------
  ------------------
  189|  4.78G|    ans->state = xn + rem;
  190|  4.78G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   554M|    ans->state = x - xn - p;
  193|   554M|  }
  194|  5.34G|#endif
  195|  5.34G|  return val;
  196|  5.34G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  69.7k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  69.7k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  69.7k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  69.7k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  4.61k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|  2.43k|                                       uint32_t num_symbols) {
  482|  2.43k|    lut_table_.resize(rans_precision);
  483|  2.43k|    probability_table_.resize(num_symbols);
  484|  2.43k|    uint32_t cum_prob = 0;
  485|  2.43k|    uint32_t act_prob = 0;
  486|  22.3k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 20.1k, False: 2.21k]
  ------------------
  487|  20.1k|      probability_table_[i].prob = token_probs[i];
  488|  20.1k|      probability_table_[i].cum_prob = cum_prob;
  489|  20.1k|      cum_prob += token_probs[i];
  490|  20.1k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 226, False: 19.9k]
  ------------------
  491|    226|        return false;
  492|    226|      }
  493|  8.29M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 8.27M, False: 19.9k]
  ------------------
  494|  8.27M|        lut_table_[j] = i;
  495|  8.27M|      }
  496|  19.9k|      act_prob = cum_prob;
  497|  19.9k|    }
  498|  2.21k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 257, False: 1.95k]
  ------------------
  499|    257|      return false;
  500|    257|    }
  501|  1.95k|    return true;
  502|  2.21k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.60k|  inline int read_init(const uint8_t *const buf, int offset) {
  422|  1.60k|    unsigned x;
  423|  1.60k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 127, False: 1.47k]
  ------------------
  424|    127|      return 1;
  425|    127|    }
  426|  1.47k|    ans_.buf = buf;
  427|  1.47k|    x = buf[offset - 1] >> 6;
  428|  1.47k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 924, False: 550]
  ------------------
  429|    924|      ans_.buf_offset = offset - 1;
  430|    924|      ans_.state = buf[offset - 1] & 0x3F;
  431|    924|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 211, False: 339]
  ------------------
  432|    211|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 33, False: 178]
  ------------------
  433|     33|        return 1;
  434|     33|      }
  435|    178|      ans_.buf_offset = offset - 2;
  436|    178|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    339|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 226, False: 113]
  ------------------
  438|    226|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 39, False: 187]
  ------------------
  439|     39|        return 1;
  440|     39|      }
  441|    187|      ans_.buf_offset = offset - 3;
  442|    187|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    187|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 113, False: 0]
  ------------------
  444|    113|      ans_.buf_offset = offset - 4;
  445|    113|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    113|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|  1.40k|    ans_.state += l_rans_base;
  450|  1.40k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.40k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 108, False: 1.29k]
  ------------------
  451|    108|      return 1;
  452|    108|    }
  453|  1.29k|    return 0;
  454|  1.40k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    277|static uint32_t mem_get_le16(const void *vmem) {
   68|    277|  uint32_t val;
   69|    277|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    277|  val = mem[1] << 8;
   72|    277|  val |= mem[0];
   73|    277|  return val;
   74|    277|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    297|static uint32_t mem_get_le24(const void *vmem) {
   77|    297|  uint32_t val;
   78|    297|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    297|  val = mem[2] << 16;
   81|    297|  val |= mem[1] << 8;
   82|    297|  val |= mem[0];
   83|    297|  return val;
   84|    297|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    371|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    371|  uint32_t val;
   88|    371|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    371|  val = mem[3] << 24;
   91|    371|  val |= mem[2] << 16;
   92|    371|  val |= mem[1] << 8;
   93|    371|  val |= mem[0];
   94|    371|  return val;
   95|    371|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|  78.6M|  inline int rans_read() {
  463|  78.6M|    unsigned rem;
  464|  78.6M|    unsigned quo;
  465|  78.6M|    struct rans_dec_sym sym;
  466|  78.6M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 69.3M, False: 9.27M]
  |  Branch (466:40): [True: 23.1k, False: 69.3M]
  ------------------
  467|  23.1k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  23.1k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  23.1k|    }
  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|  78.6M|    quo = ans_.state / rans_precision;
  472|  78.6M|    rem = ans_.state % rans_precision;
  473|  78.6M|    fetch_sym(&sym, rem);
  474|  78.6M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  78.6M|    return sym.val;
  476|  78.6M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|  78.6M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  78.6M|    uint32_t symbol = lut_table_[rem];
  507|  78.6M|    out->val = symbol;
  508|  78.6M|    out->prob = probability_table_[symbol].prob;
  509|  78.6M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  78.6M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|  1.22k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    357|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|    196|                                       uint32_t num_symbols) {
  482|    196|    lut_table_.resize(rans_precision);
  483|    196|    probability_table_.resize(num_symbols);
  484|    196|    uint32_t cum_prob = 0;
  485|    196|    uint32_t act_prob = 0;
  486|  4.64k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 4.48k, False: 161]
  ------------------
  487|  4.48k|      probability_table_[i].prob = token_probs[i];
  488|  4.48k|      probability_table_[i].cum_prob = cum_prob;
  489|  4.48k|      cum_prob += token_probs[i];
  490|  4.48k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 35, False: 4.45k]
  ------------------
  491|     35|        return false;
  492|     35|      }
  493|  1.16M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.15M, False: 4.45k]
  ------------------
  494|  1.15M|        lut_table_[j] = i;
  495|  1.15M|      }
  496|  4.45k|      act_prob = cum_prob;
  497|  4.45k|    }
  498|    161|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 35, False: 126]
  ------------------
  499|     35|      return false;
  500|     35|    }
  501|    126|    return true;
  502|    161|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|     67|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     67|    unsigned x;
  423|     67|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 1, False: 66]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|     66|    ans_.buf = buf;
  427|     66|    x = buf[offset - 1] >> 6;
  428|     66|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 29, False: 37]
  ------------------
  429|     29|      ans_.buf_offset = offset - 1;
  430|     29|      ans_.state = buf[offset - 1] & 0x3F;
  431|     37|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 10, False: 27]
  ------------------
  432|     10|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 9]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      9|      ans_.buf_offset = offset - 2;
  436|      9|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     27|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 13, False: 14]
  ------------------
  438|     13|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 6, False: 7]
  ------------------
  439|      6|        return 1;
  440|      6|      }
  441|      7|      ans_.buf_offset = offset - 3;
  442|      7|      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|     59|    ans_.state += l_rans_base;
  450|     59|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     59|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 12, False: 47]
  ------------------
  451|     12|      return 1;
  452|     12|    }
  453|     47|    return 0;
  454|     59|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|   145k|  inline int rans_read() {
  463|   145k|    unsigned rem;
  464|   145k|    unsigned quo;
  465|   145k|    struct rans_dec_sym sym;
  466|   146k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 50.5k, False: 96.2k]
  |  Branch (466:40): [True: 1.23k, False: 49.3k]
  ------------------
  467|  1.23k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.23k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.23k|    }
  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|   145k|    quo = ans_.state / rans_precision;
  472|   145k|    rem = ans_.state % rans_precision;
  473|   145k|    fetch_sym(&sym, rem);
  474|   145k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   145k|    return sym.val;
  476|   145k|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|   145k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   145k|    uint32_t symbol = lut_table_[rem];
  507|   145k|    out->val = symbol;
  508|   145k|    out->prob = probability_table_[symbol].prob;
  509|   145k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   145k|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|     47|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    350|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|    189|                                       uint32_t num_symbols) {
  482|    189|    lut_table_.resize(rans_precision);
  483|    189|    probability_table_.resize(num_symbols);
  484|    189|    uint32_t cum_prob = 0;
  485|    189|    uint32_t act_prob = 0;
  486|  10.0k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 9.88k, False: 165]
  ------------------
  487|  9.88k|      probability_table_[i].prob = token_probs[i];
  488|  9.88k|      probability_table_[i].cum_prob = cum_prob;
  489|  9.88k|      cum_prob += token_probs[i];
  490|  9.88k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 24, False: 9.86k]
  ------------------
  491|     24|        return false;
  492|     24|      }
  493|  4.72M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 4.71M, False: 9.86k]
  ------------------
  494|  4.71M|        lut_table_[j] = i;
  495|  4.71M|      }
  496|  9.86k|      act_prob = cum_prob;
  497|  9.86k|    }
  498|    165|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 36, False: 129]
  ------------------
  499|     36|      return false;
  500|     36|    }
  501|    129|    return true;
  502|    165|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|     88|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     88|    unsigned x;
  423|     88|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 1, False: 87]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|     87|    ans_.buf = buf;
  427|     87|    x = buf[offset - 1] >> 6;
  428|     87|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 33, False: 54]
  ------------------
  429|     33|      ans_.buf_offset = offset - 1;
  430|     33|      ans_.state = buf[offset - 1] & 0x3F;
  431|     54|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 16, False: 38]
  ------------------
  432|     16|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 6, False: 10]
  ------------------
  433|      6|        return 1;
  434|      6|      }
  435|     10|      ans_.buf_offset = offset - 2;
  436|     10|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     38|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 20, False: 18]
  ------------------
  438|     20|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 3, False: 17]
  ------------------
  439|      3|        return 1;
  440|      3|      }
  441|     17|      ans_.buf_offset = offset - 3;
  442|     17|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     18|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 18, False: 0]
  ------------------
  444|     18|      ans_.buf_offset = offset - 4;
  445|     18|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     18|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     78|    ans_.state += l_rans_base;
  450|     78|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     78|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 15, False: 63]
  ------------------
  451|     15|      return 1;
  452|     15|    }
  453|     63|    return 0;
  454|     78|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|   470k|  inline int rans_read() {
  463|   470k|    unsigned rem;
  464|   470k|    unsigned quo;
  465|   470k|    struct rans_dec_sym sym;
  466|   472k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 458k, False: 14.3k]
  |  Branch (466:40): [True: 2.08k, False: 455k]
  ------------------
  467|  2.08k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  2.08k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  2.08k|    }
  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|   470k|    quo = ans_.state / rans_precision;
  472|   470k|    rem = ans_.state % rans_precision;
  473|   470k|    fetch_sym(&sym, rem);
  474|   470k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   470k|    return sym.val;
  476|   470k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|   470k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   470k|    uint32_t symbol = lut_table_[rem];
  507|   470k|    out->val = symbol;
  508|   470k|    out->prob = probability_table_[symbol].prob;
  509|   470k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   470k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     63|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    397|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|    228|                                       uint32_t num_symbols) {
  482|    228|    lut_table_.resize(rans_precision);
  483|    228|    probability_table_.resize(num_symbols);
  484|    228|    uint32_t cum_prob = 0;
  485|    228|    uint32_t act_prob = 0;
  486|  8.58k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 8.39k, False: 192]
  ------------------
  487|  8.39k|      probability_table_[i].prob = token_probs[i];
  488|  8.39k|      probability_table_[i].cum_prob = cum_prob;
  489|  8.39k|      cum_prob += token_probs[i];
  490|  8.39k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 36, False: 8.35k]
  ------------------
  491|     36|        return false;
  492|     36|      }
  493|  11.1M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 11.1M, False: 8.35k]
  ------------------
  494|  11.1M|        lut_table_[j] = i;
  495|  11.1M|      }
  496|  8.35k|      act_prob = cum_prob;
  497|  8.35k|    }
  498|    192|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 50, False: 142]
  ------------------
  499|     50|      return false;
  500|     50|    }
  501|    142|    return true;
  502|    192|  }
_ZN5draco11RAnsDecoderILi16EE9read_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: 1, False: 67]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|     67|    ans_.buf = buf;
  427|     67|    x = buf[offset - 1] >> 6;
  428|     67|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 21, False: 46]
  ------------------
  429|     21|      ans_.buf_offset = offset - 1;
  430|     21|      ans_.state = buf[offset - 1] & 0x3F;
  431|     46|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 19, False: 27]
  ------------------
  432|     19|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 10, False: 9]
  ------------------
  433|     10|        return 1;
  434|     10|      }
  435|      9|      ans_.buf_offset = offset - 2;
  436|      9|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     27|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 20, False: 7]
  ------------------
  438|     20|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 15, False: 5]
  ------------------
  439|     15|        return 1;
  440|     15|      }
  441|      5|      ans_.buf_offset = offset - 3;
  442|      5|      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|     42|    ans_.state += l_rans_base;
  450|     42|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     42|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 7, False: 35]
  ------------------
  451|      7|      return 1;
  452|      7|    }
  453|     35|    return 0;
  454|     42|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|  46.4k|  inline int rans_read() {
  463|  46.4k|    unsigned rem;
  464|  46.4k|    unsigned quo;
  465|  46.4k|    struct rans_dec_sym sym;
  466|  46.9k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 44.3k, False: 2.59k]
  |  Branch (466:40): [True: 523, False: 43.8k]
  ------------------
  467|    523|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    523|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    523|    }
  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|  46.4k|    quo = ans_.state / rans_precision;
  472|  46.4k|    rem = ans_.state % rans_precision;
  473|  46.4k|    fetch_sym(&sym, rem);
  474|  46.4k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  46.4k|    return sym.val;
  476|  46.4k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|  46.4k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  46.4k|    uint32_t symbol = lut_table_[rem];
  507|  46.4k|    out->val = symbol;
  508|  46.4k|    out->prob = probability_table_[symbol].prob;
  509|  46.4k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  46.4k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|     35|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    437|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|    270|                                       uint32_t num_symbols) {
  482|    270|    lut_table_.resize(rans_precision);
  483|    270|    probability_table_.resize(num_symbols);
  484|    270|    uint32_t cum_prob = 0;
  485|    270|    uint32_t act_prob = 0;
  486|  7.00k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 6.76k, False: 241]
  ------------------
  487|  6.76k|      probability_table_[i].prob = token_probs[i];
  488|  6.76k|      probability_table_[i].cum_prob = cum_prob;
  489|  6.76k|      cum_prob += token_probs[i];
  490|  6.76k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 29, False: 6.73k]
  ------------------
  491|     29|        return false;
  492|     29|      }
  493|  50.5M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 50.5M, False: 6.73k]
  ------------------
  494|  50.5M|        lut_table_[j] = i;
  495|  50.5M|      }
  496|  6.73k|      act_prob = cum_prob;
  497|  6.73k|    }
  498|    241|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 66, False: 175]
  ------------------
  499|     66|      return false;
  500|     66|    }
  501|    175|    return true;
  502|    241|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     87|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     87|    unsigned x;
  423|     87|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 81]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     81|    ans_.buf = buf;
  427|     81|    x = buf[offset - 1] >> 6;
  428|     81|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 26, False: 55]
  ------------------
  429|     26|      ans_.buf_offset = offset - 1;
  430|     26|      ans_.state = buf[offset - 1] & 0x3F;
  431|     55|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 5, False: 50]
  ------------------
  432|      5|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 4]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      4|      ans_.buf_offset = offset - 2;
  436|      4|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     50|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 18, False: 32]
  ------------------
  438|     18|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 3, False: 15]
  ------------------
  439|      3|        return 1;
  440|      3|      }
  441|     15|      ans_.buf_offset = offset - 3;
  442|     15|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     32|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 32, False: 0]
  ------------------
  444|     32|      ans_.buf_offset = offset - 4;
  445|     32|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     32|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     77|    ans_.state += l_rans_base;
  450|     77|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     77|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 21, False: 56]
  ------------------
  451|     21|      return 1;
  452|     21|    }
  453|     56|    return 0;
  454|     77|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|   161k|  inline int rans_read() {
  463|   161k|    unsigned rem;
  464|   161k|    unsigned quo;
  465|   161k|    struct rans_dec_sym sym;
  466|   162k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 93.7k, False: 68.4k]
  |  Branch (466:40): [True: 308, False: 93.4k]
  ------------------
  467|    308|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    308|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    308|    }
  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|   161k|    quo = ans_.state / rans_precision;
  472|   161k|    rem = ans_.state % rans_precision;
  473|   161k|    fetch_sym(&sym, rem);
  474|   161k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   161k|    return sym.val;
  476|   161k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|   161k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   161k|    uint32_t symbol = lut_table_[rem];
  507|   161k|    out->val = symbol;
  508|   161k|    out->prob = probability_table_[symbol].prob;
  509|   161k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   161k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|     56|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    351|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|    202|                                       uint32_t num_symbols) {
  482|    202|    lut_table_.resize(rans_precision);
  483|    202|    probability_table_.resize(num_symbols);
  484|    202|    uint32_t cum_prob = 0;
  485|    202|    uint32_t act_prob = 0;
  486|  4.69k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 4.52k, False: 176]
  ------------------
  487|  4.52k|      probability_table_[i].prob = token_probs[i];
  488|  4.52k|      probability_table_[i].cum_prob = cum_prob;
  489|  4.52k|      cum_prob += token_probs[i];
  490|  4.52k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 26, False: 4.49k]
  ------------------
  491|     26|        return false;
  492|     26|      }
  493|  73.1M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 73.1M, False: 4.49k]
  ------------------
  494|  73.1M|        lut_table_[j] = i;
  495|  73.1M|      }
  496|  4.49k|      act_prob = cum_prob;
  497|  4.49k|    }
  498|    176|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 49, False: 127]
  ------------------
  499|     49|      return false;
  500|     49|    }
  501|    127|    return true;
  502|    176|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     82|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     82|    unsigned x;
  423|     82|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 76]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     76|    ans_.buf = buf;
  427|     76|    x = buf[offset - 1] >> 6;
  428|     76|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 24, False: 52]
  ------------------
  429|     24|      ans_.buf_offset = offset - 1;
  430|     24|      ans_.state = buf[offset - 1] & 0x3F;
  431|     52|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 4, False: 48]
  ------------------
  432|      4|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 3]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      3|      ans_.buf_offset = offset - 2;
  436|      3|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     48|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 12, False: 36]
  ------------------
  438|     12|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 11]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|     11|      ans_.buf_offset = offset - 3;
  442|     11|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     36|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 36, False: 0]
  ------------------
  444|     36|      ans_.buf_offset = offset - 4;
  445|     36|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     36|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     74|    ans_.state += l_rans_base;
  450|     74|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     74|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 17, False: 57]
  ------------------
  451|     17|      return 1;
  452|     17|    }
  453|     57|    return 0;
  454|     74|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|   417k|  inline int rans_read() {
  463|   417k|    unsigned rem;
  464|   417k|    unsigned quo;
  465|   417k|    struct rans_dec_sym sym;
  466|   418k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 290k, False: 127k]
  |  Branch (466:40): [True: 1.39k, False: 289k]
  ------------------
  467|  1.39k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.39k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.39k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|   417k|    quo = ans_.state / rans_precision;
  472|   417k|    rem = ans_.state % rans_precision;
  473|   417k|    fetch_sym(&sym, rem);
  474|   417k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   417k|    return sym.val;
  476|   417k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|   417k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   417k|    uint32_t symbol = lut_table_[rem];
  507|   417k|    out->val = symbol;
  508|   417k|    out->prob = probability_table_[symbol].prob;
  509|   417k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   417k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     57|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.75k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|    971|                                       uint32_t num_symbols) {
  482|    971|    lut_table_.resize(rans_precision);
  483|    971|    probability_table_.resize(num_symbols);
  484|    971|    uint32_t cum_prob = 0;
  485|    971|    uint32_t act_prob = 0;
  486|  12.4k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 11.5k, False: 917]
  ------------------
  487|  11.5k|      probability_table_[i].prob = token_probs[i];
  488|  11.5k|      probability_table_[i].cum_prob = cum_prob;
  489|  11.5k|      cum_prob += token_probs[i];
  490|  11.5k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 54, False: 11.4k]
  ------------------
  491|     54|        return false;
  492|     54|      }
  493|   881M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 881M, False: 11.4k]
  ------------------
  494|   881M|        lut_table_[j] = i;
  495|   881M|      }
  496|  11.4k|      act_prob = cum_prob;
  497|  11.4k|    }
  498|    917|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 108, False: 809]
  ------------------
  499|    108|      return false;
  500|    108|    }
  501|    809|    return true;
  502|    917|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    469|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    469|    unsigned x;
  423|    469|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 27, False: 442]
  ------------------
  424|     27|      return 1;
  425|     27|    }
  426|    442|    ans_.buf = buf;
  427|    442|    x = buf[offset - 1] >> 6;
  428|    442|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 121, False: 321]
  ------------------
  429|    121|      ans_.buf_offset = offset - 1;
  430|    121|      ans_.state = buf[offset - 1] & 0x3F;
  431|    321|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 97, False: 224]
  ------------------
  432|     97|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 33, False: 64]
  ------------------
  433|     33|        return 1;
  434|     33|      }
  435|     64|      ans_.buf_offset = offset - 2;
  436|     64|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    224|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 73, False: 151]
  ------------------
  438|     73|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 18, False: 55]
  ------------------
  439|     18|        return 1;
  440|     18|      }
  441|     55|      ans_.buf_offset = offset - 3;
  442|     55|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    151|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 151, False: 0]
  ------------------
  444|    151|      ans_.buf_offset = offset - 4;
  445|    151|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    151|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    391|    ans_.state += l_rans_base;
  450|    391|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    391|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 38, False: 353]
  ------------------
  451|     38|      return 1;
  452|     38|    }
  453|    353|    return 0;
  454|    391|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  97.8M|  inline int rans_read() {
  463|  97.8M|    unsigned rem;
  464|  97.8M|    unsigned quo;
  465|  97.8M|    struct rans_dec_sym sym;
  466|  97.8M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 84.0M, False: 13.7M]
  |  Branch (466:40): [True: 5.09k, False: 84.0M]
  ------------------
  467|  5.09k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  5.09k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  5.09k|    }
  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|  97.8M|    quo = ans_.state / rans_precision;
  472|  97.8M|    rem = ans_.state % rans_precision;
  473|  97.8M|    fetch_sym(&sym, rem);
  474|  97.8M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  97.8M|    return sym.val;
  476|  97.8M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  97.8M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  97.8M|    uint32_t symbol = lut_table_[rem];
  507|  97.8M|    out->val = symbol;
  508|  97.8M|    out->prob = probability_table_[symbol].prob;
  509|  97.8M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  97.8M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    353|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|  1.38k|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|  1.38k|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|  1.38k|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 1.38k]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|  1.38k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|  1.38k|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.38k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 74, False: 1.31k]
  ------------------
   67|     74|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 8, False: 66]
  ------------------
   68|      8|      return false;
   69|      8|    }
   70|       |
   71|     74|  } else
   72|  1.31k|#endif
   73|  1.31k|  {
   74|  1.31k|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 35, False: 1.27k]
  ------------------
   75|     35|      return false;
   76|     35|    }
   77|  1.31k|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|  1.34k|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 74, False: 1.27k]
  ------------------
   83|     74|    return false;
   84|     74|  }
   85|  1.27k|  probability_table_.resize(num_symbols_);
   86|  1.27k|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 490, False: 780]
  ------------------
   87|    490|    return true;
   88|    490|  }
   89|       |  // Decode the table.
   90|  53.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 52.8k, False: 559]
  ------------------
   91|  52.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|  52.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 96, False: 52.7k]
  ------------------
   95|     96|      return false;
   96|     96|    }
   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|  52.7k|    const int token = prob_data & 3;
  102|  52.7k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 22.6k, False: 30.1k]
  ------------------
  103|  22.6k|      const uint32_t offset = prob_data >> 2;
  104|  22.6k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 93, False: 22.5k]
  ------------------
  105|     93|        return false;
  106|     93|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   718k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 695k, False: 22.5k]
  ------------------
  109|   695k|        probability_table_[i + j] = 0;
  110|   695k|      }
  111|  22.5k|      i += offset;
  112|  30.1k|    } else {
  113|  30.1k|      const int extra_bytes = token;
  114|  30.1k|      uint32_t prob = prob_data >> 2;
  115|  56.4k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 26.3k, False: 30.1k]
  ------------------
  116|  26.3k|        uint8_t eb;
  117|  26.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 32, False: 26.2k]
  ------------------
  118|     32|          return false;
  119|     32|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  26.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  26.2k|      }
  124|  30.1k|      probability_table_[i] = prob;
  125|  30.1k|    }
  126|  52.7k|  }
  127|    559|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 160, False: 399]
  ------------------
  128|    160|    return false;
  129|    160|  }
  130|    399|  return true;
  131|    559|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    762|    DecoderBuffer *buffer) {
  136|    762|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    762|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    762|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    762|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 48, False: 714]
  ------------------
  140|     48|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 9, False: 39]
  ------------------
  141|      9|      return false;
  142|      9|    }
  143|       |
  144|     48|  } else
  145|    714|#endif
  146|    714|  {
  147|    714|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 42, False: 672]
  ------------------
  148|     42|      return false;
  149|     42|    }
  150|    714|  }
  151|    711|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 140, False: 571]
  ------------------
  152|    140|    return false;
  153|    140|  }
  154|    571|  const uint8_t *const data_head =
  155|    571|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    571|  buffer->Advance(bytes_encoded);
  158|    571|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 136, False: 435]
  ------------------
  159|    136|    return false;
  160|    136|  }
  161|    435|  return true;
  162|    571|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    584|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  1.63M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    365|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    365|  ans_.read_end();
  167|    365|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    574|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    574|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    574|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 574]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    574|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    574|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    574|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 53, False: 521]
  ------------------
   67|     53|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 49]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     53|  } else
   72|    521|#endif
   73|    521|  {
   74|    521|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 511]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    521|  }
   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|    560|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 46, False: 514]
  ------------------
   83|     46|    return false;
   84|     46|  }
   85|    514|  probability_table_.resize(num_symbols_);
   86|    514|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 18, False: 496]
  ------------------
   87|     18|    return true;
   88|     18|  }
   89|       |  // Decode the table.
   90|  1.91M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.91M, False: 323]
  ------------------
   91|  1.91M|    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.91M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 72, False: 1.91M]
  ------------------
   95|     72|      return false;
   96|     72|    }
   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.91M|    const int token = prob_data & 3;
  102|  1.91M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 574k, False: 1.33M]
  ------------------
  103|   574k|      const uint32_t offset = prob_data >> 2;
  104|   574k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 64, False: 574k]
  ------------------
  105|     64|        return false;
  106|     64|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  17.8M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 17.2M, False: 574k]
  ------------------
  109|  17.2M|        probability_table_[i + j] = 0;
  110|  17.2M|      }
  111|   574k|      i += offset;
  112|  1.33M|    } else {
  113|  1.33M|      const int extra_bytes = token;
  114|  1.33M|      uint32_t prob = prob_data >> 2;
  115|  1.35M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 20.2k, False: 1.33M]
  ------------------
  116|  20.2k|        uint8_t eb;
  117|  20.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 37, False: 20.1k]
  ------------------
  118|     37|          return false;
  119|     37|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  20.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  20.1k|      }
  124|  1.33M|      probability_table_[i] = prob;
  125|  1.33M|    }
  126|  1.91M|  }
  127|    323|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 114, False: 209]
  ------------------
  128|    114|    return false;
  129|    114|  }
  130|    209|  return true;
  131|    323|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    227|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    209|    DecoderBuffer *buffer) {
  136|    209|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    209|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    209|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    209|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 7, False: 202]
  ------------------
  140|      7|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 6]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      7|  } else
  145|    202|#endif
  146|    202|  {
  147|    202|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 200]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    202|  }
  151|    206|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 46, False: 160]
  ------------------
  152|     46|    return false;
  153|     46|  }
  154|    160|  const uint8_t *const data_head =
  155|    160|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    160|  buffer->Advance(bytes_encoded);
  158|    160|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 20, False: 140]
  ------------------
  159|     20|    return false;
  160|     20|  }
  161|    140|  return true;
  162|    160|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  40.4M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    140|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    140|  ans_.read_end();
  167|    140|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    594|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    594|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    594|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 594]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    594|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    594|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    594|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 61, False: 533]
  ------------------
   67|     61|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 59]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     61|  } else
   72|    533|#endif
   73|    533|  {
   74|    533|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 523]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    533|  }
   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|    582|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 45, False: 537]
  ------------------
   83|     45|    return false;
   84|     45|  }
   85|    537|  probability_table_.resize(num_symbols_);
   86|    537|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 14, False: 523]
  ------------------
   87|     14|    return true;
   88|     14|  }
   89|       |  // Decode the table.
   90|   599k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 599k, False: 372]
  ------------------
   91|   599k|    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|   599k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 76, False: 599k]
  ------------------
   95|     76|      return false;
   96|     76|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   599k|    const int token = prob_data & 3;
  102|   599k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 325k, False: 274k]
  ------------------
  103|   325k|      const uint32_t offset = prob_data >> 2;
  104|   325k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 41, False: 324k]
  ------------------
  105|     41|        return false;
  106|     41|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  10.8M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 10.5M, False: 324k]
  ------------------
  109|  10.5M|        probability_table_[i + j] = 0;
  110|  10.5M|      }
  111|   324k|      i += offset;
  112|   324k|    } else {
  113|   274k|      const int extra_bytes = token;
  114|   274k|      uint32_t prob = prob_data >> 2;
  115|   396k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 122k, False: 274k]
  ------------------
  116|   122k|        uint8_t eb;
  117|   122k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 34, False: 122k]
  ------------------
  118|     34|          return false;
  119|     34|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   122k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   122k|      }
  124|   274k|      probability_table_[i] = prob;
  125|   274k|    }
  126|   599k|  }
  127|    372|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 34, False: 338]
  ------------------
  128|     34|    return false;
  129|     34|  }
  130|    338|  return true;
  131|    372|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    352|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    338|    DecoderBuffer *buffer) {
  136|    338|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    338|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    338|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    338|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 29, False: 309]
  ------------------
  140|     29|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 27]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     29|  } else
  145|    309|#endif
  146|    309|  {
  147|    309|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 6, False: 303]
  ------------------
  148|      6|      return false;
  149|      6|    }
  150|    309|  }
  151|    330|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 91, False: 239]
  ------------------
  152|     91|    return false;
  153|     91|  }
  154|    239|  const uint8_t *const data_head =
  155|    239|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    239|  buffer->Advance(bytes_encoded);
  158|    239|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 21, False: 218]
  ------------------
  159|     21|    return false;
  160|     21|  }
  161|    218|  return true;
  162|    239|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  6.46M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    218|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    218|  ans_.read_end();
  167|    218|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    414|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    414|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    414|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 414]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    414|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    414|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    414|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 56, False: 358]
  ------------------
   67|     56|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 55]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     56|  } else
   72|    358|#endif
   73|    358|  {
   74|    358|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 355]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    358|  }
   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|    410|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 21, False: 389]
  ------------------
   83|     21|    return false;
   84|     21|  }
   85|    389|  probability_table_.resize(num_symbols_);
   86|    389|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 382]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  14.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 14.1k, False: 260]
  ------------------
   91|  14.1k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  14.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 67, False: 14.0k]
  ------------------
   95|     67|      return false;
   96|     67|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  14.0k|    const int token = prob_data & 3;
  102|  14.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.72k, False: 9.31k]
  ------------------
  103|  4.72k|      const uint32_t offset = prob_data >> 2;
  104|  4.72k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 4.70k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   153k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 149k, False: 4.70k]
  ------------------
  109|   149k|        probability_table_[i + j] = 0;
  110|   149k|      }
  111|  4.70k|      i += offset;
  112|  9.31k|    } else {
  113|  9.31k|      const int extra_bytes = token;
  114|  9.31k|      uint32_t prob = prob_data >> 2;
  115|  15.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 6.50k, False: 9.29k]
  ------------------
  116|  6.50k|        uint8_t eb;
  117|  6.50k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 26, False: 6.47k]
  ------------------
  118|     26|          return false;
  119|     26|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  6.47k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  6.47k|      }
  124|  9.29k|      probability_table_[i] = prob;
  125|  9.29k|    }
  126|  14.0k|  }
  127|    260|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 35, False: 225]
  ------------------
  128|     35|    return false;
  129|     35|  }
  130|    225|  return true;
  131|    260|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    232|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    225|    DecoderBuffer *buffer) {
  136|    225|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    225|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    225|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    225|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 52, False: 173]
  ------------------
  140|     52|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 4, False: 48]
  ------------------
  141|      4|      return false;
  142|      4|    }
  143|       |
  144|     52|  } else
  145|    173|#endif
  146|    173|  {
  147|    173|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 170]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    173|  }
  151|    218|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 98, False: 120]
  ------------------
  152|     98|    return false;
  153|     98|  }
  154|    120|  const uint8_t *const data_head =
  155|    120|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    120|  buffer->Advance(bytes_encoded);
  158|    120|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 19, False: 101]
  ------------------
  159|     19|    return false;
  160|     19|  }
  161|    101|  return true;
  162|    120|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  5.79M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    101|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    101|  ans_.read_end();
  167|    101|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    291|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    291|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    291|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 291]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    291|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    291|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    291|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 26, False: 265]
  ------------------
   67|     26|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 24]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     26|  } else
   72|    265|#endif
   73|    265|  {
   74|    265|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 254]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    265|  }
   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|    278|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 268]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    268|  probability_table_.resize(num_symbols_);
   86|    268|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 8, False: 260]
  ------------------
   87|      8|    return true;
   88|      8|  }
   89|       |  // Decode the table.
   90|  18.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 18.3k, False: 148]
  ------------------
   91|  18.3k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  18.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 52, False: 18.3k]
  ------------------
   95|     52|      return false;
   96|     52|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  18.3k|    const int token = prob_data & 3;
  102|  18.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 9.45k, False: 8.84k]
  ------------------
  103|  9.45k|      const uint32_t offset = prob_data >> 2;
  104|  9.45k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 32, False: 9.42k]
  ------------------
  105|     32|        return false;
  106|     32|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   386k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 376k, False: 9.42k]
  ------------------
  109|   376k|        probability_table_[i + j] = 0;
  110|   376k|      }
  111|  9.42k|      i += offset;
  112|  9.42k|    } else {
  113|  8.84k|      const int extra_bytes = token;
  114|  8.84k|      uint32_t prob = prob_data >> 2;
  115|  15.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 6.45k, False: 8.82k]
  ------------------
  116|  6.45k|        uint8_t eb;
  117|  6.45k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 28, False: 6.42k]
  ------------------
  118|     28|          return false;
  119|     28|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  6.42k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  6.42k|      }
  124|  8.82k|      probability_table_[i] = prob;
  125|  8.82k|    }
  126|  18.3k|  }
  127|    148|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 25, False: 123]
  ------------------
  128|     25|    return false;
  129|     25|  }
  130|    123|  return true;
  131|    148|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    131|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    123|    DecoderBuffer *buffer) {
  136|    123|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    123|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    123|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    123|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 107]
  ------------------
  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|    107|#endif
  146|    107|  {
  147|    107|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 104]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    107|  }
  151|    117|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 18, False: 99]
  ------------------
  152|     18|    return false;
  153|     18|  }
  154|     99|  const uint8_t *const data_head =
  155|     99|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     99|  buffer->Advance(bytes_encoded);
  158|     99|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 13, False: 86]
  ------------------
  159|     13|    return false;
  160|     13|  }
  161|     86|  return true;
  162|     99|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  1.12M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|     86|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     86|  ans_.read_end();
  167|     86|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    475|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    475|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    475|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 475]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    475|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    475|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    475|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 68, False: 407]
  ------------------
   67|     68|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 67]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     68|  } else
   72|    407|#endif
   73|    407|  {
   74|    407|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 399]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    407|  }
   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|    466|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 34, False: 432]
  ------------------
   83|     34|    return false;
   84|     34|  }
   85|    432|  probability_table_.resize(num_symbols_);
   86|    432|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 425]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  20.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 20.0k, False: 303]
  ------------------
   91|  20.0k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  20.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 55, False: 19.9k]
  ------------------
   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|  19.9k|    const int token = prob_data & 3;
  102|  19.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 7.59k, False: 12.3k]
  ------------------
  103|  7.59k|      const uint32_t offset = prob_data >> 2;
  104|  7.59k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 39, False: 7.55k]
  ------------------
  105|     39|        return false;
  106|     39|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   275k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 267k, False: 7.55k]
  ------------------
  109|   267k|        probability_table_[i + j] = 0;
  110|   267k|      }
  111|  7.55k|      i += offset;
  112|  12.3k|    } else {
  113|  12.3k|      const int extra_bytes = token;
  114|  12.3k|      uint32_t prob = prob_data >> 2;
  115|  22.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 10.5k, False: 12.3k]
  ------------------
  116|  10.5k|        uint8_t eb;
  117|  10.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 28, False: 10.4k]
  ------------------
  118|     28|          return false;
  119|     28|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  10.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  10.4k|      }
  124|  12.3k|      probability_table_[i] = prob;
  125|  12.3k|    }
  126|  19.9k|  }
  127|    303|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 35, False: 268]
  ------------------
  128|     35|    return false;
  129|     35|  }
  130|    268|  return true;
  131|    303|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    275|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    268|    DecoderBuffer *buffer) {
  136|    268|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    268|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    268|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    268|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 41, False: 227]
  ------------------
  140|     41|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 39]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     41|  } else
  145|    227|#endif
  146|    227|  {
  147|    227|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 226]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    227|  }
  151|    265|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 78, False: 187]
  ------------------
  152|     78|    return false;
  153|     78|  }
  154|    187|  const uint8_t *const data_head =
  155|    187|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    187|  buffer->Advance(bytes_encoded);
  158|    187|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 29, False: 158]
  ------------------
  159|     29|    return false;
  160|     29|  }
  161|    158|  return true;
  162|    187|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  13.1M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|    158|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    158|  ans_.read_end();
  167|    158|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    429|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    429|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    429|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 429]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    429|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    429|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    429|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 57, False: 372]
  ------------------
   67|     57|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 54]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     57|  } else
   72|    372|#endif
   73|    372|  {
   74|    372|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 365]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    372|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    419|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 20, False: 399]
  ------------------
   83|     20|    return false;
   84|     20|  }
   85|    399|  probability_table_.resize(num_symbols_);
   86|    399|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 14, False: 385]
  ------------------
   87|     14|    return true;
   88|     14|  }
   89|       |  // Decode the table.
   90|  1.17M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.17M, False: 223]
  ------------------
   91|  1.17M|    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.17M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 88, False: 1.17M]
  ------------------
   95|     88|      return false;
   96|     88|    }
   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.17M|    const int token = prob_data & 3;
  102|  1.17M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 381k, False: 788k]
  ------------------
  103|   381k|      const uint32_t offset = prob_data >> 2;
  104|   381k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 37, False: 381k]
  ------------------
  105|     37|        return false;
  106|     37|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  14.4M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 14.0M, False: 381k]
  ------------------
  109|  14.0M|        probability_table_[i + j] = 0;
  110|  14.0M|      }
  111|   381k|      i += offset;
  112|   788k|    } else {
  113|   788k|      const int extra_bytes = token;
  114|   788k|      uint32_t prob = prob_data >> 2;
  115|  1.27M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 488k, False: 788k]
  ------------------
  116|   488k|        uint8_t eb;
  117|   488k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 37, False: 488k]
  ------------------
  118|     37|          return false;
  119|     37|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   488k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   488k|      }
  124|   788k|      probability_table_[i] = prob;
  125|   788k|    }
  126|  1.17M|  }
  127|    223|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 44, False: 179]
  ------------------
  128|     44|    return false;
  129|     44|  }
  130|    179|  return true;
  131|    223|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    193|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    179|    DecoderBuffer *buffer) {
  136|    179|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    179|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    179|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    179|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 25, False: 154]
  ------------------
  140|     25|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 6, False: 19]
  ------------------
  141|      6|      return false;
  142|      6|    }
  143|       |
  144|     25|  } else
  145|    154|#endif
  146|    154|  {
  147|    154|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 153]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    154|  }
  151|    172|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 52, False: 120]
  ------------------
  152|     52|    return false;
  153|     52|  }
  154|    120|  const uint8_t *const data_head =
  155|    120|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    120|  buffer->Advance(bytes_encoded);
  158|    120|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 34, False: 86]
  ------------------
  159|     34|    return false;
  160|     34|  }
  161|     86|  return true;
  162|    120|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  7.91M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|     86|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     86|  ans_.read_end();
  167|     86|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    447|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    447|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    447|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 447]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    447|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    447|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    447|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 78, False: 369]
  ------------------
   67|     78|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 74]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     78|  } else
   72|    369|#endif
   73|    369|  {
   74|    369|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 23, False: 346]
  ------------------
   75|     23|      return false;
   76|     23|    }
   77|    369|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    420|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 40, False: 380]
  ------------------
   83|     40|    return false;
   84|     40|  }
   85|    380|  probability_table_.resize(num_symbols_);
   86|    380|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 375]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|   504k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 504k, False: 249]
  ------------------
   91|   504k|    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|   504k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 59, False: 504k]
  ------------------
   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|   504k|    const int token = prob_data & 3;
  102|   504k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 145k, False: 358k]
  ------------------
  103|   145k|      const uint32_t offset = prob_data >> 2;
  104|   145k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 42, False: 145k]
  ------------------
  105|     42|        return false;
  106|     42|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  5.29M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 5.14M, False: 145k]
  ------------------
  109|  5.14M|        probability_table_[i + j] = 0;
  110|  5.14M|      }
  111|   145k|      i += offset;
  112|   358k|    } else {
  113|   358k|      const int extra_bytes = token;
  114|   358k|      uint32_t prob = prob_data >> 2;
  115|   633k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 275k, False: 358k]
  ------------------
  116|   275k|        uint8_t eb;
  117|   275k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 25, False: 275k]
  ------------------
  118|     25|          return false;
  119|     25|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   275k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   275k|      }
  124|   358k|      probability_table_[i] = prob;
  125|   358k|    }
  126|   504k|  }
  127|    249|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 36, False: 213]
  ------------------
  128|     36|    return false;
  129|     36|  }
  130|    213|  return true;
  131|    249|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    218|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|    213|    DecoderBuffer *buffer) {
  136|    213|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    213|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    213|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    213|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 47, False: 166]
  ------------------
  140|     47|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 46]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     47|  } else
  145|    166|#endif
  146|    166|  {
  147|    166|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 165]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    166|  }
  151|    211|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 106, False: 105]
  ------------------
  152|    106|    return false;
  153|    106|  }
  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: 35, False: 70]
  ------------------
  159|     35|    return false;
  160|     35|  }
  161|     70|  return true;
  162|    105|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  2.14M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     70|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     70|  ans_.read_end();
  167|     70|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    357|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    357|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    357|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 357]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    357|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    357|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    357|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 19, False: 338]
  ------------------
   67|     19|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 18]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     19|  } else
   72|    338|#endif
   73|    338|  {
   74|    338|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 332]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    338|  }
   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|    350|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 33, False: 317]
  ------------------
   83|     33|    return false;
   84|     33|  }
   85|    317|  probability_table_.resize(num_symbols_);
   86|    317|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 307]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|  10.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 9.89k, False: 196]
  ------------------
   91|  9.89k|    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.89k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 41, False: 9.85k]
  ------------------
   95|     41|      return false;
   96|     41|    }
   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.85k|    const int token = prob_data & 3;
  102|  9.85k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.12k, False: 5.73k]
  ------------------
  103|  4.12k|      const uint32_t offset = prob_data >> 2;
  104|  4.12k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 43, False: 4.08k]
  ------------------
  105|     43|        return false;
  106|     43|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   154k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 150k, False: 4.08k]
  ------------------
  109|   150k|        probability_table_[i + j] = 0;
  110|   150k|      }
  111|  4.08k|      i += offset;
  112|  5.73k|    } else {
  113|  5.73k|      const int extra_bytes = token;
  114|  5.73k|      uint32_t prob = prob_data >> 2;
  115|  9.38k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.67k, False: 5.70k]
  ------------------
  116|  3.67k|        uint8_t eb;
  117|  3.67k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 27, False: 3.65k]
  ------------------
  118|     27|          return false;
  119|     27|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.65k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.65k|      }
  124|  5.70k|      probability_table_[i] = prob;
  125|  5.70k|    }
  126|  9.85k|  }
  127|    196|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 70, False: 126]
  ------------------
  128|     70|    return false;
  129|     70|  }
  130|    126|  return true;
  131|    196|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    136|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|    126|    DecoderBuffer *buffer) {
  136|    126|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    126|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    126|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    126|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 126]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|    126|#endif
  146|    126|  {
  147|    126|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 125]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    126|  }
  151|    125|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 58, False: 67]
  ------------------
  152|     58|    return false;
  153|     58|  }
  154|     67|  const uint8_t *const data_head =
  155|     67|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     67|  buffer->Advance(bytes_encoded);
  158|     67|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 20, False: 47]
  ------------------
  159|     20|    return false;
  160|     20|  }
  161|     47|  return true;
  162|     67|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|   145k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     47|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     47|  ans_.read_end();
  167|     47|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    350|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    350|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    350|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 350]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    350|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    350|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    350|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 17, False: 333]
  ------------------
   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|    333|#endif
   73|    333|  {
   74|    333|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 330]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    333|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    345|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 330]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    330|  probability_table_.resize(num_symbols_);
   86|    330|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 324]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|   196k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 196k, False: 189]
  ------------------
   91|   196k|    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|   196k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 68, False: 196k]
  ------------------
   95|     68|      return false;
   96|     68|    }
   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|   196k|    const int token = prob_data & 3;
  102|   196k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 64.2k, False: 131k]
  ------------------
  103|  64.2k|      const uint32_t offset = prob_data >> 2;
  104|  64.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 48, False: 64.2k]
  ------------------
  105|     48|        return false;
  106|     48|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.26M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.19M, False: 64.2k]
  ------------------
  109|  2.19M|        probability_table_[i + j] = 0;
  110|  2.19M|      }
  111|  64.2k|      i += offset;
  112|   131k|    } else {
  113|   131k|      const int extra_bytes = token;
  114|   131k|      uint32_t prob = prob_data >> 2;
  115|   225k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 94.0k, False: 131k]
  ------------------
  116|  94.0k|        uint8_t eb;
  117|  94.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 19, False: 93.9k]
  ------------------
  118|     19|          return false;
  119|     19|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  93.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  93.9k|      }
  124|   131k|      probability_table_[i] = prob;
  125|   131k|    }
  126|   196k|  }
  127|    189|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 60, False: 129]
  ------------------
  128|     60|    return false;
  129|     60|  }
  130|    129|  return true;
  131|    189|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    135|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    129|    DecoderBuffer *buffer) {
  136|    129|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    129|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    129|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    129|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 129]
  ------------------
  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|    129|#endif
  146|    129|  {
  147|    129|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 128]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    129|  }
  151|    128|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 40, False: 88]
  ------------------
  152|     40|    return false;
  153|     40|  }
  154|     88|  const uint8_t *const data_head =
  155|     88|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     88|  buffer->Advance(bytes_encoded);
  158|     88|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 63]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     63|  return true;
  162|     88|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   470k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     63|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     63|  ans_.read_end();
  167|     63|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    397|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    397|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    397|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 397]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    397|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    397|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    397|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 32, False: 365]
  ------------------
   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|    365|#endif
   73|    365|  {
   74|    365|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 363]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    365|  }
   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|    394|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 22, False: 372]
  ------------------
   83|     22|    return false;
   84|     22|  }
   85|    372|  probability_table_.resize(num_symbols_);
   86|    372|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 366]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|  85.9k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 85.7k, False: 228]
  ------------------
   91|  85.7k|    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|  85.7k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 59, False: 85.6k]
  ------------------
   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|  85.6k|    const int token = prob_data & 3;
  102|  85.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 28.5k, False: 57.1k]
  ------------------
  103|  28.5k|      const uint32_t offset = prob_data >> 2;
  104|  28.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 53, False: 28.5k]
  ------------------
  105|     53|        return false;
  106|     53|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.10M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.07M, False: 28.5k]
  ------------------
  109|  1.07M|        probability_table_[i + j] = 0;
  110|  1.07M|      }
  111|  28.5k|      i += offset;
  112|  57.1k|    } else {
  113|  57.1k|      const int extra_bytes = token;
  114|  57.1k|      uint32_t prob = prob_data >> 2;
  115|  86.4k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 29.4k, False: 57.0k]
  ------------------
  116|  29.4k|        uint8_t eb;
  117|  29.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 26, False: 29.3k]
  ------------------
  118|     26|          return false;
  119|     26|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  29.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  29.3k|      }
  124|  57.0k|      probability_table_[i] = prob;
  125|  57.0k|    }
  126|  85.6k|  }
  127|    228|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 86, False: 142]
  ------------------
  128|     86|    return false;
  129|     86|  }
  130|    142|  return true;
  131|    228|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|    148|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|    142|    DecoderBuffer *buffer) {
  136|    142|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    142|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    142|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    142|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 142]
  ------------------
  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|    142|#endif
  146|    142|  {
  147|    142|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 4, False: 138]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|    142|  }
  151|    138|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 70, False: 68]
  ------------------
  152|     70|    return false;
  153|     70|  }
  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: 33, False: 35]
  ------------------
  159|     33|    return false;
  160|     33|  }
  161|     35|  return true;
  162|     68|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|  46.4k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     35|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     35|  ans_.read_end();
  167|     35|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    437|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    437|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    437|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 437]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    437|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    437|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    437|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 2, False: 435]
  ------------------
   67|      2|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 1]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|      2|  } else
   72|    435|#endif
   73|    435|  {
   74|    435|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 424]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    435|  }
   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|    425|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 415]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    415|  probability_table_.resize(num_symbols_);
   86|    415|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 406]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  65.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 65.2k, False: 270]
  ------------------
   91|  65.2k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  65.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 73, False: 65.1k]
  ------------------
   95|     73|      return false;
   96|     73|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  65.1k|    const int token = prob_data & 3;
  102|  65.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 10.4k, False: 54.6k]
  ------------------
  103|  10.4k|      const uint32_t offset = prob_data >> 2;
  104|  10.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 42, False: 10.4k]
  ------------------
  105|     42|        return false;
  106|     42|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   360k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 350k, False: 10.4k]
  ------------------
  109|   350k|        probability_table_[i + j] = 0;
  110|   350k|      }
  111|  10.4k|      i += offset;
  112|  54.6k|    } else {
  113|  54.6k|      const int extra_bytes = token;
  114|  54.6k|      uint32_t prob = prob_data >> 2;
  115|  65.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 10.4k, False: 54.6k]
  ------------------
  116|  10.4k|        uint8_t eb;
  117|  10.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 10.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|  10.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  10.4k|      }
  124|  54.6k|      probability_table_[i] = prob;
  125|  54.6k|    }
  126|  65.1k|  }
  127|    270|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 95, False: 175]
  ------------------
  128|     95|    return false;
  129|     95|  }
  130|    175|  return true;
  131|    270|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    184|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    175|    DecoderBuffer *buffer) {
  136|    175|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    175|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    175|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    175|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 175]
  ------------------
  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|    175|#endif
  146|    175|  {
  147|    175|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 172]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    175|  }
  151|    172|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 85, False: 87]
  ------------------
  152|     85|    return false;
  153|     85|  }
  154|     87|  const uint8_t *const data_head =
  155|     87|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     87|  buffer->Advance(bytes_encoded);
  158|     87|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 31, False: 56]
  ------------------
  159|     31|    return false;
  160|     31|  }
  161|     56|  return true;
  162|     87|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|   161k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     56|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     56|  ans_.read_end();
  167|     56|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    351|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    351|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    351|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 351]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    351|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    351|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    351|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 15, False: 336]
  ------------------
   67|     15|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 13]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     15|  } else
   72|    336|#endif
   73|    336|  {
   74|    336|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 334]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    336|  }
   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|    347|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 14, False: 333]
  ------------------
   83|     14|    return false;
   84|     14|  }
   85|    333|  probability_table_.resize(num_symbols_);
   86|    333|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 15, False: 318]
  ------------------
   87|     15|    return true;
   88|     15|  }
   89|       |  // Decode the table.
   90|   234k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 234k, False: 202]
  ------------------
   91|   234k|    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|   234k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 50, False: 234k]
  ------------------
   95|     50|      return false;
   96|     50|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   234k|    const int token = prob_data & 3;
  102|   234k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 64.3k, False: 170k]
  ------------------
  103|  64.3k|      const uint32_t offset = prob_data >> 2;
  104|  64.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 36, False: 64.2k]
  ------------------
  105|     36|        return false;
  106|     36|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.34M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.27M, False: 64.2k]
  ------------------
  109|  2.27M|        probability_table_[i + j] = 0;
  110|  2.27M|      }
  111|  64.2k|      i += offset;
  112|   170k|    } else {
  113|   170k|      const int extra_bytes = token;
  114|   170k|      uint32_t prob = prob_data >> 2;
  115|   292k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 122k, False: 170k]
  ------------------
  116|   122k|        uint8_t eb;
  117|   122k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 30, False: 122k]
  ------------------
  118|     30|          return false;
  119|     30|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   122k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   122k|      }
  124|   170k|      probability_table_[i] = prob;
  125|   170k|    }
  126|   234k|  }
  127|    202|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 75, False: 127]
  ------------------
  128|     75|    return false;
  129|     75|  }
  130|    127|  return true;
  131|    202|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|    142|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|    127|    DecoderBuffer *buffer) {
  136|    127|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    127|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    127|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    127|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 127]
  ------------------
  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|    127|#endif
  146|    127|  {
  147|    127|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 6, False: 121]
  ------------------
  148|      6|      return false;
  149|      6|    }
  150|    127|  }
  151|    121|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 39, False: 82]
  ------------------
  152|     39|    return false;
  153|     39|  }
  154|     82|  const uint8_t *const data_head =
  155|     82|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     82|  buffer->Advance(bytes_encoded);
  158|     82|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 57]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     57|  return true;
  162|     82|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   417k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     57|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     57|  ans_.read_end();
  167|     57|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    346|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    346|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    346|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 346]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    346|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    346|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    346|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 27, False: 319]
  ------------------
   67|     27|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 26]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     27|  } else
   72|    319|#endif
   73|    319|  {
   74|    319|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 15, False: 304]
  ------------------
   75|     15|      return false;
   76|     15|    }
   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|    330|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 26, False: 304]
  ------------------
   83|     26|    return false;
   84|     26|  }
   85|    304|  probability_table_.resize(num_symbols_);
   86|    304|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 297]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  50.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 50.0k, False: 178]
  ------------------
   91|  50.0k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  50.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 59, False: 49.9k]
  ------------------
   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|  49.9k|    const int token = prob_data & 3;
  102|  49.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 23.3k, False: 26.6k]
  ------------------
  103|  23.3k|      const uint32_t offset = prob_data >> 2;
  104|  23.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 31, False: 23.3k]
  ------------------
  105|     31|        return false;
  106|     31|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.13M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.11M, False: 23.3k]
  ------------------
  109|  1.11M|        probability_table_[i + j] = 0;
  110|  1.11M|      }
  111|  23.3k|      i += offset;
  112|  26.6k|    } else {
  113|  26.6k|      const int extra_bytes = token;
  114|  26.6k|      uint32_t prob = prob_data >> 2;
  115|  41.5k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 14.8k, False: 26.6k]
  ------------------
  116|  14.8k|        uint8_t eb;
  117|  14.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 29, False: 14.8k]
  ------------------
  118|     29|          return false;
  119|     29|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  14.8k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  14.8k|      }
  124|  26.6k|      probability_table_[i] = prob;
  125|  26.6k|    }
  126|  49.9k|  }
  127|    178|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 40, False: 138]
  ------------------
  128|     40|    return false;
  129|     40|  }
  130|    138|  return true;
  131|    178|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    145|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    138|    DecoderBuffer *buffer) {
  136|    138|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    138|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    138|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    138|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 136]
  ------------------
  140|      2|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 0]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|      2|  } else
  145|    136|#endif
  146|    136|  {
  147|    136|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 133]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    136|  }
  151|    133|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 41, False: 92]
  ------------------
  152|     41|    return false;
  153|     41|  }
  154|     92|  const uint8_t *const data_head =
  155|     92|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     92|  buffer->Advance(bytes_encoded);
  158|     92|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 67]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     67|  return true;
  162|     92|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  5.12M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     67|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     67|  ans_.read_end();
  167|     67|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    400|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    400|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    400|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 400]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    400|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    400|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    400|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 46, False: 354]
  ------------------
   67|     46|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 43]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     46|  } else
   72|    354|#endif
   73|    354|  {
   74|    354|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 352]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    354|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    395|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 11, False: 384]
  ------------------
   83|     11|    return false;
   84|     11|  }
   85|    384|  probability_table_.resize(num_symbols_);
   86|    384|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 20, False: 364]
  ------------------
   87|     20|    return true;
   88|     20|  }
   89|       |  // Decode the table.
   90|   260k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 260k, False: 236]
  ------------------
   91|   260k|    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|   260k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 65, False: 260k]
  ------------------
   95|     65|      return false;
   96|     65|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   260k|    const int token = prob_data & 3;
  102|   260k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 29.1k, False: 231k]
  ------------------
  103|  29.1k|      const uint32_t offset = prob_data >> 2;
  104|  29.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 38, False: 29.1k]
  ------------------
  105|     38|        return false;
  106|     38|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.16M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.13M, False: 29.1k]
  ------------------
  109|  1.13M|        probability_table_[i + j] = 0;
  110|  1.13M|      }
  111|  29.1k|      i += offset;
  112|   231k|    } else {
  113|   231k|      const int extra_bytes = token;
  114|   231k|      uint32_t prob = prob_data >> 2;
  115|   305k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 74.3k, False: 231k]
  ------------------
  116|  74.3k|        uint8_t eb;
  117|  74.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 25, False: 74.3k]
  ------------------
  118|     25|          return false;
  119|     25|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  74.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  74.3k|      }
  124|   231k|      probability_table_[i] = prob;
  125|   231k|    }
  126|   260k|  }
  127|    236|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 51, False: 185]
  ------------------
  128|     51|    return false;
  129|     51|  }
  130|    185|  return true;
  131|    236|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    205|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|    185|    DecoderBuffer *buffer) {
  136|    185|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    185|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    185|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    185|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 35, False: 150]
  ------------------
  140|     35|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 34]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     35|  } else
  145|    150|#endif
  146|    150|  {
  147|    150|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 8, False: 142]
  ------------------
  148|      8|      return false;
  149|      8|    }
  150|    150|  }
  151|    176|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 55, False: 121]
  ------------------
  152|     55|    return false;
  153|     55|  }
  154|    121|  const uint8_t *const data_head =
  155|    121|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    121|  buffer->Advance(bytes_encoded);
  158|    121|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 34, False: 87]
  ------------------
  159|     34|    return false;
  160|     34|  }
  161|     87|  return true;
  162|    121|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  3.52M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     87|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     87|  ans_.read_end();
  167|     87|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    341|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    341|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    341|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 341]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    341|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    341|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    341|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 35, False: 306]
  ------------------
   67|     35|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 33]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     35|  } else
   72|    306|#endif
   73|    306|  {
   74|    306|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 298]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    306|  }
   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|    331|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 23, False: 308]
  ------------------
   83|     23|    return false;
   84|     23|  }
   85|    308|  probability_table_.resize(num_symbols_);
   86|    308|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 307]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  13.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 12.9k, False: 194]
  ------------------
   91|  12.9k|    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|  12.9k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 54, False: 12.8k]
  ------------------
   95|     54|      return false;
   96|     54|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  12.8k|    const int token = prob_data & 3;
  102|  12.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 7.60k, False: 5.27k]
  ------------------
  103|  7.60k|      const uint32_t offset = prob_data >> 2;
  104|  7.60k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 37, False: 7.56k]
  ------------------
  105|     37|        return false;
  106|     37|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   269k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 262k, False: 7.56k]
  ------------------
  109|   262k|        probability_table_[i + j] = 0;
  110|   262k|      }
  111|  7.56k|      i += offset;
  112|  7.56k|    } else {
  113|  5.27k|      const int extra_bytes = token;
  114|  5.27k|      uint32_t prob = prob_data >> 2;
  115|  9.09k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.84k, False: 5.25k]
  ------------------
  116|  3.84k|        uint8_t eb;
  117|  3.84k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 3.81k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.81k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.81k|      }
  124|  5.25k|      probability_table_[i] = prob;
  125|  5.25k|    }
  126|  12.8k|  }
  127|    194|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 24, False: 170]
  ------------------
  128|     24|    return false;
  129|     24|  }
  130|    170|  return true;
  131|    194|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    171|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    170|    DecoderBuffer *buffer) {
  136|    170|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    170|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    170|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    170|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 19, False: 151]
  ------------------
  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|    151|#endif
  146|    151|  {
  147|    151|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 13, False: 138]
  ------------------
  148|     13|      return false;
  149|     13|    }
  150|    151|  }
  151|    155|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 57, False: 98]
  ------------------
  152|     57|    return false;
  153|     57|  }
  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: 28, False: 70]
  ------------------
  159|     28|    return false;
  160|     28|  }
  161|     70|  return true;
  162|     98|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  24.3M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     70|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     70|  ans_.read_end();
  167|     70|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    345|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    345|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    345|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 345]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    345|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    345|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    345|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 49, False: 296]
  ------------------
   67|     49|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 48]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     49|  } else
   72|    296|#endif
   73|    296|  {
   74|    296|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 292]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    296|  }
   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|    340|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 20, False: 320]
  ------------------
   83|     20|    return false;
   84|     20|  }
   85|    320|  probability_table_.resize(num_symbols_);
   86|    320|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 308]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|  10.7k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 10.5k, False: 182]
  ------------------
   91|  10.5k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  10.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 67, False: 10.4k]
  ------------------
   95|     67|      return false;
   96|     67|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  10.4k|    const int token = prob_data & 3;
  102|  10.4k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.35k, False: 6.13k]
  ------------------
  103|  4.35k|      const uint32_t offset = prob_data >> 2;
  104|  4.35k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 33, False: 4.32k]
  ------------------
  105|     33|        return false;
  106|     33|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   158k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 154k, False: 4.32k]
  ------------------
  109|   154k|        probability_table_[i + j] = 0;
  110|   154k|      }
  111|  4.32k|      i += offset;
  112|  6.13k|    } else {
  113|  6.13k|      const int extra_bytes = token;
  114|  6.13k|      uint32_t prob = prob_data >> 2;
  115|  10.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.27k, False: 6.11k]
  ------------------
  116|  4.27k|        uint8_t eb;
  117|  4.27k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 26, False: 4.24k]
  ------------------
  118|     26|          return false;
  119|     26|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.24k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.24k|      }
  124|  6.11k|      probability_table_[i] = prob;
  125|  6.11k|    }
  126|  10.4k|  }
  127|    182|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 21, False: 161]
  ------------------
  128|     21|    return false;
  129|     21|  }
  130|    161|  return true;
  131|    182|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    173|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    161|    DecoderBuffer *buffer) {
  136|    161|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    161|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    161|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    161|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 37, False: 124]
  ------------------
  140|     37|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 35]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     37|  } else
  145|    124|#endif
  146|    124|  {
  147|    124|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 121]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    124|  }
  151|    156|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 70, False: 86]
  ------------------
  152|     70|    return false;
  153|     70|  }
  154|     86|  const uint8_t *const data_head =
  155|     86|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     86|  buffer->Advance(bytes_encoded);
  158|     86|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 22, False: 64]
  ------------------
  159|     22|    return false;
  160|     22|  }
  161|     64|  return true;
  162|     86|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  17.3M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     64|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     64|  ans_.read_end();
  167|     64|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    325|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    325|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    325|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 325]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    325|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    325|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    325|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 73, False: 252]
  ------------------
   67|     73|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 72]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     73|  } else
   72|    252|#endif
   73|    252|  {
   74|    252|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 244]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    252|  }
   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|    316|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 14, False: 302]
  ------------------
   83|     14|    return false;
   84|     14|  }
   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|  68.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 68.1k, False: 181]
  ------------------
   91|  68.1k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  68.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 54, False: 68.1k]
  ------------------
   95|     54|      return false;
   96|     54|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  68.1k|    const int token = prob_data & 3;
  102|  68.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 48.1k, False: 19.9k]
  ------------------
  103|  48.1k|      const uint32_t offset = prob_data >> 2;
  104|  48.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 33, False: 48.0k]
  ------------------
  105|     33|        return false;
  106|     33|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   525k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 477k, False: 48.0k]
  ------------------
  109|   477k|        probability_table_[i + j] = 0;
  110|   477k|      }
  111|  48.0k|      i += offset;
  112|  48.0k|    } else {
  113|  19.9k|      const int extra_bytes = token;
  114|  19.9k|      uint32_t prob = prob_data >> 2;
  115|  42.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 23.0k, False: 19.9k]
  ------------------
  116|  23.0k|        uint8_t eb;
  117|  23.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 30, False: 22.9k]
  ------------------
  118|     30|          return false;
  119|     30|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  22.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  22.9k|      }
  124|  19.9k|      probability_table_[i] = prob;
  125|  19.9k|    }
  126|  68.1k|  }
  127|    181|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 26, False: 155]
  ------------------
  128|     26|    return false;
  129|     26|  }
  130|    155|  return true;
  131|    181|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    159|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    155|    DecoderBuffer *buffer) {
  136|    155|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    155|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    155|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    155|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 62, False: 93]
  ------------------
  140|     62|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 61]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     62|  } else
  145|     93|#endif
  146|     93|  {
  147|     93|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 90]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|     93|  }
  151|    151|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 79, False: 72]
  ------------------
  152|     79|    return false;
  153|     79|  }
  154|     72|  const uint8_t *const data_head =
  155|     72|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     72|  buffer->Advance(bytes_encoded);
  158|     72|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 7, False: 65]
  ------------------
  159|      7|    return false;
  160|      7|  }
  161|     65|  return true;
  162|     72|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  47.4M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     65|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     65|  ans_.read_end();
  167|     65|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  11.4k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  11.4k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 24, False: 11.4k]
  ------------------
   35|     24|    return true;
   36|     24|  }
   37|       |  // Decode which scheme to use.
   38|  11.4k|  uint8_t scheme;
   39|  11.4k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 146, False: 11.2k]
  ------------------
   40|    146|    return false;
   41|    146|  }
   42|  11.2k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 1.12k, False: 10.1k]
  ------------------
   43|  1.12k|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|  1.12k|                                                  src_buffer, out_values);
   45|  10.1k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 7.46k, False: 2.69k]
  ------------------
   46|  7.46k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  7.46k|                                               out_values);
   48|  7.46k|  }
   49|  2.69k|  return false;
   50|  11.2k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|  1.12k|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|  1.12k|  SymbolDecoderT<5> tag_decoder;
   57|  1.12k|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 467, False: 658]
  ------------------
   58|    467|    return false;
   59|    467|  }
   60|       |
   61|    658|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 305, False: 353]
  ------------------
   62|    305|    return false;
   63|    305|  }
   64|       |
   65|    353|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 353, False: 0]
  |  Branch (65:25): [True: 70, False: 283]
  ------------------
   66|     70|    return false;  // Wrong number of symbols.
   67|     70|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    283|  src_buffer->StartBitDecoding(false, nullptr);
   72|    283|  int value_id = 0;
   73|   821k|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 820k, False: 283]
  ------------------
   74|       |    // Decode the tag.
   75|   820k|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  2.05M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 1.23M, False: 820k]
  ------------------
   78|  1.23M|      uint32_t val;
   79|  1.23M|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 0, False: 1.23M]
  ------------------
   80|      0|        return false;
   81|      0|      }
   82|  1.23M|      out_values[value_id++] = val;
   83|  1.23M|    }
   84|   820k|  }
   85|    283|  tag_decoder.EndDecoding();
   86|    283|  src_buffer->EndBitDecoding();
   87|    283|  return true;
   88|    283|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  7.46k|                      uint32_t *out_values) {
  117|  7.46k|  uint8_t max_bit_length;
  118|  7.46k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 35, False: 7.42k]
  ------------------
  119|     35|    return false;
  120|     35|  }
  121|  7.42k|  switch (max_bit_length) {
  122|    574|    case 1:
  ------------------
  |  Branch (122:5): [True: 574, False: 6.85k]
  ------------------
  123|    574|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    574|                                                         out_values);
  125|    594|    case 2:
  ------------------
  |  Branch (125:5): [True: 594, False: 6.83k]
  ------------------
  126|    594|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    594|                                                         out_values);
  128|    414|    case 3:
  ------------------
  |  Branch (128:5): [True: 414, False: 7.01k]
  ------------------
  129|    414|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    414|                                                         out_values);
  131|    291|    case 4:
  ------------------
  |  Branch (131:5): [True: 291, False: 7.13k]
  ------------------
  132|    291|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    291|                                                         out_values);
  134|    262|    case 5:
  ------------------
  |  Branch (134:5): [True: 262, False: 7.16k]
  ------------------
  135|    262|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    262|                                                         out_values);
  137|    475|    case 6:
  ------------------
  |  Branch (137:5): [True: 475, False: 6.95k]
  ------------------
  138|    475|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    475|                                                         out_values);
  140|    429|    case 7:
  ------------------
  |  Branch (140:5): [True: 429, False: 6.99k]
  ------------------
  141|    429|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    429|                                                         out_values);
  143|    447|    case 8:
  ------------------
  |  Branch (143:5): [True: 447, False: 6.97k]
  ------------------
  144|    447|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    447|                                                         out_values);
  146|    357|    case 9:
  ------------------
  |  Branch (146:5): [True: 357, False: 7.06k]
  ------------------
  147|    357|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    357|                                                         out_values);
  149|    350|    case 10:
  ------------------
  |  Branch (149:5): [True: 350, False: 7.07k]
  ------------------
  150|    350|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    350|          num_values, src_buffer, out_values);
  152|    397|    case 11:
  ------------------
  |  Branch (152:5): [True: 397, False: 7.02k]
  ------------------
  153|    397|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    397|          num_values, src_buffer, out_values);
  155|    437|    case 12:
  ------------------
  |  Branch (155:5): [True: 437, False: 6.98k]
  ------------------
  156|    437|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    437|          num_values, src_buffer, out_values);
  158|    351|    case 13:
  ------------------
  |  Branch (158:5): [True: 351, False: 7.07k]
  ------------------
  159|    351|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    351|          num_values, src_buffer, out_values);
  161|    346|    case 14:
  ------------------
  |  Branch (161:5): [True: 346, False: 7.07k]
  ------------------
  162|    346|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    346|          num_values, src_buffer, out_values);
  164|    400|    case 15:
  ------------------
  |  Branch (164:5): [True: 400, False: 7.02k]
  ------------------
  165|    400|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    400|          num_values, src_buffer, out_values);
  167|    341|    case 16:
  ------------------
  |  Branch (167:5): [True: 341, False: 7.08k]
  ------------------
  168|    341|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    341|          num_values, src_buffer, out_values);
  170|    345|    case 17:
  ------------------
  |  Branch (170:5): [True: 345, False: 7.08k]
  ------------------
  171|    345|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    345|          num_values, src_buffer, out_values);
  173|    325|    case 18:
  ------------------
  |  Branch (173:5): [True: 325, False: 7.10k]
  ------------------
  174|    325|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    325|          num_values, src_buffer, out_values);
  176|    290|    default:
  ------------------
  |  Branch (176:5): [True: 290, False: 7.13k]
  ------------------
  177|    290|      return false;
  178|  7.42k|  }
  179|  7.42k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    574|                              uint32_t *out_values) {
   93|    574|  SymbolDecoderT decoder;
   94|    574|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 347, False: 227]
  ------------------
   95|    347|    return false;
   96|    347|  }
   97|       |
   98|    227|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 227, False: 0]
  |  Branch (98:25): [True: 18, False: 209]
  ------------------
   99|     18|    return false;  // Wrong number of symbols.
  100|     18|  }
  101|       |
  102|    209|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 69, False: 140]
  ------------------
  103|     69|    return false;
  104|     69|  }
  105|  40.4M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 40.4M, False: 140]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  40.4M|    const uint32_t value = decoder.DecodeSymbol();
  108|  40.4M|    out_values[i] = value;
  109|  40.4M|  }
  110|    140|  decoder.EndDecoding();
  111|    140|  return true;
  112|    209|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    594|                              uint32_t *out_values) {
   93|    594|  SymbolDecoderT decoder;
   94|    594|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 242, False: 352]
  ------------------
   95|    242|    return false;
   96|    242|  }
   97|       |
   98|    352|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 352, False: 0]
  |  Branch (98:25): [True: 14, False: 338]
  ------------------
   99|     14|    return false;  // Wrong number of symbols.
  100|     14|  }
  101|       |
  102|    338|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 120, False: 218]
  ------------------
  103|    120|    return false;
  104|    120|  }
  105|  6.46M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.46M, False: 218]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.46M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.46M|    out_values[i] = value;
  109|  6.46M|  }
  110|    218|  decoder.EndDecoding();
  111|    218|  return true;
  112|    338|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    414|                              uint32_t *out_values) {
   93|    414|  SymbolDecoderT decoder;
   94|    414|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 182, False: 232]
  ------------------
   95|    182|    return false;
   96|    182|  }
   97|       |
   98|    232|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 232, False: 0]
  |  Branch (98:25): [True: 7, False: 225]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    225|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 124, False: 101]
  ------------------
  103|    124|    return false;
  104|    124|  }
  105|  5.79M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.79M, False: 101]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.79M|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.79M|    out_values[i] = value;
  109|  5.79M|  }
  110|    101|  decoder.EndDecoding();
  111|    101|  return true;
  112|    225|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    291|                              uint32_t *out_values) {
   93|    291|  SymbolDecoderT decoder;
   94|    291|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 160, False: 131]
  ------------------
   95|    160|    return false;
   96|    160|  }
   97|       |
   98|    131|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 131, False: 0]
  |  Branch (98:25): [True: 8, False: 123]
  ------------------
   99|      8|    return false;  // Wrong number of symbols.
  100|      8|  }
  101|       |
  102|    123|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 37, False: 86]
  ------------------
  103|     37|    return false;
  104|     37|  }
  105|  1.12M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.12M, False: 86]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.12M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.12M|    out_values[i] = value;
  109|  1.12M|  }
  110|     86|  decoder.EndDecoding();
  111|     86|  return true;
  112|    123|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    262|                              uint32_t *out_values) {
   93|    262|  SymbolDecoderT decoder;
   94|    262|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 31, False: 231]
  ------------------
   95|     31|    return false;
   96|     31|  }
   97|       |
   98|    231|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 231, False: 0]
  |  Branch (98:25): [True: 127, False: 104]
  ------------------
   99|    127|    return false;  // Wrong number of symbols.
  100|    127|  }
  101|       |
  102|    104|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 22, False: 82]
  ------------------
  103|     22|    return false;
  104|     22|  }
  105|   813k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 813k, False: 82]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   813k|    const uint32_t value = decoder.DecodeSymbol();
  108|   813k|    out_values[i] = value;
  109|   813k|  }
  110|     82|  decoder.EndDecoding();
  111|     82|  return true;
  112|    104|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    475|                              uint32_t *out_values) {
   93|    475|  SymbolDecoderT decoder;
   94|    475|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 200, False: 275]
  ------------------
   95|    200|    return false;
   96|    200|  }
   97|       |
   98|    275|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 275, False: 0]
  |  Branch (98:25): [True: 7, False: 268]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    268|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 110, False: 158]
  ------------------
  103|    110|    return false;
  104|    110|  }
  105|  13.1M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 13.1M, False: 158]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  13.1M|    const uint32_t value = decoder.DecodeSymbol();
  108|  13.1M|    out_values[i] = value;
  109|  13.1M|  }
  110|    158|  decoder.EndDecoding();
  111|    158|  return true;
  112|    268|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    429|                              uint32_t *out_values) {
   93|    429|  SymbolDecoderT decoder;
   94|    429|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 236, False: 193]
  ------------------
   95|    236|    return false;
   96|    236|  }
   97|       |
   98|    193|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 193, False: 0]
  |  Branch (98:25): [True: 14, False: 179]
  ------------------
   99|     14|    return false;  // Wrong number of symbols.
  100|     14|  }
  101|       |
  102|    179|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 93, False: 86]
  ------------------
  103|     93|    return false;
  104|     93|  }
  105|  7.91M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 7.91M, False: 86]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  7.91M|    const uint32_t value = decoder.DecodeSymbol();
  108|  7.91M|    out_values[i] = value;
  109|  7.91M|  }
  110|     86|  decoder.EndDecoding();
  111|     86|  return true;
  112|    179|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    447|                              uint32_t *out_values) {
   93|    447|  SymbolDecoderT decoder;
   94|    447|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 229, False: 218]
  ------------------
   95|    229|    return false;
   96|    229|  }
   97|       |
   98|    218|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 218, False: 0]
  |  Branch (98:25): [True: 5, False: 213]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    213|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 143, False: 70]
  ------------------
  103|    143|    return false;
  104|    143|  }
  105|  2.14M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.14M, False: 70]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.14M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.14M|    out_values[i] = value;
  109|  2.14M|  }
  110|     70|  decoder.EndDecoding();
  111|     70|  return true;
  112|    213|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    357|                              uint32_t *out_values) {
   93|    357|  SymbolDecoderT decoder;
   94|    357|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 221, False: 136]
  ------------------
   95|    221|    return false;
   96|    221|  }
   97|       |
   98|    136|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 136, False: 0]
  |  Branch (98:25): [True: 10, False: 126]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    126|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 79, False: 47]
  ------------------
  103|     79|    return false;
  104|     79|  }
  105|   145k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 145k, False: 47]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   145k|    const uint32_t value = decoder.DecodeSymbol();
  108|   145k|    out_values[i] = value;
  109|   145k|  }
  110|     47|  decoder.EndDecoding();
  111|     47|  return true;
  112|    126|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    350|                              uint32_t *out_values) {
   93|    350|  SymbolDecoderT decoder;
   94|    350|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 215, False: 135]
  ------------------
   95|    215|    return false;
   96|    215|  }
   97|       |
   98|    135|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 135, False: 0]
  |  Branch (98:25): [True: 6, False: 129]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|    129|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 66, False: 63]
  ------------------
  103|     66|    return false;
  104|     66|  }
  105|   470k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 470k, False: 63]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   470k|    const uint32_t value = decoder.DecodeSymbol();
  108|   470k|    out_values[i] = value;
  109|   470k|  }
  110|     63|  decoder.EndDecoding();
  111|     63|  return true;
  112|    129|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    397|                              uint32_t *out_values) {
   93|    397|  SymbolDecoderT decoder;
   94|    397|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 249, False: 148]
  ------------------
   95|    249|    return false;
   96|    249|  }
   97|       |
   98|    148|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 148, False: 0]
  |  Branch (98:25): [True: 6, False: 142]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|    142|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 107, False: 35]
  ------------------
  103|    107|    return false;
  104|    107|  }
  105|  46.4k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 46.4k, False: 35]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  46.4k|    const uint32_t value = decoder.DecodeSymbol();
  108|  46.4k|    out_values[i] = value;
  109|  46.4k|  }
  110|     35|  decoder.EndDecoding();
  111|     35|  return true;
  112|    142|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    437|                              uint32_t *out_values) {
   93|    437|  SymbolDecoderT decoder;
   94|    437|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 253, False: 184]
  ------------------
   95|    253|    return false;
   96|    253|  }
   97|       |
   98|    184|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 184, False: 0]
  |  Branch (98:25): [True: 9, False: 175]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    175|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 119, False: 56]
  ------------------
  103|    119|    return false;
  104|    119|  }
  105|   161k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 161k, False: 56]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   161k|    const uint32_t value = decoder.DecodeSymbol();
  108|   161k|    out_values[i] = value;
  109|   161k|  }
  110|     56|  decoder.EndDecoding();
  111|     56|  return true;
  112|    175|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    351|                              uint32_t *out_values) {
   93|    351|  SymbolDecoderT decoder;
   94|    351|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 209, False: 142]
  ------------------
   95|    209|    return false;
   96|    209|  }
   97|       |
   98|    142|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 142, False: 0]
  |  Branch (98:25): [True: 15, False: 127]
  ------------------
   99|     15|    return false;  // Wrong number of symbols.
  100|     15|  }
  101|       |
  102|    127|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 70, False: 57]
  ------------------
  103|     70|    return false;
  104|     70|  }
  105|   417k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 417k, False: 57]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   417k|    const uint32_t value = decoder.DecodeSymbol();
  108|   417k|    out_values[i] = value;
  109|   417k|  }
  110|     57|  decoder.EndDecoding();
  111|     57|  return true;
  112|    127|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    346|                              uint32_t *out_values) {
   93|    346|  SymbolDecoderT decoder;
   94|    346|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 201, False: 145]
  ------------------
   95|    201|    return false;
   96|    201|  }
   97|       |
   98|    145|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 145, False: 0]
  |  Branch (98:25): [True: 7, False: 138]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    138|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 71, False: 67]
  ------------------
  103|     71|    return false;
  104|     71|  }
  105|  5.12M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.12M, False: 67]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.12M|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.12M|    out_values[i] = value;
  109|  5.12M|  }
  110|     67|  decoder.EndDecoding();
  111|     67|  return true;
  112|    138|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    400|                              uint32_t *out_values) {
   93|    400|  SymbolDecoderT decoder;
   94|    400|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 195, False: 205]
  ------------------
   95|    195|    return false;
   96|    195|  }
   97|       |
   98|    205|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 205, False: 0]
  |  Branch (98:25): [True: 20, False: 185]
  ------------------
   99|     20|    return false;  // Wrong number of symbols.
  100|     20|  }
  101|       |
  102|    185|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 98, False: 87]
  ------------------
  103|     98|    return false;
  104|     98|  }
  105|  3.52M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.52M, False: 87]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.52M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.52M|    out_values[i] = value;
  109|  3.52M|  }
  110|     87|  decoder.EndDecoding();
  111|     87|  return true;
  112|    185|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    341|                              uint32_t *out_values) {
   93|    341|  SymbolDecoderT decoder;
   94|    341|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 170, False: 171]
  ------------------
   95|    170|    return false;
   96|    170|  }
   97|       |
   98|    171|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 171, False: 0]
  |  Branch (98:25): [True: 1, False: 170]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    170|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 100, False: 70]
  ------------------
  103|    100|    return false;
  104|    100|  }
  105|  24.3M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 24.3M, False: 70]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  24.3M|    const uint32_t value = decoder.DecodeSymbol();
  108|  24.3M|    out_values[i] = value;
  109|  24.3M|  }
  110|     70|  decoder.EndDecoding();
  111|     70|  return true;
  112|    170|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    345|                              uint32_t *out_values) {
   93|    345|  SymbolDecoderT decoder;
   94|    345|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 172, False: 173]
  ------------------
   95|    172|    return false;
   96|    172|  }
   97|       |
   98|    173|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 173, False: 0]
  |  Branch (98:25): [True: 12, False: 161]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|    161|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 97, False: 64]
  ------------------
  103|     97|    return false;
  104|     97|  }
  105|  17.3M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 17.3M, False: 64]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  17.3M|    const uint32_t value = decoder.DecodeSymbol();
  108|  17.3M|    out_values[i] = value;
  109|  17.3M|  }
  110|     64|  decoder.EndDecoding();
  111|     64|  return true;
  112|    161|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    325|                              uint32_t *out_values) {
   93|    325|  SymbolDecoderT decoder;
   94|    325|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 166, False: 159]
  ------------------
   95|    166|    return false;
   96|    166|  }
   97|       |
   98|    159|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 159, False: 0]
  |  Branch (98:25): [True: 4, False: 155]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    155|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 90, False: 65]
  ------------------
  103|     90|    return false;
  104|     90|  }
  105|  47.4M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 47.4M, False: 65]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  47.4M|    const uint32_t value = decoder.DecodeSymbol();
  108|  47.4M|    out_values[i] = value;
  109|  47.4M|  }
  110|     65|  decoder.EndDecoding();
  111|     65|  return true;
  112|    155|}

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

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

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

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

_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEEC2Ev:
   48|  2.78k|    : decoder_(nullptr),
   49|  2.78k|      last_symbol_id_(-1),
   50|  2.78k|      last_vert_id_(-1),
   51|  2.78k|      last_face_id_(-1),
   52|  2.78k|      num_new_vertices_(0),
   53|  2.78k|      num_encoded_vertices_(0),
   54|  2.78k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.78k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.78k|  decoder_ = decoder;
   60|  2.78k|  return true;
   61|  2.78k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23GetAttributeCornerTableEi:
   66|  2.41k|    int att_id) const {
   67|  3.96k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 3.44k, False: 523]
  ------------------
   68|  3.44k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  3.44k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.55k, False: 1.89k]
  |  Branch (69:27): [True: 0, False: 1.89k]
  ------------------
   70|  1.55k|      continue;
   71|  1.55k|    }
   72|  1.89k|    const AttributesDecoderInterface *const dec =
   73|  1.89k|        decoder_->attributes_decoder(decoder_id);
   74|  4.64k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 4.64k, False: 0]
  ------------------
   75|  4.64k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 1.89k, False: 2.75k]
  ------------------
   76|  1.89k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 1.23k, False: 659]
  ------------------
   77|  1.23k|          return &attribute_data_[i].connectivity_data;
   78|  1.23k|        }
   79|    659|        return nullptr;
   80|  1.89k|      }
   81|  4.64k|    }
   82|  1.89k|  }
   83|    523|  return nullptr;
   84|  2.41k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE24GetAttributeEncodingDataEi:
   89|  2.41k|    int att_id) const {
   90|  3.96k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 3.44k, False: 523]
  ------------------
   91|  3.44k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  3.44k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.55k, False: 1.89k]
  |  Branch (92:27): [True: 0, False: 1.89k]
  ------------------
   93|  1.55k|      continue;
   94|  1.55k|    }
   95|  1.89k|    const AttributesDecoderInterface *const dec =
   96|  1.89k|        decoder_->attributes_decoder(decoder_id);
   97|  4.64k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 4.64k, False: 0]
  ------------------
   98|  4.64k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 1.89k, False: 2.75k]
  ------------------
   99|  1.89k|        return &attribute_data_[i].encoding_data;
  100|  1.89k|      }
  101|  4.64k|    }
  102|  1.89k|  }
  103|    523|  return &pos_encoding_data_;
  104|  2.41k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23CreateAttributesDecoderEi:
  130|  1.91k|    int32_t att_decoder_id) {
  131|  1.91k|  int8_t att_data_id;
  132|  1.91k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 19, False: 1.90k]
  ------------------
  133|     19|    return false;
  134|     19|  }
  135|  1.90k|  uint8_t decoder_type;
  136|  1.90k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 9, False: 1.89k]
  ------------------
  137|      9|    return false;
  138|      9|  }
  139|       |
  140|  1.89k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 1.41k, False: 473]
  ------------------
  141|  1.41k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 76, False: 1.34k]
  ------------------
  142|     76|      return false;  // Unexpected attribute data.
  143|     76|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  1.34k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 10, False: 1.33k]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|       |
  151|  1.33k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  1.33k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    473|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 2, False: 471]
  ------------------
  155|      2|      return false;  // Some other decoder is already using the data. Error.
  156|      2|    }
  157|    471|    pos_data_decoder_id_ = att_decoder_id;
  158|    471|  }
  159|       |
  160|  1.80k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  1.80k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.80k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 1.80k, False: 1]
  ------------------
  162|  1.80k|    uint8_t traversal_method_encoded;
  163|  1.80k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 16, False: 1.78k]
  ------------------
  164|     16|      return false;
  165|     16|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  1.78k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 57, False: 1.72k]
  ------------------
  168|     57|      return false;
  169|     57|    }
  170|  1.72k|    traversal_method =
  171|  1.72k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  1.72k|  }
  173|       |
  174|  1.73k|  const Mesh *mesh = decoder_->mesh();
  175|  1.73k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  1.73k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 844, False: 886]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    844|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    844|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 416, False: 428]
  ------------------
  182|    416|      encoding_data = &pos_encoding_data_;
  183|    428|    } else {
  184|    428|      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|    428|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    428|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    844|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 155, False: 689]
  ------------------
  191|    155|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    155|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    155|          AttTraverser;
  194|    155|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    689|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 689, False: 0]
  ------------------
  196|    689|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    689|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    689|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    689|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    886|  } else {
  203|    886|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 7, False: 879]
  ------------------
  204|      7|      return false;  // Unsupported method.
  205|      7|    }
  206|    879|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 2, False: 877]
  ------------------
  207|      2|      return false;  // Attribute data must be specified.
  208|      2|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    877|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    877|        AttObserver;
  214|    877|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    877|        AttTraverser;
  216|       |
  217|    877|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|    877|        &attribute_data_[att_data_id].encoding_data;
  219|    877|    const MeshAttributeCornerTable *const corner_table =
  220|    877|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    877|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    877|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    877|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    877|                             encoding_data);
  227|       |
  228|    877|    AttTraverser att_traverser;
  229|    877|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    877|    traversal_sequencer->SetTraverser(att_traverser);
  232|    877|    sequencer = std::move(traversal_sequencer);
  233|    877|  }
  234|       |
  235|  1.72k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 1.72k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  1.72k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  1.72k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  1.72k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  1.72k|                                        std::move(att_controller));
  244|  1.72k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEv:
  247|  2.78k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.78k|  num_new_vertices_ = 0;
  249|  2.78k|  new_to_parent_vertex_map_.clear();
  250|  2.78k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.78k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.78k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 593, False: 2.19k]
  ------------------
  252|    593|    uint32_t num_new_verts;
  253|    593|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    593|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 184, False: 409]
  ------------------
  254|    184|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 10, False: 174]
  ------------------
  255|     10|        return false;
  256|     10|      }
  257|    409|    } else {
  258|    409|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 1, False: 408]
  ------------------
  259|      1|        return false;
  260|      1|      }
  261|    409|    }
  262|    582|    num_new_vertices_ = num_new_verts;
  263|    582|  }
  264|  2.77k|#endif
  265|       |
  266|  2.77k|  uint32_t num_encoded_vertices;
  267|  2.77k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.77k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.77k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 174, False: 2.59k]
  ------------------
  269|    174|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 2, False: 172]
  ------------------
  270|      2|      return false;
  271|      2|    }
  272|       |
  273|    174|  } else
  274|  2.59k|#endif
  275|  2.59k|  {
  276|  2.59k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 3, False: 2.59k]
  ------------------
  277|      3|      return false;
  278|      3|    }
  279|  2.59k|  }
  280|  2.76k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.76k|  uint32_t num_faces;
  283|  2.76k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.76k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.76k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 172, False: 2.59k]
  ------------------
  285|    172|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 3, False: 169]
  ------------------
  286|      3|      return false;
  287|      3|    }
  288|       |
  289|    172|  } else
  290|  2.59k|#endif
  291|  2.59k|  {
  292|  2.59k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 2, False: 2.59k]
  ------------------
  293|      2|      return false;
  294|      2|    }
  295|  2.59k|  }
  296|  2.76k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 5, False: 2.75k]
  ------------------
  297|      5|    return false;  // Draco cannot handle this many faces.
  298|      5|  }
  299|       |
  300|  2.75k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 22, False: 2.73k]
  ------------------
  301|     22|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     22|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.73k|  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.73k|  const uint64_t num_encoded_vertices_64 =
  311|  2.73k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.73k|  const uint64_t max_num_vertex_edges =
  313|  2.73k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.73k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 8, False: 2.72k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      8|    return false;
  317|      8|  }
  318|       |
  319|  2.72k|  uint8_t num_attribute_data;
  320|  2.72k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 30, False: 2.69k]
  ------------------
  321|     30|    return false;
  322|     30|  }
  323|       |
  324|  2.69k|  uint32_t num_encoded_symbols;
  325|  2.69k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.69k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.69k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 152, False: 2.54k]
  ------------------
  327|    152|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 9, False: 143]
  ------------------
  328|      9|      return false;
  329|      9|    }
  330|       |
  331|    152|  } else
  332|  2.54k|#endif
  333|  2.54k|  {
  334|  2.54k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 7, False: 2.53k]
  ------------------
  335|      7|      return false;
  336|      7|    }
  337|  2.54k|  }
  338|       |
  339|  2.68k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 16, False: 2.66k]
  ------------------
  340|       |    // Number of faces needs to be the same or greater than the number of
  341|       |    // symbols (it can be greater because the initial face may not be encoded as
  342|       |    // a symbol).
  343|     16|    return false;
  344|     16|  }
  345|  2.66k|  const uint32_t max_encoded_faces =
  346|  2.66k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.66k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 37, False: 2.62k]
  ------------------
  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|     37|    return false;
  352|     37|  }
  353|       |
  354|  2.62k|  uint32_t num_encoded_split_symbols;
  355|  2.62k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.62k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.62k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 120, False: 2.50k]
  ------------------
  357|    120|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 5, False: 115]
  ------------------
  358|      5|      return false;
  359|      5|    }
  360|       |
  361|    120|  } else
  362|  2.50k|#endif
  363|  2.50k|  {
  364|  2.50k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 5, False: 2.50k]
  ------------------
  365|      5|      return false;
  366|      5|    }
  367|  2.50k|  }
  368|       |
  369|  2.61k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 27, False: 2.59k]
  ------------------
  370|     27|    return false;  // Split symbols are a sub-set of all symbols.
  371|     27|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.59k|  vertex_traversal_length_.clear();
  375|  2.59k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.59k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.59k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.59k|  processed_corner_ids_.clear();
  380|  2.59k|  processed_corner_ids_.reserve(num_faces);
  381|  2.59k|  processed_connectivity_corners_.clear();
  382|  2.59k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.59k|  topology_split_data_.clear();
  384|  2.59k|  hole_event_data_.clear();
  385|  2.59k|  init_face_configurations_.clear();
  386|  2.59k|  init_corners_.clear();
  387|       |
  388|  2.59k|  last_symbol_id_ = -1;
  389|  2.59k|  last_face_id_ = -1;
  390|  2.59k|  last_vert_id_ = -1;
  391|       |
  392|  2.59k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.59k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.59k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.59k]
  ------------------
  397|  2.59k|          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.59k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.59k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.59k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.59k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.59k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 504, False: 2.08k]
  ------------------
  411|    504|    uint32_t encoded_connectivity_size;
  412|    504|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    504|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 112, False: 392]
  ------------------
  413|    112|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 5, False: 107]
  ------------------
  414|      5|        return false;
  415|      5|      }
  416|    392|    } else {
  417|    392|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 1, False: 391]
  ------------------
  418|      1|        return false;
  419|      1|      }
  420|    392|    }
  421|    498|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 1, False: 497]
  ------------------
  422|    497|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 33, False: 464]
  ------------------
  423|     34|      return false;
  424|     34|    }
  425|    464|    DecoderBuffer event_buffer;
  426|    464|    event_buffer.Init(
  427|    464|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    464|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    464|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    464|    topology_split_decoded_bytes =
  432|    464|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    464|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 125, False: 339]
  ------------------
  434|    125|      return false;
  435|    125|    }
  436|       |
  437|    464|  } else
  438|  2.08k|#endif
  439|  2.08k|  {
  440|  2.08k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 83, False: 2.00k]
  ------------------
  441|     83|      return false;
  442|     83|    }
  443|  2.08k|  }
  444|       |
  445|  2.34k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.34k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.34k|                                           num_encoded_split_symbols);
  449|  2.34k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.34k|  DecoderBuffer traversal_end_buffer;
  452|  2.34k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 188, False: 2.15k]
  ------------------
  453|    188|    return false;
  454|    188|  }
  455|       |
  456|  2.15k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  2.15k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 245, False: 1.91k]
  ------------------
  458|    245|    return false;
  459|    245|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  1.91k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  1.91k|                           traversal_end_buffer.remaining_size(),
  464|  1.91k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  1.91k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  1.91k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.91k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 231, False: 1.68k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|    231|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|    231|  }
  471|  1.91k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  1.91k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 1.83k, False: 77]
  ------------------
  475|  1.83k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  1.83k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.83k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 226, False: 1.60k]
  ------------------
  477|  1.62k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 1.39k, False: 226]
  ------------------
  478|  1.39k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 1.39k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  1.39k|      }
  482|       |
  483|    226|    } else
  484|  1.60k|#endif
  485|  1.60k|    {
  486|   381k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 379k, False: 1.60k]
  ------------------
  487|   379k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 379k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   379k|      }
  491|  1.60k|    }
  492|  1.83k|  }
  493|  1.91k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  5.94k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 4.03k, False: 1.91k]
  ------------------
  498|  4.03k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  4.43M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 4.43M, False: 4.03k]
  ------------------
  501|  4.43M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  4.43M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  4.03k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 4.03k]
  ------------------
  505|  4.03k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  4.03k|  }
  509|       |
  510|  1.91k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  5.94k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 4.03k, False: 1.91k]
  ------------------
  512|       |    // For non-position attributes, preallocate the vertex to value mapping
  513|       |    // using the maximum number of vertices from the base corner table and the
  514|       |    // attribute corner table (since the attribute decoder may use either of
  515|       |    // it).
  516|  4.03k|    int32_t att_connectivity_verts =
  517|  4.03k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  4.03k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 235, False: 3.79k]
  ------------------
  519|    235|      att_connectivity_verts = corner_table_->num_vertices();
  520|    235|    }
  521|  4.03k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  4.03k|  }
  523|  1.91k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 6, False: 1.90k]
  ------------------
  524|      6|    return false;
  525|      6|  }
  526|  1.90k|  return true;
  527|  1.91k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE19OnAttributesDecodedEv:
  530|    437|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    437|  return true;
  532|    437|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEi:
  536|  2.15k|    int num_symbols) {
  537|       |  // Algorithm does the reverse decoding of the symbols encoded with the
  538|       |  // edgebreaker method. The reverse decoding always keeps track of the active
  539|       |  // edge identified by its opposite corner (active corner). New faces are
  540|       |  // always added to this active edge. There may be multiple active corners at
  541|       |  // one time that either correspond to separate mesh components or to
  542|       |  // sub-components of one mesh that are going to be merged together using the
  543|       |  // TOPOLOGY_S symbol. We can store these active edges on a stack, because the
  544|       |  // decoder always processes only the latest active edge. TOPOLOGY_S then
  545|       |  // removes the top edge from the stack and TOPOLOGY_E adds a new edge to the
  546|       |  // stack.
  547|  2.15k|  std::vector<CornerIndex> active_corner_stack;
  548|       |
  549|       |  // Additional active edges may be added as a result of topology split events.
  550|       |  // They can be added in arbitrary order, but we always know the split symbol
  551|       |  // id they belong to, so we can address them using this symbol id.
  552|  2.15k|  std::unordered_map<int, CornerIndex> topology_split_active_corners;
  553|       |
  554|       |  // Vector used for storing vertices that were marked as isolated during the
  555|       |  // decoding process. Currently used only when the mesh doesn't contain any
  556|       |  // non-position connectivity data.
  557|  2.15k|  std::vector<VertexIndex> invalid_vertices;
  558|  2.15k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  2.15k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  2.15k|  int num_faces = 0;
  562|  6.80M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 6.80M, False: 1.96k]
  ------------------
  563|  6.80M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  6.80M|    bool check_topology_split = false;
  566|  6.80M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  6.80M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 3.01M, False: 3.78M]
  ------------------
  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.01M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 1, False: 3.01M]
  ------------------
  588|      1|        return -1;
  589|      1|      }
  590|       |
  591|  3.01M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  3.01M|      const VertexIndex vertex_x =
  593|  3.01M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  3.01M|      const CornerIndex corner_b =
  595|  3.01M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  3.01M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 137, False: 3.01M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    137|        return -1;
  600|    137|      }
  601|  3.01M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 3.01M]
  |  Branch (601:11): [True: 0, False: 3.01M]
  ------------------
  602|  3.01M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 3.01M]
  ------------------
  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.01M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  3.01M|      SetOppositeCorners(corner_a, corner + 1);
  612|  3.01M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  3.01M|      const VertexIndex vert_a_prev =
  616|  3.01M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  3.01M|      const VertexIndex vert_b_next =
  618|  3.01M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  3.01M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 3.01M]
  |  Branch (619:38): [True: 0, False: 3.01M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  3.01M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  3.01M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  3.01M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  3.01M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  3.01M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  3.01M|      active_corner_stack.back() = corner;
  631|  3.78M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 1.02M, False: 2.76M]
  |  Branch (631:40): [True: 479k, False: 2.28M]
  ------------------
  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.50M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 2, False: 1.50M]
  ------------------
  647|      2|        return -1;
  648|      2|      }
  649|  1.50M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  1.50M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 1.50M]
  ------------------
  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.50M|      const CornerIndex corner(3 * face.value());
  658|  1.50M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  1.50M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 1.02M, False: 479k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  1.02M|        opp_corner = corner + 2;
  662|  1.02M|        corner_l = corner + 1;
  663|  1.02M|        corner_r = corner;
  664|  1.02M|      } else {
  665|       |        // "l" is the new first corner.
  666|   479k|        opp_corner = corner + 1;
  667|   479k|        corner_l = corner;
  668|   479k|        corner_r = corner + 2;
  669|   479k|      }
  670|  1.50M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  1.50M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  1.50M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 1, False: 1.50M]
  ------------------
  675|      1|        return -1;  // Unexpected number of decoded vertices.
  676|      1|      }
  677|       |
  678|  1.50M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  1.50M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  1.50M|      const VertexIndex vertex_r =
  682|  1.50M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  1.50M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  1.50M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  1.50M|      corner_table_->MapCornerToVertex(
  688|  1.50M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  1.50M|      active_corner_stack.back() = corner;
  690|  1.50M|      check_topology_split = true;
  691|  2.28M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 732k, False: 1.55M]
  ------------------
  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|   732k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 2, False: 732k]
  ------------------
  703|      2|        return -1;
  704|      2|      }
  705|   732k|      const CornerIndex corner_b = active_corner_stack.back();
  706|   732k|      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|   732k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|   732k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 53, False: 732k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     53|        active_corner_stack.push_back(it->second);
  714|     53|      }
  715|   732k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 16, False: 732k]
  ------------------
  716|     16|        return -1;
  717|     16|      }
  718|   732k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|   732k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 732k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|   732k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 8, False: 732k]
  |  Branch (724:11): [True: 8, False: 732k]
  ------------------
  725|   732k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 732k]
  ------------------
  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|   732k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|   732k|      SetOppositeCorners(corner_a, corner + 2);
  735|   732k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|   732k|      const VertexIndex vertex_p =
  739|   732k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|   732k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|   732k|      corner_table_->MapCornerToVertex(
  742|   732k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|   732k|      const VertexIndex vert_b_prev =
  744|   732k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|   732k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|   732k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|   732k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|   732k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|   732k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|   732k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|   732k|                                       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|   732k|      const CornerIndex first_corner = corner_n;
  757|  4.60M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 3.87M, False: 732k]
  ------------------
  758|  3.87M|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  3.87M|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  3.87M|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 2, False: 3.87M]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      2|          return -1;
  764|      2|        }
  765|  3.87M|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|   732k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|   732k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 17.3k, False: 715k]
  ------------------
  770|  17.3k|        invalid_vertices.push_back(vertex_n);
  771|  17.3k|      }
  772|   732k|      active_corner_stack.back() = corner;
  773|  1.55M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 1.55M, False: 0]
  ------------------
  774|  1.55M|      const CornerIndex corner(3 * face.value());
  775|  1.55M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  1.55M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  1.55M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  1.55M|                                       corner_table_->AddNewVertex());
  780|  1.55M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  1.55M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  1.55M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 3, False: 1.55M]
  ------------------
  784|      3|        return -1;  // Unexpected number of decoded vertices.
  785|      3|      }
  786|       |
  787|  1.55M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  1.55M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  1.55M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  1.55M|      active_corner_stack.push_back(corner);
  792|  1.55M|      check_topology_split = true;
  793|  1.55M|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|      0|      return -1;
  796|      0|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  6.80M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  6.80M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 3.05M, False: 3.74M]
  ------------------
  801|       |      // Check for topology splits happens only for TOPOLOGY_L, TOPOLOGY_R and
  802|       |      // TOPOLOGY_E symbols because those are the symbols that correspond to
  803|       |      // faces that can be directly connected a TOPOLOGY_S face through the
  804|       |      // topology split event.
  805|       |      // If a topology split is detected, we need to add a new active edge
  806|       |      // onto the active_corner_stack because it will be used later when the
  807|       |      // corresponding TOPOLOGY_S event is decoded.
  808|       |
  809|       |      // Symbol id used by the encoder (reverse).
  810|  3.05M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  3.05M|      EdgeFaceName split_edge;
  812|  3.05M|      int encoder_split_symbol_id;
  813|  3.05M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.48k, False: 3.05M]
  ------------------
  814|  3.05M|                             &encoder_split_symbol_id)) {
  815|  1.48k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 20, False: 1.46k]
  ------------------
  816|     20|          return -1;  // Wrong split symbol id.
  817|     20|        }
  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.46k|        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.46k|        CornerIndex new_active_corner;
  831|  1.46k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 519, False: 950]
  ------------------
  832|    519|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    950|        } else {
  834|    950|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    950|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.46k|        const int decoder_split_symbol_id =
  839|  1.46k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.46k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.46k|            new_active_corner;
  842|  1.46k|      }
  843|  3.05M|    }
  844|  6.80M|  }
  845|  1.96k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 1.96k]
  ------------------
  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|  30.7k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 28.7k, False: 1.93k]
  ------------------
  850|  28.7k|    const CornerIndex corner = active_corner_stack.back();
  851|  28.7k|    active_corner_stack.pop_back();
  852|  28.7k|    const bool interior_face =
  853|  28.7k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  28.7k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 20.2k, False: 8.49k]
  ------------------
  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|  20.2k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 6, False: 20.2k]
  ------------------
  877|      6|        return -1;  // More faces than expected added to the mesh.
  878|      6|      }
  879|       |
  880|  20.2k|      const CornerIndex corner_a = corner;
  881|  20.2k|      const VertexIndex vert_n =
  882|  20.2k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  20.2k|      const CornerIndex corner_b =
  884|  20.2k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  20.2k|      const VertexIndex vert_x =
  887|  20.2k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  20.2k|      const CornerIndex corner_c =
  889|  20.2k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  20.2k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 15, False: 20.2k]
  |  Branch (891:33): [True: 9, False: 20.2k]
  |  Branch (891:55): [True: 0, False: 20.2k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     24|        return -1;
  894|     24|      }
  895|  20.2k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 1, False: 20.2k]
  |  Branch (895:11): [True: 1, False: 20.2k]
  ------------------
  896|  20.2k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 20.2k]
  ------------------
  897|  20.2k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 20.2k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      1|        return -1;
  901|      1|      }
  902|       |
  903|  20.2k|      const VertexIndex vert_p =
  904|  20.2k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  20.2k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  20.2k|      const CornerIndex new_corner(3 * face.value());
  909|  20.2k|      SetOppositeCorners(new_corner, corner);
  910|  20.2k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  20.2k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  20.2k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  20.2k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  20.2k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  81.0k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 60.8k, False: 20.2k]
  ------------------
  920|  60.8k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  60.8k|      }
  922|       |
  923|  20.2k|      init_face_configurations_.push_back(true);
  924|  20.2k|      init_corners_.push_back(new_corner);
  925|  20.2k|    } else {
  926|       |      // The initial face wasn't interior and the traversal had to start from
  927|       |      // an open boundary. In this case no new face is added, but we need to
  928|       |      // keep record about the first opposite corner to this boundary.
  929|  8.49k|      init_face_configurations_.push_back(false);
  930|  8.49k|      init_corners_.push_back(corner);
  931|  8.49k|    }
  932|  28.7k|  }
  933|  1.93k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 19, False: 1.91k]
  ------------------
  934|     19|    return -1;  // Unexpected number of decoded faces.
  935|     19|  }
  936|       |
  937|  1.91k|  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.91k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 893, False: 1.91k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|    893|    VertexIndex src_vert(num_vertices - 1);
  943|  1.04k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 149, False: 893]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    149|      src_vert = VertexIndex(--num_vertices - 1);
  946|    149|    }
  947|    893|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 148, False: 745]
  ------------------
  948|    148|      continue;  // No need to swap anything.
  949|    148|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|    745|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  4.93k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 4.19k, False: 742]
  ------------------
  954|  4.19k|      const CornerIndex cid = vcit.Corner();
  955|  4.19k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 3, False: 4.18k]
  ------------------
  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|  4.18k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  4.18k|    }
  962|    742|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|    742|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|    742|    corner_table_->MakeVertexIsolated(src_vert);
  967|    742|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|    742|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|    742|    num_vertices--;
  972|    742|  }
  973|  1.91k|  return num_vertices;
  974|  1.91k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.55k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.55k|  uint32_t num_topology_splits;
  982|  2.55k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.55k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.55k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 96, False: 2.45k]
  ------------------
  984|     96|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 1, False: 95]
  ------------------
  985|      1|      return -1;
  986|      1|    }
  987|       |
  988|     96|  } else
  989|  2.45k|#endif
  990|  2.45k|  {
  991|  2.45k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 6, False: 2.45k]
  ------------------
  992|      6|      return -1;
  993|      6|    }
  994|  2.45k|  }
  995|  2.54k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 1.44k, False: 1.10k]
  ------------------
  996|  1.44k|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 38, False: 1.40k]
  ------------------
  997|  1.44k|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     38|      return -1;
  999|     38|    }
 1000|  1.40k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|  1.40k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.40k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 43, False: 1.36k]
  ------------------
 1002|  85.4k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 85.4k, False: 15]
  ------------------
 1003|  85.4k|        TopologySplitEventData event_data;
 1004|  85.4k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 15, False: 85.4k]
  ------------------
 1005|     15|          return -1;
 1006|     15|        }
 1007|  85.4k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 11, False: 85.4k]
  ------------------
 1008|     11|          return -1;
 1009|     11|        }
 1010|  85.4k|        uint8_t edge_data;
 1011|  85.4k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 2, False: 85.4k]
  ------------------
 1012|      2|          return -1;
 1013|      2|        }
 1014|  85.4k|        event_data.source_edge = edge_data & 1;
 1015|  85.4k|        topology_split_data_.push_back(event_data);
 1016|  85.4k|      }
 1017|       |
 1018|     43|    } else
 1019|  1.36k|#endif
 1020|  1.36k|    {
 1021|       |      // Decode source and split symbol ids using delta and varint coding. See
 1022|       |      // description in mesh_edgebreaker_encoder_impl.cc for more details.
 1023|  1.36k|      int last_source_symbol_id = 0;
 1024|  6.68k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 5.36k, False: 1.31k]
  ------------------
 1025|  5.36k|        TopologySplitEventData event_data;
 1026|  5.36k|        uint32_t delta;
 1027|  5.36k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 12, False: 5.35k]
  ------------------
 1028|     12|          return -1;
 1029|     12|        }
 1030|  5.35k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  5.35k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 9, False: 5.34k]
  ------------------
 1032|      9|          return -1;
 1033|      9|        }
 1034|  5.34k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 26, False: 5.31k]
  ------------------
 1035|     26|          return -1;
 1036|     26|        }
 1037|  5.31k|        event_data.split_symbol_id =
 1038|  5.31k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  5.31k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  5.31k|        topology_split_data_.push_back(event_data);
 1041|  5.31k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|  1.31k|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  6.10k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 4.78k, False: 1.31k]
  ------------------
 1045|  4.78k|        uint32_t edge_data;
 1046|  4.78k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.78k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 1.30k, False: 3.48k]
  ------------------
 1047|  1.30k|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  3.48k|        } else {
 1049|  3.48k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  3.48k|        }
 1051|  4.78k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  4.78k|        event_data.source_edge = edge_data & 1;
 1053|  4.78k|      }
 1054|  1.31k|      decoder_buffer->EndBitDecoding();
 1055|  1.31k|    }
 1056|  1.40k|  }
 1057|  2.43k|  uint32_t num_hole_events = 0;
 1058|  2.43k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.43k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.43k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 64, False: 2.36k]
  ------------------
 1060|     64|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 8, False: 56]
  ------------------
 1061|      8|      return -1;
 1062|      8|    }
 1063|  2.36k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.36k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 352, False: 2.01k]
  ------------------
 1064|    352|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 8, False: 344]
  ------------------
 1065|      8|      return -1;
 1066|      8|    }
 1067|    352|  }
 1068|  2.41k|#endif
 1069|  2.41k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 84, False: 2.33k]
  ------------------
 1070|     84|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     84|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     84|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 32, False: 52]
  ------------------
 1072|   102k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 102k, False: 1]
  ------------------
 1073|   102k|        HoleEventData event_data;
 1074|   102k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 31, False: 101k]
  ------------------
 1075|     31|          return -1;
 1076|     31|        }
 1077|   101k|        hole_event_data_.push_back(event_data);
 1078|   101k|      }
 1079|       |
 1080|     32|    } else
 1081|     52|#endif
 1082|     52|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     52|      int last_symbol_id = 0;
 1085|  85.1k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 85.1k, False: 11]
  ------------------
 1086|  85.1k|        HoleEventData event_data;
 1087|  85.1k|        uint32_t delta;
 1088|  85.1k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 41, False: 85.1k]
  ------------------
 1089|     41|          return -1;
 1090|     41|        }
 1091|  85.1k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  85.1k|        last_symbol_id = event_data.symbol_id;
 1093|  85.1k|        hole_event_data_.push_back(event_data);
 1094|  85.1k|      }
 1095|     52|    }
 1096|     84|  }
 1097|  2.34k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.41k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  1.39k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  1.39k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  1.39k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  5.58k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 4.19k, False: 1.39k]
  ------------------
 1109|  4.19k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  4.19k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 1.18k, False: 3.00k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  2.37k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 1.18k, False: 1.18k]
  ------------------
 1114|  1.18k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|  1.18k|      }
 1116|  1.18k|      continue;
 1117|  1.18k|    }
 1118|       |
 1119|  6.00k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 3.00k, False: 3.00k]
  ------------------
 1120|  3.00k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  3.00k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 2.42k, False: 583]
  ------------------
 1122|  2.42k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  2.42k|      }
 1124|  3.00k|    }
 1125|  3.00k|  }
 1126|  1.39k|  return true;
 1127|  1.39k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   379k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   379k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   379k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   379k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.51M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 1.13M, False: 379k]
  ------------------
 1139|  1.13M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  1.13M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 78.9k, False: 1.06M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   567k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 488k, False: 78.9k]
  ------------------
 1144|   488k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   488k|      }
 1146|  78.9k|      continue;
 1147|  78.9k|    }
 1148|  1.06M|    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.06M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 530k, False: 530k]
  ------------------
 1151|   530k|      continue;
 1152|   530k|    }
 1153|       |
 1154|  4.81M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 4.28M, False: 530k]
  ------------------
 1155|  4.28M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  4.28M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 3.93M, False: 345k]
  ------------------
 1157|  3.93M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  3.93M|      }
 1159|  4.28M|    }
 1160|   530k|  }
 1161|   379k|  return true;
 1162|   379k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE21AssignPointsToCornersEi:
 1166|  1.91k|    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.91k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  1.91k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 77, False: 1.83k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  6.18k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 6.10k, False: 77]
  ------------------
 1176|  6.10k|      Mesh::Face face;
 1177|  6.10k|      const CornerIndex start_corner(3 * f.value());
 1178|  24.4k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 18.3k, False: 6.10k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  18.3k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  18.3k|        face[c] = vert_id;
 1182|  18.3k|      }
 1183|  6.10k|      decoder_->mesh()->SetFace(f, face);
 1184|  6.10k|    }
 1185|     77|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     77|    return true;
 1187|     77|  }
 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.83k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  1.83k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   261k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 259k, False: 1.82k]
  ------------------
 1197|   259k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   259k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 16.0k, False: 243k]
  ------------------
 1199|  16.0k|      continue;  // Isolated vertex.
 1200|  16.0k|    }
 1201|   243k|    CornerIndex deduplication_first_corner = c;
 1202|   243k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 80.0k, 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|  80.0k|      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|   174k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 171k, False: 3.30k]
  ------------------
 1210|   171k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 5.71k, False: 165k]
  ------------------
 1211|  5.71k|          continue;  // No seam for this attribute, ignore it.
 1212|  5.71k|        }
 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|   165k|        const VertexIndex vert_id =
 1217|   165k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|   165k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|   165k|        bool seam_found = false;
 1220|   175k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 169k, False: 5.66k]
  ------------------
 1221|   169k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 6, False: 169k]
  ------------------
 1222|      6|            return false;
 1223|      6|          }
 1224|   169k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 160k, False: 9.37k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|   160k|            deduplication_first_corner = act_c;
 1227|   160k|            seam_found = true;
 1228|   160k|            break;
 1229|   160k|          }
 1230|  9.37k|          act_c = corner_table_->SwingRight(act_c);
 1231|  9.37k|        }
 1232|   165k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 160k, False: 5.66k]
  ------------------
 1233|   160k|          break;  // No reason to process other attributes if we found a seam.
 1234|   160k|        }
 1235|   165k|      }
 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|   243k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   243k|    corner_to_point_map[c.value()] =
 1246|   243k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   243k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   243k|    CornerIndex prev_c = c;
 1250|   243k|    c = corner_table_->SwingRight(c);
 1251|  1.19M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 1.11M, False: 80.3k]
  |  Branch (1251:40): [True: 954k, False: 163k]
  ------------------
 1252|   954k|      bool attribute_seam = false;
 1253|  1.00M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 987k, False: 16.8k]
  ------------------
 1254|   987k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 938k, False: 49.8k]
  ------------------
 1255|   987k|            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|   938k|          attribute_seam = true;
 1259|   938k|          break;
 1260|   938k|        }
 1261|   987k|      }
 1262|   954k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 938k, False: 16.8k]
  ------------------
 1263|   938k|        corner_to_point_map[c.value()] =
 1264|   938k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   938k|        point_to_corner_map.push_back(c.value());
 1266|   938k|      } else {
 1267|  16.8k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  16.8k|      }
 1269|   954k|      prev_c = c;
 1270|   954k|      c = corner_table_->SwingRight(c);
 1271|   954k|    }
 1272|   243k|  }
 1273|       |  // Add faces.
 1274|   382k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 381k, False: 1.82k]
  ------------------
 1275|   381k|    Mesh::Face face;
 1276|  1.52M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 1.14M, False: 381k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  1.14M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  1.14M|    }
 1280|   381k|    decoder_->mesh()->SetFace(f, face);
 1281|   381k|  }
 1282|  1.82k|  decoder_->point_cloud()->set_num_points(
 1283|  1.82k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  1.82k|  return true;
 1285|  1.83k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEEC2Ev:
   48|  2.57k|    : decoder_(nullptr),
   49|  2.57k|      last_symbol_id_(-1),
   50|  2.57k|      last_vert_id_(-1),
   51|  2.57k|      last_face_id_(-1),
   52|  2.57k|      num_new_vertices_(0),
   53|  2.57k|      num_encoded_vertices_(0),
   54|  2.57k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.57k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.57k|  decoder_ = decoder;
   60|  2.57k|  return true;
   61|  2.57k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23GetAttributeCornerTableEi:
   66|  1.98k|    int att_id) const {
   67|  3.26k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 2.59k, False: 679]
  ------------------
   68|  2.59k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  2.59k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.28k, False: 1.30k]
  |  Branch (69:27): [True: 0, False: 1.30k]
  ------------------
   70|  1.28k|      continue;
   71|  1.28k|    }
   72|  1.30k|    const AttributesDecoderInterface *const dec =
   73|  1.30k|        decoder_->attributes_decoder(decoder_id);
   74|  2.57k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 2.57k, False: 0]
  ------------------
   75|  2.57k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 1.30k, False: 1.27k]
  ------------------
   76|  1.30k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 841, False: 460]
  ------------------
   77|    841|          return &attribute_data_[i].connectivity_data;
   78|    841|        }
   79|    460|        return nullptr;
   80|  1.30k|      }
   81|  2.57k|    }
   82|  1.30k|  }
   83|    679|  return nullptr;
   84|  1.98k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE24GetAttributeEncodingDataEi:
   89|  1.98k|    int att_id) const {
   90|  3.26k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 2.59k, False: 679]
  ------------------
   91|  2.59k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  2.59k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.28k, False: 1.30k]
  |  Branch (92:27): [True: 0, False: 1.30k]
  ------------------
   93|  1.28k|      continue;
   94|  1.28k|    }
   95|  1.30k|    const AttributesDecoderInterface *const dec =
   96|  1.30k|        decoder_->attributes_decoder(decoder_id);
   97|  2.57k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 2.57k, False: 0]
  ------------------
   98|  2.57k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 1.30k, False: 1.27k]
  ------------------
   99|  1.30k|        return &attribute_data_[i].encoding_data;
  100|  1.30k|      }
  101|  2.57k|    }
  102|  1.30k|  }
  103|    679|  return &pos_encoding_data_;
  104|  1.98k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23CreateAttributesDecoderEi:
  130|  1.69k|    int32_t att_decoder_id) {
  131|  1.69k|  int8_t att_data_id;
  132|  1.69k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 42, False: 1.65k]
  ------------------
  133|     42|    return false;
  134|     42|  }
  135|  1.65k|  uint8_t decoder_type;
  136|  1.65k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 21, False: 1.63k]
  ------------------
  137|     21|    return false;
  138|     21|  }
  139|       |
  140|  1.63k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 1.12k, False: 509]
  ------------------
  141|  1.12k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 32, False: 1.09k]
  ------------------
  142|     32|      return false;  // Unexpected attribute data.
  143|     32|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  1.09k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 5, False: 1.08k]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|       |
  151|  1.08k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  1.08k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    509|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 1, False: 508]
  ------------------
  155|      1|      return false;  // Some other decoder is already using the data. Error.
  156|      1|    }
  157|    508|    pos_data_decoder_id_ = att_decoder_id;
  158|    508|  }
  159|       |
  160|  1.59k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  1.59k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.59k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 1.59k, False: 0]
  ------------------
  162|  1.59k|    uint8_t traversal_method_encoded;
  163|  1.59k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 9, False: 1.58k]
  ------------------
  164|      9|      return false;
  165|      9|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  1.58k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 20, False: 1.56k]
  ------------------
  168|     20|      return false;
  169|     20|    }
  170|  1.56k|    traversal_method =
  171|  1.56k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  1.56k|  }
  173|       |
  174|  1.56k|  const Mesh *mesh = decoder_->mesh();
  175|  1.56k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  1.56k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 858, False: 710]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    858|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    858|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 486, False: 372]
  ------------------
  182|    486|      encoding_data = &pos_encoding_data_;
  183|    486|    } else {
  184|    372|      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|    372|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    372|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    858|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 212, False: 646]
  ------------------
  191|    212|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    212|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    212|          AttTraverser;
  194|    212|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    646|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 646, False: 0]
  ------------------
  196|    646|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    646|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    646|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    646|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    858|  } else {
  203|    710|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 5, False: 705]
  ------------------
  204|      5|      return false;  // Unsupported method.
  205|      5|    }
  206|    705|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 4, False: 701]
  ------------------
  207|      4|      return false;  // Attribute data must be specified.
  208|      4|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    701|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    701|        AttObserver;
  214|    701|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    701|        AttTraverser;
  216|       |
  217|    701|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|    701|        &attribute_data_[att_data_id].encoding_data;
  219|    701|    const MeshAttributeCornerTable *const corner_table =
  220|    701|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    701|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    701|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    701|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    701|                             encoding_data);
  227|       |
  228|    701|    AttTraverser att_traverser;
  229|    701|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    701|    traversal_sequencer->SetTraverser(att_traverser);
  232|    701|    sequencer = std::move(traversal_sequencer);
  233|    701|  }
  234|       |
  235|  1.55k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 1.55k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  1.55k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  1.55k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  1.55k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  1.55k|                                        std::move(att_controller));
  244|  1.55k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEv:
  247|  2.57k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.57k|  num_new_vertices_ = 0;
  249|  2.57k|  new_to_parent_vertex_map_.clear();
  250|  2.57k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.57k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.57k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 337, False: 2.23k]
  ------------------
  252|    337|    uint32_t num_new_verts;
  253|    337|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    337|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 227, False: 110]
  ------------------
  254|    227|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 7, False: 220]
  ------------------
  255|      7|        return false;
  256|      7|      }
  257|    227|    } else {
  258|    110|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 2, False: 108]
  ------------------
  259|      2|        return false;
  260|      2|      }
  261|    110|    }
  262|    328|    num_new_vertices_ = num_new_verts;
  263|    328|  }
  264|  2.56k|#endif
  265|       |
  266|  2.56k|  uint32_t num_encoded_vertices;
  267|  2.56k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.56k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.56k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 220, False: 2.34k]
  ------------------
  269|    220|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 3, False: 217]
  ------------------
  270|      3|      return false;
  271|      3|    }
  272|       |
  273|    220|  } else
  274|  2.34k|#endif
  275|  2.34k|  {
  276|  2.34k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 2, False: 2.34k]
  ------------------
  277|      2|      return false;
  278|      2|    }
  279|  2.34k|  }
  280|  2.56k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.56k|  uint32_t num_faces;
  283|  2.56k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.56k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.56k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 217, False: 2.34k]
  ------------------
  285|    217|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 3, False: 214]
  ------------------
  286|      3|      return false;
  287|      3|    }
  288|       |
  289|    217|  } else
  290|  2.34k|#endif
  291|  2.34k|  {
  292|  2.34k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 3, False: 2.34k]
  ------------------
  293|      3|      return false;
  294|      3|    }
  295|  2.34k|  }
  296|  2.55k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 6, False: 2.55k]
  ------------------
  297|      6|    return false;  // Draco cannot handle this many faces.
  298|      6|  }
  299|       |
  300|  2.55k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 24, False: 2.52k]
  ------------------
  301|     24|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     24|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.52k|  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.52k|  const uint64_t num_encoded_vertices_64 =
  311|  2.52k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.52k|  const uint64_t max_num_vertex_edges =
  313|  2.52k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.52k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 12, False: 2.51k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|     12|    return false;
  317|     12|  }
  318|       |
  319|  2.51k|  uint8_t num_attribute_data;
  320|  2.51k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 31, False: 2.48k]
  ------------------
  321|     31|    return false;
  322|     31|  }
  323|       |
  324|  2.48k|  uint32_t num_encoded_symbols;
  325|  2.48k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.48k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.48k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 194, False: 2.28k]
  ------------------
  327|    194|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 14, False: 180]
  ------------------
  328|     14|      return false;
  329|     14|    }
  330|       |
  331|    194|  } else
  332|  2.28k|#endif
  333|  2.28k|  {
  334|  2.28k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 3, False: 2.28k]
  ------------------
  335|      3|      return false;
  336|      3|    }
  337|  2.28k|  }
  338|       |
  339|  2.46k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 23, False: 2.44k]
  ------------------
  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|     23|    return false;
  344|     23|  }
  345|  2.44k|  const uint32_t max_encoded_faces =
  346|  2.44k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.44k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 43, False: 2.40k]
  ------------------
  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|     43|    return false;
  352|     43|  }
  353|       |
  354|  2.40k|  uint32_t num_encoded_split_symbols;
  355|  2.40k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.40k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.40k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 156, False: 2.24k]
  ------------------
  357|    156|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 3, False: 153]
  ------------------
  358|      3|      return false;
  359|      3|    }
  360|       |
  361|    156|  } else
  362|  2.24k|#endif
  363|  2.24k|  {
  364|  2.24k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 6, False: 2.23k]
  ------------------
  365|      6|      return false;
  366|      6|    }
  367|  2.24k|  }
  368|       |
  369|  2.39k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 28, False: 2.36k]
  ------------------
  370|     28|    return false;  // Split symbols are a sub-set of all symbols.
  371|     28|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.36k|  vertex_traversal_length_.clear();
  375|  2.36k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.36k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.36k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.36k|  processed_corner_ids_.clear();
  380|  2.36k|  processed_corner_ids_.reserve(num_faces);
  381|  2.36k|  processed_connectivity_corners_.clear();
  382|  2.36k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.36k|  topology_split_data_.clear();
  384|  2.36k|  hole_event_data_.clear();
  385|  2.36k|  init_face_configurations_.clear();
  386|  2.36k|  init_corners_.clear();
  387|       |
  388|  2.36k|  last_symbol_id_ = -1;
  389|  2.36k|  last_face_id_ = -1;
  390|  2.36k|  last_vert_id_ = -1;
  391|       |
  392|  2.36k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.36k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.36k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.36k]
  ------------------
  397|  2.36k|          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.36k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.36k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.36k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.36k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.36k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 252, False: 2.11k]
  ------------------
  411|    252|    uint32_t encoded_connectivity_size;
  412|    252|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    252|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 150, False: 102]
  ------------------
  413|    150|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 2, False: 148]
  ------------------
  414|      2|        return false;
  415|      2|      }
  416|    150|    } else {
  417|    102|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 2, False: 100]
  ------------------
  418|      2|        return false;
  419|      2|      }
  420|    102|    }
  421|    248|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 3, False: 245]
  ------------------
  422|    245|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 26, False: 219]
  ------------------
  423|     29|      return false;
  424|     29|    }
  425|    219|    DecoderBuffer event_buffer;
  426|    219|    event_buffer.Init(
  427|    219|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    219|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    219|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    219|    topology_split_decoded_bytes =
  432|    219|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    219|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 164, False: 55]
  ------------------
  434|    164|      return false;
  435|    164|    }
  436|       |
  437|    219|  } else
  438|  2.11k|#endif
  439|  2.11k|  {
  440|  2.11k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 87, False: 2.02k]
  ------------------
  441|     87|      return false;
  442|     87|    }
  443|  2.11k|  }
  444|       |
  445|  2.07k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.07k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.07k|                                           num_encoded_split_symbols);
  449|  2.07k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.07k|  DecoderBuffer traversal_end_buffer;
  452|  2.07k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 178, False: 1.90k]
  ------------------
  453|    178|    return false;
  454|    178|  }
  455|       |
  456|  1.90k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.90k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 148, False: 1.75k]
  ------------------
  458|    148|    return false;
  459|    148|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  1.75k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  1.75k|                           traversal_end_buffer.remaining_size(),
  464|  1.75k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  1.75k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  1.75k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.75k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 21, False: 1.73k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|     21|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|     21|  }
  471|  1.75k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  1.75k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 1.72k, False: 24]
  ------------------
  475|  1.72k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  1.72k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.72k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 21, False: 1.70k]
  ------------------
  477|  2.26k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 2.24k, False: 21]
  ------------------
  478|  2.24k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 2.24k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  2.24k|      }
  482|       |
  483|     21|    } else
  484|  1.70k|#endif
  485|  1.70k|    {
  486|  11.4M|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 11.4M, False: 1.70k]
  ------------------
  487|  11.4M|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 11.4M]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|  11.4M|      }
  491|  1.70k|    }
  492|  1.72k|  }
  493|  1.75k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  3.96k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 2.21k, False: 1.75k]
  ------------------
  498|  2.21k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  15.6M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 15.6M, False: 2.21k]
  ------------------
  501|  15.6M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  15.6M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  2.21k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 2.21k]
  ------------------
  505|  2.21k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  2.21k|  }
  509|       |
  510|  1.75k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  3.96k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 2.21k, False: 1.75k]
  ------------------
  512|       |    // For non-position attributes, preallocate the vertex to value mapping
  513|       |    // using the maximum number of vertices from the base corner table and the
  514|       |    // attribute corner table (since the attribute decoder may use either of
  515|       |    // it).
  516|  2.21k|    int32_t att_connectivity_verts =
  517|  2.21k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  2.21k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 183, False: 2.02k]
  ------------------
  519|    183|      att_connectivity_verts = corner_table_->num_vertices();
  520|    183|    }
  521|  2.21k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  2.21k|  }
  523|  1.75k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 16, False: 1.73k]
  ------------------
  524|     16|    return false;
  525|     16|  }
  526|  1.73k|  return true;
  527|  1.75k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE19OnAttributesDecodedEv:
  530|    600|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    600|  return true;
  532|    600|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEi:
  536|  1.90k|    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.90k|  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.90k|  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.90k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.90k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.90k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.90k|  int num_faces = 0;
  562|  59.0M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 59.0M, False: 1.81k]
  ------------------
  563|  59.0M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  59.0M|    bool check_topology_split = false;
  566|  59.0M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  59.0M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 29.3M, False: 29.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|  29.3M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 1, False: 29.3M]
  ------------------
  588|      1|        return -1;
  589|      1|      }
  590|       |
  591|  29.3M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  29.3M|      const VertexIndex vertex_x =
  593|  29.3M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  29.3M|      const CornerIndex corner_b =
  595|  29.3M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  29.3M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 31, False: 29.3M]
  ------------------
  598|       |        // All matched corners must be different.
  599|     31|        return -1;
  600|     31|      }
  601|  29.3M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 29.3M]
  |  Branch (601:11): [True: 0, False: 29.3M]
  ------------------
  602|  29.3M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 29.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|  29.3M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  29.3M|      SetOppositeCorners(corner_a, corner + 1);
  612|  29.3M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  29.3M|      const VertexIndex vert_a_prev =
  616|  29.3M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  29.3M|      const VertexIndex vert_b_next =
  618|  29.3M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  29.3M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 29.3M]
  |  Branch (619:38): [True: 0, False: 29.3M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  29.3M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  29.3M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  29.3M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  29.3M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  29.3M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  29.3M|      active_corner_stack.back() = corner;
  631|  29.6M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 29.6M, False: 30.6k]
  |  Branch (631:40): [True: 6.14k, False: 24.5k]
  ------------------
  632|       |      // Create a new face extending from the open boundary edge opposite to the
  633|       |      // corner "a" from the image below. Two new boundary edges are created
  634|       |      // opposite to corners "r" and "l". New active corner is set to either "r"
  635|       |      // or "l" depending on the decoded symbol. One new vertex is created
  636|       |      // at the opposite corner to corner "a".
  637|       |      //     *-------*
  638|       |      //    /a\     / \
  639|       |      //   /   \   /   \
  640|       |      //  /     \ /     \
  641|       |      // *-------v-------*
  642|       |      //  .l   r.
  643|       |      //   .   .
  644|       |      //    . .
  645|       |      //     *
  646|  29.6M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 29.6M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  29.6M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  29.6M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 29.6M]
  ------------------
  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.6M|      const CornerIndex corner(3 * face.value());
  658|  29.6M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  29.6M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 29.6M, False: 6.14k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  29.6M|        opp_corner = corner + 2;
  662|  29.6M|        corner_l = corner + 1;
  663|  29.6M|        corner_r = corner;
  664|  29.6M|      } else {
  665|       |        // "l" is the new first corner.
  666|  6.14k|        opp_corner = corner + 1;
  667|  6.14k|        corner_l = corner;
  668|  6.14k|        corner_r = corner + 2;
  669|  6.14k|      }
  670|  29.6M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  29.6M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  29.6M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 10, False: 29.6M]
  ------------------
  675|     10|        return -1;  // Unexpected number of decoded vertices.
  676|     10|      }
  677|       |
  678|  29.6M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  29.6M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  29.6M|      const VertexIndex vertex_r =
  682|  29.6M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  29.6M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  29.6M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  29.6M|      corner_table_->MapCornerToVertex(
  688|  29.6M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  29.6M|      active_corner_stack.back() = corner;
  690|  29.6M|      check_topology_split = true;
  691|  29.6M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 8.02k, False: 16.4k]
  ------------------
  692|       |      // Create a new face that merges two last active edges from the active
  693|       |      // stack. No new vertex is created, but two vertices at corners "p" and
  694|       |      // "n" need to be merged into a single vertex.
  695|       |      //
  696|       |      // *-------v-------*
  697|       |      //  \a   p/x\n   b/
  698|       |      //   \   /   \   /
  699|       |      //    \ /  S  \ /
  700|       |      //     *.......*
  701|       |      //
  702|  8.02k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 1, False: 8.02k]
  ------------------
  703|      1|        return -1;
  704|      1|      }
  705|  8.02k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  8.02k|      active_corner_stack.pop_back();
  707|       |
  708|       |      // Corner "a" can correspond either to a normal active edge, or to an edge
  709|       |      // created from the topology split event.
  710|  8.02k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  8.02k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 25, False: 8.00k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     25|        active_corner_stack.push_back(it->second);
  714|     25|      }
  715|  8.02k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 7, False: 8.02k]
  ------------------
  716|      7|        return -1;
  717|      7|      }
  718|  8.02k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  8.02k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 8.02k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  8.02k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 6, False: 8.01k]
  |  Branch (724:11): [True: 6, False: 8.01k]
  ------------------
  725|  8.01k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 8.01k]
  ------------------
  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|  8.01k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  8.01k|      SetOppositeCorners(corner_a, corner + 2);
  735|  8.01k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  8.01k|      const VertexIndex vertex_p =
  739|  8.01k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  8.01k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  8.01k|      corner_table_->MapCornerToVertex(
  742|  8.01k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  8.01k|      const VertexIndex vert_b_prev =
  744|  8.01k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  8.01k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  8.01k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  8.01k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  8.01k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  8.01k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  8.01k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  8.01k|                                       corner_table_->LeftMostCorner(vertex_n));
  753|       |
  754|       |      // Also update the vertex id at corner "n" and all corners that are
  755|       |      // connected to it in the CCW direction.
  756|  8.01k|      const CornerIndex first_corner = corner_n;
  757|  33.7k|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 25.7k, False: 8.01k]
  ------------------
  758|  25.7k|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  25.7k|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  25.7k|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 1, False: 25.7k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      1|          return -1;
  764|      1|        }
  765|  25.7k|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  8.01k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  8.01k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 3.05k, False: 4.96k]
  ------------------
  770|  3.05k|        invalid_vertices.push_back(vertex_n);
  771|  3.05k|      }
  772|  8.01k|      active_corner_stack.back() = corner;
  773|  16.4k|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 16.4k, False: 0]
  ------------------
  774|  16.4k|      const CornerIndex corner(3 * face.value());
  775|  16.4k|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  16.4k|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  16.4k|      corner_table_->MapCornerToVertex(corner + 1,
  779|  16.4k|                                       corner_table_->AddNewVertex());
  780|  16.4k|      corner_table_->MapCornerToVertex(corner + 2,
  781|  16.4k|                                       corner_table_->AddNewVertex());
  782|       |
  783|  16.4k|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 3, False: 16.4k]
  ------------------
  784|      3|        return -1;  // Unexpected number of decoded vertices.
  785|      3|      }
  786|       |
  787|  16.4k|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  16.4k|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  16.4k|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  16.4k|      active_corner_stack.push_back(corner);
  792|  16.4k|      check_topology_split = true;
  793|  16.4k|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|      0|      return -1;
  796|      0|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  59.0M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  59.0M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 29.6M, False: 29.4M]
  ------------------
  801|       |      // Check for topology splits happens only for TOPOLOGY_L, TOPOLOGY_R and
  802|       |      // TOPOLOGY_E symbols because those are the symbols that correspond to
  803|       |      // faces that can be directly connected a TOPOLOGY_S face through the
  804|       |      // topology split event.
  805|       |      // If a topology split is detected, we need to add a new active edge
  806|       |      // onto the active_corner_stack because it will be used later when the
  807|       |      // corresponding TOPOLOGY_S event is decoded.
  808|       |
  809|       |      // Symbol id used by the encoder (reverse).
  810|  29.6M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  29.6M|      EdgeFaceName split_edge;
  812|  29.6M|      int encoder_split_symbol_id;
  813|  29.6M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.40k, False: 29.6M]
  ------------------
  814|  29.6M|                             &encoder_split_symbol_id)) {
  815|  1.40k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 23, False: 1.38k]
  ------------------
  816|     23|          return -1;  // Wrong split symbol id.
  817|     23|        }
  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.38k|        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.38k|        CornerIndex new_active_corner;
  831|  1.38k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 464, False: 917]
  ------------------
  832|    464|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    917|        } else {
  834|    917|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    917|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.38k|        const int decoder_split_symbol_id =
  839|  1.38k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.38k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.38k|            new_active_corner;
  842|  1.38k|      }
  843|  29.6M|    }
  844|  59.0M|  }
  845|  1.81k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 1.81k]
  ------------------
  846|      0|    return -1;  // Unexpected number of decoded vertices.
  847|      0|  }
  848|       |  // Decode start faces and connect them to the faces from the active stack.
  849|  7.72k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 5.92k, False: 1.80k]
  ------------------
  850|  5.92k|    const CornerIndex corner = active_corner_stack.back();
  851|  5.92k|    active_corner_stack.pop_back();
  852|  5.92k|    const bool interior_face =
  853|  5.92k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  5.92k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 3.39k, False: 2.52k]
  ------------------
  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.39k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 5, False: 3.39k]
  ------------------
  877|      5|        return -1;  // More faces than expected added to the mesh.
  878|      5|      }
  879|       |
  880|  3.39k|      const CornerIndex corner_a = corner;
  881|  3.39k|      const VertexIndex vert_n =
  882|  3.39k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  3.39k|      const CornerIndex corner_b =
  884|  3.39k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  3.39k|      const VertexIndex vert_x =
  887|  3.39k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  3.39k|      const CornerIndex corner_c =
  889|  3.39k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  3.39k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 2, False: 3.39k]
  |  Branch (891:33): [True: 8, False: 3.38k]
  |  Branch (891:55): [True: 0, False: 3.38k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     10|        return -1;
  894|     10|      }
  895|  3.38k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 1, False: 3.38k]
  |  Branch (895:11): [True: 1, False: 3.38k]
  ------------------
  896|  3.38k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 3.38k]
  ------------------
  897|  3.38k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 3.38k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      1|        return -1;
  901|      1|      }
  902|       |
  903|  3.38k|      const VertexIndex vert_p =
  904|  3.38k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  3.38k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  3.38k|      const CornerIndex new_corner(3 * face.value());
  909|  3.38k|      SetOppositeCorners(new_corner, corner);
  910|  3.38k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  3.38k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  3.38k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  3.38k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  3.38k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  13.5k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 10.1k, False: 3.38k]
  ------------------
  920|  10.1k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  10.1k|      }
  922|       |
  923|  3.38k|      init_face_configurations_.push_back(true);
  924|  3.38k|      init_corners_.push_back(new_corner);
  925|  3.38k|    } 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.52k|      init_face_configurations_.push_back(false);
  930|  2.52k|      init_corners_.push_back(corner);
  931|  2.52k|    }
  932|  5.92k|  }
  933|  1.80k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 44, False: 1.75k]
  ------------------
  934|     44|    return -1;  // Unexpected number of decoded faces.
  935|     44|  }
  936|       |
  937|  1.75k|  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.75k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 201, False: 1.75k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|    201|    VertexIndex src_vert(num_vertices - 1);
  943|    238|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 37, False: 201]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|     37|      src_vert = VertexIndex(--num_vertices - 1);
  946|     37|    }
  947|    201|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 37, False: 164]
  ------------------
  948|     37|      continue;  // No need to swap anything.
  949|     37|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|    164|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|    833|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 673, False: 160]
  ------------------
  954|    673|      const CornerIndex cid = vcit.Corner();
  955|    673|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 4, False: 669]
  ------------------
  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|    669|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|    669|    }
  962|    160|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|    160|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|    160|    corner_table_->MakeVertexIsolated(src_vert);
  967|    160|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|    160|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|    160|    num_vertices--;
  972|    160|  }
  973|  1.75k|  return num_vertices;
  974|  1.75k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.33k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.33k|  uint32_t num_topology_splits;
  982|  2.33k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.33k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.33k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 125, False: 2.20k]
  ------------------
  984|    125|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 2, False: 123]
  ------------------
  985|      2|      return -1;
  986|      2|    }
  987|       |
  988|    125|  } else
  989|  2.20k|#endif
  990|  2.20k|  {
  991|  2.20k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 13, False: 2.19k]
  ------------------
  992|     13|      return -1;
  993|     13|    }
  994|  2.20k|  }
  995|  2.31k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 806, False: 1.50k]
  ------------------
  996|    806|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 57, False: 749]
  ------------------
  997|    806|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     57|      return -1;
  999|     57|    }
 1000|    749|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    749|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    749|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 73, False: 676]
  ------------------
 1002|   158k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 158k, False: 33]
  ------------------
 1003|   158k|        TopologySplitEventData event_data;
 1004|   158k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 25, False: 158k]
  ------------------
 1005|     25|          return -1;
 1006|     25|        }
 1007|   158k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 12, False: 158k]
  ------------------
 1008|     12|          return -1;
 1009|     12|        }
 1010|   158k|        uint8_t edge_data;
 1011|   158k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 3, False: 158k]
  ------------------
 1012|      3|          return -1;
 1013|      3|        }
 1014|   158k|        event_data.source_edge = edge_data & 1;
 1015|   158k|        topology_split_data_.push_back(event_data);
 1016|   158k|      }
 1017|       |
 1018|     73|    } else
 1019|    676|#endif
 1020|    676|    {
 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|    676|      int last_source_symbol_id = 0;
 1024|  4.34k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 3.70k, False: 635]
  ------------------
 1025|  3.70k|        TopologySplitEventData event_data;
 1026|  3.70k|        uint32_t delta;
 1027|  3.70k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 15, False: 3.69k]
  ------------------
 1028|     15|          return -1;
 1029|     15|        }
 1030|  3.69k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  3.69k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 10, False: 3.68k]
  ------------------
 1032|     10|          return -1;
 1033|     10|        }
 1034|  3.68k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 16, False: 3.66k]
  ------------------
 1035|     16|          return -1;
 1036|     16|        }
 1037|  3.66k|        event_data.split_symbol_id =
 1038|  3.66k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  3.66k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  3.66k|        topology_split_data_.push_back(event_data);
 1041|  3.66k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    635|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  3.73k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 3.09k, False: 635]
  ------------------
 1045|  3.09k|        uint32_t edge_data;
 1046|  3.09k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.09k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 660, False: 2.43k]
  ------------------
 1047|    660|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  2.43k|        } else {
 1049|  2.43k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  2.43k|        }
 1051|  3.09k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  3.09k|        event_data.source_edge = edge_data & 1;
 1053|  3.09k|      }
 1054|    635|      decoder_buffer->EndBitDecoding();
 1055|    635|    }
 1056|    749|  }
 1057|  2.17k|  uint32_t num_hole_events = 0;
 1058|  2.17k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.17k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.17k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 69, False: 2.10k]
  ------------------
 1060|     69|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 3, False: 66]
  ------------------
 1061|      3|      return -1;
 1062|      3|    }
 1063|  2.10k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.10k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 77, False: 2.03k]
  ------------------
 1064|     77|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 9, False: 68]
  ------------------
 1065|      9|      return -1;
 1066|      9|    }
 1067|     77|  }
 1068|  2.16k|#endif
 1069|  2.16k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 93, False: 2.07k]
  ------------------
 1070|     93|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     93|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     93|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 59, False: 34]
  ------------------
 1072|   182k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 182k, False: 1]
  ------------------
 1073|   182k|        HoleEventData event_data;
 1074|   182k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 58, False: 182k]
  ------------------
 1075|     58|          return -1;
 1076|     58|        }
 1077|   182k|        hole_event_data_.push_back(event_data);
 1078|   182k|      }
 1079|       |
 1080|     59|    } else
 1081|     34|#endif
 1082|     34|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     34|      int last_symbol_id = 0;
 1085|  2.08k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 2.07k, False: 6]
  ------------------
 1086|  2.07k|        HoleEventData event_data;
 1087|  2.07k|        uint32_t delta;
 1088|  2.07k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 28, False: 2.04k]
  ------------------
 1089|     28|          return -1;
 1090|     28|        }
 1091|  2.04k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  2.04k|        last_symbol_id = event_data.symbol_id;
 1093|  2.04k|        hole_event_data_.push_back(event_data);
 1094|  2.04k|      }
 1095|     34|    }
 1096|     93|  }
 1097|  2.07k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.16k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  2.24k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  2.24k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  2.24k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  8.98k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 6.74k, False: 2.24k]
  ------------------
 1109|  6.74k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  6.74k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 865, False: 5.87k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  1.73k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 865, False: 865]
  ------------------
 1114|    865|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|    865|      }
 1116|    865|      continue;
 1117|    865|    }
 1118|       |
 1119|  11.7k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 5.87k, False: 5.87k]
  ------------------
 1120|  5.87k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  5.87k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 5.73k, False: 139]
  ------------------
 1122|  5.73k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  5.73k|      }
 1124|  5.87k|    }
 1125|  5.87k|  }
 1126|  2.24k|  return true;
 1127|  2.24k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|  11.4M|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|  11.4M|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|  11.4M|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|  11.4M|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  45.8M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 34.3M, False: 11.4M]
  ------------------
 1139|  34.3M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  34.3M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 150k, False: 34.2M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   306k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 156k, False: 150k]
  ------------------
 1144|   156k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   156k|      }
 1146|   150k|      continue;
 1147|   150k|    }
 1148|  34.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|  34.2M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 17.1M, False: 17.1M]
  ------------------
 1151|  17.1M|      continue;
 1152|  17.1M|    }
 1153|       |
 1154|  34.6M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 17.5M, False: 17.1M]
  ------------------
 1155|  17.5M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  17.5M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 15.4M, False: 2.05M]
  ------------------
 1157|  15.4M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  15.4M|      }
 1159|  17.5M|    }
 1160|  17.1M|  }
 1161|  11.4M|  return true;
 1162|  11.4M|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE21AssignPointsToCornersEi:
 1166|  1.75k|    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.75k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  1.75k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 24, False: 1.72k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  2.26k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 2.24k, False: 24]
  ------------------
 1176|  2.24k|      Mesh::Face face;
 1177|  2.24k|      const CornerIndex start_corner(3 * f.value());
 1178|  8.96k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 6.72k, False: 2.24k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  6.72k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  6.72k|        face[c] = vert_id;
 1182|  6.72k|      }
 1183|  2.24k|      decoder_->mesh()->SetFace(f, face);
 1184|  2.24k|    }
 1185|     24|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     24|    return true;
 1187|     24|  }
 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.72k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  1.72k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|  5.80M|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 5.80M, False: 1.71k]
  ------------------
 1197|  5.80M|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|  5.80M|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 3.17k, False: 5.79M]
  ------------------
 1199|  3.17k|      continue;  // Isolated vertex.
 1200|  3.17k|    }
 1201|  5.79M|    CornerIndex deduplication_first_corner = c;
 1202|  5.79M|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 150k, False: 5.64M]
  ------------------
 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|   150k|      deduplication_first_corner = c;
 1206|  5.64M|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  6.27M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 5.65M, False: 619k]
  ------------------
 1210|  5.65M|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 605k, False: 5.04M]
  ------------------
 1211|   605k|          continue;  // No seam for this attribute, ignore it.
 1212|   605k|        }
 1213|       |        // Else there needs to be at least one seam edge.
 1214|       |
 1215|       |        // At this point, we use identity mapping between corners and point ids.
 1216|  5.04M|        const VertexIndex vert_id =
 1217|  5.04M|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  5.04M|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  5.04M|        bool seam_found = false;
 1220|  5.21M|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 5.19M, False: 16.4k]
  ------------------
 1221|  5.19M|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 16, False: 5.19M]
  ------------------
 1222|     16|            return false;
 1223|     16|          }
 1224|  5.19M|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 5.02M, False: 166k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  5.02M|            deduplication_first_corner = act_c;
 1227|  5.02M|            seam_found = true;
 1228|  5.02M|            break;
 1229|  5.02M|          }
 1230|   166k|          act_c = corner_table_->SwingRight(act_c);
 1231|   166k|        }
 1232|  5.04M|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 5.02M, False: 16.4k]
  ------------------
 1233|  5.02M|          break;  // No reason to process other attributes if we found a seam.
 1234|  5.02M|        }
 1235|  5.04M|      }
 1236|  5.64M|    }
 1237|       |
 1238|       |    // Do a deduplication pass over the corners on the processed vertex.
 1239|       |    // At this point each corner corresponds to one point id and our goal is to
 1240|       |    // merge similar points into a single point id.
 1241|       |    // We do a single pass in a clockwise direction over the corners and we add
 1242|       |    // a new point id whenever one of the attributes change.
 1243|  5.79M|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|  5.79M|    corner_to_point_map[c.value()] =
 1246|  5.79M|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|  5.79M|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|  5.79M|    CornerIndex prev_c = c;
 1250|  5.79M|    c = corner_table_->SwingRight(c);
 1251|  34.3M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 34.1M, False: 152k]
  |  Branch (1251:40): [True: 28.5M, False: 5.64M]
  ------------------
 1252|  28.5M|      bool attribute_seam = false;
 1253|  31.7M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 28.5M, False: 3.23M]
  ------------------
 1254|  28.5M|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 25.2M, False: 3.24M]
  ------------------
 1255|  28.5M|            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|  25.2M|          attribute_seam = true;
 1259|  25.2M|          break;
 1260|  25.2M|        }
 1261|  28.5M|      }
 1262|  28.5M|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 25.2M, False: 3.23M]
  ------------------
 1263|  25.2M|        corner_to_point_map[c.value()] =
 1264|  25.2M|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  25.2M|        point_to_corner_map.push_back(c.value());
 1266|  25.2M|      } else {
 1267|  3.23M|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  3.23M|      }
 1269|  28.5M|      prev_c = c;
 1270|  28.5M|      c = corner_table_->SwingRight(c);
 1271|  28.5M|    }
 1272|  5.79M|  }
 1273|       |  // Add faces.
 1274|  11.3M|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 11.3M, False: 1.71k]
  ------------------
 1275|  11.3M|    Mesh::Face face;
 1276|  45.3M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 34.0M, False: 11.3M]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  34.0M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  34.0M|    }
 1280|  11.3M|    decoder_->mesh()->SetFace(f, face);
 1281|  11.3M|  }
 1282|  1.71k|  decoder_->point_cloud()->set_num_points(
 1283|  1.71k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  1.71k|  return true;
 1285|  1.72k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEEC2Ev:
   48|  2.64k|    : decoder_(nullptr),
   49|  2.64k|      last_symbol_id_(-1),
   50|  2.64k|      last_vert_id_(-1),
   51|  2.64k|      last_face_id_(-1),
   52|  2.64k|      num_new_vertices_(0),
   53|  2.64k|      num_encoded_vertices_(0),
   54|  2.64k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.64k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.64k|  decoder_ = decoder;
   60|  2.64k|  return true;
   61|  2.64k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23GetAttributeCornerTableEi:
   66|    123|    int att_id) const {
   67|    205|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 157, False: 48]
  ------------------
   68|    157|    const int decoder_id = attribute_data_[i].decoder_id;
   69|    157|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 82, False: 75]
  |  Branch (69:27): [True: 0, False: 75]
  ------------------
   70|     82|      continue;
   71|     82|    }
   72|     75|    const AttributesDecoderInterface *const dec =
   73|     75|        decoder_->attributes_decoder(decoder_id);
   74|    642|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 642, False: 0]
  ------------------
   75|    642|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 75, False: 567]
  ------------------
   76|     75|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 51, False: 24]
  ------------------
   77|     51|          return &attribute_data_[i].connectivity_data;
   78|     51|        }
   79|     24|        return nullptr;
   80|     75|      }
   81|    642|    }
   82|     75|  }
   83|     48|  return nullptr;
   84|    123|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE24GetAttributeEncodingDataEi:
   89|    123|    int att_id) const {
   90|    205|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 157, False: 48]
  ------------------
   91|    157|    const int decoder_id = attribute_data_[i].decoder_id;
   92|    157|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 82, False: 75]
  |  Branch (92:27): [True: 0, False: 75]
  ------------------
   93|     82|      continue;
   94|     82|    }
   95|     75|    const AttributesDecoderInterface *const dec =
   96|     75|        decoder_->attributes_decoder(decoder_id);
   97|    642|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 642, False: 0]
  ------------------
   98|    642|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 75, False: 567]
  ------------------
   99|     75|        return &attribute_data_[i].encoding_data;
  100|     75|      }
  101|    642|    }
  102|     75|  }
  103|     48|  return &pos_encoding_data_;
  104|    123|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23CreateAttributesDecoderEi:
  130|    167|    int32_t att_decoder_id) {
  131|    167|  int8_t att_data_id;
  132|    167|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 6, False: 161]
  ------------------
  133|      6|    return false;
  134|      6|  }
  135|    161|  uint8_t decoder_type;
  136|    161|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 7, False: 154]
  ------------------
  137|      7|    return false;
  138|      7|  }
  139|       |
  140|    154|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 101, False: 53]
  ------------------
  141|    101|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 22, False: 79]
  ------------------
  142|     22|      return false;  // Unexpected attribute data.
  143|     22|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|     79|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 3, False: 76]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|       |
  151|     76|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|     76|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|     53|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 2, False: 51]
  ------------------
  155|      2|      return false;  // Some other decoder is already using the data. Error.
  156|      2|    }
  157|     51|    pos_data_decoder_id_ = att_decoder_id;
  158|     51|  }
  159|       |
  160|    127|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|    127|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    127|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 127, False: 0]
  ------------------
  162|    127|    uint8_t traversal_method_encoded;
  163|    127|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 4, False: 123]
  ------------------
  164|      4|      return false;
  165|      4|    }
  166|       |    // Check that decoded traversal method is valid.
  167|    123|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 15, False: 108]
  ------------------
  168|     15|      return false;
  169|     15|    }
  170|    108|    traversal_method =
  171|    108|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|    108|  }
  173|       |
  174|    108|  const Mesh *mesh = decoder_->mesh();
  175|    108|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|    108|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 54, False: 54]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|     54|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|     54|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 31, False: 23]
  ------------------
  182|     31|      encoding_data = &pos_encoding_data_;
  183|     31|    } else {
  184|     23|      encoding_data = &attribute_data_[att_data_id].encoding_data;
  185|       |      // Mark the attribute connectivity data invalid to ensure it's not used
  186|       |      // later on.
  187|     23|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|     23|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|     54|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 37, False: 17]
  ------------------
  191|     37|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|     37|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|     37|          AttTraverser;
  194|     37|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|     37|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 17, False: 0]
  ------------------
  196|     17|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|     17|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|     17|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|     17|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|     54|  } else {
  203|     54|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 4, False: 50]
  ------------------
  204|      4|      return false;  // Unsupported method.
  205|      4|    }
  206|     50|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 3, False: 47]
  ------------------
  207|      3|      return false;  // Attribute data must be specified.
  208|      3|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|     47|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|     47|        AttObserver;
  214|     47|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|     47|        AttTraverser;
  216|       |
  217|     47|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|     47|        &attribute_data_[att_data_id].encoding_data;
  219|     47|    const MeshAttributeCornerTable *const corner_table =
  220|     47|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|     47|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|     47|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|     47|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|     47|                             encoding_data);
  227|       |
  228|     47|    AttTraverser att_traverser;
  229|     47|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|     47|    traversal_sequencer->SetTraverser(att_traverser);
  232|     47|    sequencer = std::move(traversal_sequencer);
  233|     47|  }
  234|       |
  235|    101|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 101]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|    101|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|    101|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|    101|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|    101|                                        std::move(att_controller));
  244|    101|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEv:
  247|  2.64k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.64k|  num_new_vertices_ = 0;
  249|  2.64k|  new_to_parent_vertex_map_.clear();
  250|  2.64k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.64k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.64k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 420, False: 2.22k]
  ------------------
  252|    420|    uint32_t num_new_verts;
  253|    420|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    420|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 217, False: 203]
  ------------------
  254|    217|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 7, False: 210]
  ------------------
  255|      7|        return false;
  256|      7|      }
  257|    217|    } else {
  258|    203|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 1, False: 202]
  ------------------
  259|      1|        return false;
  260|      1|      }
  261|    203|    }
  262|    412|    num_new_vertices_ = num_new_verts;
  263|    412|  }
  264|  2.63k|#endif
  265|       |
  266|  2.63k|  uint32_t num_encoded_vertices;
  267|  2.63k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.63k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.63k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 210, False: 2.42k]
  ------------------
  269|    210|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 2, False: 208]
  ------------------
  270|      2|      return false;
  271|      2|    }
  272|       |
  273|    210|  } else
  274|  2.42k|#endif
  275|  2.42k|  {
  276|  2.42k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 5, False: 2.42k]
  ------------------
  277|      5|      return false;
  278|      5|    }
  279|  2.42k|  }
  280|  2.62k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.62k|  uint32_t num_faces;
  283|  2.62k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.62k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.62k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 208, False: 2.42k]
  ------------------
  285|    208|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 1, False: 207]
  ------------------
  286|      1|      return false;
  287|      1|    }
  288|       |
  289|    208|  } else
  290|  2.42k|#endif
  291|  2.42k|  {
  292|  2.42k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 3, False: 2.41k]
  ------------------
  293|      3|      return false;
  294|      3|    }
  295|  2.42k|  }
  296|  2.62k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 2, False: 2.62k]
  ------------------
  297|      2|    return false;  // Draco cannot handle this many faces.
  298|      2|  }
  299|       |
  300|  2.62k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 25, False: 2.59k]
  ------------------
  301|     25|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|     25|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.59k|  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.59k|  const uint64_t num_encoded_vertices_64 =
  311|  2.59k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.59k|  const uint64_t max_num_vertex_edges =
  313|  2.59k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.59k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 12, False: 2.58k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|     12|    return false;
  317|     12|  }
  318|       |
  319|  2.58k|  uint8_t num_attribute_data;
  320|  2.58k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 24, False: 2.56k]
  ------------------
  321|     24|    return false;
  322|     24|  }
  323|       |
  324|  2.56k|  uint32_t num_encoded_symbols;
  325|  2.56k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.56k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.56k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 199, False: 2.36k]
  ------------------
  327|    199|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 9, False: 190]
  ------------------
  328|      9|      return false;
  329|      9|    }
  330|       |
  331|    199|  } else
  332|  2.36k|#endif
  333|  2.36k|  {
  334|  2.36k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 6, False: 2.35k]
  ------------------
  335|      6|      return false;
  336|      6|    }
  337|  2.36k|  }
  338|       |
  339|  2.54k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 15, False: 2.53k]
  ------------------
  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.53k|  const uint32_t max_encoded_faces =
  346|  2.53k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.53k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 44, False: 2.48k]
  ------------------
  348|       |    // Faces can only be 1 1/3 times bigger than number of encoded symbols. This
  349|       |    // could only happen if all new encoded components started with interior
  350|       |    // triangles. E.g. A mesh with multiple tetrahedrons.
  351|     44|    return false;
  352|     44|  }
  353|       |
  354|  2.48k|  uint32_t num_encoded_split_symbols;
  355|  2.48k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.48k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.48k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 171, False: 2.31k]
  ------------------
  357|    171|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 2, False: 169]
  ------------------
  358|      2|      return false;
  359|      2|    }
  360|       |
  361|    171|  } else
  362|  2.31k|#endif
  363|  2.31k|  {
  364|  2.31k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 5, False: 2.31k]
  ------------------
  365|      5|      return false;
  366|      5|    }
  367|  2.31k|  }
  368|       |
  369|  2.48k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 20, False: 2.46k]
  ------------------
  370|     20|    return false;  // Split symbols are a sub-set of all symbols.
  371|     20|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.46k|  vertex_traversal_length_.clear();
  375|  2.46k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.46k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.46k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.46k|  processed_corner_ids_.clear();
  380|  2.46k|  processed_corner_ids_.reserve(num_faces);
  381|  2.46k|  processed_connectivity_corners_.clear();
  382|  2.46k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.46k|  topology_split_data_.clear();
  384|  2.46k|  hole_event_data_.clear();
  385|  2.46k|  init_face_configurations_.clear();
  386|  2.46k|  init_corners_.clear();
  387|       |
  388|  2.46k|  last_symbol_id_ = -1;
  389|  2.46k|  last_face_id_ = -1;
  390|  2.46k|  last_vert_id_ = -1;
  391|       |
  392|  2.46k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.46k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.46k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.46k]
  ------------------
  397|  2.46k|          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.46k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.46k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.46k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.46k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.46k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 356, False: 2.10k]
  ------------------
  411|    356|    uint32_t encoded_connectivity_size;
  412|    356|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    356|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 168, False: 188]
  ------------------
  413|    168|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 4, False: 164]
  ------------------
  414|      4|        return false;
  415|      4|      }
  416|    188|    } else {
  417|    188|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 1, False: 187]
  ------------------
  418|      1|        return false;
  419|      1|      }
  420|    188|    }
  421|    351|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 1, False: 350]
  ------------------
  422|    350|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 20, False: 330]
  ------------------
  423|     21|      return false;
  424|     21|    }
  425|    330|    DecoderBuffer event_buffer;
  426|    330|    event_buffer.Init(
  427|    330|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    330|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    330|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    330|    topology_split_decoded_bytes =
  432|    330|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    330|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 113, False: 217]
  ------------------
  434|    113|      return false;
  435|    113|    }
  436|       |
  437|    330|  } else
  438|  2.10k|#endif
  439|  2.10k|  {
  440|  2.10k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 81, False: 2.02k]
  ------------------
  441|     81|      return false;
  442|     81|    }
  443|  2.10k|  }
  444|       |
  445|  2.24k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.24k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.24k|                                           num_encoded_split_symbols);
  449|  2.24k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.24k|  DecoderBuffer traversal_end_buffer;
  452|  2.24k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 1.22k, False: 1.01k]
  ------------------
  453|  1.22k|    return false;
  454|  1.22k|  }
  455|       |
  456|  1.01k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.01k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 831, False: 182]
  ------------------
  458|    831|    return false;
  459|    831|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|    182|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|    182|                           traversal_end_buffer.remaining_size(),
  464|    182|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|    182|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|    182|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    182|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 5, False: 177]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|      5|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|      5|  }
  471|    182|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|    182|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 159, False: 23]
  ------------------
  475|    159|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|    159|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|    159|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 4, False: 155]
  ------------------
  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|    155|#endif
  485|    155|    {
  486|   295k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 294k, False: 155]
  ------------------
  487|   294k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 294k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   294k|      }
  491|    155|    }
  492|    159|  }
  493|    182|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|    443|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 261, False: 182]
  ------------------
  498|    261|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|   337k|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 337k, False: 261]
  ------------------
  501|   337k|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|   337k|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|    261|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 261]
  ------------------
  505|    261|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|    261|  }
  509|       |
  510|    182|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|    443|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 261, False: 182]
  ------------------
  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|    261|    int32_t att_connectivity_verts =
  517|    261|        attribute_data_[i].connectivity_data.num_vertices();
  518|    261|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 3, False: 258]
  ------------------
  519|      3|      att_connectivity_verts = corner_table_->num_vertices();
  520|      3|    }
  521|    261|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|    261|  }
  523|    182|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 16, False: 166]
  ------------------
  524|     16|    return false;
  525|     16|  }
  526|    166|  return true;
  527|    182|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE19OnAttributesDecodedEv:
  530|     16|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|     16|  return true;
  532|     16|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEi:
  536|  1.01k|    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.01k|  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.01k|  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.01k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.01k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.01k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.01k|  int num_faces = 0;
  562|  40.6M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 40.6M, False: 292]
  ------------------
  563|  40.6M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  40.6M|    bool check_topology_split = false;
  566|  40.6M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  40.6M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 3.71M, False: 36.8M]
  ------------------
  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.71M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 43, False: 3.71M]
  ------------------
  588|     43|        return -1;
  589|     43|      }
  590|       |
  591|  3.71M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  3.71M|      const VertexIndex vertex_x =
  593|  3.71M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  3.71M|      const CornerIndex corner_b =
  595|  3.71M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  3.71M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 322, False: 3.71M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    322|        return -1;
  600|    322|      }
  601|  3.71M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 3.71M]
  |  Branch (601:11): [True: 0, False: 3.71M]
  ------------------
  602|  3.71M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 3.71M]
  ------------------
  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.71M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  3.71M|      SetOppositeCorners(corner_a, corner + 1);
  612|  3.71M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  3.71M|      const VertexIndex vert_a_prev =
  616|  3.71M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  3.71M|      const VertexIndex vert_b_next =
  618|  3.71M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  3.71M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 3.71M]
  |  Branch (619:38): [True: 0, False: 3.71M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  3.71M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  3.71M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  3.71M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  3.71M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  3.71M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  3.71M|      active_corner_stack.back() = corner;
  631|  36.8M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 3.57k, False: 36.8M]
  |  Branch (631:40): [True: 32.9M, False: 3.92M]
  ------------------
  632|       |      // Create a new face extending from the open boundary edge opposite to the
  633|       |      // corner "a" from the image below. Two new boundary edges are created
  634|       |      // opposite to corners "r" and "l". New active corner is set to either "r"
  635|       |      // or "l" depending on the decoded symbol. One new vertex is created
  636|       |      // at the opposite corner to corner "a".
  637|       |      //     *-------*
  638|       |      //    /a\     / \
  639|       |      //   /   \   /   \
  640|       |      //  /     \ /     \
  641|       |      // *-------v-------*
  642|       |      //  .l   r.
  643|       |      //   .   .
  644|       |      //    . .
  645|       |      //     *
  646|  32.9M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 32.9M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  32.9M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  32.9M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 32.9M]
  ------------------
  651|       |        // Active corner is already opposite to an existing face, which should
  652|       |        // not happen unless the input was tampered with.
  653|      0|        return -1;
  654|      0|      }
  655|       |
  656|       |      // First corner on the new face is either corner "l" or "r".
  657|  32.9M|      const CornerIndex corner(3 * face.value());
  658|  32.9M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  32.9M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 3.57k, False: 32.9M]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  3.57k|        opp_corner = corner + 2;
  662|  3.57k|        corner_l = corner + 1;
  663|  3.57k|        corner_r = corner;
  664|  32.9M|      } else {
  665|       |        // "l" is the new first corner.
  666|  32.9M|        opp_corner = corner + 1;
  667|  32.9M|        corner_l = corner;
  668|  32.9M|        corner_r = corner + 2;
  669|  32.9M|      }
  670|  32.9M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  32.9M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  32.9M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 10, False: 32.9M]
  ------------------
  675|     10|        return -1;  // Unexpected number of decoded vertices.
  676|     10|      }
  677|       |
  678|  32.9M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  32.9M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  32.9M|      const VertexIndex vertex_r =
  682|  32.9M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  32.9M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  32.9M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  32.9M|      corner_table_->MapCornerToVertex(
  688|  32.9M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  32.9M|      active_corner_stack.back() = corner;
  690|  32.9M|      check_topology_split = true;
  691|  32.9M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 46.3k, False: 3.87M]
  ------------------
  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|  46.3k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 0, False: 46.3k]
  ------------------
  703|      0|        return -1;
  704|      0|      }
  705|  46.3k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  46.3k|      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|  46.3k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  46.3k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 23, False: 46.3k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     23|        active_corner_stack.push_back(it->second);
  714|     23|      }
  715|  46.3k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 73, False: 46.2k]
  ------------------
  716|     73|        return -1;
  717|     73|      }
  718|  46.2k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  46.2k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 46.2k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  46.2k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 4, False: 46.2k]
  |  Branch (724:11): [True: 4, False: 46.2k]
  ------------------
  725|  46.2k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 46.2k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      4|        return -1;
  729|      4|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  46.2k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  46.2k|      SetOppositeCorners(corner_a, corner + 2);
  735|  46.2k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  46.2k|      const VertexIndex vertex_p =
  739|  46.2k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  46.2k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  46.2k|      corner_table_->MapCornerToVertex(
  742|  46.2k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  46.2k|      const VertexIndex vert_b_prev =
  744|  46.2k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  46.2k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  46.2k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  46.2k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  46.2k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  46.2k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  46.2k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  46.2k|                                       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|  46.2k|      const CornerIndex first_corner = corner_n;
  757|  10.3M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 10.2M, False: 46.2k]
  ------------------
  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|  46.2k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  46.2k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 46.2k, False: 69]
  ------------------
  770|  46.2k|        invalid_vertices.push_back(vertex_n);
  771|  46.2k|      }
  772|  46.2k|      active_corner_stack.back() = corner;
  773|  3.87M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 3.87M, False: 217]
  ------------------
  774|  3.87M|      const CornerIndex corner(3 * face.value());
  775|  3.87M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  3.87M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  3.87M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  3.87M|                                       corner_table_->AddNewVertex());
  780|  3.87M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  3.87M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  3.87M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 17, False: 3.87M]
  ------------------
  784|     17|        return -1;  // Unexpected number of decoded vertices.
  785|     17|      }
  786|       |
  787|  3.87M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  3.87M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  3.87M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  3.87M|      active_corner_stack.push_back(corner);
  792|  3.87M|      check_topology_split = true;
  793|  3.87M|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|    217|      return -1;
  796|    217|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  40.6M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  40.6M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 36.8M, False: 3.76M]
  ------------------
  801|       |      // Check for topology splits happens only for TOPOLOGY_L, TOPOLOGY_R and
  802|       |      // TOPOLOGY_E symbols because those are the symbols that correspond to
  803|       |      // faces that can be directly connected a TOPOLOGY_S face through the
  804|       |      // topology split event.
  805|       |      // If a topology split is detected, we need to add a new active edge
  806|       |      // onto the active_corner_stack because it will be used later when the
  807|       |      // corresponding TOPOLOGY_S event is decoded.
  808|       |
  809|       |      // Symbol id used by the encoder (reverse).
  810|  36.8M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  36.8M|      EdgeFaceName split_edge;
  812|  36.8M|      int encoder_split_symbol_id;
  813|  36.8M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.29k, False: 36.8M]
  ------------------
  814|  36.8M|                             &encoder_split_symbol_id)) {
  815|  1.29k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 33, False: 1.26k]
  ------------------
  816|     33|          return -1;  // Wrong split symbol id.
  817|     33|        }
  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.26k|        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.26k|        CornerIndex new_active_corner;
  831|  1.26k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 473, False: 790]
  ------------------
  832|    473|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    790|        } else {
  834|    790|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    790|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.26k|        const int decoder_split_symbol_id =
  839|  1.26k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.26k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.26k|            new_active_corner;
  842|  1.26k|      }
  843|  36.8M|    }
  844|  40.6M|  }
  845|    292|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 292]
  ------------------
  846|      0|    return -1;  // Unexpected number of decoded vertices.
  847|      0|  }
  848|       |  // Decode start faces and connect them to the faces from the active stack.
  849|  2.08M|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 2.08M, False: 258]
  ------------------
  850|  2.08M|    const CornerIndex corner = active_corner_stack.back();
  851|  2.08M|    active_corner_stack.pop_back();
  852|  2.08M|    const bool interior_face =
  853|  2.08M|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  2.08M|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 2.04M, False: 40.6k]
  ------------------
  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.04M|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 31, False: 2.04M]
  ------------------
  877|     31|        return -1;  // More faces than expected added to the mesh.
  878|     31|      }
  879|       |
  880|  2.04M|      const CornerIndex corner_a = corner;
  881|  2.04M|      const VertexIndex vert_n =
  882|  2.04M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  2.04M|      const CornerIndex corner_b =
  884|  2.04M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  2.04M|      const VertexIndex vert_x =
  887|  2.04M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  2.04M|      const CornerIndex corner_c =
  889|  2.04M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  2.04M|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 2, False: 2.04M]
  |  Branch (891:33): [True: 1, False: 2.04M]
  |  Branch (891:55): [True: 0, False: 2.04M]
  ------------------
  892|       |        // All matched corners must be different.
  893|      3|        return -1;
  894|      3|      }
  895|  2.04M|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 0, False: 2.04M]
  |  Branch (895:11): [True: 0, False: 2.04M]
  ------------------
  896|  2.04M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 2.04M]
  ------------------
  897|  2.04M|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 2.04M]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      0|        return -1;
  901|      0|      }
  902|       |
  903|  2.04M|      const VertexIndex vert_p =
  904|  2.04M|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  2.04M|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  2.04M|      const CornerIndex new_corner(3 * face.value());
  909|  2.04M|      SetOppositeCorners(new_corner, corner);
  910|  2.04M|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  2.04M|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  2.04M|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  2.04M|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  2.04M|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  8.19M|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 6.14M, False: 2.04M]
  ------------------
  920|  6.14M|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  6.14M|      }
  922|       |
  923|  2.04M|      init_face_configurations_.push_back(true);
  924|  2.04M|      init_corners_.push_back(new_corner);
  925|  2.04M|    } 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|  40.6k|      init_face_configurations_.push_back(false);
  930|  40.6k|      init_corners_.push_back(corner);
  931|  40.6k|    }
  932|  2.08M|  }
  933|    258|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 73, False: 185]
  ------------------
  934|     73|    return -1;  // Unexpected number of decoded faces.
  935|     73|  }
  936|       |
  937|    185|  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.49k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 2.49k, False: 182]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  2.49k|    VertexIndex src_vert(num_vertices - 1);
  943|  3.06k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 573, False: 2.49k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    573|      src_vert = VertexIndex(--num_vertices - 1);
  946|    573|    }
  947|  2.49k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 440, False: 2.05k]
  ------------------
  948|    440|      continue;  // No need to swap anything.
  949|    440|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  2.05k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  8.17k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 6.12k, False: 2.05k]
  ------------------
  954|  6.12k|      const CornerIndex cid = vcit.Corner();
  955|  6.12k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 3, False: 6.12k]
  ------------------
  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.12k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  6.12k|    }
  962|  2.05k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  2.05k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  2.05k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  2.05k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  2.05k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  2.05k|    num_vertices--;
  972|  2.05k|  }
  973|    182|  return num_vertices;
  974|    185|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.43k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.43k|  uint32_t num_topology_splits;
  982|  2.43k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.43k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.43k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 147, False: 2.28k]
  ------------------
  984|    147|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 1, False: 146]
  ------------------
  985|      1|      return -1;
  986|      1|    }
  987|       |
  988|    147|  } else
  989|  2.28k|#endif
  990|  2.28k|  {
  991|  2.28k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 9, False: 2.27k]
  ------------------
  992|      9|      return -1;
  993|      9|    }
  994|  2.28k|  }
  995|  2.42k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 519, False: 1.90k]
  ------------------
  996|    519|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 44, False: 475]
  ------------------
  997|    519|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     44|      return -1;
  999|     44|    }
 1000|    475|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    475|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    475|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 47, False: 428]
  ------------------
 1002|   133k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 133k, False: 16]
  ------------------
 1003|   133k|        TopologySplitEventData event_data;
 1004|   133k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 17, False: 133k]
  ------------------
 1005|     17|          return -1;
 1006|     17|        }
 1007|   133k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 10, False: 133k]
  ------------------
 1008|     10|          return -1;
 1009|     10|        }
 1010|   133k|        uint8_t edge_data;
 1011|   133k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 4, False: 133k]
  ------------------
 1012|      4|          return -1;
 1013|      4|        }
 1014|   133k|        event_data.source_edge = edge_data & 1;
 1015|   133k|        topology_split_data_.push_back(event_data);
 1016|   133k|      }
 1017|       |
 1018|     47|    } else
 1019|    428|#endif
 1020|    428|    {
 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|    428|      int last_source_symbol_id = 0;
 1024|  3.56k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 3.18k, False: 377]
  ------------------
 1025|  3.18k|        TopologySplitEventData event_data;
 1026|  3.18k|        uint32_t delta;
 1027|  3.18k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 19, False: 3.16k]
  ------------------
 1028|     19|          return -1;
 1029|     19|        }
 1030|  3.16k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  3.16k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 9, False: 3.15k]
  ------------------
 1032|      9|          return -1;
 1033|      9|        }
 1034|  3.15k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 23, False: 3.13k]
  ------------------
 1035|     23|          return -1;
 1036|     23|        }
 1037|  3.13k|        event_data.split_symbol_id =
 1038|  3.13k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  3.13k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  3.13k|        topology_split_data_.push_back(event_data);
 1041|  3.13k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    377|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  3.05k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 2.67k, False: 377]
  ------------------
 1045|  2.67k|        uint32_t edge_data;
 1046|  2.67k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.67k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 255, False: 2.41k]
  ------------------
 1047|    255|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  2.41k|        } else {
 1049|  2.41k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  2.41k|        }
 1051|  2.67k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  2.67k|        event_data.source_edge = edge_data & 1;
 1053|  2.67k|      }
 1054|    377|      decoder_buffer->EndBitDecoding();
 1055|    377|    }
 1056|    475|  }
 1057|  2.29k|  uint32_t num_hole_events = 0;
 1058|  2.29k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.29k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.29k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 101, False: 2.19k]
  ------------------
 1060|    101|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 1, False: 100]
  ------------------
 1061|      1|      return -1;
 1062|      1|    }
 1063|  2.19k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.19k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 171, False: 2.02k]
  ------------------
 1064|    171|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 11, False: 160]
  ------------------
 1065|     11|      return -1;
 1066|     11|    }
 1067|    171|  }
 1068|  2.28k|#endif
 1069|  2.28k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 73, False: 2.21k]
  ------------------
 1070|     73|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     73|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     73|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 31, False: 42]
  ------------------
 1072|   606k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 606k, False: 1]
  ------------------
 1073|   606k|        HoleEventData event_data;
 1074|   606k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 30, False: 606k]
  ------------------
 1075|     30|          return -1;
 1076|     30|        }
 1077|   606k|        hole_event_data_.push_back(event_data);
 1078|   606k|      }
 1079|       |
 1080|     31|    } else
 1081|     42|#endif
 1082|     42|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     42|      int last_symbol_id = 0;
 1085|  92.6k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 92.5k, False: 26]
  ------------------
 1086|  92.5k|        HoleEventData event_data;
 1087|  92.5k|        uint32_t delta;
 1088|  92.5k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 16, False: 92.5k]
  ------------------
 1089|     16|          return -1;
 1090|     16|        }
 1091|  92.5k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  92.5k|        last_symbol_id = event_data.symbol_id;
 1093|  92.5k|        hole_event_data_.push_back(event_data);
 1094|  92.5k|      }
 1095|     42|    }
 1096|     73|  }
 1097|  2.24k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.28k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|      8|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|      8|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|      8|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|     32|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 24, False: 8]
  ------------------
 1109|     24|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|     24|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 8, False: 16]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|     16|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 8, False: 8]
  ------------------
 1114|      8|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|      8|      }
 1116|      8|      continue;
 1117|      8|    }
 1118|       |
 1119|     32|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 16, False: 16]
  ------------------
 1120|     16|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|     16|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 6, False: 10]
  ------------------
 1122|      6|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|      6|      }
 1124|     16|    }
 1125|     16|  }
 1126|      8|  return true;
 1127|      8|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   294k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   294k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   294k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   294k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.17M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 884k, False: 294k]
  ------------------
 1139|   884k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   884k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 172k, False: 712k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   345k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 172k, False: 172k]
  ------------------
 1144|   172k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   172k|      }
 1146|   172k|      continue;
 1147|   172k|    }
 1148|   712k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   712k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 356k, False: 356k]
  ------------------
 1151|   356k|      continue;
 1152|   356k|    }
 1153|       |
 1154|   712k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 356k, False: 356k]
  ------------------
 1155|   356k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|   356k|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 164k, False: 191k]
  ------------------
 1157|   164k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|   164k|      }
 1159|   356k|    }
 1160|   356k|  }
 1161|   294k|  return true;
 1162|   294k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE21AssignPointsToCornersEi:
 1166|    182|    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|    182|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|    182|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 23, False: 159]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  80.9k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 80.9k, False: 23]
  ------------------
 1176|  80.9k|      Mesh::Face face;
 1177|  80.9k|      const CornerIndex start_corner(3 * f.value());
 1178|   323k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 242k, False: 80.9k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   242k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   242k|        face[c] = vert_id;
 1182|   242k|      }
 1183|  80.9k|      decoder_->mesh()->SetFace(f, face);
 1184|  80.9k|    }
 1185|     23|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     23|    return true;
 1187|     23|  }
 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|    159|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|    159|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   236k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 236k, False: 143]
  ------------------
 1197|   236k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   236k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 64, False: 236k]
  ------------------
 1199|     64|      continue;  // Isolated vertex.
 1200|     64|    }
 1201|   236k|    CornerIndex deduplication_first_corner = c;
 1202|   236k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 171k, False: 65.3k]
  ------------------
 1203|       |      // If the vertex is on a boundary, start deduplication from the left most
 1204|       |      // corner that is guaranteed to lie on the boundary.
 1205|   171k|      deduplication_first_corner = c;
 1206|   171k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  73.4k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 65.4k, False: 8.06k]
  ------------------
 1210|  65.4k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 7.90k, False: 57.5k]
  ------------------
 1211|  7.90k|          continue;  // No seam for this attribute, ignore it.
 1212|  7.90k|        }
 1213|       |        // Else there needs to be at least one seam edge.
 1214|       |
 1215|       |        // At this point, we use identity mapping between corners and point ids.
 1216|  57.5k|        const VertexIndex vert_id =
 1217|  57.5k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  57.5k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  57.5k|        bool seam_found = false;
 1220|  61.1k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 60.9k, False: 214]
  ------------------
 1221|  60.9k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 16, False: 60.9k]
  ------------------
 1222|     16|            return false;
 1223|     16|          }
 1224|  60.9k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 57.2k, False: 3.64k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  57.2k|            deduplication_first_corner = act_c;
 1227|  57.2k|            seam_found = true;
 1228|  57.2k|            break;
 1229|  57.2k|          }
 1230|  3.64k|          act_c = corner_table_->SwingRight(act_c);
 1231|  3.64k|        }
 1232|  57.5k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 57.2k, False: 214]
  ------------------
 1233|  57.2k|          break;  // No reason to process other attributes if we found a seam.
 1234|  57.2k|        }
 1235|  57.5k|      }
 1236|  65.3k|    }
 1237|       |
 1238|       |    // Do a deduplication pass over the corners on the processed vertex.
 1239|       |    // At this point each corner corresponds to one point id and our goal is to
 1240|       |    // merge similar points into a single point id.
 1241|       |    // We do a single pass in a clockwise direction over the corners and we add
 1242|       |    // a new point id whenever one of the attributes change.
 1243|   236k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   236k|    corner_to_point_map[c.value()] =
 1246|   236k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   236k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   236k|    CornerIndex prev_c = c;
 1250|   236k|    c = corner_table_->SwingRight(c);
 1251|   813k|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 641k, False: 171k]
  |  Branch (1251:40): [True: 576k, False: 64.9k]
  ------------------
 1252|   576k|      bool attribute_seam = false;
 1253|  1.05M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 576k, False: 475k]
  ------------------
 1254|   576k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 100k, False: 475k]
  ------------------
 1255|   576k|            attribute_data_[i].connectivity_data.Vertex(prev_c)) {
 1256|       |          // Attribute index changed from the previous corner. We need to add a
 1257|       |          // new point here.
 1258|   100k|          attribute_seam = true;
 1259|   100k|          break;
 1260|   100k|        }
 1261|   576k|      }
 1262|   576k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 100k, False: 475k]
  ------------------
 1263|   100k|        corner_to_point_map[c.value()] =
 1264|   100k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   100k|        point_to_corner_map.push_back(c.value());
 1266|   475k|      } else {
 1267|   475k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|   475k|      }
 1269|   576k|      prev_c = c;
 1270|   576k|      c = corner_table_->SwingRight(c);
 1271|   576k|    }
 1272|   236k|  }
 1273|       |  // Add faces.
 1274|  94.0k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 93.9k, False: 143]
  ------------------
 1275|  93.9k|    Mesh::Face face;
 1276|   375k|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 281k, False: 93.9k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   281k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   281k|    }
 1280|  93.9k|    decoder_->mesh()->SetFace(f, face);
 1281|  93.9k|  }
 1282|    143|  decoder_->point_cloud()->set_num_points(
 1283|    143|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|    143|  return true;
 1285|    159|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    155|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    155|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    155|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    155|  const Mesh *mesh = decoder_->mesh();
  115|    155|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    155|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    155|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    155|                           encoding_data);
  120|       |
  121|    155|  TraverserT att_traverser;
  122|    155|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    155|  traversal_sequencer->SetTraverser(att_traverser);
  125|    155|  return std::move(traversal_sequencer);
  126|    155|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    689|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    689|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    689|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    689|  const Mesh *mesh = decoder_->mesh();
  115|    689|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    689|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    689|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    689|                           encoding_data);
  120|       |
  121|    689|  TraverserT att_traverser;
  122|    689|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    689|  traversal_sequencer->SetTraverser(att_traverser);
  125|    689|  return std::move(traversal_sequencer);
  126|    689|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    212|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    212|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    212|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    212|  const Mesh *mesh = decoder_->mesh();
  115|    212|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    212|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    212|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    212|                           encoding_data);
  120|       |
  121|    212|  TraverserT att_traverser;
  122|    212|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    212|  traversal_sequencer->SetTraverser(att_traverser);
  125|    212|  return std::move(traversal_sequencer);
  126|    212|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    646|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    646|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    646|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    646|  const Mesh *mesh = decoder_->mesh();
  115|    646|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    646|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    646|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    646|                           encoding_data);
  120|       |
  121|    646|  TraverserT att_traverser;
  122|    646|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    646|  traversal_sequencer->SetTraverser(att_traverser);
  125|    646|  return std::move(traversal_sequencer);
  126|    646|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     37|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|     37|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     37|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     37|  const Mesh *mesh = decoder_->mesh();
  115|     37|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     37|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     37|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     37|                           encoding_data);
  120|       |
  121|     37|  TraverserT att_traverser;
  122|     37|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     37|  traversal_sequencer->SetTraverser(att_traverser);
  125|     37|  return std::move(traversal_sequencer);
  126|     37|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     17|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|     17|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     17|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     17|  const Mesh *mesh = decoder_->mesh();
  115|     17|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     17|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     17|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     17|                           encoding_data);
  120|       |
  121|     17|  TraverserT att_traverser;
  122|     17|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     17|  traversal_sequencer->SetTraverser(att_traverser);
  125|     17|  return std::move(traversal_sequencer);
  126|     17|}

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  7.03k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  2.41k|  const CornerTable *GetCornerTable() const override {
   67|  2.41k|    return corner_table_.get();
   68|  2.41k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  3.05M|                       int *out_encoder_split_symbol_id) {
   87|  3.05M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 23.9k, False: 3.03M]
  ------------------
   88|  23.9k|      return false;
   89|  23.9k|    }
   90|  3.03M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 20, False: 3.03M]
  ------------------
   91|  3.03M|        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|     20|      *out_encoder_split_symbol_id = -1;
   98|     20|      return true;
   99|     20|    }
  100|  3.03M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 3.02M, False: 1.46k]
  ------------------
  101|  3.02M|      return false;
  102|  3.02M|    }
  103|  1.46k|    *out_face_edge =
  104|  1.46k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.46k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.46k|    topology_split_data_.pop_back();
  108|  1.46k|    return true;
  109|  3.03M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  9.05M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  9.05M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  9.05M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  9.05M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  14.0k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  6.23k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  4.05k|  const CornerTable *GetCornerTable() const override {
   67|  4.05k|    return corner_table_.get();
   68|  4.05k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  29.6M|                       int *out_encoder_split_symbol_id) {
   87|  29.6M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 29.6M, False: 48.2k]
  ------------------
   88|  29.6M|      return false;
   89|  29.6M|    }
   90|  48.2k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 23, False: 48.2k]
  ------------------
   91|  48.2k|        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|     23|      *out_encoder_split_symbol_id = -1;
   98|     23|      return true;
   99|     23|    }
  100|  48.2k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 46.8k, False: 1.38k]
  ------------------
  101|  46.8k|      return false;
  102|  46.8k|    }
  103|  1.38k|    *out_face_edge =
  104|  1.38k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.38k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.38k|    topology_split_data_.pop_back();
  108|  1.38k|    return true;
  109|  48.2k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  88.4M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  88.4M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  88.4M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  88.4M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  8.47k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  12.0k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  2.36k|  const CornerTable *GetCornerTable() const override {
   67|  2.36k|    return corner_table_.get();
   68|  2.36k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  36.8M|                       int *out_encoder_split_symbol_id) {
   87|  36.8M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 36.3M, False: 511k]
  ------------------
   88|  36.3M|      return false;
   89|  36.3M|    }
   90|   511k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 33, False: 511k]
  ------------------
   91|   511k|        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|     33|      *out_encoder_split_symbol_id = -1;
   98|     33|      return true;
   99|     33|    }
  100|   511k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 510k, False: 1.26k]
  ------------------
  101|   510k|      return false;
  102|   510k|    }
  103|  1.26k|    *out_face_edge =
  104|  1.26k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.26k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.26k|    topology_split_data_.pop_back();
  108|  1.26k|    return true;
  109|   511k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  46.6M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  46.6M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  46.6M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  46.6M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  16.7k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

_ZN5draco13HoleEventDataC2Ev:
  118|  1.07M|  HoleEventData() : symbol_id(0) {}

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  8.00k|      : attribute_connectivity_decoders_(nullptr),
   34|  8.00k|        num_attribute_data_(0),
   35|  8.00k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  6.66k|  void Init(MeshEdgebreakerDecoderImplInterface *decoder) {
   37|  6.66k|    decoder_impl_ = decoder;
   38|  6.66k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  6.66k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  6.66k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  6.66k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  5.35k|  uint16_t BitstreamVersion() const {
   45|  5.35k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  5.35k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  2.34k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  6.66k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  4.42k|  bool Start(DecoderBuffer *out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  4.42k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 156, False: 4.26k]
  ------------------
   63|    156|      return false;
   64|    156|    }
   65|       |
   66|  4.26k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 115, False: 4.15k]
  ------------------
   67|    115|      return false;
   68|    115|    }
   69|       |
   70|  4.15k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 27, False: 4.12k]
  ------------------
   71|     27|      return false;
   72|     27|    }
   73|  4.12k|    *out_buffer = buffer_;
   74|  4.12k|    return true;
   75|  4.15k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  2.12M|  inline bool DecodeStartFaceConfiguration() {
   79|  2.12M|    uint32_t face_configuration;
   80|  2.12M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  2.12M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.12M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 511, False: 2.12M]
  ------------------
   82|    511|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|    511|    } else
   85|  2.12M|#endif
   86|  2.12M|    {
   87|  2.12M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  2.12M|    }
   89|  2.12M|    return face_configuration;
   90|  2.12M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  6.87M|  inline uint32_t DecodeSymbol() {
   94|  6.87M|    uint32_t symbol;
   95|  6.87M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  6.87M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 3.05M, False: 3.82M]
  ------------------
   97|  3.05M|      return symbol;
   98|  3.05M|    }
   99|       |    // Else decode two additional bits.
  100|  3.82M|    uint32_t symbol_suffix;
  101|  3.82M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  3.82M|    symbol |= (symbol_suffix << 1);
  103|  3.82M|    return symbol;
  104|  6.87M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  6.80M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|   732k|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  22.2M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  22.2M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  22.2M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  3.84k|  void Done() {
  123|  3.84k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 3.66k, False: 177]
  ------------------
  124|  3.66k|      symbol_buffer_.EndBitDecoding();
  125|  3.66k|    }
  126|  3.84k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  3.84k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.84k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 257, False: 3.58k]
  ------------------
  128|    257|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    257|    } else
  131|  3.58k|#endif
  132|  3.58k|    {
  133|  3.58k|      start_face_decoder_.EndDecoding();
  134|  3.58k|    }
  135|  3.84k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|  2.03k|  DecoderBuffer *buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  4.64k|  bool DecodeTraversalSymbols() {
  141|  4.64k|    uint64_t traversal_size;
  142|  4.64k|    symbol_buffer_ = buffer_;
  143|  4.64k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 51, False: 4.58k]
  ------------------
  144|     51|      return false;
  145|     51|    }
  146|  4.58k|    buffer_ = symbol_buffer_;
  147|  4.58k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 176, False: 4.41k]
  ------------------
  148|    176|      return false;
  149|    176|    }
  150|  4.41k|    buffer_.Advance(traversal_size);
  151|  4.41k|    return true;
  152|  4.58k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  6.43k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  6.43k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  6.43k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  6.43k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 502, False: 5.93k]
  ------------------
  158|    502|      start_face_buffer_ = buffer_;
  159|    502|      uint64_t traversal_size;
  160|    502|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 4, False: 498]
  ------------------
  161|      4|        return false;
  162|      4|      }
  163|    498|      buffer_ = start_face_buffer_;
  164|    498|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 165, False: 333]
  ------------------
  165|    165|        return false;
  166|    165|      }
  167|    333|      buffer_.Advance(traversal_size);
  168|    333|      return true;
  169|    498|    }
  170|  5.93k|#endif
  171|  5.93k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  6.43k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  6.20k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  6.20k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 4.02k, False: 2.18k]
  ------------------
  177|  4.02k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  4.02k|          new BinaryDecoder[num_attribute_data_]);
  179|  11.1k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 7.21k, False: 3.97k]
  ------------------
  180|  7.21k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 47, False: 7.16k]
  ------------------
  181|     47|          return false;
  182|     47|        }
  183|  7.21k|      }
  184|  4.02k|    }
  185|  6.16k|    return true;
  186|  6.20k|  }

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

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

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

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.29k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  3.32M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  3.32M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 3.32M, False: 3.65k]
  ------------------
   61|  3.32M|      return true;  // Already traversed.
   62|  3.32M|    }
   63|       |
   64|  3.65k|    corner_traversal_stack_.clear();
   65|  3.65k|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  3.65k|    const VertexIndex next_vert =
   69|  3.65k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  3.65k|    const VertexIndex prev_vert =
   71|  3.65k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  3.65k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 3.65k]
  |  Branch (72:45): [True: 0, False: 3.65k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  3.65k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.89k, False: 759]
  ------------------
   76|  2.89k|      this->MarkVertexVisited(next_vert);
   77|  2.89k|      this->traversal_observer().OnNewVertexVisited(
   78|  2.89k|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.89k|    }
   80|  3.65k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 3.12k, False: 529]
  ------------------
   81|  3.12k|      this->MarkVertexVisited(prev_vert);
   82|  3.12k|      this->traversal_observer().OnNewVertexVisited(
   83|  3.12k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  3.12k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  24.0k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 20.4k, False: 3.65k]
  ------------------
   88|       |      // Currently processed corner.
   89|  20.4k|      corner_id = corner_traversal_stack_.back();
   90|  20.4k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  20.4k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 20.4k]
  |  Branch (92:47): [True: 878, False: 19.5k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    878|        corner_traversal_stack_.pop_back();
   95|    878|        continue;
   96|    878|      }
   97|  3.32M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 3.32M, Folded]
  ------------------
   98|  3.32M|        this->MarkFaceVisited(face_id);
   99|  3.32M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  3.32M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  3.32M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 3.32M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  3.32M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.68M, False: 1.64M]
  ------------------
  105|  1.68M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.68M|          this->MarkVertexVisited(vert_id);
  107|  1.68M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.68M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 1.63M, False: 41.2k]
  ------------------
  109|  1.63M|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  1.63M|            face_id = FaceIndex(corner_id.value() / 3);
  111|  1.63M|            continue;
  112|  1.63M|          }
  113|  1.68M|        }
  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.68M|        const CornerIndex right_corner_id =
  118|  1.68M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.68M|        const CornerIndex left_corner_id =
  120|  1.68M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.68M|        const FaceIndex right_face_id(
  122|  1.68M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 28.1k, False: 1.65M]
  ------------------
  123|  1.68M|                 ? kInvalidFaceIndex
  124|  1.68M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.68M|        const FaceIndex left_face_id(
  126|  1.68M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 15.4k, False: 1.66M]
  ------------------
  127|  1.68M|                 ? kInvalidFaceIndex
  128|  1.68M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.68M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.64M, False: 40.8k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.64M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 11.1k, False: 1.63M]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  11.1k|            corner_traversal_stack_.pop_back();
  134|  11.1k|            break;  // Break from the while (true) loop.
  135|  1.63M|          } else {
  136|       |            // Go to the left face.
  137|  1.63M|            corner_id = left_corner_id;
  138|  1.63M|            face_id = left_face_id;
  139|  1.63M|          }
  140|  1.64M|        } else {
  141|       |          // Right face was not visited.
  142|  40.8k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 32.4k, False: 8.39k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  32.4k|            corner_id = right_corner_id;
  145|  32.4k|            face_id = right_face_id;
  146|  32.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|  8.39k|            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|  8.39k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  8.39k|            break;
  159|  8.39k|          }
  160|  40.8k|        }
  161|  1.68M|      }
  162|  19.5k|    }
  163|  3.65k|    return true;
  164|  3.65k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.29k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.70k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.55k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  3.88M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  3.88M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 951k, False: 2.93M]
  ------------------
   61|   951k|      return true;  // Already traversed.
   62|   951k|    }
   63|       |
   64|  2.93M|    corner_traversal_stack_.clear();
   65|  2.93M|    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.93M|    const VertexIndex next_vert =
   69|  2.93M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  2.93M|    const VertexIndex prev_vert =
   71|  2.93M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  2.93M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.93M]
  |  Branch (72:45): [True: 0, False: 2.93M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  2.93M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.93M, False: 1.53k]
  ------------------
   76|  2.93M|      this->MarkVertexVisited(next_vert);
   77|  2.93M|      this->traversal_observer().OnNewVertexVisited(
   78|  2.93M|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.93M|    }
   80|  2.93M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.93M, False: 1.32k]
  ------------------
   81|  2.93M|      this->MarkVertexVisited(prev_vert);
   82|  2.93M|      this->traversal_observer().OnNewVertexVisited(
   83|  2.93M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.93M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  5.94M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 3.00M, False: 2.93M]
  ------------------
   88|       |      // Currently processed corner.
   89|  3.00M|      corner_id = corner_traversal_stack_.back();
   90|  3.00M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  3.00M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 3.00M]
  |  Branch (92:47): [True: 5.59k, False: 3.00M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  5.59k|        corner_traversal_stack_.pop_back();
   95|  5.59k|        continue;
   96|  5.59k|      }
   97|  3.88M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 3.88M, Folded]
  ------------------
   98|  3.88M|        this->MarkFaceVisited(face_id);
   99|  3.88M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  3.88M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  3.88M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 3.88M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  3.88M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 3.43M, False: 453k]
  ------------------
  105|  3.43M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  3.43M|          this->MarkVertexVisited(vert_id);
  107|  3.43M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  3.43M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 438k, False: 2.99M]
  ------------------
  109|   438k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   438k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   438k|            continue;
  112|   438k|          }
  113|  3.43M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  3.45M|        const CornerIndex right_corner_id =
  118|  3.45M|            this->corner_table()->GetRightCorner(corner_id);
  119|  3.45M|        const CornerIndex left_corner_id =
  120|  3.45M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  3.45M|        const FaceIndex right_face_id(
  122|  3.45M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 2.96M, False: 480k]
  ------------------
  123|  3.45M|                 ? kInvalidFaceIndex
  124|  3.45M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  3.45M|        const FaceIndex left_face_id(
  126|  3.45M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 2.96M, False: 486k]
  ------------------
  127|  3.45M|                 ? kInvalidFaceIndex
  128|  3.45M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  3.45M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 3.39M, False: 57.0k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  3.39M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 2.96M, False: 425k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  2.96M|            corner_traversal_stack_.pop_back();
  134|  2.96M|            break;  // Break from the while (true) loop.
  135|  2.96M|          } else {
  136|       |            // Go to the left face.
  137|   425k|            corner_id = left_corner_id;
  138|   425k|            face_id = left_face_id;
  139|   425k|          }
  140|  3.39M|        } else {
  141|       |          // Right face was not visited.
  142|  57.0k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 20.9k, False: 36.1k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  20.9k|            corner_id = right_corner_id;
  145|  20.9k|            face_id = right_face_id;
  146|  36.1k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  36.1k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  36.1k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  36.1k|            break;
  159|  36.1k|          }
  160|  57.0k|        }
  161|  3.45M|      }
  162|  3.00M|    }
  163|  2.93M|    return true;
  164|  2.93M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.55k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  3.25k|  DepthFirstTraverser() {}

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

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    404|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  1.36k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  1.36k|    const auto *corner_table = traverser_.corner_table();
   50|  1.36k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  1.36k|    const size_t num_faces = mesh_->num_faces();
   52|  1.36k|    const size_t num_points = mesh_->num_points();
   53|  4.48M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 4.48M, False: 1.36k]
  ------------------
   54|  4.48M|      const auto &face = mesh_->face(f);
   55|  17.9M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 13.4M, False: 4.48M]
  ------------------
   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.48M|    }
   72|  1.36k|    return true;
   73|  1.36k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    375|  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|    375|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    375|    traverser_.OnTraversalStart();
   82|    375|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 375]
  ------------------
   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|    375|    } else {
   89|    375|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.70M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.70M, False: 375]
  ------------------
   91|  2.70M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.70M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.70M|      }
   95|    375|    }
   96|    375|    traverser_.OnTraversalEnd();
   97|    375|    return true;
   98|    375|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.70M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.70M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.70M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    404|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.35k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  5.83k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  5.83k|    const auto *corner_table = traverser_.corner_table();
   50|  5.83k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  5.83k|    const size_t num_faces = mesh_->num_faces();
   52|  5.83k|    const size_t num_points = mesh_->num_points();
   53|  5.51M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 5.51M, False: 5.83k]
  ------------------
   54|  5.51M|      const auto &face = mesh_->face(f);
   55|  22.0M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 16.5M, False: 5.51M]
  ------------------
   56|  16.5M|        const PointIndex point_id = face[p];
   57|  16.5M|        const VertexIndex vert_id =
   58|  16.5M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  16.5M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 16.5M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  16.5M|        const AttributeValueIndex att_entry_id(
   63|  16.5M|            encoding_data_
   64|  16.5M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  16.5M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 16.5M]
  |  Branch (65:13): [True: 0, False: 16.5M]
  |  Branch (65:39): [True: 0, False: 16.5M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  16.5M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  16.5M|      }
   71|  5.51M|    }
   72|  5.83k|    return true;
   73|  5.83k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.29k|  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.29k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.29k|    traverser_.OnTraversalStart();
   82|  1.29k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.29k]
  ------------------
   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.29k|    } else {
   89|  1.29k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.32M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.32M, False: 1.29k]
  ------------------
   91|  3.32M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.32M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.32M|      }
   95|  1.29k|    }
   96|  1.29k|    traverser_.OnTraversalEnd();
   97|  1.29k|    return true;
   98|  1.29k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.32M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.32M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.32M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.35k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.62k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  6.56k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  6.56k|    const auto *corner_table = traverser_.corner_table();
   50|  6.56k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  6.56k|    const size_t num_faces = mesh_->num_faces();
   52|  6.56k|    const size_t num_points = mesh_->num_points();
   53|  5.94M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 5.93M, False: 6.56k]
  ------------------
   54|  5.93M|      const auto &face = mesh_->face(f);
   55|  23.7M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 17.8M, False: 5.93M]
  ------------------
   56|  17.8M|        const PointIndex point_id = face[p];
   57|  17.8M|        const VertexIndex vert_id =
   58|  17.8M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  17.8M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 17.8M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  17.8M|        const AttributeValueIndex att_entry_id(
   63|  17.8M|            encoding_data_
   64|  17.8M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  17.8M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 17.8M]
  |  Branch (65:13): [True: 0, False: 17.8M]
  |  Branch (65:39): [True: 0, False: 17.8M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  17.8M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  17.8M|      }
   71|  5.93M|    }
   72|  6.56k|    return true;
   73|  6.56k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.55k|  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.55k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.55k|    traverser_.OnTraversalStart();
   82|  1.55k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.55k]
  ------------------
   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.55k|    } else {
   89|  1.55k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.89M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.88M, False: 1.55k]
  ------------------
   91|  3.88M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.88M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.88M|      }
   95|  1.55k|    }
   96|  1.55k|    traverser_.OnTraversalEnd();
   97|  1.55k|    return true;
   98|  1.55k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.88M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.88M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.88M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.62k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.25k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  35.7M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  18.2M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  18.2M|    return is_vertex_visited_[vert_id.value()];
   65|  18.2M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  3.06M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  3.06M|    is_vertex_visited_[vert_id.value()] = true;
   68|  3.06M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  9.09M|  inline TraversalObserverT &traversal_observer() {
   75|  9.09M|    return traversal_observer_;
   76|  9.09M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  14.0M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  14.0M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 81.6k, False: 13.9M]
  ------------------
   47|  81.6k|      return true;  // Invalid faces are always considered as visited.
   48|  81.6k|    }
   49|  13.9M|    return is_face_visited_[face_id.value()];
   50|  14.0M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  6.03M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  6.03M|    is_face_visited_[face_id.value()] = true;
   62|  6.03M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.51k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.51k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.75k|                    TraversalObserver traversal_observer) {
   37|  1.75k|    corner_table_ = corner_table;
   38|  1.75k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.75k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.75k|    traversal_observer_ = traversal_observer;
   41|  1.75k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  3.32M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  3.32M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.32M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  3.32M|    return is_face_visited_[corner_id.value() / 3];
   58|  3.32M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  32.2M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  3.88M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  3.88M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.88M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  3.88M|    return is_face_visited_[corner_id.value() / 3];
   58|  3.88M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  9.76M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  9.76M|    return is_vertex_visited_[vert_id.value()];
   65|  9.76M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  9.30M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  9.30M|    is_vertex_visited_[vert_id.value()] = true;
   68|  9.30M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  13.1M|  inline TraversalObserverT &traversal_observer() {
   75|  13.1M|    return traversal_observer_;
   76|  13.1M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  9.91M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  9.91M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 5.93M, False: 3.97M]
  ------------------
   47|  5.93M|      return true;  // Invalid faces are always considered as visited.
   48|  5.93M|    }
   49|  3.97M|    return is_face_visited_[face_id.value()];
   50|  9.91M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  3.88M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  3.88M|    is_face_visited_[face_id.value()] = true;
   62|  3.88M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.25k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.62k|                    TraversalObserver traversal_observer) {
   37|  1.62k|    corner_table_ = corner_table;
   38|  1.62k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.62k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.62k|    traversal_observer_ = traversal_observer;
   41|  1.62k|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    254|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    254|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 12, False: 242]
  ------------------
  187|     12|    return false;
  188|     12|  }
  189|    242|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 12, False: 230]
  ------------------
  190|     12|    return false;
  191|     12|  }
  192|    230|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 12, False: 218]
  ------------------
  193|     12|    return false;
  194|     12|  }
  195|    218|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 75, False: 143]
  ------------------
  196|     75|    return true;
  197|     75|  }
  198|    143|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 25, False: 118]
  ------------------
  199|     25|    return false;
  200|     25|  }
  201|    118|  num_decoded_points_ = 0;
  202|       |
  203|    118|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 27, False: 91]
  ------------------
  204|     27|    return false;
  205|     27|  }
  206|     91|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 7, False: 84]
  ------------------
  207|      7|    return false;
  208|      7|  }
  209|     84|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 82]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     82|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 79]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|       |
  216|     79|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 59, False: 20]
  ------------------
  217|     59|    return false;
  218|     59|  }
  219|       |
  220|     20|  numbers_decoder_.EndDecoding();
  221|     20|  remaining_bits_decoder_.EndDecoding();
  222|     20|  axis_decoder_.EndDecoding();
  223|     20|  half_decoder_.EndDecoding();
  224|       |
  225|     20|  return true;
  226|     79|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     79|    uint32_t num_points, OutputIteratorT &oit) {
  254|     79|  typedef DecodingStatus Status;
  255|     79|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     79|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     79|  DecodingStatus init_status(num_points, 0, 0);
  258|     79|  std::stack<Status> status_stack;
  259|     79|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  3.18M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 3.18M, False: 20]
  ------------------
  263|  3.18M|    const DecodingStatus status = status_stack.top();
  264|  3.18M|    status_stack.pop();
  265|       |
  266|  3.18M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  3.18M|    const uint32_t last_axis = status.last_axis;
  268|  3.18M|    const uint32_t stack_pos = status.stack_pos;
  269|  3.18M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  3.18M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  3.18M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 3.18M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  3.18M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  3.18M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 3.18M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  3.18M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  3.18M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.58M, False: 1.59M]
  ------------------
  285|   296M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 294M, False: 1.58M]
  ------------------
  286|   294M|        *oit = old_base;
  287|   294M|        ++oit;
  288|   294M|        ++num_decoded_points_;
  289|   294M|      }
  290|  1.58M|      continue;
  291|  1.58M|    }
  292|       |
  293|  1.59M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  1.59M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.86k, False: 1.59M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.86k|      axes_[0] = axis;
  300|  12.2k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 10.3k, False: 1.86k]
  ------------------
  301|  10.3k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  10.3k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 651, False: 9.68k]
  |  |  ------------------
  ------------------
  302|  10.3k|      }
  303|  5.02k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.18k, False: 1.83k]
  ------------------
  304|  23.6k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 20.5k, False: 3.15k]
  ------------------
  305|  20.5k|          p_[axes_[j]] = 0;
  306|  20.5k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  20.5k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 7.29k, False: 13.2k]
  ------------------
  308|  7.29k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 31, False: 7.26k]
  ------------------
  309|  7.29k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     31|              return false;
  311|     31|            }
  312|  7.29k|          }
  313|  20.4k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  20.4k|        }
  315|  3.15k|        *oit = p_;
  316|  3.15k|        ++oit;
  317|  3.15k|        ++num_decoded_points_;
  318|  3.15k|      }
  319|  1.83k|      continue;
  320|  1.86k|    }
  321|       |
  322|  1.59M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.59M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.59M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.59M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.59M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.59M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.59M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.59M|    uint32_t number = 0;
  334|  1.59M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.59M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.59M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 28, False: 1.59M]
  ------------------
  338|       |      // Invalid |number|.
  339|     28|      return false;
  340|     28|    }
  341|  1.59M|    first_half -= number;
  342|  1.59M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.59M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 859k, False: 731k]
  ------------------
  345|   859k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 857k, False: 2.24k]
  ------------------
  346|   857k|        std::swap(first_half, second_half);
  347|   857k|      }
  348|   859k|    }
  349|       |
  350|  1.59M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.59M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.59M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.59M, False: 59]
  ------------------
  353|  1.59M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.59M|    }
  355|  1.59M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.59M, False: 119]
  ------------------
  356|  1.59M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.59M|    }
  358|  1.59M|  }
  359|     20|  return true;
  360|     79|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  134|  4.03M|        : num_remaining_points(num_remaining_points_),
  135|  4.03M|          last_axis(last_axis_),
  136|  4.03M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|  2.01M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.01M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.01M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|     75|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|    367|      : bit_length_(0),
   87|    367|        num_points_(0),
   88|    367|        num_decoded_points_(0),
   89|    367|        dimension_(dimension),
   90|    367|        p_(dimension, 0),
   91|    367|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    367|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    367|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    198|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    198|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 7, False: 191]
  ------------------
  187|      7|    return false;
  188|      7|  }
  189|    191|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 20, False: 171]
  ------------------
  190|     20|    return false;
  191|     20|  }
  192|    171|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 3, False: 168]
  ------------------
  193|      3|    return false;
  194|      3|  }
  195|    168|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 40, False: 128]
  ------------------
  196|     40|    return true;
  197|     40|  }
  198|    128|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 18, False: 110]
  ------------------
  199|     18|    return false;
  200|     18|  }
  201|    110|  num_decoded_points_ = 0;
  202|       |
  203|    110|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 21, False: 89]
  ------------------
  204|     21|    return false;
  205|     21|  }
  206|     89|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 86]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     86|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 4, False: 82]
  ------------------
  210|      4|    return false;
  211|      4|  }
  212|     82|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 80]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     80|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 58, False: 22]
  ------------------
  217|     58|    return false;
  218|     58|  }
  219|       |
  220|     22|  numbers_decoder_.EndDecoding();
  221|     22|  remaining_bits_decoder_.EndDecoding();
  222|     22|  axis_decoder_.EndDecoding();
  223|     22|  half_decoder_.EndDecoding();
  224|       |
  225|     22|  return true;
  226|     80|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     80|    uint32_t num_points, OutputIteratorT &oit) {
  254|     80|  typedef DecodingStatus Status;
  255|     80|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     80|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     80|  DecodingStatus init_status(num_points, 0, 0);
  258|     80|  std::stack<Status> status_stack;
  259|     80|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  5.79M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 5.79M, False: 22]
  ------------------
  263|  5.79M|    const DecodingStatus status = status_stack.top();
  264|  5.79M|    status_stack.pop();
  265|       |
  266|  5.79M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  5.79M|    const uint32_t last_axis = status.last_axis;
  268|  5.79M|    const uint32_t stack_pos = status.stack_pos;
  269|  5.79M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  5.79M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  5.79M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 5.79M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  5.79M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  5.79M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 5.79M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  5.79M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  5.79M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.89M, False: 2.89M]
  ------------------
  285|   307M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 304M, False: 2.89M]
  ------------------
  286|   304M|        *oit = old_base;
  287|   304M|        ++oit;
  288|   304M|        ++num_decoded_points_;
  289|   304M|      }
  290|  2.89M|      continue;
  291|  2.89M|    }
  292|       |
  293|  2.89M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  2.89M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 2.17k, False: 2.89M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  2.17k|      axes_[0] = axis;
  300|  15.0k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 12.9k, False: 2.17k]
  ------------------
  301|  12.9k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  12.9k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 461, False: 12.4k]
  |  |  ------------------
  ------------------
  302|  12.9k|      }
  303|  5.92k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.78k, False: 2.13k]
  ------------------
  304|  29.7k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 25.9k, False: 3.75k]
  ------------------
  305|  25.9k|          p_[axes_[j]] = 0;
  306|  25.9k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  25.9k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 4.98k, False: 20.9k]
  ------------------
  308|  4.98k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 33, False: 4.95k]
  ------------------
  309|  4.98k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     33|              return false;
  311|     33|            }
  312|  4.98k|          }
  313|  25.9k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  25.9k|        }
  315|  3.75k|        *oit = p_;
  316|  3.75k|        ++oit;
  317|  3.75k|        ++num_decoded_points_;
  318|  3.75k|      }
  319|  2.13k|      continue;
  320|  2.17k|    }
  321|       |
  322|  2.89M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 2.89M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  2.89M|    const int num_remaining_bits = bit_length_ - level;
  327|  2.89M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  2.89M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  2.89M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  2.89M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  2.89M|    uint32_t number = 0;
  334|  2.89M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  2.89M|    uint32_t first_half = num_remaining_points / 2;
  337|  2.89M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 25, False: 2.89M]
  ------------------
  338|       |      // Invalid |number|.
  339|     25|      return false;
  340|     25|    }
  341|  2.89M|    first_half -= number;
  342|  2.89M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  2.89M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.55M, False: 1.33M]
  ------------------
  345|  1.55M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.55M, False: 4.53k]
  ------------------
  346|  1.55M|        std::swap(first_half, second_half);
  347|  1.55M|      }
  348|  1.55M|    }
  349|       |
  350|  2.89M|    levels_stack_[stack_pos][axis] += 1;
  351|  2.89M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  2.89M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 2.89M, False: 64]
  ------------------
  353|  2.89M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  2.89M|    }
  355|  2.89M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.89M, False: 392]
  ------------------
  356|  2.89M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.89M|    }
  358|  2.89M|  }
  359|     22|  return true;
  360|     80|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  134|  7.68M|        : num_remaining_points(num_remaining_points_),
  135|  7.68M|          last_axis(last_axis_),
  136|  7.68M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  7.68M|    uint32_t last_axis) {
  232|  7.68M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 7.68M, Folded]
  ------------------
  233|  7.68M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  7.68M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 5.92M, False: 1.76M]
  |  |  ------------------
  ------------------
  234|  7.68M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  7.68M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  3.84M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  3.84M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  3.84M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|     38|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    186|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    186|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 5, False: 181]
  ------------------
  187|      5|    return false;
  188|      5|  }
  189|    181|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 17, False: 164]
  ------------------
  190|     17|    return false;
  191|     17|  }
  192|    164|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 163]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    163|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 19, False: 144]
  ------------------
  196|     19|    return true;
  197|     19|  }
  198|    144|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 13, False: 131]
  ------------------
  199|     13|    return false;
  200|     13|  }
  201|    131|  num_decoded_points_ = 0;
  202|       |
  203|    131|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 26, False: 105]
  ------------------
  204|     26|    return false;
  205|     26|  }
  206|    105|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 11, False: 94]
  ------------------
  207|     11|    return false;
  208|     11|  }
  209|     94|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 93]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     93|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 5, False: 88]
  ------------------
  213|      5|    return false;
  214|      5|  }
  215|       |
  216|     88|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 81, False: 7]
  ------------------
  217|     81|    return false;
  218|     81|  }
  219|       |
  220|      7|  numbers_decoder_.EndDecoding();
  221|      7|  remaining_bits_decoder_.EndDecoding();
  222|      7|  axis_decoder_.EndDecoding();
  223|      7|  half_decoder_.EndDecoding();
  224|       |
  225|      7|  return true;
  226|     88|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     88|    uint32_t num_points, OutputIteratorT &oit) {
  254|     88|  typedef DecodingStatus Status;
  255|     88|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     88|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     88|  DecodingStatus init_status(num_points, 0, 0);
  258|     88|  std::stack<Status> status_stack;
  259|     88|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  44.0k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 44.0k, False: 7]
  ------------------
  263|  44.0k|    const DecodingStatus status = status_stack.top();
  264|  44.0k|    status_stack.pop();
  265|       |
  266|  44.0k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  44.0k|    const uint32_t last_axis = status.last_axis;
  268|  44.0k|    const uint32_t stack_pos = status.stack_pos;
  269|  44.0k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  44.0k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  44.0k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 44.0k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  44.0k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  44.0k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 44.0k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  44.0k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  44.0k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 5.21k, False: 38.8k]
  ------------------
  285|  3.91G|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 3.91G, False: 5.21k]
  ------------------
  286|  3.91G|        *oit = old_base;
  287|  3.91G|        ++oit;
  288|  3.91G|        ++num_decoded_points_;
  289|  3.91G|      }
  290|  5.21k|      continue;
  291|  5.21k|    }
  292|       |
  293|  38.8k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  38.8k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 2.30k, False: 36.4k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  2.30k|      axes_[0] = axis;
  300|  5.22k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.91k, False: 2.30k]
  ------------------
  301|  2.91k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.91k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 512, False: 2.40k]
  |  |  ------------------
  ------------------
  302|  2.91k|      }
  303|  6.10k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.82k, False: 2.28k]
  ------------------
  304|  12.3k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 8.52k, False: 3.80k]
  ------------------
  305|  8.52k|          p_[axes_[j]] = 0;
  306|  8.52k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  8.52k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 6.58k, False: 1.94k]
  ------------------
  308|  6.58k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 23, False: 6.55k]
  ------------------
  309|  6.58k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     23|              return false;
  311|     23|            }
  312|  6.58k|          }
  313|  8.50k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  8.50k|        }
  315|  3.80k|        *oit = p_;
  316|  3.80k|        ++oit;
  317|  3.80k|        ++num_decoded_points_;
  318|  3.80k|      }
  319|  2.28k|      continue;
  320|  2.30k|    }
  321|       |
  322|  36.4k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 36.4k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  36.4k|    const int num_remaining_bits = bit_length_ - level;
  327|  36.4k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  36.4k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  36.4k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  36.4k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  36.4k|    uint32_t number = 0;
  334|  36.4k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  36.4k|    uint32_t first_half = num_remaining_points / 2;
  337|  36.4k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 58, False: 36.4k]
  ------------------
  338|       |      // Invalid |number|.
  339|     58|      return false;
  340|     58|    }
  341|  36.4k|    first_half -= number;
  342|  36.4k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  36.4k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 33.1k, False: 3.33k]
  ------------------
  345|  33.1k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 30.1k, False: 2.95k]
  ------------------
  346|  30.1k|        std::swap(first_half, second_half);
  347|  30.1k|      }
  348|  33.1k|    }
  349|       |
  350|  36.4k|    levels_stack_[stack_pos][axis] += 1;
  351|  36.4k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  36.4k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 34.8k, False: 1.56k]
  ------------------
  353|  34.8k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  34.8k|    }
  355|  36.4k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 10.1k, False: 26.2k]
  ------------------
  356|  10.1k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  10.1k|    }
  358|  36.4k|  }
  359|      7|  return true;
  360|     88|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  134|  8.51M|        : num_remaining_points(num_remaining_points_),
  135|  8.51M|          last_axis(last_axis_),
  136|  8.51M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  127|  4.27M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  4.27M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  4.27M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  118|     18|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|    285|      : bit_length_(0),
   87|    285|        num_points_(0),
   88|    285|        num_decoded_points_(0),
   89|    285|        dimension_(dimension),
   90|    285|        p_(dimension, 0),
   91|    285|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    285|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    285|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    163|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    163|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 2, False: 161]
  ------------------
  187|      2|    return false;
  188|      2|  }
  189|    161|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 11, False: 150]
  ------------------
  190|     11|    return false;
  191|     11|  }
  192|    150|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 149]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    149|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 17, False: 132]
  ------------------
  196|     17|    return true;
  197|     17|  }
  198|    132|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 10, False: 122]
  ------------------
  199|     10|    return false;
  200|     10|  }
  201|    122|  num_decoded_points_ = 0;
  202|       |
  203|    122|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 17, False: 105]
  ------------------
  204|     17|    return false;
  205|     17|  }
  206|    105|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 5, False: 100]
  ------------------
  207|      5|    return false;
  208|      5|  }
  209|    100|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 9, False: 91]
  ------------------
  210|      9|    return false;
  211|      9|  }
  212|     91|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 89]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     89|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 81, False: 8]
  ------------------
  217|     81|    return false;
  218|     81|  }
  219|       |
  220|      8|  numbers_decoder_.EndDecoding();
  221|      8|  remaining_bits_decoder_.EndDecoding();
  222|      8|  axis_decoder_.EndDecoding();
  223|      8|  half_decoder_.EndDecoding();
  224|       |
  225|      8|  return true;
  226|     89|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     89|    uint32_t num_points, OutputIteratorT &oit) {
  254|     89|  typedef DecodingStatus Status;
  255|     89|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     89|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     89|  DecodingStatus init_status(num_points, 0, 0);
  258|     89|  std::stack<Status> status_stack;
  259|     89|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  26.3k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 26.3k, False: 8]
  ------------------
  263|  26.3k|    const DecodingStatus status = status_stack.top();
  264|  26.3k|    status_stack.pop();
  265|       |
  266|  26.3k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  26.3k|    const uint32_t last_axis = status.last_axis;
  268|  26.3k|    const uint32_t stack_pos = status.stack_pos;
  269|  26.3k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  26.3k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  26.3k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 26.3k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  26.3k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  26.3k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 26.3k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  26.3k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  26.3k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 4.89k, False: 21.4k]
  ------------------
  285|  43.3M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 43.3M, False: 4.89k]
  ------------------
  286|  43.3M|        *oit = old_base;
  287|  43.3M|        ++oit;
  288|  43.3M|        ++num_decoded_points_;
  289|  43.3M|      }
  290|  4.89k|      continue;
  291|  4.89k|    }
  292|       |
  293|  21.4k|    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.4k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.61k, False: 19.8k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.61k|      axes_[0] = axis;
  300|  4.29k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.67k, False: 1.61k]
  ------------------
  301|  2.67k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.67k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 513, False: 2.16k]
  |  |  ------------------
  ------------------
  302|  2.67k|      }
  303|  4.35k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.77k, False: 1.58k]
  ------------------
  304|  10.0k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 7.32k, False: 2.74k]
  ------------------
  305|  7.32k|          p_[axes_[j]] = 0;
  306|  7.32k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  7.32k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 4.51k, False: 2.80k]
  ------------------
  308|  4.51k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 28, False: 4.49k]
  ------------------
  309|  4.51k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     28|              return false;
  311|     28|            }
  312|  4.51k|          }
  313|  7.29k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  7.29k|        }
  315|  2.74k|        *oit = p_;
  316|  2.74k|        ++oit;
  317|  2.74k|        ++num_decoded_points_;
  318|  2.74k|      }
  319|  1.58k|      continue;
  320|  1.61k|    }
  321|       |
  322|  19.8k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 19.8k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  19.8k|    const int num_remaining_bits = bit_length_ - level;
  327|  19.8k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  19.8k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  19.8k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  19.8k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  19.8k|    uint32_t number = 0;
  334|  19.8k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  19.8k|    uint32_t first_half = num_remaining_points / 2;
  337|  19.8k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 53, False: 19.7k]
  ------------------
  338|       |      // Invalid |number|.
  339|     53|      return false;
  340|     53|    }
  341|  19.7k|    first_half -= number;
  342|  19.7k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  19.7k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 16.6k, False: 3.13k]
  ------------------
  345|  16.6k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 12.8k, False: 3.78k]
  ------------------
  346|  12.8k|        std::swap(first_half, second_half);
  347|  12.8k|      }
  348|  16.6k|    }
  349|       |
  350|  19.7k|    levels_stack_[stack_pos][axis] += 1;
  351|  19.7k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  19.7k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 16.8k, False: 2.92k]
  ------------------
  353|  16.8k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  16.8k|    }
  355|  19.7k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 10.2k, False: 9.48k]
  ------------------
  356|  10.2k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  10.2k|    }
  358|  19.7k|  }
  359|      8|  return true;
  360|     89|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  134|  8.43M|        : num_remaining_points(num_remaining_points_),
  135|  8.43M|          last_axis(last_axis_),
  136|  8.43M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  8.43M|    uint32_t last_axis) {
  232|  8.43M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 8.43M, Folded]
  ------------------
  233|  8.43M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  8.43M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.40M, False: 6.02M]
  |  |  ------------------
  ------------------
  234|  8.43M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  8.43M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  127|  4.22M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  4.22M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  4.22M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  118|     17|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    164|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    164|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 161]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|    161|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 12, False: 149]
  ------------------
  190|     12|    return false;
  191|     12|  }
  192|    149|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 148]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    148|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 14, False: 134]
  ------------------
  196|     14|    return true;
  197|     14|  }
  198|    134|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 21, False: 113]
  ------------------
  199|     21|    return false;
  200|     21|  }
  201|    113|  num_decoded_points_ = 0;
  202|       |
  203|    113|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 16, False: 97]
  ------------------
  204|     16|    return false;
  205|     16|  }
  206|     97|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 96]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     96|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 95]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     95|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 94]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     94|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 40, False: 54]
  ------------------
  217|     40|    return false;
  218|     40|  }
  219|       |
  220|     54|  numbers_decoder_.EndDecoding();
  221|     54|  remaining_bits_decoder_.EndDecoding();
  222|     54|  axis_decoder_.EndDecoding();
  223|     54|  half_decoder_.EndDecoding();
  224|       |
  225|     54|  return true;
  226|     94|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     94|    uint32_t num_points, OutputIteratorT &oit) {
  254|     94|  typedef DecodingStatus Status;
  255|     94|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     94|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     94|  DecodingStatus init_status(num_points, 0, 0);
  258|     94|  std::stack<Status> status_stack;
  259|     94|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.92M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.92M, False: 54]
  ------------------
  263|  1.92M|    const DecodingStatus status = status_stack.top();
  264|  1.92M|    status_stack.pop();
  265|       |
  266|  1.92M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.92M|    const uint32_t last_axis = status.last_axis;
  268|  1.92M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.92M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.92M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.92M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.92M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.92M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.92M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.92M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.92M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.92M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 852k, False: 1.07M]
  ------------------
  285|  86.2M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 85.3M, False: 852k]
  ------------------
  286|  85.3M|        *oit = old_base;
  287|  85.3M|        ++oit;
  288|  85.3M|        ++num_decoded_points_;
  289|  85.3M|      }
  290|   852k|      continue;
  291|   852k|    }
  292|       |
  293|  1.07M|    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.07M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 74.0k, False: 1.00M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  74.0k|      axes_[0] = axis;
  300|   121k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 47.8k, False: 74.0k]
  ------------------
  301|  47.8k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  47.8k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 15.6k, False: 32.2k]
  |  |  ------------------
  ------------------
  302|  47.8k|      }
  303|   187k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 113k, False: 74.0k]
  ------------------
  304|   292k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 178k, False: 113k]
  ------------------
  305|   178k|          p_[axes_[j]] = 0;
  306|   178k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   178k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 152k, False: 25.9k]
  ------------------
  308|   152k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 34, False: 152k]
  ------------------
  309|   152k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     34|              return false;
  311|     34|            }
  312|   152k|          }
  313|   178k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   178k|        }
  315|   113k|        *oit = p_;
  316|   113k|        ++oit;
  317|   113k|        ++num_decoded_points_;
  318|   113k|      }
  319|  74.0k|      continue;
  320|  74.0k|    }
  321|       |
  322|  1.00M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.00M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.00M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.00M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.00M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.00M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.00M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.00M|    uint32_t number = 0;
  334|  1.00M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.00M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.00M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 6, False: 1.00M]
  ------------------
  338|       |      // Invalid |number|.
  339|      6|      return false;
  340|      6|    }
  341|  1.00M|    first_half -= number;
  342|  1.00M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.00M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 951k, False: 49.1k]
  ------------------
  345|   951k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 909k, False: 41.3k]
  ------------------
  346|   909k|        std::swap(first_half, second_half);
  347|   909k|      }
  348|   951k|    }
  349|       |
  350|  1.00M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.00M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.00M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 986k, False: 13.2k]
  ------------------
  353|   986k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   986k|    }
  355|  1.00M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 940k, False: 60.0k]
  ------------------
  356|   940k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   940k|    }
  358|  1.00M|  }
  359|     54|  return true;
  360|     94|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  134|  1.92M|        : num_remaining_points(num_remaining_points_),
  135|  1.92M|          last_axis(last_axis_),
  136|  1.92M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|  1.00M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.00M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.00M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     67|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|    221|      : bit_length_(0),
   87|    221|        num_points_(0),
   88|    221|        num_decoded_points_(0),
   89|    221|        dimension_(dimension),
   90|    221|        p_(dimension, 0),
   91|    221|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    221|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    221|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    162|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    162|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 159]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|    159|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 10, False: 149]
  ------------------
  190|     10|    return false;
  191|     10|  }
  192|    149|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 147]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|    147|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 2, False: 145]
  ------------------
  196|      2|    return true;
  197|      2|  }
  198|    145|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 15, False: 130]
  ------------------
  199|     15|    return false;
  200|     15|  }
  201|    130|  num_decoded_points_ = 0;
  202|       |
  203|    130|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 26, False: 104]
  ------------------
  204|     26|    return false;
  205|     26|  }
  206|    104|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 101]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|    101|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 6, False: 95]
  ------------------
  210|      6|    return false;
  211|      6|  }
  212|     95|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 93]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     93|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 56, False: 37]
  ------------------
  217|     56|    return false;
  218|     56|  }
  219|       |
  220|     37|  numbers_decoder_.EndDecoding();
  221|     37|  remaining_bits_decoder_.EndDecoding();
  222|     37|  axis_decoder_.EndDecoding();
  223|     37|  half_decoder_.EndDecoding();
  224|       |
  225|     37|  return true;
  226|     93|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     93|    uint32_t num_points, OutputIteratorT &oit) {
  254|     93|  typedef DecodingStatus Status;
  255|     93|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     93|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     93|  DecodingStatus init_status(num_points, 0, 0);
  258|     93|  std::stack<Status> status_stack;
  259|     93|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.59M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.59M, False: 37]
  ------------------
  263|  2.59M|    const DecodingStatus status = status_stack.top();
  264|  2.59M|    status_stack.pop();
  265|       |
  266|  2.59M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.59M|    const uint32_t last_axis = status.last_axis;
  268|  2.59M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.59M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.59M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.59M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.59M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.59M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.59M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.59M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.59M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.59M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.12M, False: 1.46M]
  ------------------
  285|   128M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 126M, False: 1.12M]
  ------------------
  286|   126M|        *oit = old_base;
  287|   126M|        ++oit;
  288|   126M|        ++num_decoded_points_;
  289|   126M|      }
  290|  1.12M|      continue;
  291|  1.12M|    }
  292|       |
  293|  1.46M|    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.46M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 80.6k, False: 1.38M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  80.6k|      axes_[0] = axis;
  300|   226k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 145k, False: 80.6k]
  ------------------
  301|   145k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   145k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 12.8k, False: 133k]
  |  |  ------------------
  ------------------
  302|   145k|      }
  303|   194k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 113k, False: 80.5k]
  ------------------
  304|   472k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 358k, False: 113k]
  ------------------
  305|   358k|          p_[axes_[j]] = 0;
  306|   358k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   358k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 145k, False: 212k]
  ------------------
  308|   145k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 55, False: 145k]
  ------------------
  309|   145k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     55|              return false;
  311|     55|            }
  312|   145k|          }
  313|   358k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   358k|        }
  315|   113k|        *oit = p_;
  316|   113k|        ++oit;
  317|   113k|        ++num_decoded_points_;
  318|   113k|      }
  319|  80.5k|      continue;
  320|  80.6k|    }
  321|       |
  322|  1.38M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.38M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.38M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.38M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.38M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.38M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.38M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.38M|    uint32_t number = 0;
  334|  1.38M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.38M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.38M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 1.38M]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|  1.38M|    first_half -= number;
  342|  1.38M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.38M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.36M, False: 22.5k]
  ------------------
  345|  1.36M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.29M, False: 67.4k]
  ------------------
  346|  1.29M|        std::swap(first_half, second_half);
  347|  1.29M|      }
  348|  1.36M|    }
  349|       |
  350|  1.38M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.38M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.38M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.35M, False: 37.2k]
  ------------------
  353|  1.35M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.35M|    }
  355|  1.38M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.24M, False: 144k]
  ------------------
  356|  1.24M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.24M|    }
  358|  1.38M|  }
  359|     37|  return true;
  360|     93|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  134|  2.59M|        : num_remaining_points(num_remaining_points_),
  135|  2.59M|          last_axis(last_axis_),
  136|  2.59M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.59M|    uint32_t last_axis) {
  232|  2.59M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.59M, Folded]
  ------------------
  233|  2.59M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.59M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 980k, False: 1.61M]
  |  |  ------------------
  ------------------
  234|  2.59M|  }
  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.59M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|  1.38M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.38M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.38M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     39|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    142|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    142|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 4, False: 138]
  ------------------
  187|      4|    return false;
  188|      4|  }
  189|    138|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 6, False: 132]
  ------------------
  190|      6|    return false;
  191|      6|  }
  192|    132|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 4, False: 128]
  ------------------
  193|      4|    return false;
  194|      4|  }
  195|    128|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 39, False: 89]
  ------------------
  196|     39|    return true;
  197|     39|  }
  198|     89|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 12, False: 77]
  ------------------
  199|     12|    return false;
  200|     12|  }
  201|     77|  num_decoded_points_ = 0;
  202|       |
  203|     77|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 35, False: 42]
  ------------------
  204|     35|    return false;
  205|     35|  }
  206|     42|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 40]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     40|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 37]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     37|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 4, False: 33]
  ------------------
  213|      4|    return false;
  214|      4|  }
  215|       |
  216|     33|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 22, False: 11]
  ------------------
  217|     22|    return false;
  218|     22|  }
  219|       |
  220|     11|  numbers_decoder_.EndDecoding();
  221|     11|  remaining_bits_decoder_.EndDecoding();
  222|     11|  axis_decoder_.EndDecoding();
  223|     11|  half_decoder_.EndDecoding();
  224|       |
  225|     11|  return true;
  226|     33|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     33|    uint32_t num_points, OutputIteratorT &oit) {
  254|     33|  typedef DecodingStatus Status;
  255|     33|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     33|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     33|  DecodingStatus init_status(num_points, 0, 0);
  258|     33|  std::stack<Status> status_stack;
  259|     33|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  87.3k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 87.3k, False: 11]
  ------------------
  263|  87.3k|    const DecodingStatus status = status_stack.top();
  264|  87.3k|    status_stack.pop();
  265|       |
  266|  87.3k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  87.3k|    const uint32_t last_axis = status.last_axis;
  268|  87.3k|    const uint32_t stack_pos = status.stack_pos;
  269|  87.3k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  87.3k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  87.3k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 87.3k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  87.3k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  87.3k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 7, False: 87.3k]
  ------------------
  278|      7|      return false;
  279|      7|    }
  280|       |
  281|  87.3k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  87.3k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 75, False: 87.2k]
  ------------------
  285|  1.07M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 1.07M, False: 75]
  ------------------
  286|  1.07M|        *oit = old_base;
  287|  1.07M|        ++oit;
  288|  1.07M|        ++num_decoded_points_;
  289|  1.07M|      }
  290|     75|      continue;
  291|     75|    }
  292|       |
  293|  87.2k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  87.2k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 118, False: 87.1k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    118|      axes_[0] = axis;
  300|  6.35k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 6.23k, False: 118]
  ------------------
  301|  6.23k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  6.23k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 95, False: 6.14k]
  |  |  ------------------
  ------------------
  302|  6.23k|      }
  303|    273|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 162, False: 111]
  ------------------
  304|  8.22k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 8.07k, False: 155]
  ------------------
  305|  8.07k|          p_[axes_[j]] = 0;
  306|  8.07k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  8.07k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 7.76k, False: 312]
  ------------------
  308|  7.76k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 7, False: 7.75k]
  ------------------
  309|  7.76k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      7|              return false;
  311|      7|            }
  312|  7.76k|          }
  313|  8.06k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  8.06k|        }
  315|    155|        *oit = p_;
  316|    155|        ++oit;
  317|    155|        ++num_decoded_points_;
  318|    155|      }
  319|    111|      continue;
  320|    118|    }
  321|       |
  322|  87.1k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 87.1k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  87.1k|    const int num_remaining_bits = bit_length_ - level;
  327|  87.1k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  87.1k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  87.1k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  87.1k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  87.1k|    uint32_t number = 0;
  334|  87.1k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  87.1k|    uint32_t first_half = num_remaining_points / 2;
  337|  87.1k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 8, False: 87.1k]
  ------------------
  338|       |      // Invalid |number|.
  339|      8|      return false;
  340|      8|    }
  341|  87.1k|    first_half -= number;
  342|  87.1k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  87.1k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 87.1k, False: 15]
  ------------------
  345|  87.1k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 74.5k, False: 12.6k]
  ------------------
  346|  74.5k|        std::swap(first_half, second_half);
  347|  74.5k|      }
  348|  87.1k|    }
  349|       |
  350|  87.1k|    levels_stack_[stack_pos][axis] += 1;
  351|  87.1k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  87.1k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 74.5k, False: 12.5k]
  ------------------
  353|  74.5k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  74.5k|    }
  355|  87.1k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 12.7k, False: 74.3k]
  ------------------
  356|  12.7k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  12.7k|    }
  358|  87.1k|  }
  359|     11|  return true;
  360|     33|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  134|  87.3k|        : num_remaining_points(num_remaining_points_),
  135|  87.3k|          last_axis(last_axis_),
  136|  87.3k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|  87.1k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  87.1k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  87.1k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     49|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|    155|      : bit_length_(0),
   87|    155|        num_points_(0),
   88|    155|        num_decoded_points_(0),
   89|    155|        dimension_(dimension),
   90|    155|        p_(dimension, 0),
   91|    155|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    155|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    155|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|    116|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    116|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    116|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|    287|      : bit_length_(0),
   87|    287|        num_points_(0),
   88|    287|        num_decoded_points_(0),
   89|    287|        dimension_(dimension),
   90|    287|        p_(dimension, 0),
   91|    287|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    287|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    287|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|    118|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    118|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    118|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|    131|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    131|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    131|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|    282|      : bit_length_(0),
   87|    282|        num_points_(0),
   88|    282|        num_decoded_points_(0),
   89|    282|        dimension_(dimension),
   90|    282|        p_(dimension, 0),
   91|    282|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    282|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    282|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|    108|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    108|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    108|}
_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|    191|      : bit_length_(0),
   87|    191|        num_points_(0),
   88|    191|        num_decoded_points_(0),
   89|    191|        dimension_(dimension),
   90|    191|        p_(dimension, 0),
   91|    191|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    191|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    191|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      2|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      2|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      4|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      4|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      4|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  4.03M|    uint32_t last_axis) {
  232|  4.03M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 4.03M, Folded]
  ------------------
  233|  4.03M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.03M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 3.40M, False: 631k]
  |  |  ------------------
  ------------------
  234|  4.03M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  4.03M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  8.51M|    uint32_t last_axis) {
  232|  8.51M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 8.51M, Folded]
  ------------------
  233|  8.51M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  8.51M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.42M, False: 6.08M]
  |  |  ------------------
  ------------------
  234|  8.51M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  8.51M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  1.92M|    uint32_t last_axis) {
  232|  1.92M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 1.92M, Folded]
  ------------------
  233|  1.92M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  1.92M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.70M, False: 221k]
  |  |  ------------------
  ------------------
  234|  1.92M|  }
  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.92M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  87.3k|    uint32_t last_axis) {
  232|  87.3k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded, False: 87.3k]
  ------------------
  233|      0|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|      0|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  234|      0|  }
  235|       |
  236|  87.3k|  uint32_t best_axis = 0;
  237|  87.3k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 87.2k, False: 64]
  ------------------
  238|  12.0M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 11.9M, False: 87.2k]
  ------------------
  239|  11.9M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 86.2k, False: 11.8M]
  ------------------
  240|  86.2k|        best_axis = axis;
  241|  86.2k|      }
  242|  11.9M|    }
  243|  87.2k|  } else {
  244|     64|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|     64|  }
  246|       |
  247|  87.3k|  return best_axis;
  248|  87.3k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|    113|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    113|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    113|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|    113|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    113|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 4, False: 109]
  ------------------
  187|      4|    return false;
  188|      4|  }
  189|    109|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 12, False: 97]
  ------------------
  190|     12|    return false;
  191|     12|  }
  192|     97|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 96]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     96|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 95]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     95|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 95]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     95|  num_decoded_points_ = 0;
  202|       |
  203|     95|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 29, False: 66]
  ------------------
  204|     29|    return false;
  205|     29|  }
  206|     66|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 6, False: 60]
  ------------------
  207|      6|    return false;
  208|      6|  }
  209|     60|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 58]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     58|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 56]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     56|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 42, False: 14]
  ------------------
  217|     42|    return false;
  218|     42|  }
  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|     56|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     56|    uint32_t num_points, OutputIteratorT &oit) {
  254|     56|  typedef DecodingStatus Status;
  255|     56|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     56|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     56|  DecodingStatus init_status(num_points, 0, 0);
  258|     56|  std::stack<Status> status_stack;
  259|     56|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   854k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 854k, False: 14]
  ------------------
  263|   854k|    const DecodingStatus status = status_stack.top();
  264|   854k|    status_stack.pop();
  265|       |
  266|   854k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   854k|    const uint32_t last_axis = status.last_axis;
  268|   854k|    const uint32_t stack_pos = status.stack_pos;
  269|   854k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   854k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   854k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 854k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   854k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   854k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 854k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   854k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   854k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 426k, False: 428k]
  ------------------
  285|  80.7M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 80.3M, False: 426k]
  ------------------
  286|  80.3M|        *oit = old_base;
  287|  80.3M|        ++oit;
  288|  80.3M|        ++num_decoded_points_;
  289|  80.3M|      }
  290|   426k|      continue;
  291|   426k|    }
  292|       |
  293|   428k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   428k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 581, False: 427k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    581|      axes_[0] = axis;
  300|  1.74k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.16k, False: 581]
  ------------------
  301|  1.16k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.16k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 244, False: 918]
  |  |  ------------------
  ------------------
  302|  1.16k|      }
  303|  1.52k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 971, False: 558]
  ------------------
  304|  3.82k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 2.88k, False: 948]
  ------------------
  305|  2.88k|          p_[axes_[j]] = 0;
  306|  2.88k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  2.88k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.64k, False: 1.23k]
  ------------------
  308|  1.64k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 23, False: 1.61k]
  ------------------
  309|  1.64k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     23|              return false;
  311|     23|            }
  312|  1.64k|          }
  313|  2.85k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  2.85k|        }
  315|    948|        *oit = p_;
  316|    948|        ++oit;
  317|    948|        ++num_decoded_points_;
  318|    948|      }
  319|    558|      continue;
  320|    581|    }
  321|       |
  322|   427k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 427k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   427k|    const int num_remaining_bits = bit_length_ - level;
  327|   427k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   427k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   427k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   427k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   427k|    uint32_t number = 0;
  334|   427k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   427k|    uint32_t first_half = num_remaining_points / 2;
  337|   427k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 19, False: 427k]
  ------------------
  338|       |      // Invalid |number|.
  339|     19|      return false;
  340|     19|    }
  341|   427k|    first_half -= number;
  342|   427k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   427k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 223k, False: 204k]
  ------------------
  345|   223k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 222k, False: 808]
  ------------------
  346|   222k|        std::swap(first_half, second_half);
  347|   222k|      }
  348|   223k|    }
  349|       |
  350|   427k|    levels_stack_[stack_pos][axis] += 1;
  351|   427k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   427k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 427k, False: 37]
  ------------------
  353|   427k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   427k|    }
  355|   427k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 427k, False: 73]
  ------------------
  356|   427k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   427k|    }
  358|   427k|  }
  359|     14|  return true;
  360|     56|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     89|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     89|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     89|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     89|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     89|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 88]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     88|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 11, False: 77]
  ------------------
  190|     11|    return false;
  191|     11|  }
  192|     77|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 76]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     76|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 75]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     75|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 75]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     75|  num_decoded_points_ = 0;
  202|       |
  203|     75|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 14, False: 61]
  ------------------
  204|     14|    return false;
  205|     14|  }
  206|     61|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 59]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     59|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 57]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     57|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 54]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|       |
  216|     54|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 42, False: 12]
  ------------------
  217|     42|    return false;
  218|     42|  }
  219|       |
  220|     12|  numbers_decoder_.EndDecoding();
  221|     12|  remaining_bits_decoder_.EndDecoding();
  222|     12|  axis_decoder_.EndDecoding();
  223|     12|  half_decoder_.EndDecoding();
  224|       |
  225|     12|  return true;
  226|     54|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     54|    uint32_t num_points, OutputIteratorT &oit) {
  254|     54|  typedef DecodingStatus Status;
  255|     54|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     54|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     54|  DecodingStatus init_status(num_points, 0, 0);
  258|     54|  std::stack<Status> status_stack;
  259|     54|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.89M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.89M, False: 12]
  ------------------
  263|  1.89M|    const DecodingStatus status = status_stack.top();
  264|  1.89M|    status_stack.pop();
  265|       |
  266|  1.89M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.89M|    const uint32_t last_axis = status.last_axis;
  268|  1.89M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.89M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.89M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.89M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.89M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.89M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.89M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.89M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.89M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.89M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 945k, False: 948k]
  ------------------
  285|  97.2M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 96.2M, False: 945k]
  ------------------
  286|  96.2M|        *oit = old_base;
  287|  96.2M|        ++oit;
  288|  96.2M|        ++num_decoded_points_;
  289|  96.2M|      }
  290|   945k|      continue;
  291|   945k|    }
  292|       |
  293|   948k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   948k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 989, False: 947k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    989|      axes_[0] = axis;
  300|  2.96k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.97k, False: 989]
  ------------------
  301|  1.97k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.97k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 247, False: 1.73k]
  |  |  ------------------
  ------------------
  302|  1.97k|      }
  303|  2.59k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.63k, False: 960]
  ------------------
  304|  6.44k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 4.84k, False: 1.60k]
  ------------------
  305|  4.84k|          p_[axes_[j]] = 0;
  306|  4.84k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  4.84k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.50k, False: 2.34k]
  ------------------
  308|  2.50k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 29, False: 2.47k]
  ------------------
  309|  2.50k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     29|              return false;
  311|     29|            }
  312|  2.50k|          }
  313|  4.81k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  4.81k|        }
  315|  1.60k|        *oit = p_;
  316|  1.60k|        ++oit;
  317|  1.60k|        ++num_decoded_points_;
  318|  1.60k|      }
  319|    960|      continue;
  320|    989|    }
  321|       |
  322|   947k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 947k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   947k|    const int num_remaining_bits = bit_length_ - level;
  327|   947k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   947k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   947k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   947k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   947k|    uint32_t number = 0;
  334|   947k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   947k|    uint32_t first_half = num_remaining_points / 2;
  337|   947k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 13, False: 947k]
  ------------------
  338|       |      // Invalid |number|.
  339|     13|      return false;
  340|     13|    }
  341|   947k|    first_half -= number;
  342|   947k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   947k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 486k, False: 460k]
  ------------------
  345|   486k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 486k, False: 535]
  ------------------
  346|   486k|        std::swap(first_half, second_half);
  347|   486k|      }
  348|   486k|    }
  349|       |
  350|   947k|    levels_stack_[stack_pos][axis] += 1;
  351|   947k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   947k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 947k, False: 16]
  ------------------
  353|   947k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   947k|    }
  355|   947k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 947k, False: 52]
  ------------------
  356|   947k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   947k|    }
  358|   947k|  }
  359|     12|  return true;
  360|     54|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     99|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     99|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     99|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     99|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     99|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 98]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     98|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 7, False: 91]
  ------------------
  190|      7|    return false;
  191|      7|  }
  192|     91|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 90]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     90|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 89]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     89|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 89]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     89|  num_decoded_points_ = 0;
  202|       |
  203|     89|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 32, False: 57]
  ------------------
  204|     32|    return false;
  205|     32|  }
  206|     57|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 53]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     53|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 52]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     52|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 51]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     51|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 46, False: 5]
  ------------------
  217|     46|    return false;
  218|     46|  }
  219|       |
  220|      5|  numbers_decoder_.EndDecoding();
  221|      5|  remaining_bits_decoder_.EndDecoding();
  222|      5|  axis_decoder_.EndDecoding();
  223|      5|  half_decoder_.EndDecoding();
  224|       |
  225|      5|  return true;
  226|     51|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     51|    uint32_t num_points, OutputIteratorT &oit) {
  254|     51|  typedef DecodingStatus Status;
  255|     51|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     51|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     51|  DecodingStatus init_status(num_points, 0, 0);
  258|     51|  std::stack<Status> status_stack;
  259|     51|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  8.46M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 8.46M, False: 5]
  ------------------
  263|  8.46M|    const DecodingStatus status = status_stack.top();
  264|  8.46M|    status_stack.pop();
  265|       |
  266|  8.46M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  8.46M|    const uint32_t last_axis = status.last_axis;
  268|  8.46M|    const uint32_t stack_pos = status.stack_pos;
  269|  8.46M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  8.46M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  8.46M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 8.46M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  8.46M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  8.46M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 8.46M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  8.46M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  8.46M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 4.23M, False: 4.23M]
  ------------------
  285|  48.4M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 44.2M, False: 4.23M]
  ------------------
  286|  44.2M|        *oit = old_base;
  287|  44.2M|        ++oit;
  288|  44.2M|        ++num_decoded_points_;
  289|  44.2M|      }
  290|  4.23M|      continue;
  291|  4.23M|    }
  292|       |
  293|  4.23M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  4.23M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 391, False: 4.23M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    391|      axes_[0] = axis;
  300|  1.17k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 782, False: 391]
  ------------------
  301|    782|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    782|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 179, False: 603]
  |  |  ------------------
  ------------------
  302|    782|      }
  303|  1.03k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 659, False: 380]
  ------------------
  304|  2.61k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 1.96k, False: 648]
  ------------------
  305|  1.96k|          p_[axes_[j]] = 0;
  306|  1.96k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  1.96k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.33k, False: 628]
  ------------------
  308|  1.33k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 11, False: 1.32k]
  ------------------
  309|  1.33k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     11|              return false;
  311|     11|            }
  312|  1.33k|          }
  313|  1.95k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  1.95k|        }
  315|    648|        *oit = p_;
  316|    648|        ++oit;
  317|    648|        ++num_decoded_points_;
  318|    648|      }
  319|    380|      continue;
  320|    391|    }
  321|       |
  322|  4.23M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 4.23M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  4.23M|    const int num_remaining_bits = bit_length_ - level;
  327|  4.23M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  4.23M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  4.23M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  4.23M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  4.23M|    uint32_t number = 0;
  334|  4.23M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  4.23M|    uint32_t first_half = num_remaining_points / 2;
  337|  4.23M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 35, False: 4.23M]
  ------------------
  338|       |      // Invalid |number|.
  339|     35|      return false;
  340|     35|    }
  341|  4.23M|    first_half -= number;
  342|  4.23M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  4.23M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 745k, False: 3.48M]
  ------------------
  345|   745k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 741k, False: 3.98k]
  ------------------
  346|   741k|        std::swap(first_half, second_half);
  347|   741k|      }
  348|   745k|    }
  349|       |
  350|  4.23M|    levels_stack_[stack_pos][axis] += 1;
  351|  4.23M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  4.23M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 4.23M, False: 60]
  ------------------
  353|  4.23M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  4.23M|    }
  355|  4.23M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 4.23M, False: 80]
  ------------------
  356|  4.23M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  4.23M|    }
  358|  4.23M|  }
  359|      5|  return true;
  360|     51|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|    119|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    119|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    119|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|    119|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    119|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 118]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    118|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 15, False: 103]
  ------------------
  190|     15|    return false;
  191|     15|  }
  192|    103|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 101]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|    101|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 100]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|    100|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 100]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|    100|  num_decoded_points_ = 0;
  202|       |
  203|    100|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 35, False: 65]
  ------------------
  204|     35|    return false;
  205|     35|  }
  206|     65|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 63]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     63|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 61]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     61|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 59]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     59|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 56, False: 3]
  ------------------
  217|     56|    return false;
  218|     56|  }
  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|     59|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  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|  8.40M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 8.40M, False: 3]
  ------------------
  263|  8.40M|    const DecodingStatus status = status_stack.top();
  264|  8.40M|    status_stack.pop();
  265|       |
  266|  8.40M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  8.40M|    const uint32_t last_axis = status.last_axis;
  268|  8.40M|    const uint32_t stack_pos = status.stack_pos;
  269|  8.40M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  8.40M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  8.40M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 8.40M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  8.40M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  8.40M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 8.40M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  8.40M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  8.40M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 4.20M, False: 4.20M]
  ------------------
  285|  44.8M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 40.6M, False: 4.20M]
  ------------------
  286|  40.6M|        *oit = old_base;
  287|  40.6M|        ++oit;
  288|  40.6M|        ++num_decoded_points_;
  289|  40.6M|      }
  290|  4.20M|      continue;
  291|  4.20M|    }
  292|       |
  293|  4.20M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  4.20M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 886, False: 4.20M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    886|      axes_[0] = axis;
  300|  2.65k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.77k, False: 886]
  ------------------
  301|  1.77k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.77k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 451, False: 1.32k]
  |  |  ------------------
  ------------------
  302|  1.77k|      }
  303|  2.40k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.52k, False: 872]
  ------------------
  304|  6.08k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 4.56k, False: 1.51k]
  ------------------
  305|  4.56k|          p_[axes_[j]] = 0;
  306|  4.56k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  4.56k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.84k, False: 725]
  ------------------
  308|  3.84k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 14, False: 3.83k]
  ------------------
  309|  3.84k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     14|              return false;
  311|     14|            }
  312|  3.84k|          }
  313|  4.55k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  4.55k|        }
  315|  1.51k|        *oit = p_;
  316|  1.51k|        ++oit;
  317|  1.51k|        ++num_decoded_points_;
  318|  1.51k|      }
  319|    872|      continue;
  320|    886|    }
  321|       |
  322|  4.20M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 4.20M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  4.20M|    const int num_remaining_bits = bit_length_ - level;
  327|  4.20M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  4.20M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  4.20M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  4.20M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  4.20M|    uint32_t number = 0;
  334|  4.20M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  4.20M|    uint32_t first_half = num_remaining_points / 2;
  337|  4.20M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 42, False: 4.20M]
  ------------------
  338|       |      // Invalid |number|.
  339|     42|      return false;
  340|     42|    }
  341|  4.20M|    first_half -= number;
  342|  4.20M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  4.20M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.25M, False: 2.95M]
  ------------------
  345|  1.25M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.24M, False: 1.07k]
  ------------------
  346|  1.24M|        std::swap(first_half, second_half);
  347|  1.24M|      }
  348|  1.25M|    }
  349|       |
  350|  4.20M|    levels_stack_[stack_pos][axis] += 1;
  351|  4.20M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  4.20M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 4.20M, False: 25]
  ------------------
  353|  4.20M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  4.20M|    }
  355|  4.20M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 4.20M, False: 68]
  ------------------
  356|  4.20M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  4.20M|    }
  358|  4.20M|  }
  359|      3|  return true;
  360|     59|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     57|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     57|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     57|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     57|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     57|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 2, False: 55]
  ------------------
  187|      2|    return false;
  188|      2|  }
  189|     55|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 12, False: 43]
  ------------------
  190|     12|    return false;
  191|     12|  }
  192|     43|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 42]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     42|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 6, False: 36]
  ------------------
  196|      6|    return true;
  197|      6|  }
  198|     36|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 36]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     36|  num_decoded_points_ = 0;
  202|       |
  203|     36|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 36, False: 0]
  ------------------
  204|     36|    return false;
  205|     36|  }
  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|     29|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     29|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     29|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     29|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     29|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 28]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     28|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 9, False: 19]
  ------------------
  190|      9|    return false;
  191|      9|  }
  192|     19|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 18]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     18|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 17]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     17|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 17]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     17|  num_decoded_points_ = 0;
  202|       |
  203|     17|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 17, False: 0]
  ------------------
  204|     17|    return false;
  205|     17|  }
  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|     13|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     13|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     13|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     13|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     13|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 12]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     12|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 9]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|      9|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 8]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|      8|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 7]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|      7|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 7]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      7|  num_decoded_points_ = 0;
  202|       |
  203|      7|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 7, False: 0]
  ------------------
  204|      7|    return false;
  205|      7|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}

_ZN5draco22FloatPointsTreeDecoderC2Ev:
   65|    594|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|    594|  qinfo_.quantization_bits = 0;
   67|    594|  qinfo_.range = 0;
   68|    594|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|    560|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|    560|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 1, False: 559]
  ------------------
   73|      1|    return false;
   74|      1|  }
   75|    559|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 4, False: 555]
  ------------------
   76|      4|    return false;
   77|      4|  }
   78|    555|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 1, False: 554]
  ------------------
   79|      1|    return false;
   80|      1|  }
   81|    554|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 1, False: 553]
  ------------------
   82|      1|    return false;
   83|      1|  }
   84|    553|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 38, False: 515]
  |  Branch (84:38): [True: 22, False: 16]
  ------------------
   85|     22|    return false;
   86|     22|  }
   87|    531|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 2, False: 529]
  ------------------
   88|      2|    return false;
   89|      2|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|    529|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 8, False: 521]
  ------------------
   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|    521|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|    521|      std::back_inserter(*qpoints);
  100|    521|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|    521|                           Converter>
  102|    521|      oit(oit_qpoints);
  103|    521|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 519, False: 2]
  ------------------
  104|    519|    qpoints->reserve(num_points_);
  105|    519|    switch (compression_level_) {
  106|    113|      case 0: {
  ------------------
  |  Branch (106:7): [True: 113, False: 406]
  ------------------
  107|    113|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|    113|        qpoints_decoder.DecodePoints(buffer, oit);
  109|    113|        break;
  110|      0|      }
  111|     89|      case 1: {
  ------------------
  |  Branch (111:7): [True: 89, False: 430]
  ------------------
  112|     89|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|     89|        qpoints_decoder.DecodePoints(buffer, oit);
  114|     89|        break;
  115|      0|      }
  116|     99|      case 2: {
  ------------------
  |  Branch (116:7): [True: 99, False: 420]
  ------------------
  117|     99|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|     99|        qpoints_decoder.DecodePoints(buffer, oit);
  119|     99|        break;
  120|      0|      }
  121|    119|      case 3: {
  ------------------
  |  Branch (121:7): [True: 119, False: 400]
  ------------------
  122|    119|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|    119|        qpoints_decoder.DecodePoints(buffer, oit);
  124|    119|        break;
  125|      0|      }
  126|     57|      case 4: {
  ------------------
  |  Branch (126:7): [True: 57, False: 462]
  ------------------
  127|     57|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     57|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     57|        break;
  130|      0|      }
  131|     29|      case 5: {
  ------------------
  |  Branch (131:7): [True: 29, False: 490]
  ------------------
  132|     29|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|     29|        qpoints_decoder.DecodePoints(buffer, oit);
  134|     29|        break;
  135|      0|      }
  136|     13|      case 6: {
  ------------------
  |  Branch (136:7): [True: 13, False: 506]
  ------------------
  137|     13|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|     13|        qpoints_decoder.DecodePoints(buffer, oit);
  139|     13|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 519]
  ------------------
  142|      0|        return false;
  143|    519|    }
  144|    519|  }
  145|       |
  146|    521|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 508, False: 13]
  ------------------
  147|    508|    return false;
  148|    508|  }
  149|     13|  return true;
  150|    521|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|    521|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|   261M|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|   261M|  const Self &operator=(const SourceType &source) {
   56|   261M|    *oit_ = Converter()(source);
   57|   261M|    return *this;
   58|   261M|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|   261M|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|   261M|    return Point3ui(v[0], v[1], v[2]);
   31|   261M|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|   261M|  const Self &operator++() {
   46|   261M|    ++oit_;
   47|   261M|    return *this;
   48|   261M|  }

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  11.9M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  11.9M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 11.9M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  11.9M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  11.9M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|   985M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|   985M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 360, False: 985M]
  ------------------
   78|    360|      return false;  // Buffer overflow.
   79|    360|    }
   80|   985M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|   985M|    pos_ += size_to_decode;
   82|   985M|    return true;
   83|   985M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  34.3k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  15.2k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  48.6k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   211k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  6.66k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  11.9M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  2.19M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  7.69k|    inline void reset(const void *b, size_t s) {
  131|  7.69k|      bit_offset_ = 0;
  132|  7.69k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  7.69k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  7.69k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  6.53k|    inline uint64_t BitsDecoded() const {
  138|  6.53k|      return static_cast<uint64_t>(bit_offset_);
  139|  6.53k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  11.9M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  11.9M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 0, False: 11.9M]
  ------------------
  162|      0|        return false;
  163|      0|      }
  164|  11.9M|      uint32_t value = 0;
  165|  27.1M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 15.2M, False: 11.9M]
  ------------------
  166|  15.2M|        value |= GetBit() << bit;
  167|  15.2M|      }
  168|  11.9M|      *x = value;
  169|  11.9M|      return true;
  170|  11.9M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  15.2M|    inline int GetBit() {
  176|  15.2M|      const size_t off = bit_offset_;
  177|  15.2M|      const size_t byte_offset = off >> 3;
  178|  15.2M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  15.2M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 14.2M, False: 1.01M]
  ------------------
  180|  14.2M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  14.2M|        bit_offset_ = off + 1;
  182|  14.2M|        return bit;
  183|  14.2M|      }
  184|  1.01M|      return 0;
  185|  15.2M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  8.28M|  bool Decode(T *out_val) {
   69|  8.28M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 4.48k, False: 8.27M]
  ------------------
   70|  4.48k|      return false;
   71|  4.48k|    }
   72|  8.27M|    pos_ += sizeof(T);
   73|  8.27M|    return true;
   74|  8.28M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  8.28M|  bool Peek(T *out_val) {
   88|  8.28M|    const size_t size_to_decode = sizeof(T);
   89|  8.28M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 4.48k, False: 8.27M]
  ------------------
   90|  4.48k|      return false;  // Buffer overflow.
   91|  4.48k|    }
   92|  8.27M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  8.27M|    return true;
   94|  8.28M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  13.6k|  bool Decode(T *out_val) {
   69|  13.6k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 144, False: 13.4k]
  ------------------
   70|    144|      return false;
   71|    144|    }
   72|  13.4k|    pos_ += sizeof(T);
   73|  13.4k|    return true;
   74|  13.6k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  13.6k|  bool Peek(T *out_val) {
   88|  13.6k|    const size_t size_to_decode = sizeof(T);
   89|  13.6k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 144, False: 13.4k]
  ------------------
   90|    144|      return false;  // Buffer overflow.
   91|    144|    }
   92|  13.4k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  13.4k|    return true;
   94|  13.6k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   774k|  bool Decode(T *out_val) {
   69|   774k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 469, False: 773k]
  ------------------
   70|    469|      return false;
   71|    469|    }
   72|   773k|    pos_ += sizeof(T);
   73|   773k|    return true;
   74|   774k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   774k|  bool Peek(T *out_val) {
   88|   774k|    const size_t size_to_decode = sizeof(T);
   89|   774k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 469, False: 773k]
  ------------------
   90|    469|      return false;  // Buffer overflow.
   91|    469|    }
   92|   773k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   773k|    return true;
   94|   774k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  20.1k|  bool Decode(T *out_val) {
   69|  20.1k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 131, False: 20.0k]
  ------------------
   70|    131|      return false;
   71|    131|    }
   72|  20.0k|    pos_ += sizeof(T);
   73|  20.0k|    return true;
   74|  20.1k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  20.1k|  bool Peek(T *out_val) {
   88|  20.1k|    const size_t size_to_decode = sizeof(T);
   89|  20.1k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 131, False: 20.0k]
  ------------------
   90|    131|      return false;  // Buffer overflow.
   91|    131|    }
   92|  20.0k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  20.0k|    return true;
   94|  20.1k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   890k|  bool Decode(T *out_val) {
   69|   890k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 119, False: 890k]
  ------------------
   70|    119|      return false;
   71|    119|    }
   72|   890k|    pos_ += sizeof(T);
   73|   890k|    return true;
   74|   890k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   890k|  bool Peek(T *out_val) {
   88|   890k|    const size_t size_to_decode = sizeof(T);
   89|   890k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 119, False: 890k]
  ------------------
   90|    119|      return false;  // Buffer overflow.
   91|    119|    }
   92|   890k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   890k|    return true;
   94|   890k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  64.0k|  bool Decode(T *out_val) {
   69|  64.0k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 32, False: 63.9k]
  ------------------
   70|     32|      return false;
   71|     32|    }
   72|  63.9k|    pos_ += sizeof(T);
   73|  63.9k|    return true;
   74|  64.0k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  64.0k|  bool Peek(T *out_val) {
   88|  64.0k|    const size_t size_to_decode = sizeof(T);
   89|  64.0k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 32, False: 63.9k]
  ------------------
   90|     32|      return false;  // Buffer overflow.
   91|     32|    }
   92|  63.9k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  63.9k|    return true;
   94|  64.0k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  1.53k|  bool Decode(T *out_val) {
   69|  1.53k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 45, False: 1.48k]
  ------------------
   70|     45|      return false;
   71|     45|    }
   72|  1.48k|    pos_ += sizeof(T);
   73|  1.48k|    return true;
   74|  1.53k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  1.53k|  bool Peek(T *out_val) {
   88|  1.53k|    const size_t size_to_decode = sizeof(T);
   89|  1.53k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 45, False: 1.48k]
  ------------------
   90|     45|      return false;  // Buffer overflow.
   91|     45|    }
   92|  1.48k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.48k|    return true;
   94|  1.53k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    736|  bool Decode(T *out_val) {
   69|    736|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 7, False: 729]
  ------------------
   70|      7|      return false;
   71|      7|    }
   72|    729|    pos_ += sizeof(T);
   73|    729|    return true;
   74|    736|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    736|  bool Peek(T *out_val) {
   88|    736|    const size_t size_to_decode = sizeof(T);
   89|    736|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 7, False: 729]
  ------------------
   90|      7|      return false;  // Buffer overflow.
   91|      7|    }
   92|    729|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    729|    return true;
   94|    736|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   386M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|  4.88G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  11.9M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  11.9M|    return value_ >= val;
  100|  11.9M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   260M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  3.19G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  27.8M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|   118M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   118M|    value_ = i.value_;
  153|   118M|    return *this;
  154|   118M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|  1.21G|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  1.21G|    value_ = i.value_;
  153|  1.21G|    return *this;
  154|  1.21G|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  27.8M|  inline ThisIndexType &operator++() {
  103|  27.8M|    ++value_;
  104|  27.8M|    return *this;
  105|  27.8M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  2.40G|  constexpr bool operator==(const IndexType &i) const {
   76|  2.40G|    return value_ == i.value_;
   77|  2.40G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   886M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  3.58k|  constexpr bool operator<(const IndexType &i) const {
   88|  3.58k|    return value_ < i.value_;
   89|  3.58k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   133M|  constexpr bool operator==(const IndexType &i) const {
   76|   133M|    return value_ == i.value_;
   77|   133M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   219M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   219M|    return ThisIndexType(value_ - val);
  133|   219M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   664M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   664M|    return ThisIndexType(value_ + val);
  127|   664M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  23.9M|  constexpr bool operator==(const IndexType &i) const {
   76|  23.9M|    return value_ == i.value_;
   77|  23.9M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   217M|  constexpr bool operator!=(const IndexType &i) const {
   82|   217M|    return value_ != i.value_;
   83|   217M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   376M|  constexpr bool operator!=(const IndexType &i) const {
   82|   376M|    return value_ != i.value_;
   83|   376M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   521M|  inline ThisIndexType &operator++() {
  103|   521M|    ++value_;
  104|   521M|    return *this;
  105|   521M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   385M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   385M|    value_ = i.value_;
  153|   385M|    return *this;
  154|   385M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|   958M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   958M|    value_ = i.value_;
  153|   958M|    return *this;
  154|   958M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  47.8M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  47.8M|    return value_ >= val;
  100|  47.8M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  12.1M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|  1.07G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  19.9G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   191M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  15.1G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   205M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  10.8M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  10.8M|    return ThisIndexType(value_ + val);
  127|  10.8M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   143M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  36.0M|  constexpr bool operator<(const IndexType &i) const {
   88|  36.0M|    return value_ < i.value_;
   89|  36.0M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|  5.02G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|  1.21G|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  77.6M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|  4.85G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   600M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  6.89M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  6.89M|    value_ = i.value_;
  153|  6.89M|    return *this;
  154|  6.89M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  12.1M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  12.1M|    value_ += val;
  141|  12.1M|    return *this;
  142|  12.1M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  35.9M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  35.9M|    value_ = val;
  157|  35.9M|    return *this;
  158|  35.9M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|  1.18G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  8.27M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  8.27M|  inline ThisIndexType &operator++() {
  103|  8.27M|    ++value_;
  104|  8.27M|    return *this;
  105|  8.27M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  28.1M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|  20.3M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|  4.79G|  inline ThisIndexType &operator++() {
  103|  4.79G|    ++value_;
  104|  4.79G|    return *this;
  105|  4.79G|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|  20.3M|  inline ThisIndexType &operator++() {
  103|  20.3M|    ++value_;
  104|  20.3M|    return *this;
  105|  20.3M|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|  4.77G|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  4.77G|    return value_ >= val;
  100|  4.77G|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  41.7M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  41.7M|    return vector_[index.value()];
   75|  41.7M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  28.1M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  12.7k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  17.3k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  75.9M|  inline reference operator[](const IndexTypeT &index) {
   71|  75.9M|    return vector_[index.value()];
   72|  75.9M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  86.2k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  23.8M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  3.84k|  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|  11.9M|  inline reference operator[](const IndexTypeT &index) {
   71|  11.9M|    return vector_[index.value()];
   72|  11.9M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  28.3M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  28.3M|    return vector_[index.value()];
   75|  28.3M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   164M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  14.2M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   334M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   334M|    return vector_[index.value()];
   75|   334M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   778M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   778M|    return vector_[index.value()];
   75|   778M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   339M|  inline reference operator[](const IndexTypeT &index) {
   71|   339M|    return vector_[index.value()];
   72|   339M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  57.3M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  57.3M|    return vector_[index.value()];
   75|  57.3M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   288M|  inline reference operator[](const IndexTypeT &index) {
   71|   288M|    return vector_[index.value()];
   72|   288M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  80.4M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   183M|  inline reference operator[](const IndexTypeT &index) {
   71|   183M|    return vector_[index.value()];
   72|   183M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  2.40k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   161M|  inline reference operator[](const IndexTypeT &index) {
   71|   161M|    return vector_[index.value()];
   72|   161M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  64.0k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  2.70M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  60.5k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  7.41k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  7.41k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  7.41k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  7.41k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  13.9k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  13.9k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  13.9k|    vector_.swap(arg.vector_);
   57|  13.9k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  13.9k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  13.9k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  13.9k|    vector_.swap(arg.vector_);
   57|  13.9k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  7.41k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  7.41k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  7.41k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  12.9k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  31.5k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  61.7k|int32_t DataTypeLength(DataType dt) {
   20|  61.7k|  switch (dt) {
   21|  20.9k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 20.9k, False: 40.7k]
  ------------------
   22|  24.7k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 3.86k, False: 57.8k]
  ------------------
   23|  24.7k|      return 1;
   24|  3.65k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 3.65k, False: 58.0k]
  ------------------
   25|  4.98k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 1.32k, False: 60.3k]
  ------------------
   26|  4.98k|      return 2;
   27|  25.7k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 25.7k, False: 35.9k]
  ------------------
   28|  27.2k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 1.49k, False: 60.2k]
  ------------------
   29|  27.2k|      return 4;
   30|    173|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 173, False: 61.5k]
  ------------------
   31|    555|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 382, False: 61.3k]
  ------------------
   32|    555|      return 8;
   33|  3.85k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 3.85k, False: 57.8k]
  ------------------
   34|  3.85k|      return 4;
   35|    110|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 110, False: 61.6k]
  ------------------
   36|    110|      return 8;
   37|    187|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 187, False: 61.5k]
  ------------------
   38|    187|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 61.7k]
  ------------------
   40|      0|      return -1;
   41|  61.7k|  }
   42|  61.7k|}

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

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  2.31k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|     10|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  12.9k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|     10|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2ERKNS_6StatusE:
   37|     60|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|  15.2k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|  15.3k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE6statusEv:
   43|     60|  const Status &status() const { return status_; }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  13.8k|  StatusOr(const Status &status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|  15.2k|  T &&value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  1.44k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  2.32k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|     10|  const Status &status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  2.31k|  T &&value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  12.9k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|     10|  const Status &status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  12.9k|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   499k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   499k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 499k, Folded]
  ------------------
   65|   499k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 1.67k, False: 497k]
  ------------------
   66|  1.67k|      return false;
   67|  1.67k|    }
   68|   499k|  } 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|   497k|  return true;
   77|   499k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   276k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   276k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   276k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 91, False: 276k]
  ------------------
   33|     91|    return false;
   34|     91|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   276k|  uint8_t in;
   39|   276k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 1.06k, False: 275k]
  ------------------
   40|  1.06k|    return false;
   41|  1.06k|  }
   42|   275k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 24.2k, False: 251k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  24.2k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 654, False: 23.5k]
  ------------------
   45|    654|      return false;
   46|    654|    }
   47|       |    // Append decoded info from this byte.
   48|  23.5k|    *out_val <<= 7;
   49|  23.5k|    *out_val |= in & ((1 << 7) - 1);
   50|   251k|  } else {
   51|       |    // Last byte reached
   52|   251k|    *out_val = in;
   53|   251k|  }
   54|   274k|  return true;
   55|   275k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  8.80k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  8.80k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  8.80k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 2, False: 8.80k]
  ------------------
   33|      2|    return false;
   34|      2|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  8.80k|  uint8_t in;
   39|  8.80k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 38, False: 8.76k]
  ------------------
   40|     38|    return false;
   41|     38|  }
   42|  8.76k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 634, False: 8.13k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    634|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 44, False: 590]
  ------------------
   45|     44|      return false;
   46|     44|    }
   47|       |    // Append decoded info from this byte.
   48|    590|    *out_val <<= 7;
   49|    590|    *out_val |= in & ((1 << 7) - 1);
   50|  8.13k|  } else {
   51|       |    // Last byte reached
   52|  8.13k|    *out_val = in;
   53|  8.13k|  }
   54|  8.72k|  return true;
   55|  8.76k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  7.43k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  7.43k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 7.43k, Folded]
  ------------------
   65|  7.43k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 150, False: 7.28k]
  ------------------
   66|    150|      return false;
   67|    150|    }
   68|  7.43k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|      0|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|      0|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 0]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|      0|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|      0|  }
   76|  7.28k|  return true;
   77|  7.43k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  4.37k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.37k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.37k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 4.37k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.37k|  uint8_t in;
   39|  4.37k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 45, False: 4.32k]
  ------------------
   40|     45|    return false;
   41|     45|  }
   42|  4.32k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 345, False: 3.98k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    345|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 40, False: 305]
  ------------------
   45|     40|      return false;
   46|     40|    }
   47|       |    // Append decoded info from this byte.
   48|    305|    *out_val <<= 7;
   49|    305|    *out_val |= in & ((1 << 7) - 1);
   50|  3.98k|  } else {
   51|       |    // Last byte reached
   52|  3.98k|    *out_val = in;
   53|  3.98k|  }
   54|  4.28k|  return true;
   55|  4.32k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   173k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   173k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   173k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 12, False: 173k]
  ------------------
   33|     12|    return false;
   34|     12|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   173k|  uint8_t in;
   39|   173k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 142, False: 173k]
  ------------------
   40|    142|    return false;
   41|    142|  }
   42|   173k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 3.98k, False: 169k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  3.98k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 89, False: 3.89k]
  ------------------
   45|     89|      return false;
   46|     89|    }
   47|       |    // Append decoded info from this byte.
   48|  3.89k|    *out_val <<= 7;
   49|  3.89k|    *out_val |= in & ((1 << 7) - 1);
   50|   169k|  } else {
   51|       |    // Last byte reached
   52|   169k|    *out_val = in;
   53|   169k|  }
   54|   173k|  return true;
   55|   173k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  4.20k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  4.20k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 4.20k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  4.20k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  4.20k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  4.20k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 56, False: 4.14k]
  ------------------
   72|     56|      return false;
   73|     56|    }
   74|  4.14k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  4.14k|  }
   76|  4.14k|  return true;
   77|  4.20k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  4.68k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.68k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.68k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 13, False: 4.67k]
  ------------------
   33|     13|    return false;
   34|     13|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.67k|  uint8_t in;
   39|  4.67k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 43, False: 4.63k]
  ------------------
   40|     43|    return false;
   41|     43|  }
   42|  4.63k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 489, False: 4.14k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    489|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 70, False: 419]
  ------------------
   45|     70|      return false;
   46|     70|    }
   47|       |    // Append decoded info from this byte.
   48|    419|    *out_val <<= 7;
   49|    419|    *out_val |= in & ((1 << 7) - 1);
   50|  4.14k|  } else {
   51|       |    // Last byte reached
   52|  4.14k|    *out_val = in;
   53|  4.14k|  }
   54|  4.56k|  return true;
   55|  4.63k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.76k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.76k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.76k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 7, False: 3.75k]
  ------------------
   33|      7|    return false;
   34|      7|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.75k|  uint8_t in;
   39|  3.75k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 22, False: 3.73k]
  ------------------
   40|     22|    return false;
   41|     22|  }
   42|  3.73k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 829, False: 2.90k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    829|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 42, False: 787]
  ------------------
   45|     42|      return false;
   46|     42|    }
   47|       |    // Append decoded info from this byte.
   48|    787|    *out_val <<= 7;
   49|    787|    *out_val |= in & ((1 << 7) - 1);
   50|  2.90k|  } else {
   51|       |    // Last byte reached
   52|  2.90k|    *out_val = in;
   53|  2.90k|  }
   54|  3.69k|  return true;
   55|  3.73k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  26.8k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  26.8k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  26.8k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 11, False: 26.8k]
  ------------------
   33|     11|    return false;
   34|     11|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  26.8k|  uint8_t in;
   39|  26.8k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 38, False: 26.8k]
  ------------------
   40|     38|    return false;
   41|     38|  }
   42|  26.8k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 560, False: 26.2k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    560|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 62, False: 498]
  ------------------
   45|     62|      return false;
   46|     62|    }
   47|       |    // Append decoded info from this byte.
   48|    498|    *out_val <<= 7;
   49|    498|    *out_val |= in & ((1 << 7) - 1);
   50|  26.2k|  } else {
   51|       |    // Last byte reached
   52|  26.2k|    *out_val = in;
   53|  26.2k|  }
   54|  26.7k|  return true;
   55|  26.8k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  10.1k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  10.1k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  10.1k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 68, False: 10.0k]
  ------------------
   33|     68|    return false;
   34|     68|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  10.0k|  uint8_t in;
   39|  10.0k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 100, False: 9.93k]
  ------------------
   40|    100|    return false;
   41|    100|  }
   42|  9.93k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.62k, False: 7.30k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.62k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 386, False: 2.24k]
  ------------------
   45|    386|      return false;
   46|    386|    }
   47|       |    // Append decoded info from this byte.
   48|  2.24k|    *out_val <<= 7;
   49|  2.24k|    *out_val |= in & ((1 << 7) - 1);
   50|  7.30k|  } else {
   51|       |    // Last byte reached
   52|  7.30k|    *out_val = in;
   53|  7.30k|  }
   54|  9.54k|  return true;
   55|  9.93k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  7.57k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  7.57k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  7.57k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 36, False: 7.53k]
  ------------------
   33|     36|    return false;
   34|     36|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  7.53k|  uint8_t in;
   39|  7.53k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 68, False: 7.46k]
  ------------------
   40|     68|    return false;
   41|     68|  }
   42|  7.46k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 4.16k, False: 3.30k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  4.16k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 431, False: 3.73k]
  ------------------
   45|    431|      return false;
   46|    431|    }
   47|       |    // Append decoded info from this byte.
   48|  3.73k|    *out_val <<= 7;
   49|  3.73k|    *out_val |= in & ((1 << 7) - 1);
   50|  3.73k|  } else {
   51|       |    // Last byte reached
   52|  3.30k|    *out_val = in;
   53|  3.30k|  }
   54|  7.03k|  return true;
   55|  7.46k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  35.3k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  35.3k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  35.3k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 7, False: 35.3k]
  ------------------
   33|      7|    return false;
   34|      7|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  35.3k|  uint8_t in;
   39|  35.3k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 69, False: 35.2k]
  ------------------
   40|     69|    return false;
   41|     69|  }
   42|  35.2k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 3.02k, False: 32.2k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  3.02k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 55, False: 2.96k]
  ------------------
   45|     55|      return false;
   46|     55|    }
   47|       |    // Append decoded info from this byte.
   48|  2.96k|    *out_val <<= 7;
   49|  2.96k|    *out_val |= in & ((1 << 7) - 1);
   50|  32.2k|  } else {
   51|       |    // Last byte reached
   52|  32.2k|    *out_val = in;
   53|  32.2k|  }
   54|  35.2k|  return true;
   55|  35.2k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|   130k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|   169k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  14.0k|  Self operator-(const Self &o) const {
  138|  14.0k|    Self ret;
  139|  56.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 42.2k, False: 14.0k]
  ------------------
  140|  42.2k|      ret[i] = (*this)[i] - o[i];
  141|  42.2k|    }
  142|  14.0k|    return ret;
  143|  14.0k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  35.0k|  VectorD() {
   41|   140k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 105k, False: 35.0k]
  ------------------
   42|   105k|      (*this)[i] = Scalar(0);
   43|   105k|    }
   44|  35.0k|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|  1.80G|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIfLi3EEC2ERKfS3_S3_:
   59|    116|      : v_({{c0, c1, c2}}) {
   60|    116|    DRACO_DCHECK_EQ(dimension, 3);
   61|    116|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|   136M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  11.2M|  Self operator-(const Self &o) const {
  138|  11.2M|    Self ret;
  139|  45.1M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 33.8M, False: 11.2M]
  ------------------
  140|  33.8M|      ret[i] = (*this)[i] - o[i];
  141|  33.8M|    }
  142|  11.2M|    return ret;
  143|  11.2M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  5.63M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  5.63M|  static_assert(std::is_signed<ScalarT>::value,
  321|  5.63M|                "ScalarT must be a signed type. ");
  322|  5.63M|  VectorD<ScalarT, 3> r;
  323|  5.63M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  5.63M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  5.63M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  5.63M|  return r;
  327|  5.63M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  5.63M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  5.63M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  2.24M|  Scalar AbsSum() const {
  238|  2.24M|    Scalar result(0);
  239|  8.94M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 6.72M, False: 2.22M]
  ------------------
  240|  6.72M|      Scalar next_value = std::abs(v_[i]);
  241|  6.72M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 15.5k, False: 6.70M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  15.5k|        return std::numeric_limits<Scalar>::max();
  244|  15.5k|      }
  245|  6.70M|      result += next_value;
  246|  6.70M|    }
  247|  2.22M|    return result;
  248|  2.24M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   298k|  Self operator/(const Scalar &o) const {
  183|   298k|    Self ret;
  184|  1.19M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 894k, False: 298k]
  ------------------
  185|   894k|      ret[i] = (*this)[i] / o;
  186|   894k|    }
  187|   298k|    return ret;
  188|   298k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   171M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  10.4M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  6.72M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  1.73M|  Self operator-() const {
  121|  1.73M|    Self ret;
  122|  6.95M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 5.21M, False: 1.73M]
  ------------------
  123|  5.21M|      ret[i] = -(*this)[i];
  124|  5.21M|    }
  125|  1.73M|    return ret;
  126|  1.73M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  5.21M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|   854k|  Self operator-(const Self &o) const {
  138|   854k|    Self ret;
  139|  2.56M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.70M, False: 854k]
  ------------------
  140|  1.70M|      ret[i] = (*this)[i] - o[i];
  141|  1.70M|    }
  142|   854k|    return ret;
  143|   854k|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  10.2M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  15.3M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  31.9M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  1.70M|  Self operator+(const Self &o) const {
  130|  1.70M|    Self ret;
  131|  5.12M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 3.41M, False: 1.70M]
  ------------------
  132|  3.41M|      ret[i] = (*this)[i] + o[i];
  133|  3.41M|    }
  134|  1.70M|    return ret;
  135|  1.70M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  30.1M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|   841k|  Self operator-(const Self &o) const {
  138|   841k|    Self ret;
  139|  2.52M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.68M, False: 841k]
  ------------------
  140|  1.68M|      ret[i] = (*this)[i] - o[i];
  141|  1.68M|    }
  142|   841k|    return ret;
  143|   841k|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|   841k|  Self operator+(const Self &o) const {
  130|   841k|    Self ret;
  131|  2.52M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.68M, False: 841k]
  ------------------
  132|  1.68M|      ret[i] = (*this)[i] + o[i];
  133|  1.68M|    }
  134|   841k|    return ret;
  135|   841k|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   493k|  bool operator==(const Self &o) const {
  207|  1.46M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 982k, False: 486k]
  ------------------
  208|   982k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 6.88k, False: 975k]
  ------------------
  209|  6.88k|        return false;
  210|  6.88k|      }
  211|   982k|    }
  212|   486k|    return true;
  213|   493k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  5.92M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  7.19k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  7.51k|  Scalar Dot(const Self &o) const {
  251|  7.51k|    Scalar ret(0);
  252|  30.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 22.5k, False: 7.51k]
  ------------------
  253|  22.5k|      ret += (*this)[i] * o[i];
  254|  22.5k|    }
  255|  7.51k|    return ret;
  256|  7.51k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    314|  Self operator*(const Scalar &o) const {
  175|    314|    Self ret;
  176|  1.25k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 942, False: 314]
  ------------------
  177|    942|      ret[i] = (*this)[i] * o;
  178|    942|    }
  179|    314|    return ret;
  180|    314|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  6.88k|  Self operator-(const Self &o) const {
  138|  6.88k|    Self ret;
  139|  20.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 13.7k, False: 6.88k]
  ------------------
  140|  13.7k|      ret[i] = (*this)[i] - o[i];
  141|  13.7k|    }
  142|  6.88k|    return ret;
  143|  6.88k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  13.7k|  VectorD() {
   41|  41.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 27.5k, False: 13.7k]
  ------------------
   42|  27.5k|      (*this)[i] = Scalar(0);
   43|  27.5k|    }
   44|  13.7k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   994k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   994k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   994k|    v_[0] = c0;
   55|   994k|    v_[1] = c1;
   56|   994k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  54.9k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   397k|  bool operator==(const Self &o) const {
  207|  1.14M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 769k, False: 371k]
  ------------------
  208|   769k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 25.5k, False: 744k]
  ------------------
  209|  25.5k|        return false;
  210|  25.5k|      }
  211|   769k|    }
  212|   371k|    return true;
  213|   397k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  2.35M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  33.0M|  VectorD() {
   41|   132M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 99.1M, False: 33.0M]
  ------------------
   42|  99.1M|      (*this)[i] = Scalar(0);
   43|  99.1M|    }
   44|  33.0M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  28.4k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  31.4k|  Scalar Dot(const Self &o) const {
  251|  31.4k|    Scalar ret(0);
  252|   125k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 94.2k, False: 31.4k]
  ------------------
  253|  94.2k|      ret += (*this)[i] * o[i];
  254|  94.2k|    }
  255|  31.4k|    return ret;
  256|  31.4k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  2.97k|  Self operator-(const Self &o) const {
  138|  2.97k|    Self ret;
  139|  8.91k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 5.94k, False: 2.97k]
  ------------------
  140|  5.94k|      ret[i] = (*this)[i] - o[i];
  141|  5.94k|    }
  142|  2.97k|    return ret;
  143|  2.97k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  8.65k|  Self operator*(const Scalar &o) const {
  175|  8.65k|    Self ret;
  176|  25.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 17.3k, False: 8.65k]
  ------------------
  177|  17.3k|      ret[i] = (*this)[i] * o;
  178|  17.3k|    }
  179|  8.65k|    return ret;
  180|  8.65k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  2.89k|  Self operator+(const Self &o) const {
  130|  2.89k|    Self ret;
  131|  8.67k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 5.78k, False: 2.89k]
  ------------------
  132|  5.78k|      ret[i] = (*this)[i] + o[i];
  133|  5.78k|    }
  134|  2.89k|    return ret;
  135|  2.89k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.89k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.89k|  return v * o;
  294|  2.89k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  2.87k|  Self operator+(const Self &o) const {
  130|  2.87k|    Self ret;
  131|  11.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 8.61k, False: 2.87k]
  ------------------
  132|  8.61k|      ret[i] = (*this)[i] + o[i];
  133|  8.61k|    }
  134|  2.87k|    return ret;
  135|  2.87k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.87k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.87k|  return v * o;
  294|  2.87k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  2.87k|  Self operator*(const Scalar &o) const {
  175|  2.87k|    Self ret;
  176|  11.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 8.61k, False: 2.87k]
  ------------------
  177|  8.61k|      ret[i] = (*this)[i] * o;
  178|  8.61k|    }
  179|  2.87k|    return ret;
  180|  2.87k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   797k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   797k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   797k|    v_[0] = c0;
   55|   797k|    v_[1] = c1;
   56|   797k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  20.2k|  VectorD() {
   41|  60.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 40.4k, False: 20.2k]
  ------------------
   42|  40.4k|      (*this)[i] = Scalar(0);
   43|  40.4k|    }
   44|  20.2k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  5.71k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  17.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 11.4k, False: 5.71k]
  ------------------
  104|  11.4k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 11.4k, False: 0]
  ------------------
  105|  11.4k|        v_[i] = Scalar(src_vector[i]);
  106|  11.4k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  11.4k|    }
  110|  5.71k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|    823|  Self operator+(const Self &o) const {
  130|    823|    Self ret;
  131|  2.46k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.64k, False: 823]
  ------------------
  132|  1.64k|      ret[i] = (*this)[i] + o[i];
  133|  1.64k|    }
  134|    823|    return ret;
  135|    823|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  2.85k|  VectorD() {
   41|  8.57k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 5.71k, False: 2.85k]
  ------------------
   42|  5.71k|      (*this)[i] = Scalar(0);
   43|  5.71k|    }
   44|  2.85k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  17.1k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  11.4k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  2.85k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  8.57k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 5.71k, False: 2.85k]
  ------------------
  104|  5.71k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 5.71k, False: 0]
  ------------------
  105|  5.71k|        v_[i] = Scalar(src_vector[i]);
  106|  5.71k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  5.71k|    }
  110|  2.85k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  2.85k|  Self operator/(const Scalar &o) const {
  183|  2.85k|    Self ret;
  184|  8.57k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 5.71k, False: 2.85k]
  ------------------
  185|  5.71k|      ret[i] = (*this)[i] / o;
  186|  5.71k|    }
  187|  2.85k|    return ret;
  188|  2.85k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  2.03k|  Self operator-(const Self &o) const {
  138|  2.03k|    Self ret;
  139|  6.10k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 4.07k, False: 2.03k]
  ------------------
  140|  4.07k|      ret[i] = (*this)[i] - o[i];
  141|  4.07k|    }
  142|  2.03k|    return ret;
  143|  2.03k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  80.9k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  1.74M|  VectorD() {
   41|  6.96M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 5.22M, False: 1.74M]
  ------------------
   42|  5.22M|      (*this)[i] = Scalar(0);
   43|  5.22M|    }
   44|  1.74M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  6.51M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  6.51M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  6.51M|    v_[0] = c0;
   55|  6.51M|    v_[1] = c1;
   56|  6.51M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  5.12M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  15.3M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 10.2M, False: 5.12M]
  ------------------
  104|  10.2M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 10.2M, False: 0]
  ------------------
  105|  10.2M|        v_[i] = Scalar(src_vector[i]);
  106|  10.2M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  10.2M|    }
  110|  5.12M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  2.56M|  VectorD() {
   41|  7.68M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 5.12M, False: 2.56M]
  ------------------
   42|  5.12M|      (*this)[i] = Scalar(0);
   43|  5.12M|    }
   44|  2.56M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  2.56M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  7.68M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 5.12M, False: 2.56M]
  ------------------
  104|  5.12M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 5.12M, False: 0]
  ------------------
  105|  5.12M|        v_[i] = Scalar(src_vector[i]);
  106|  5.12M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  5.12M|    }
  110|  2.56M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  3.96M|  VectorD(const Self &o) {
   89|  11.9M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 7.93M, False: 3.96M]
  ------------------
   90|  7.93M|      (*this)[i] = o[i];
   91|  7.93M|    }
   92|  3.96M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  1.68M|  VectorD() {
   41|  5.04M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.36M, False: 1.68M]
  ------------------
   42|  3.36M|      (*this)[i] = Scalar(0);
   43|  3.36M|    }
   44|  1.68M|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|   600M|  VectorD(const Self &o) {
   89|  2.40G|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 1.80G, False: 600M]
  ------------------
   90|  1.80G|      (*this)[i] = o[i];
   91|  1.80G|    }
   92|   600M|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|  1.80G|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|   261M|      : v_({{c0, c1, c2}}) {
   60|   261M|    DRACO_DCHECK_EQ(dimension, 3);
   61|   261M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|  84.2M|  inline int num_vertices() const {
   74|  84.2M|    return static_cast<int>(vertex_corners_.size());
   75|  84.2M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  12.1M|  inline int num_corners() const {
   77|  12.1M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  12.1M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  2.09M|  inline int num_faces() const {
   80|  2.09M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  2.09M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   334M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   334M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 334M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   334M|    return opposite_corners_[corner];
   88|   334M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   535M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   535M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 14.0M, False: 521M]
  ------------------
   91|  14.0M|      return corner;
   92|  14.0M|    }
   93|   521M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 460M, False: 61.1M]
  ------------------
   94|   535M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   478M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   478M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 5.38M, False: 473M]
  ------------------
   97|  5.38M|      return corner;
   98|  5.38M|    }
   99|   473M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 158M, False: 315M]
  ------------------
  100|   478M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   778M|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|   778M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 778M]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|   778M|    return ConfidentVertex(corner);
  106|   778M|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|   778M|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|   778M|    DRACO_DCHECK_GE(corner.value(), 0);
  109|   778M|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|   778M|    return corner_to_vertex_map_[corner];
  111|   778M|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  48.1M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  48.1M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 48.1M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  48.1M|    return FaceIndex(corner.value() / 3);
  117|  48.1M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|   994M|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  57.3M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  57.3M|    return vertex_corners_[v];
  152|  57.3M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|  1.68M|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|  1.68M|    const CornerIndex corner = LeftMostCorner(vert);
  187|  1.68M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 41.2k, False: 1.63M]
  ------------------
  188|  41.2k|      return true;
  189|  41.2k|    }
  190|  1.63M|    return false;
  191|  1.68M|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  92.5M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  92.5M|    return Previous(Opposite(Previous(corner)));
  202|  92.5M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  19.9M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  19.9M|    return Next(Opposite(Next(corner)));
  207|  19.9M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  4.39M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  4.39M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 4.39M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  4.39M|    return Opposite(Previous(corner_id));
  222|  4.39M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  6.03M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  6.03M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 6.03M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  6.03M|    return Opposite(Next(corner_id));
  228|  6.03M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   288M|                                CornerIndex opp_corner_id) {
  249|   288M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   288M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   288M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   339M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   339M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   339M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   339M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|  80.4M|  VertexIndex AddNewVertex() {
  271|  80.4M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|  80.4M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|  80.4M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|  80.4M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   182M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   182M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   182M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 182M, False: 0]
  ------------------
  295|   182M|      vertex_corners_[vert] = corner;
  296|   182M|    }
  297|   182M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|   789k|  void MakeVertexIsolated(VertexIndex vert) {
  329|   789k|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|   789k|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|   789k|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  2.96k|      : corner_table_(table),
  229|  2.96k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  2.96k|        corner_(start_corner_),
  231|  2.96k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  3.98M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  10.9k|  VertexCornersIterator &operator++() {
  268|  10.9k|    Next();
  269|  10.9k|    return *this;
  270|  10.9k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.40M|  void Next() {
  248|  3.40M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.37M, False: 23.3k]
  ------------------
  249|  3.37M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.37M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 21.0k, False: 3.35M]
  ------------------
  251|       |        // Open boundary reached.
  252|  21.0k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  21.0k|        left_traversal_ = false;
  254|  3.35M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 560k, False: 2.79M]
  ------------------
  255|       |        // End reached.
  256|   560k|        corner_ = kInvalidCornerIndex;
  257|   560k|      }
  258|  3.37M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  23.3k|      corner_ = corner_table_->SwingRight(corner_);
  262|  23.3k|    }
  263|  3.40M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  6.79M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  3.90M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  4.47M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  2.24M|  void Next() {
  248|  2.24M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 2.21M, False: 24.5k]
  ------------------
  249|  2.21M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  2.21M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 1.55M, False: 660k]
  ------------------
  251|       |        // Open boundary reached.
  252|  1.55M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  1.55M|        left_traversal_ = false;
  254|  1.55M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 107k, False: 552k]
  ------------------
  255|       |        // End reached.
  256|   107k|        corner_ = kInvalidCornerIndex;
  257|   107k|      }
  258|  2.21M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  24.5k|      corner_ = corner_table_->SwingRight(corner_);
  262|  24.5k|    }
  263|  2.24M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  1.66M|      : corner_table_(table),
  236|  1.66M|        start_corner_(corner_id),
  237|  1.66M|        corner_(start_corner_),
  238|  1.66M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   578k|      : corner_table_(table),
  236|   578k|        start_corner_(corner_id),
  237|   578k|        corner_(start_corner_),
  238|   578k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  68.9M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  68.9M|    return is_edge_on_seam_[corner.value()];
   47|  68.9M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  31.1M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  31.1M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 31.1M]
  |  Branch (50:42): [True: 26.8M, False: 4.35M]
  ------------------
   51|  26.8M|      return kInvalidCornerIndex;
   52|  26.8M|    }
   53|  4.35M|    return corner_table_->Opposite(corner);
   54|  31.1M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  43.6M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  43.6M|    return corner_table_->Next(corner);
   58|  43.6M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  22.7M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  22.7M|    return corner_table_->Previous(corner);
   62|  22.7M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  5.88M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  5.88M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  5.88M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.45M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  3.45M|    return Opposite(Previous(corner));
   73|  3.45M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  3.88M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  3.88M|    return Opposite(Next(corner));
   76|  3.88M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  4.58M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  4.58M|    return Previous(Opposite(Previous(corner)));
   81|  4.58M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  14.8M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  14.8M|    return Next(Opposite(Next(corner)));
   86|  14.8M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  9.68k|  int num_vertices() const {
   89|  9.68k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  9.68k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  3.18k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  1.42k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|   109M|  VertexIndex Vertex(CornerIndex corner) const {
   95|   109M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|   109M|    return ConfidentVertex(corner);
   97|   109M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|   109M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|   109M|    return corner_to_vertex_map_[corner.value()];
  100|   109M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  3.43M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  3.43M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  3.43M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  3.43M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  3.43M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  3.43M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 3.43M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  3.43M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 2.99M, False: 438k]
  ------------------
  128|  2.99M|      return true;
  129|  2.99M|    }
  130|   438k|    return false;
  131|  3.43M|  }

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

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

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

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

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

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

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

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

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

