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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|    492|      : quantization_bits_(-1),
   54|    492|        max_quantized_value_(-1),
   55|    492|        max_value_(-1),
   56|    492|        dequantization_scale_(1.f),
   57|    492|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|    436|  bool SetQuantizationBits(int32_t q) {
   60|    436|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 248, False: 188]
  |  Branch (60:18): [True: 29, False: 159]
  ------------------
   61|    277|      return false;
   62|    277|    }
   63|    159|    quantization_bits_ = q;
   64|    159|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|    159|    max_value_ = max_quantized_value_ - 1;
   66|    159|    dequantization_scale_ = 2.f / max_value_;
   67|    159|    center_value_ = max_value_ / 2;
   68|    159|    return true;
   69|    436|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|   384k|                                           int32_t *out_t) const {
   77|   384k|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 3.31k, False: 381k]
  |  Branch (77:20): [True: 0, False: 3.31k]
  |  Branch (77:32): [True: 3.31k, False: 381k]
  |  Branch (77:42): [True: 0, False: 3.31k]
  ------------------
   78|   384k|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 86.8k, False: 297k]
  |  Branch (78:29): [True: 3.15k, False: 83.7k]
  ------------------
   79|  3.15k|      s = max_value_;
   80|  3.15k|      t = max_value_;
   81|   381k|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 3.31k, False: 377k]
  |  Branch (81:26): [True: 1.06k, False: 2.25k]
  ------------------
   82|  1.06k|      t = center_value_ - (t - center_value_);
   83|   380k|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 83.7k, False: 296k]
  |  Branch (83:35): [True: 3.33k, False: 80.3k]
  ------------------
   84|  3.33k|      t = center_value_ + (center_value_ - t);
   85|   376k|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 82.6k, False: 294k]
  |  Branch (85:35): [True: 470, False: 82.2k]
  ------------------
   86|    470|      s = center_value_ + (center_value_ - s);
   87|   376k|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 4.53k, False: 371k]
  |  Branch (87:26): [True: 1.74k, False: 2.78k]
  ------------------
   88|  1.74k|      s = center_value_ - (s - center_value_);
   89|  1.74k|    }
   90|       |
   91|   384k|    *out_s = s;
   92|   384k|    *out_t = t;
   93|   384k|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|   384k|                                                       int32_t *out_t) const {
  100|   384k|    DRACO_DCHECK_EQ(
  101|   384k|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|   384k|        center_value_);
  103|   384k|    int32_t s, t;
  104|   384k|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 191k, False: 192k]
  ------------------
  105|       |      // Right hemisphere.
  106|   191k|      s = (int_vec[1] + center_value_);
  107|   191k|      t = (int_vec[2] + center_value_);
  108|   192k|    } else {
  109|       |      // Left hemisphere.
  110|   192k|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 61.1k, False: 131k]
  ------------------
  111|  61.1k|        s = std::abs(int_vec[2]);
  112|   131k|      } else {
  113|   131k|        s = (max_value_ - std::abs(int_vec[2]));
  114|   131k|      }
  115|   192k|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 65.5k, False: 126k]
  ------------------
  116|  65.5k|        t = std::abs(int_vec[1]);
  117|   126k|      } else {
  118|   126k|        t = (max_value_ - std::abs(int_vec[1]));
  119|   126k|      }
  120|   192k|    }
  121|   384k|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|   384k|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|  24.6k|                                                    float *out_vector) const {
  199|  24.6k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|  24.6k|                                 in_t * dequantization_scale_ - 1.f,
  201|  24.6k|                                 out_vector);
  202|  24.6k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|   425k|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|   425k|    DRACO_DCHECK_LE(s, center_value_);
  208|   425k|    DRACO_DCHECK_LE(t, center_value_);
  209|   425k|    DRACO_DCHECK_GE(s, -center_value_);
  210|   425k|    DRACO_DCHECK_GE(t, -center_value_);
  211|   425k|    const uint32_t st =
  212|   425k|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|   425k|    return st <= center_value_;
  214|   425k|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|   529k|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|   529k|    DRACO_DCHECK_LE(*s, center_value_);
  219|   529k|    DRACO_DCHECK_LE(*t, center_value_);
  220|   529k|    DRACO_DCHECK_GE(*s, -center_value_);
  221|   529k|    DRACO_DCHECK_GE(*t, -center_value_);
  222|   529k|    int32_t sign_s = 0;
  223|   529k|    int32_t sign_t = 0;
  224|   529k|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 403k, False: 126k]
  |  Branch (224:20): [True: 323k, False: 79.5k]
  ------------------
  225|   323k|      sign_s = 1;
  226|   323k|      sign_t = 1;
  227|   323k|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 128k, False: 77.2k]
  |  Branch (227:27): [True: 58.1k, False: 70.1k]
  ------------------
  228|  58.1k|      sign_s = -1;
  229|  58.1k|      sign_t = -1;
  230|   147k|    } else {
  231|   147k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 77.2k, False: 70.1k]
  ------------------
  232|   147k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 70.1k, False: 77.2k]
  ------------------
  233|   147k|    }
  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|   529k|    const uint32_t corner_point_s = sign_s * center_value_;
  239|   529k|    const uint32_t corner_point_t = sign_t * center_value_;
  240|   529k|    uint32_t us = *s;
  241|   529k|    uint32_t ut = *t;
  242|   529k|    us = us + us - corner_point_s;
  243|   529k|    ut = ut + ut - corner_point_t;
  244|   529k|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 381k, False: 147k]
  ------------------
  245|   381k|      uint32_t temp = us;
  246|   381k|      us = -ut;
  247|   381k|      ut = -temp;
  248|   381k|    } else {
  249|   147k|      std::swap(us, ut);
  250|   147k|    }
  251|   529k|    us = us + corner_point_s;
  252|   529k|    ut = ut + corner_point_t;
  253|       |
  254|   529k|    *s = us;
  255|   529k|    *t = ut;
  256|   529k|    *s /= 2;
  257|   529k|    *t /= 2;
  258|   529k|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|   850k|  int32_t ModMax(int32_t x) const {
  273|   850k|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 74, False: 850k]
  ------------------
  274|     74|      return x - this->max_quantized_value();
  275|     74|    }
  276|   850k|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 14, False: 850k]
  ------------------
  277|     14|      return x + this->max_quantized_value();
  278|     14|    }
  279|   850k|    return x;
  280|   850k|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|    175|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|     88|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  2.55M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|  24.6k|                                           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|  24.6k|    float y = in_s_scaled;
  329|  24.6k|    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|  24.6k|    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|  24.6k|    float x_offset = -x;
  342|  24.6k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 0, False: 24.6k]
  ------------------
  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|  24.6k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 579, False: 24.0k]
  ------------------
  348|  24.6k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 746, False: 23.8k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|  24.6k|    const float norm_squared = x * x + y * y + z * z;
  352|  24.6k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 24.6k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|  24.6k|    } else {
  357|  24.6k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|  24.6k|      out_vector[0] = x * d;
  359|  24.6k|      out_vector[1] = y * d;
  360|  24.6k|      out_vector[2] = z * d;
  361|  24.6k|    }
  362|  24.6k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|   384k|  void CanonicalizeIntegerVector(T *vec) const {
  174|   384k|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|   384k|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|   384k|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|   384k|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|   384k|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|   384k|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 76.1k, False: 308k]
  ------------------
  181|  76.1k|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|   308k|    } else {
  183|   308k|      vec[0] =
  184|   308k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   308k|          abs_sum;
  186|   308k|      vec[1] =
  187|   308k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   308k|          abs_sum;
  189|   308k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 162k, False: 146k]
  ------------------
  190|   162k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   162k|      } else {
  192|   146k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   146k|      }
  194|   308k|    }
  195|   384k|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|     50|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|     50|            attribute, transform, mesh_data),
   52|     50|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|     42|                                                                *buffer) {
  194|     42|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|     42|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     42|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 8, False: 34]
  ------------------
  196|       |    // Decode prediction mode.
  197|      8|    uint8_t mode;
  198|      8|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 8]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      8|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 6, False: 2]
  ------------------
  203|       |      // Unsupported mode.
  204|      6|      return false;
  205|      6|    }
  206|      8|  }
  207|     36|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|    157|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 128, False: 29]
  ------------------
  211|    128|    uint32_t num_flags;
  212|    128|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 1, False: 127]
  ------------------
  213|      1|      return false;
  214|      1|    }
  215|    127|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 4, False: 123]
  ------------------
  216|      4|      return false;
  217|      4|    }
  218|    123|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 79, False: 44]
  ------------------
  219|     79|      is_crease_edge_[i].resize(num_flags);
  220|     79|      RAnsBitDecoder decoder;
  221|     79|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 2, False: 77]
  ------------------
  222|      2|        return false;
  223|      2|      }
  224|  1.04k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 969, False: 77]
  ------------------
  225|    969|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|    969|      }
  227|     77|      decoder.EndDecoding();
  228|     77|    }
  229|    123|  }
  230|     29|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|     29|                                     MeshDataT>::DecodePredictionData(buffer);
  232|     36|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|     28|                          const PointIndex * /* entry_to_point_id_map */) {
   87|     28|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|     28|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    140|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 112, False: 28]
  ------------------
   93|    112|    pred_vals[i].resize(num_components, 0);
   94|    112|  }
   95|     28|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|     28|                                         out_data);
   97|       |
   98|     28|  const CornerTable *const table = this->mesh_data().corner_table();
   99|     28|  const std::vector<int32_t> *const vertex_to_data_map =
  100|     28|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|     28|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|     28|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|     28|  const int corner_map_size =
  109|     28|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  3.09k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 3.07k, False: 15]
  ------------------
  111|  3.07k|    const CornerIndex start_corner_id =
  112|  3.07k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  3.07k|    CornerIndex corner_id(start_corner_id);
  115|  3.07k|    int num_parallelograms = 0;
  116|  3.07k|    bool first_pass = true;
  117|  7.35k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 4.37k, False: 2.98k]
  ------------------
  118|  4.37k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 430, False: 3.94k]
  ------------------
  119|  4.37k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  4.37k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|    430|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|    430|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 0, False: 430]
  ------------------
  127|      0|          break;
  128|      0|        }
  129|    430|      }
  130|       |
  131|       |      // Proceed to the next corner attached to the vertex. First swing left
  132|       |      // and if we reach a boundary, swing right from the start corner.
  133|  4.37k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 3.79k, False: 571]
  ------------------
  134|  3.79k|        corner_id = table->SwingLeft(corner_id);
  135|  3.79k|      } else {
  136|    571|        corner_id = table->SwingRight(corner_id);
  137|    571|      }
  138|  4.37k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 88, False: 4.28k]
  ------------------
  139|     88|        break;
  140|     88|      }
  141|  4.28k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 3.46k, False: 822]
  |  Branch (141:47): [True: 2.98k, False: 471]
  ------------------
  142|  2.98k|        first_pass = false;
  143|  2.98k|        corner_id = table->SwingRight(start_corner_id);
  144|  2.98k|      }
  145|  4.28k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  3.07k|    int num_used_parallelograms = 0;
  150|  3.07k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 429, False: 2.64k]
  ------------------
  151|  4.02k|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 3.59k, False: 429]
  ------------------
  152|  3.59k|        multi_pred_vals[i] = 0;
  153|  3.59k|      }
  154|       |      // Check which parallelograms are actually used.
  155|    845|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 429, False: 416]
  ------------------
  156|    429|        const int context = num_parallelograms - 1;
  157|    429|        const int pos = is_crease_edge_pos[context]++;
  158|    429|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 13, False: 416]
  ------------------
  159|     13|          return false;
  160|     13|        }
  161|    416|        const bool is_crease = is_crease_edge_[context][pos];
  162|    416|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 7, False: 409]
  ------------------
  163|      7|          ++num_used_parallelograms;
  164|    830|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 823, False: 7]
  ------------------
  165|    823|            multi_pred_vals[j] =
  166|    823|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|    823|          }
  168|      7|        }
  169|    416|      }
  170|    429|    }
  171|  3.06k|    const int dst_offset = p * num_components;
  172|  3.06k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 3.05k, False: 7]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  3.05k|      const int src_offset = (p - 1) * num_components;
  176|  3.05k|      this->transform().ComputeOriginalValue(
  177|  3.05k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  3.05k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|    830|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 823, False: 7]
  ------------------
  181|    823|        multi_pred_vals[c] /= num_used_parallelograms;
  182|    823|      }
  183|      7|      this->transform().ComputeOriginalValue(
  184|      7|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|      7|    }
  186|  3.06k|  }
  187|     15|  return true;
  188|     28|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|     45|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|     45|            attribute, transform, mesh_data),
   52|     45|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|     44|                                                                *buffer) {
  194|     44|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|     44|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     44|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 0, False: 44]
  ------------------
  196|       |    // Decode prediction mode.
  197|      0|    uint8_t mode;
  198|      0|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 0]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      0|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 0, False: 0]
  ------------------
  203|       |      // Unsupported mode.
  204|      0|      return false;
  205|      0|    }
  206|      0|  }
  207|     44|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|    202|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 165, False: 37]
  ------------------
  211|    165|    uint32_t num_flags;
  212|    165|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 2, False: 163]
  ------------------
  213|      2|      return false;
  214|      2|    }
  215|    163|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 3, False: 160]
  ------------------
  216|      3|      return false;
  217|      3|    }
  218|    160|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 131, False: 29]
  ------------------
  219|    131|      is_crease_edge_[i].resize(num_flags);
  220|    131|      RAnsBitDecoder decoder;
  221|    131|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 2, False: 129]
  ------------------
  222|      2|        return false;
  223|      2|      }
  224|  29.6k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 29.4k, False: 129]
  ------------------
  225|  29.4k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  29.4k|      }
  227|    129|      decoder.EndDecoding();
  228|    129|    }
  229|    160|  }
  230|     37|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|     37|                                     MeshDataT>::DecodePredictionData(buffer);
  232|     44|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|     31|                          const PointIndex * /* entry_to_point_id_map */) {
   87|     31|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|     31|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    155|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 124, False: 31]
  ------------------
   93|    124|    pred_vals[i].resize(num_components, 0);
   94|    124|  }
   95|     31|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|     31|                                         out_data);
   97|       |
   98|     31|  const CornerTable *const table = this->mesh_data().corner_table();
   99|     31|  const std::vector<int32_t> *const vertex_to_data_map =
  100|     31|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|     31|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|     31|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|     31|  const int corner_map_size =
  109|     31|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  1.95k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 1.94k, False: 12]
  ------------------
  111|  1.94k|    const CornerIndex start_corner_id =
  112|  1.94k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  1.94k|    CornerIndex corner_id(start_corner_id);
  115|  1.94k|    int num_parallelograms = 0;
  116|  1.94k|    bool first_pass = true;
  117|  7.11k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 6.03k, False: 1.08k]
  ------------------
  118|  6.03k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 962, False: 5.07k]
  ------------------
  119|  6.03k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  6.03k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|    962|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|    962|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 3, False: 959]
  ------------------
  127|      3|          break;
  128|      3|        }
  129|    962|      }
  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|  6.03k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 5.21k, False: 817]
  ------------------
  134|  5.21k|        corner_id = table->SwingLeft(corner_id);
  135|  5.21k|      } else {
  136|    817|        corner_id = table->SwingRight(corner_id);
  137|    817|      }
  138|  6.03k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 855, False: 5.17k]
  ------------------
  139|    855|        break;
  140|    855|      }
  141|  5.17k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 1.45k, False: 3.72k]
  |  Branch (141:47): [True: 1.08k, False: 365]
  ------------------
  142|  1.08k|        first_pass = false;
  143|  1.08k|        corner_id = table->SwingRight(start_corner_id);
  144|  1.08k|      }
  145|  5.17k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  1.94k|    int num_used_parallelograms = 0;
  150|  1.94k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 708, False: 1.23k]
  ------------------
  151|  34.7k|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 34.0k, False: 708]
  ------------------
  152|  34.0k|        multi_pred_vals[i] = 0;
  153|  34.0k|      }
  154|       |      // Check which parallelograms are actually used.
  155|  1.64k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 952, False: 689]
  ------------------
  156|    952|        const int context = num_parallelograms - 1;
  157|    952|        const int pos = is_crease_edge_pos[context]++;
  158|    952|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 19, False: 933]
  ------------------
  159|     19|          return false;
  160|     19|        }
  161|    933|        const bool is_crease = is_crease_edge_[context][pos];
  162|    933|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 435, False: 498]
  ------------------
  163|    435|          ++num_used_parallelograms;
  164|  11.3k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 10.9k, False: 435]
  ------------------
  165|  10.9k|            multi_pred_vals[j] =
  166|  10.9k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  10.9k|          }
  168|    435|        }
  169|    933|      }
  170|    708|    }
  171|  1.92k|    const int dst_offset = p * num_components;
  172|  1.92k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 1.49k, False: 422]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  1.49k|      const int src_offset = (p - 1) * num_components;
  176|  1.49k|      this->transform().ComputeOriginalValue(
  177|  1.49k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  1.49k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|  9.95k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 9.53k, False: 422]
  ------------------
  181|  9.53k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|  9.53k|      }
  183|    422|      this->transform().ComputeOriginalValue(
  184|    422|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|    422|    }
  186|  1.92k|  }
  187|     12|  return true;
  188|     31|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|    269|           const std::vector<int32_t> *vertex_to_data_map) {
   38|    269|    mesh_ = mesh;
   39|    269|    corner_table_ = table;
   40|    269|    data_to_corner_map_ = data_to_corner_map;
   41|    269|    vertex_to_data_map_ = vertex_to_data_map;
   42|    269|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|   204k|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|   163k|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|   163k|    return vertex_to_data_map_;
   48|   163k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|   169k|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|   169k|    return data_to_corner_map_;
   51|   169k|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|    381|           const std::vector<int32_t> *vertex_to_data_map) {
   38|    381|    mesh_ = mesh;
   39|    381|    corner_table_ = table;
   40|    381|    data_to_corner_map_ = data_to_corner_map;
   41|    381|    vertex_to_data_map_ = vertex_to_data_map;
   42|    381|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  4.85M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  4.49M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  4.49M|    return vertex_to_data_map_;
   48|  4.49M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|   743k|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|   743k|    return data_to_corner_map_;
   51|   743k|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|    269|      : mesh_(nullptr),
   31|    269|        corner_table_(nullptr),
   32|    269|        vertex_to_data_map_(nullptr),
   33|    269|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|    381|      : mesh_(nullptr),
   31|    381|        corner_table_(nullptr),
   32|    381|        vertex_to_data_map_(nullptr),
   33|    381|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  21.7k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   151k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   178k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    233|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    233|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   150k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    330|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    330|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   454k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|     12|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|     12|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|     22|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|     22|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|     19|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|     19|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|     28|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|     28|        mesh_data_(mesh_data) {}

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

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|     16|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|     16|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 4, False: 12]
  ------------------
  105|      4|      this->normal_prediction_mode_ = mode;
  106|      4|      return true;
  107|     12|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 12, False: 0]
  ------------------
  108|     12|      this->normal_prediction_mode_ = mode;
  109|     12|      return true;
  110|     12|    }
  111|      0|    return false;
  112|     16|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  21.7k|                             DataTypeT *prediction) override {
   42|  21.7k|    DRACO_DCHECK(this->IsInitialized());
   43|  21.7k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  21.7k|    const CornerTable *const corner_table = this->mesh_data_.corner_table();
   45|       |    // Going to compute the predicted normal from the surrounding triangles
   46|       |    // according to the connectivity of the given corner table.
   47|  21.7k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  21.7k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  21.7k|    VectorD<int64_t, 3> normal;
   53|  21.7k|    CornerIndex c_next, c_prev;
   54|  63.5k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 41.8k, False: 21.7k]
  ------------------
   55|       |      // Getting corners.
   56|  41.8k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 0, False: 41.8k]
  ------------------
   57|      0|        c_next = corner_table->Next(corner_id);
   58|      0|        c_prev = corner_table->Previous(corner_id);
   59|  41.8k|      } else {
   60|  41.8k|        c_next = corner_table->Next(cit.Corner());
   61|  41.8k|        c_prev = corner_table->Previous(cit.Corner());
   62|  41.8k|      }
   63|  41.8k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  41.8k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  41.8k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  41.8k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  41.8k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  41.8k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  41.8k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  41.8k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  41.8k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  41.8k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  41.8k|      cit.Next();
   81|  41.8k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  21.7k|    constexpr int64_t upper_bound = 1 << 29;
   85|  21.7k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 0, False: 21.7k]
  ------------------
   86|      0|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|      0|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 0, False: 0]
  ------------------
   88|      0|        const int64_t quotient = abs_sum / upper_bound;
   89|      0|        normal = normal / quotient;
   90|      0|      }
   91|  21.7k|    } else {
   92|  21.7k|      const int64_t abs_sum = normal.AbsSum();
   93|  21.7k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 98, False: 21.6k]
  ------------------
   94|     98|        const int64_t quotient = abs_sum / upper_bound;
   95|     98|        normal = normal / quotient;
   96|     98|      }
   97|  21.7k|    }
   98|  21.7k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  21.7k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  21.7k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  21.7k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  21.7k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|     22|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|     22|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 0, False: 22]
  ------------------
  105|      0|      this->normal_prediction_mode_ = mode;
  106|      0|      return true;
  107|     22|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 22, False: 0]
  ------------------
  108|     22|      this->normal_prediction_mode_ = mode;
  109|     22|      return true;
  110|     22|    }
  111|      0|    return false;
  112|     22|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   151k|                             DataTypeT *prediction) override {
   42|   151k|    DRACO_DCHECK(this->IsInitialized());
   43|   151k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   151k|    const CornerTable *const corner_table = this->mesh_data_.corner_table();
   45|       |    // Going to compute the predicted normal from the surrounding triangles
   46|       |    // according to the connectivity of the given corner table.
   47|   151k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   151k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   151k|    VectorD<int64_t, 3> normal;
   53|   151k|    CornerIndex c_next, c_prev;
   54|  1.05M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 905k, False: 151k]
  ------------------
   55|       |      // Getting corners.
   56|   905k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 0, False: 905k]
  ------------------
   57|      0|        c_next = corner_table->Next(corner_id);
   58|      0|        c_prev = corner_table->Previous(corner_id);
   59|   905k|      } else {
   60|   905k|        c_next = corner_table->Next(cit.Corner());
   61|   905k|        c_prev = corner_table->Previous(cit.Corner());
   62|   905k|      }
   63|   905k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   905k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   905k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   905k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   905k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   905k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   905k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   905k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   905k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   905k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   905k|      cit.Next();
   81|   905k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   151k|    constexpr int64_t upper_bound = 1 << 29;
   85|   151k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 0, False: 151k]
  ------------------
   86|      0|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|      0|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 0, False: 0]
  ------------------
   88|      0|        const int64_t quotient = abs_sum / upper_bound;
   89|      0|        normal = normal / quotient;
   90|      0|      }
   91|   151k|    } else {
   92|   151k|      const int64_t abs_sum = normal.AbsSum();
   93|   151k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 135k, False: 15.7k]
  ------------------
   94|   135k|        const int64_t quotient = abs_sum / upper_bound;
   95|   135k|        normal = normal / quotient;
   96|   135k|      }
   97|   151k|    }
   98|   151k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   151k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   151k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   151k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   151k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|     20|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|     20|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 1, False: 19]
  ------------------
  105|      1|      this->normal_prediction_mode_ = mode;
  106|      1|      return true;
  107|     19|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 19, False: 0]
  ------------------
  108|     19|      this->normal_prediction_mode_ = mode;
  109|     19|      return true;
  110|     19|    }
  111|      0|    return false;
  112|     20|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|     28|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|     28|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 0, False: 28]
  ------------------
  105|      0|      this->normal_prediction_mode_ = mode;
  106|      0|      return true;
  107|     28|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 28, False: 0]
  ------------------
  108|     28|      this->normal_prediction_mode_ = mode;
  109|     28|      return true;
  110|     28|    }
  111|      0|    return false;
  112|     28|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   178k|                             DataTypeT *prediction) override {
   42|   178k|    DRACO_DCHECK(this->IsInitialized());
   43|   178k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   178k|    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|   178k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   178k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   178k|    VectorD<int64_t, 3> normal;
   53|   178k|    CornerIndex c_next, c_prev;
   54|  1.24M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.07M, False: 178k]
  ------------------
   55|       |      // Getting corners.
   56|  1.07M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 0, False: 1.07M]
  ------------------
   57|      0|        c_next = corner_table->Next(corner_id);
   58|      0|        c_prev = corner_table->Previous(corner_id);
   59|  1.07M|      } else {
   60|  1.07M|        c_next = corner_table->Next(cit.Corner());
   61|  1.07M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.07M|      }
   63|  1.07M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.07M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.07M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.07M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.07M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.07M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.07M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.07M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.07M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.07M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.07M|      cit.Next();
   81|  1.07M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   178k|    constexpr int64_t upper_bound = 1 << 29;
   85|   178k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 0, False: 178k]
  ------------------
   86|      0|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|      0|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 0, False: 0]
  ------------------
   88|      0|        const int64_t quotient = abs_sum / upper_bound;
   89|      0|        normal = normal / quotient;
   90|      0|      }
   91|   178k|    } else {
   92|   178k|      const int64_t abs_sum = normal.AbsSum();
   93|   178k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 155k, False: 22.8k]
  ------------------
   94|   155k|        const int64_t quotient = abs_sum / upper_bound;
   95|   155k|        normal = normal / quotient;
   96|   155k|      }
   97|   178k|    }
   98|   178k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   178k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   178k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   178k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   178k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|     76|      : Base(md) {
   35|     76|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     76|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|     87|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|     87|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 10, False: 77]
  ------------------
  105|     10|      this->normal_prediction_mode_ = mode;
  106|     10|      return true;
  107|     77|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 77, False: 0]
  ------------------
  108|     77|      this->normal_prediction_mode_ = mode;
  109|     77|      return true;
  110|     77|    }
  111|      0|    return false;
  112|     87|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  13.7k|                             DataTypeT *prediction) override {
   42|  13.7k|    DRACO_DCHECK(this->IsInitialized());
   43|  13.7k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  13.7k|    const CornerTable *const corner_table = this->mesh_data_.corner_table();
   45|       |    // Going to compute the predicted normal from the surrounding triangles
   46|       |    // according to the connectivity of the given corner table.
   47|  13.7k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  13.7k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  13.7k|    VectorD<int64_t, 3> normal;
   53|  13.7k|    CornerIndex c_next, c_prev;
   54|  33.6k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 19.9k, False: 13.7k]
  ------------------
   55|       |      // Getting corners.
   56|  19.9k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 60, False: 19.8k]
  ------------------
   57|     60|        c_next = corner_table->Next(corner_id);
   58|     60|        c_prev = corner_table->Previous(corner_id);
   59|  19.8k|      } else {
   60|  19.8k|        c_next = corner_table->Next(cit.Corner());
   61|  19.8k|        c_prev = corner_table->Previous(cit.Corner());
   62|  19.8k|      }
   63|  19.9k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  19.9k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  19.9k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  19.9k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  19.9k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  19.9k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  19.9k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  19.9k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  19.9k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  19.9k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  19.9k|      cit.Next();
   81|  19.9k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  13.7k|    constexpr int64_t upper_bound = 1 << 29;
   85|  13.7k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 44, False: 13.7k]
  ------------------
   86|     44|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     44|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 16, False: 28]
  ------------------
   88|     16|        const int64_t quotient = abs_sum / upper_bound;
   89|     16|        normal = normal / quotient;
   90|     16|      }
   91|  13.7k|    } else {
   92|  13.7k|      const int64_t abs_sum = normal.AbsSum();
   93|  13.7k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.09k, False: 11.6k]
  ------------------
   94|  2.09k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.09k|        normal = normal / quotient;
   96|  2.09k|      }
   97|  13.7k|    }
   98|  13.7k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  13.7k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  13.7k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  13.7k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  13.7k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    173|      : Base(md) {
   35|    173|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    173|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    180|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    180|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 7, False: 173]
  ------------------
  105|      7|      this->normal_prediction_mode_ = mode;
  106|      7|      return true;
  107|    173|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 173, False: 0]
  ------------------
  108|    173|      this->normal_prediction_mode_ = mode;
  109|    173|      return true;
  110|    173|    }
  111|      0|    return false;
  112|    180|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  19.3k|                             DataTypeT *prediction) override {
   42|  19.3k|    DRACO_DCHECK(this->IsInitialized());
   43|  19.3k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  19.3k|    const CornerTable *const corner_table = this->mesh_data_.corner_table();
   45|       |    // Going to compute the predicted normal from the surrounding triangles
   46|       |    // according to the connectivity of the given corner table.
   47|  19.3k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  19.3k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  19.3k|    VectorD<int64_t, 3> normal;
   53|  19.3k|    CornerIndex c_next, c_prev;
   54|   109k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 89.9k, False: 19.3k]
  ------------------
   55|       |      // Getting corners.
   56|  89.9k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 36, False: 89.9k]
  ------------------
   57|     36|        c_next = corner_table->Next(corner_id);
   58|     36|        c_prev = corner_table->Previous(corner_id);
   59|  89.9k|      } else {
   60|  89.9k|        c_next = corner_table->Next(cit.Corner());
   61|  89.9k|        c_prev = corner_table->Previous(cit.Corner());
   62|  89.9k|      }
   63|  89.9k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  89.9k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  89.9k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  89.9k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  89.9k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  89.9k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  89.9k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  89.9k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  89.9k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  89.9k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  89.9k|      cit.Next();
   81|  89.9k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  19.3k|    constexpr int64_t upper_bound = 1 << 29;
   85|  19.3k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 36, False: 19.3k]
  ------------------
   86|     36|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     36|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 0, False: 36]
  ------------------
   88|      0|        const int64_t quotient = abs_sum / upper_bound;
   89|      0|        normal = normal / quotient;
   90|      0|      }
   91|  19.3k|    } else {
   92|  19.3k|      const int64_t abs_sum = normal.AbsSum();
   93|  19.3k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.69k, False: 17.6k]
  ------------------
   94|  1.69k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.69k|        normal = normal / quotient;
   96|  1.69k|      }
   97|  19.3k|    }
   98|  19.3k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  19.3k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  19.3k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  19.3k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  19.3k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|     12|      : Base(md) {
   35|     12|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     12|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|     22|      : Base(md) {
   35|     22|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     22|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|     19|      : Base(md) {
   35|     19|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     19|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|     28|      : Base(md) {
   35|     28|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     28|  };

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

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|     16|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|     16|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|     11|                          const PointIndex * /* entry_to_point_id_map */) {
   64|     11|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|     11|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|     11|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|     11|      new DataTypeT[num_components]());
   70|       |
   71|     11|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|     11|  const CornerTable *const table = this->mesh_data().corner_table();
   74|     11|  const std::vector<int32_t> *const vertex_to_data_map =
   75|     11|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|     11|  const int corner_map_size =
   78|     11|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   122k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 122k, False: 11]
  ------------------
   80|   122k|    const CornerIndex start_corner_id =
   81|   122k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   122k|    CornerIndex corner_id(start_corner_id);
   84|   122k|    int num_parallelograms = 0;
   85|  1.23M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 1.10M, False: 122k]
  ------------------
   86|  1.10M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  1.10M|    }
   88|   326k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 204k, False: 122k]
  ------------------
   89|   204k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 33.1k, False: 170k]
  ------------------
   90|   204k|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|   204k|              num_components, parallelogram_pred_vals.get())) {
   92|   334k|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 301k, False: 33.1k]
  ------------------
   93|   301k|          pred_vals[c] =
   94|   301k|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|   301k|        }
   96|  33.1k|        ++num_parallelograms;
   97|  33.1k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|   204k|      corner_id = table->SwingRight(corner_id);
  101|   204k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 15.5k, False: 188k]
  ------------------
  102|  15.5k|        corner_id = kInvalidCornerIndex;
  103|  15.5k|      }
  104|   204k|    }
  105|       |
  106|   122k|    const int dst_offset = p * num_components;
  107|   122k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 105k, False: 17.7k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|   105k|      const int src_offset = (p - 1) * num_components;
  111|   105k|      this->transform().ComputeOriginalValue(
  112|   105k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   105k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|   179k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 161k, False: 17.7k]
  ------------------
  116|   161k|        pred_vals[c] /= num_parallelograms;
  117|   161k|      }
  118|  17.7k|      this->transform().ComputeOriginalValue(
  119|  17.7k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|  17.7k|    }
  121|   122k|  }
  122|     11|  return true;
  123|     11|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|     73|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|     73|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|     63|                          const PointIndex * /* entry_to_point_id_map */) {
   64|     63|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|     63|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|     63|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|     63|      new DataTypeT[num_components]());
   70|       |
   71|     63|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|     63|  const CornerTable *const table = this->mesh_data().corner_table();
   74|     63|  const std::vector<int32_t> *const vertex_to_data_map =
   75|     63|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|     63|  const int corner_map_size =
   78|     63|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   377k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 377k, False: 63]
  ------------------
   80|   377k|    const CornerIndex start_corner_id =
   81|   377k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   377k|    CornerIndex corner_id(start_corner_id);
   84|   377k|    int num_parallelograms = 0;
   85|  1.51M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 1.13M, False: 377k]
  ------------------
   86|  1.13M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  1.13M|    }
   88|  2.64M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 2.26M, False: 377k]
  ------------------
   89|  2.26M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 729k, False: 1.53M]
  ------------------
   90|  2.26M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  2.26M|              num_components, parallelogram_pred_vals.get())) {
   92|  2.91M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 2.18M, False: 729k]
  ------------------
   93|  2.18M|          pred_vals[c] =
   94|  2.18M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  2.18M|        }
   96|   729k|        ++num_parallelograms;
   97|   729k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  2.26M|      corner_id = table->SwingRight(corner_id);
  101|  2.26M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 377k, False: 1.88M]
  ------------------
  102|   377k|        corner_id = kInvalidCornerIndex;
  103|   377k|      }
  104|  2.26M|    }
  105|       |
  106|   377k|    const int dst_offset = p * num_components;
  107|   377k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 381, False: 377k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|    381|      const int src_offset = (p - 1) * num_components;
  111|    381|      this->transform().ComputeOriginalValue(
  112|    381|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   377k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  1.50M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 1.13M, False: 377k]
  ------------------
  116|  1.13M|        pred_vals[c] /= num_parallelograms;
  117|  1.13M|      }
  118|   377k|      this->transform().ComputeOriginalValue(
  119|   377k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   377k|    }
  121|   377k|  }
  122|     63|  return true;
  123|     63|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|   214k|    int num_components, DataTypeT *out_prediction) {
   49|   214k|  const CornerIndex oci = table->Opposite(ci);
   50|   214k|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 114k, False: 99.7k]
  ------------------
   51|   114k|    return false;
   52|   114k|  }
   53|  99.7k|  int vert_opp, vert_next, vert_prev;
   54|  99.7k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  99.7k|                                        &vert_opp, &vert_next, &vert_prev);
   56|  99.7k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 49.7k, False: 49.9k]
  |  Branch (56:35): [True: 36.6k, False: 13.1k]
  ------------------
   57|  36.6k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 34.1k, False: 2.52k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  34.1k|    const int v_opp_off = vert_opp * num_components;
   60|  34.1k|    const int v_next_off = vert_next * num_components;
   61|  34.1k|    const int v_prev_off = vert_prev * num_components;
   62|   341k|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 306k, False: 34.1k]
  ------------------
   63|   306k|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|   306k|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|   306k|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|   306k|      const int64_t result =
   67|   306k|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|   306k|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|   306k|    }
   71|  34.1k|    return true;
   72|  34.1k|  }
   73|  65.6k|  return false;  // Not all data is available for prediction
   74|  99.7k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  99.7k|    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|  99.7k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  99.7k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  99.7k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  99.7k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  2.27M|    int num_components, DataTypeT *out_prediction) {
   49|  2.27M|  const CornerIndex oci = table->Opposite(ci);
   50|  2.27M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 1.22k, False: 2.27M]
  ------------------
   51|  1.22k|    return false;
   52|  1.22k|  }
   53|  2.27M|  int vert_opp, vert_next, vert_prev;
   54|  2.27M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  2.27M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  2.27M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 1.14M, False: 1.13M]
  |  Branch (56:35): [True: 805k, False: 335k]
  ------------------
   57|   805k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 737k, False: 67.0k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   737k|    const int v_opp_off = vert_opp * num_components;
   60|   737k|    const int v_next_off = vert_next * num_components;
   61|   737k|    const int v_prev_off = vert_prev * num_components;
   62|  3.14M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 2.41M, False: 737k]
  ------------------
   63|  2.41M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  2.41M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  2.41M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  2.41M|      const int64_t result =
   67|  2.41M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  2.41M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  2.41M|    }
   71|   737k|    return true;
   72|   737k|  }
   73|  1.53M|  return false;  // Not all data is available for prediction
   74|  2.27M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  2.27M|    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|  2.27M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  2.27M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  2.27M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  2.27M|}

_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|      8|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|      8|            attribute, transform, mesh_data),
   46|      8|        pos_attribute_(nullptr),
   47|      8|        entry_to_point_id_map_(nullptr),
   48|      8|        num_components_(0),
   49|      8|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   71|     16|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   73|      8|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|      8|    DRACO_DCHECK_EQ(i, 0);
   75|      8|    (void)i;
   76|      8|    return GeometryAttribute::POSITION;
   77|      8|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|      8|  bool SetParentAttribute(const PointAttribute *att) override {
   80|      8|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 8]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|      8|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 8]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|      8|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 0, False: 8]
  ------------------
   87|      0|      return false;  // Currently works only for 3 component positions.
   88|      0|    }
   89|      8|    pos_attribute_ = att;
   90|      8|    return true;
   91|      8|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  153|      8|    DecodePredictionData(DecoderBuffer *buffer) {
  154|       |  // Decode the delta coded orientations.
  155|      8|  uint32_t num_orientations = 0;
  156|      8|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|      8|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (156:7): [True: 0, False: 8]
  ------------------
  157|      0|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (157:9): [True: 0, False: 0]
  ------------------
  158|      0|      return false;
  159|      0|    }
  160|      8|  } else {
  161|      8|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (161:9): [True: 0, False: 8]
  ------------------
  162|      0|      return false;
  163|      0|    }
  164|      8|  }
  165|      8|  if (num_orientations == 0) {
  ------------------
  |  Branch (165:7): [True: 0, False: 8]
  ------------------
  166|      0|    return false;
  167|      0|  }
  168|      8|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (168:7): [True: 0, False: 8]
  ------------------
  169|       |    // We can't have more orientations than the maximum number of decoded
  170|       |    // values.
  171|      0|    return false;
  172|      0|  }
  173|      8|  orientations_.resize(num_orientations);
  174|      8|  bool last_orientation = true;
  175|      8|  RAnsBitDecoder decoder;
  176|      8|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (176:7): [True: 0, False: 8]
  ------------------
  177|      0|    return false;
  178|      0|  }
  179|    201|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (179:24): [True: 193, False: 8]
  ------------------
  180|    193|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (180:9): [True: 47, False: 146]
  ------------------
  181|     47|      last_orientation = !last_orientation;
  182|     47|    }
  183|    193|    orientations_[i] = last_orientation;
  184|    193|  }
  185|      8|  decoder.EndDecoding();
  186|      8|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  187|      8|                                     MeshDataT>::DecodePredictionData(buffer);
  188|      8|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|      1|                          const PointIndex *entry_to_point_id_map) {
  126|      1|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 0, False: 1]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      0|    return false;
  129|      0|  }
  130|      1|  num_components_ = num_components;
  131|      1|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|      1|  predicted_value_ =
  133|      1|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|      1|  this->transform().Init(num_components);
  135|       |
  136|      1|  const int corner_map_size =
  137|      1|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|    283|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (138:19): [True: 282, False: 1]
  ------------------
  139|    282|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  140|    282|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 282]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|    282|    const int dst_offset = p * num_components;
  145|    282|    this->transform().ComputeOriginalValue(
  146|    282|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  147|    282|  }
  148|      1|  return true;
  149|      1|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  193|    282|                          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|    282|  const CornerIndex next_corner_id =
  198|    282|      this->mesh_data().corner_table()->Next(corner_id);
  199|    282|  const CornerIndex prev_corner_id =
  200|    282|      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|    282|  int next_data_id, prev_data_id;
  204|       |
  205|    282|  int next_vert_id, prev_vert_id;
  206|    282|  next_vert_id =
  207|    282|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  208|    282|  prev_vert_id =
  209|    282|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  210|       |
  211|    282|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  212|    282|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  213|       |
  214|    282|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (214:7): [True: 189, False: 93]
  |  Branch (214:33): [True: 96, False: 93]
  ------------------
  215|       |    // Both other corners have available UV coordinates for prediction.
  216|     96|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  217|     96|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  218|     96|    if (p_uv == n_uv) {
  ------------------
  |  Branch (218:9): [True: 68, False: 28]
  ------------------
  219|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  220|       |      // Technically floats > INT_MAX are undefined, but compilers will
  221|       |      // convert those values to INT_MIN. We are being explicit here for asan.
  222|    136|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (222:24): [True: 136, False: 68]
  ------------------
  223|    136|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (223:13): [True: 0, False: 136]
  |  Branch (223:36): [True: 0, False: 136]
  ------------------
  224|    136|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (224:13): [True: 0, False: 136]
  ------------------
  225|      0|          predicted_value_[i] = INT_MIN;
  226|    136|        } else {
  227|    136|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  228|    136|        }
  229|    136|      }
  230|     68|      return true;
  231|     68|    }
  232|       |
  233|       |    // Get positions at all corners.
  234|     28|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  235|     28|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  236|     28|    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|     28|    const Vector3f pn = prev_pos - next_pos;
  261|     28|    const Vector3f cn = tip_pos - next_pos;
  262|     28|    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|     28|    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|     28|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|     56|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (273:9): [True: 0, False: 28]
  |  Branch (273:53): [True: 0, False: 28]
  ------------------
  274|      0|      s = pn.Dot(cn) / pn_norm2_squared;
  275|       |      // To get the coordinate t, we can use formula:
  276|       |      //      t = |C-N - (P-N) * s| / |P-N|
  277|       |      // Do not use std::sqrt to avoid changes in the bitstream.
  278|      0|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  279|     28|    } else {
  280|     28|      s = 0;
  281|     28|      t = 0;
  282|     28|    }
  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|     28|    const Vector2f pn_uv = p_uv - n_uv;
  299|     28|    const float pnus = pn_uv[0] * s + n_uv[0];
  300|     28|    const float pnut = pn_uv[0] * t;
  301|     28|    const float pnvs = pn_uv[1] * s + n_uv[1];
  302|     28|    const float pnvt = pn_uv[1] * t;
  303|     28|    Vector2f predicted_uv;
  304|     28|    if (orientations_.empty()) {
  ------------------
  |  Branch (304:9): [True: 0, False: 28]
  ------------------
  305|      0|      return false;
  306|      0|    }
  307|       |
  308|       |    // When decoding the data, we already know which orientation to use.
  309|     28|    const bool orientation = orientations_.back();
  310|     28|    orientations_.pop_back();
  311|     28|    if (orientation) {
  ------------------
  |  Branch (311:9): [True: 18, False: 10]
  ------------------
  312|     18|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  313|     18|    } else {
  314|     10|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  315|     10|    }
  316|     28|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (316:9): [True: 28, 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|     28|      const double u = floor(predicted_uv[0] + 0.5);
  321|     28|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (321:11): [True: 0, False: 28]
  |  Branch (321:28): [True: 0, False: 28]
  |  Branch (321:43): [True: 0, False: 28]
  ------------------
  322|      0|        predicted_value_[0] = INT_MIN;
  323|     28|      } else {
  324|     28|        predicted_value_[0] = static_cast<int>(u);
  325|     28|      }
  326|     28|      const double v = floor(predicted_uv[1] + 0.5);
  327|     28|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (327:11): [True: 0, False: 28]
  |  Branch (327:28): [True: 0, False: 28]
  |  Branch (327:43): [True: 0, False: 28]
  ------------------
  328|      0|        predicted_value_[1] = INT_MIN;
  329|     28|      } else {
  330|     28|        predicted_value_[1] = static_cast<int>(v);
  331|     28|      }
  332|     28|    } 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|     28|    return true;
  338|     28|  }
  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|    186|  int data_offset = 0;
  343|    186|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (343:7): [True: 93, False: 93]
  ------------------
  344|       |    // Use the value on the previous corner as the prediction.
  345|     93|    data_offset = prev_data_id * num_components_;
  346|     93|  }
  347|    186|  if (next_data_id < data_id) {
  ------------------
  |  Branch (347:7): [True: 0, False: 186]
  ------------------
  348|       |    // Use the value on the next corner as the prediction.
  349|      0|    data_offset = next_data_id * num_components_;
  350|    186|  } else {
  351|       |    // None of the other corners have a valid value. Use the last encoded value
  352|       |    // as the prediction if possible.
  353|    186|    if (data_id > 0) {
  ------------------
  |  Branch (353:9): [True: 185, False: 1]
  ------------------
  354|    185|      data_offset = (data_id - 1) * num_components_;
  355|    185|    } else {
  356|       |      // We are encoding the first value. Predict 0.
  357|      3|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (357:23): [True: 2, False: 1]
  ------------------
  358|      2|        predicted_value_[i] = 0;
  359|      2|      }
  360|      1|      return true;
  361|      1|    }
  362|    186|  }
  363|    555|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (363:19): [True: 370, False: 185]
  ------------------
  364|    370|    predicted_value_[i] = data[data_offset + i];
  365|    370|  }
  366|    185|  return true;
  367|    186|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|    192|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT *data) const {
  103|    192|    const int data_offset = entry_id * num_components_;
  104|    192|    return Vector2f(static_cast<float>(data[data_offset]),
  105|    192|                    static_cast<float>(data[data_offset + 1]));
  106|    192|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   94|     84|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|     84|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|     84|    Vector3f pos;
   97|     84|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|     84|                                 &pos[0]);
   99|     84|    return pos;
  100|     84|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_i:
   44|      2|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   45|      2|            attribute, transform, mesh_data),
   46|      2|        pos_attribute_(nullptr),
   47|      2|        entry_to_point_id_map_(nullptr),
   48|      2|        num_components_(0),
   49|      2|        version_(version) {}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   71|      4|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   73|      2|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   74|      2|    DRACO_DCHECK_EQ(i, 0);
   75|      2|    (void)i;
   76|      2|    return GeometryAttribute::POSITION;
   77|      2|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   79|      2|  bool SetParentAttribute(const PointAttribute *att) override {
   80|      2|    if (att == nullptr) {
  ------------------
  |  Branch (80:9): [True: 0, False: 2]
  ------------------
   81|      0|      return false;
   82|      0|    }
   83|      2|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (83:9): [True: 0, False: 2]
  ------------------
   84|      0|      return false;  // Invalid attribute type.
   85|      0|    }
   86|      2|    if (att->num_components() != 3) {
  ------------------
  |  Branch (86:9): [True: 0, False: 2]
  ------------------
   87|      0|      return false;  // Currently works only for 3 component positions.
   88|      0|    }
   89|      2|    pos_attribute_ = att;
   90|      2|    return true;
   91|      2|  }
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  153|      2|    DecodePredictionData(DecoderBuffer *buffer) {
  154|       |  // Decode the delta coded orientations.
  155|      2|  uint32_t num_orientations = 0;
  156|      2|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|      2|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (156:7): [True: 0, False: 2]
  ------------------
  157|      0|    if (!buffer->Decode(&num_orientations)) {
  ------------------
  |  Branch (157:9): [True: 0, False: 0]
  ------------------
  158|      0|      return false;
  159|      0|    }
  160|      2|  } else {
  161|      2|    if (!DecodeVarint(&num_orientations, buffer)) {
  ------------------
  |  Branch (161:9): [True: 0, False: 2]
  ------------------
  162|      0|      return false;
  163|      0|    }
  164|      2|  }
  165|      2|  if (num_orientations == 0) {
  ------------------
  |  Branch (165:7): [True: 0, False: 2]
  ------------------
  166|      0|    return false;
  167|      0|  }
  168|      2|  if (num_orientations > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (168:7): [True: 0, False: 2]
  ------------------
  169|       |    // We can't have more orientations than the maximum number of decoded
  170|       |    // values.
  171|      0|    return false;
  172|      0|  }
  173|      2|  orientations_.resize(num_orientations);
  174|      2|  bool last_orientation = true;
  175|      2|  RAnsBitDecoder decoder;
  176|      2|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (176:7): [True: 0, False: 2]
  ------------------
  177|      0|    return false;
  178|      0|  }
  179|  6.39k|  for (uint32_t i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (179:24): [True: 6.39k, False: 2]
  ------------------
  180|  6.39k|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (180:9): [True: 3.76k, False: 2.63k]
  ------------------
  181|  3.76k|      last_orientation = !last_orientation;
  182|  3.76k|    }
  183|  6.39k|    orientations_[i] = last_orientation;
  184|  6.39k|  }
  185|      2|  decoder.EndDecoding();
  186|      2|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  187|      2|                                     MeshDataT>::DecodePredictionData(buffer);
  188|      2|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  125|      2|                          const PointIndex *entry_to_point_id_map) {
  126|      2|  if (num_components != 2) {
  ------------------
  |  Branch (126:7): [True: 0, False: 2]
  ------------------
  127|       |    // Corrupt/malformed input. Two output components are req'd.
  128|      0|    return false;
  129|      0|  }
  130|      2|  num_components_ = num_components;
  131|      2|  entry_to_point_id_map_ = entry_to_point_id_map;
  132|      2|  predicted_value_ =
  133|      2|      std::unique_ptr<DataTypeT[]>(new DataTypeT[num_components]);
  134|      2|  this->transform().Init(num_components);
  135|       |
  136|      2|  const int corner_map_size =
  137|      2|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  138|  6.70k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (138:19): [True: 6.70k, False: 0]
  ------------------
  139|  6.70k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  140|  6.70k|    if (!ComputePredictedValue(corner_id, out_data, p)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 6.70k]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|  6.70k|    const int dst_offset = p * num_components;
  145|  6.70k|    this->transform().ComputeOriginalValue(
  146|  6.70k|        predicted_value_.get(), in_corr + dst_offset, out_data + dst_offset);
  147|  6.70k|  }
  148|      0|  return true;
  149|      2|}
_ZN5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
  193|  6.70k|                          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|  6.70k|  const CornerIndex next_corner_id =
  198|  6.70k|      this->mesh_data().corner_table()->Next(corner_id);
  199|  6.70k|  const CornerIndex prev_corner_id =
  200|  6.70k|      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|  6.70k|  int next_data_id, prev_data_id;
  204|       |
  205|  6.70k|  int next_vert_id, prev_vert_id;
  206|  6.70k|  next_vert_id =
  207|  6.70k|      this->mesh_data().corner_table()->Vertex(next_corner_id).value();
  208|  6.70k|  prev_vert_id =
  209|  6.70k|      this->mesh_data().corner_table()->Vertex(prev_corner_id).value();
  210|       |
  211|  6.70k|  next_data_id = this->mesh_data().vertex_to_data_map()->at(next_vert_id);
  212|  6.70k|  prev_data_id = this->mesh_data().vertex_to_data_map()->at(prev_vert_id);
  213|       |
  214|  6.70k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (214:7): [True: 6.69k, False: 3]
  |  Branch (214:33): [True: 6.69k, False: 3]
  ------------------
  215|       |    // Both other corners have available UV coordinates for prediction.
  216|  6.69k|    const Vector2f n_uv = GetTexCoordForEntryId(next_data_id, data);
  217|  6.69k|    const Vector2f p_uv = GetTexCoordForEntryId(prev_data_id, data);
  218|  6.69k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (218:9): [True: 297, False: 6.39k]
  ------------------
  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|    594|      for (const int i : {0, 1}) {
  ------------------
  |  Branch (222:24): [True: 594, False: 297]
  ------------------
  223|    594|        if (std::isnan(p_uv[i]) || static_cast<double>(p_uv[i]) > INT_MAX ||
  ------------------
  |  Branch (223:13): [True: 0, False: 594]
  |  Branch (223:36): [True: 0, False: 594]
  ------------------
  224|    594|            static_cast<double>(p_uv[i]) < INT_MIN) {
  ------------------
  |  Branch (224:13): [True: 0, False: 594]
  ------------------
  225|      0|          predicted_value_[i] = INT_MIN;
  226|    594|        } else {
  227|    594|          predicted_value_[i] = static_cast<int>(p_uv[i]);
  228|    594|        }
  229|    594|      }
  230|    297|      return true;
  231|    297|    }
  232|       |
  233|       |    // Get positions at all corners.
  234|  6.39k|    const Vector3f tip_pos = GetPositionForEntryId(data_id);
  235|  6.39k|    const Vector3f next_pos = GetPositionForEntryId(next_data_id);
  236|  6.39k|    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|  6.39k|    const Vector3f pn = prev_pos - next_pos;
  261|  6.39k|    const Vector3f cn = tip_pos - next_pos;
  262|  6.39k|    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|  6.39k|    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|  6.39k|    if (version_ < DRACO_BITSTREAM_VERSION(1, 2) || pn_norm2_squared > 0) {
  ------------------
  |  |  115|  12.7k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (273:9): [True: 0, False: 6.39k]
  |  Branch (273:53): [True: 0, False: 6.39k]
  ------------------
  274|      0|      s = pn.Dot(cn) / pn_norm2_squared;
  275|       |      // To get the coordinate t, we can use formula:
  276|       |      //      t = |C-N - (P-N) * s| / |P-N|
  277|       |      // Do not use std::sqrt to avoid changes in the bitstream.
  278|      0|      t = sqrt((cn - pn * s).SquaredNorm() / pn_norm2_squared);
  279|  6.39k|    } else {
  280|  6.39k|      s = 0;
  281|  6.39k|      t = 0;
  282|  6.39k|    }
  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|  6.39k|    const Vector2f pn_uv = p_uv - n_uv;
  299|  6.39k|    const float pnus = pn_uv[0] * s + n_uv[0];
  300|  6.39k|    const float pnut = pn_uv[0] * t;
  301|  6.39k|    const float pnvs = pn_uv[1] * s + n_uv[1];
  302|  6.39k|    const float pnvt = pn_uv[1] * t;
  303|  6.39k|    Vector2f predicted_uv;
  304|  6.39k|    if (orientations_.empty()) {
  ------------------
  |  Branch (304:9): [True: 2, False: 6.39k]
  ------------------
  305|      2|      return false;
  306|      2|    }
  307|       |
  308|       |    // When decoding the data, we already know which orientation to use.
  309|  6.39k|    const bool orientation = orientations_.back();
  310|  6.39k|    orientations_.pop_back();
  311|  6.39k|    if (orientation) {
  ------------------
  |  Branch (311:9): [True: 4.49k, False: 1.89k]
  ------------------
  312|  4.49k|      predicted_uv = Vector2f(pnus - pnvt, pnvs + pnut);
  313|  4.49k|    } else {
  314|  1.89k|      predicted_uv = Vector2f(pnus + pnvt, pnvs - pnut);
  315|  1.89k|    }
  316|  6.39k|    if (std::is_integral<DataTypeT>::value) {
  ------------------
  |  Branch (316:9): [True: 6.39k, 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|  6.39k|      const double u = floor(predicted_uv[0] + 0.5);
  321|  6.39k|      if (std::isnan(u) || u > INT_MAX || u < INT_MIN) {
  ------------------
  |  Branch (321:11): [True: 0, False: 6.39k]
  |  Branch (321:28): [True: 0, False: 6.39k]
  |  Branch (321:43): [True: 0, False: 6.39k]
  ------------------
  322|      0|        predicted_value_[0] = INT_MIN;
  323|  6.39k|      } else {
  324|  6.39k|        predicted_value_[0] = static_cast<int>(u);
  325|  6.39k|      }
  326|  6.39k|      const double v = floor(predicted_uv[1] + 0.5);
  327|  6.39k|      if (std::isnan(v) || v > INT_MAX || v < INT_MIN) {
  ------------------
  |  Branch (327:11): [True: 0, False: 6.39k]
  |  Branch (327:28): [True: 0, False: 6.39k]
  |  Branch (327:43): [True: 0, False: 6.39k]
  ------------------
  328|      0|        predicted_value_[1] = INT_MIN;
  329|  6.39k|      } else {
  330|  6.39k|        predicted_value_[1] = static_cast<int>(v);
  331|  6.39k|      }
  332|  6.39k|    } 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|  6.39k|    return true;
  338|  6.39k|  }
  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|      6|  int data_offset = 0;
  343|      6|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (343:7): [True: 3, False: 3]
  ------------------
  344|       |    // Use the value on the previous corner as the prediction.
  345|      3|    data_offset = prev_data_id * num_components_;
  346|      3|  }
  347|      6|  if (next_data_id < data_id) {
  ------------------
  |  Branch (347:7): [True: 0, False: 6]
  ------------------
  348|       |    // Use the value on the next corner as the prediction.
  349|      0|    data_offset = next_data_id * num_components_;
  350|      6|  } else {
  351|       |    // None of the other corners have a valid value. Use the last encoded value
  352|       |    // as the prediction if possible.
  353|      6|    if (data_id > 0) {
  ------------------
  |  Branch (353:9): [True: 4, False: 2]
  ------------------
  354|      4|      data_offset = (data_id - 1) * num_components_;
  355|      4|    } else {
  356|       |      // We are encoding the first value. Predict 0.
  357|      6|      for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (357:23): [True: 4, False: 2]
  ------------------
  358|      4|        predicted_value_[i] = 0;
  359|      4|      }
  360|      2|      return true;
  361|      2|    }
  362|      6|  }
  363|     12|  for (int i = 0; i < num_components_; ++i) {
  ------------------
  |  Branch (363:19): [True: 8, False: 4]
  ------------------
  364|      8|    predicted_value_[i] = data[data_offset + i];
  365|      8|  }
  366|      4|  return true;
  367|      6|}
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
  102|  13.3k|  Vector2f GetTexCoordForEntryId(int entry_id, const DataTypeT *data) const {
  103|  13.3k|    const int data_offset = entry_id * num_components_;
  104|  13.3k|    return Vector2f(static_cast<float>(data[data_offset]),
  105|  13.3k|                    static_cast<float>(data[data_offset + 1]));
  106|  13.3k|  }
_ZNK5draco36MeshPredictionSchemeTexCoordsDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   94|  19.1k|  Vector3f GetPositionForEntryId(int entry_id) const {
   95|  19.1k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   96|  19.1k|    Vector3f pos;
   97|  19.1k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   98|  19.1k|                                 &pos[0]);
   99|  19.1k|    return pos;
  100|  19.1k|  }

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

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

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     16|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|     50|  bool AreCorrectionsPositive() override {
   71|     50|    return transform_.AreCorrectionsPositive();
   72|     50|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     16|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     16|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 12, False: 4]
  ------------------
   50|     12|      return false;
   51|     12|    }
   52|      4|    return true;
   53|     16|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|   172k|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     19|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|     66|  bool AreCorrectionsPositive() override {
   71|     66|    return transform_.AreCorrectionsPositive();
   72|     66|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     19|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     19|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 7, False: 12]
  ------------------
   50|      7|      return false;
   51|      7|    }
   52|     12|    return true;
   53|     19|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|   252k|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    583|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|    292|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|    561|  bool AreCorrectionsPositive() override {
   71|    561|    return transform_.AreCorrectionsPositive();
   72|    561|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    290|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    290|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 34, False: 256]
  ------------------
   50|     34|      return false;
   51|     34|    }
   52|    256|    return true;
   53|    290|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|   584k|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|     50|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|     66|      : attribute_(attribute), transform_(transform) {}

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

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

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|     43|    uint16_t bitstream_version) {
   38|     43|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|     43|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 43, False: 0]
  ------------------
   40|     43|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 1, False: 42]
  ------------------
   41|     42|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 0, False: 42]
  ------------------
   42|     42|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 42]
  ------------------
   43|     42|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 0, False: 42]
  ------------------
   44|     42|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 34, False: 8]
  ------------------
   45|     41|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 6, False: 2]
  ------------------
   46|     41|    const CornerTable *const ct = source->GetCornerTable();
   47|     41|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|     41|        source->GetAttributeEncodingData(att_id);
   49|     41|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 6, False: 35]
  |  Branch (49:26): [True: 0, False: 35]
  ------------------
   50|       |      // No connectivity data found.
   51|      6|      return nullptr;
   52|      6|    }
   53|       |    // Connectivity data exists.
   54|     35|    const MeshAttributeCornerTable *const att_ct =
   55|     35|        source->GetAttributeCornerTable(att_id);
   56|     35|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 12, False: 23]
  ------------------
   57|     12|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|     12|      MeshData md;
   59|     12|      md.Set(source->mesh(), att_ct,
   60|     12|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|     12|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|     12|      MeshPredictionSchemeFactoryT factory;
   63|     12|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|     12|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 12, False: 0]
  ------------------
   65|     12|        return ret;
   66|     12|      }
   67|     23|    } else {
   68|     23|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|     23|      MeshData md;
   70|     23|      md.Set(source->mesh(), ct,
   71|     23|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|     23|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|     23|      MeshPredictionSchemeFactoryT factory;
   74|     23|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|     23|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 22, False: 1]
  ------------------
   76|     22|        return ret;
   77|     22|      }
   78|     23|    }
   79|     35|  }
   80|      3|  return nullptr;
   81|     43|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|     66|    uint16_t bitstream_version) {
   38|     66|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|     66|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 66, False: 0]
  ------------------
   40|     66|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 7, False: 59]
  ------------------
   41|     59|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 0, False: 59]
  ------------------
   42|     59|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 59]
  ------------------
   43|     59|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 0, False: 59]
  ------------------
   44|     59|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 48, False: 11]
  ------------------
   45|     60|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 5, False: 6]
  ------------------
   46|     60|    const CornerTable *const ct = source->GetCornerTable();
   47|     60|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|     60|        source->GetAttributeEncodingData(att_id);
   49|     60|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 8, False: 52]
  |  Branch (49:26): [True: 0, False: 52]
  ------------------
   50|       |      // No connectivity data found.
   51|      8|      return nullptr;
   52|      8|    }
   53|       |    // Connectivity data exists.
   54|     52|    const MeshAttributeCornerTable *const att_ct =
   55|     52|        source->GetAttributeCornerTable(att_id);
   56|     52|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 24, False: 28]
  ------------------
   57|     24|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|     24|      MeshData md;
   59|     24|      md.Set(source->mesh(), att_ct,
   60|     24|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|     24|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|     24|      MeshPredictionSchemeFactoryT factory;
   63|     24|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|     24|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 19, False: 5]
  ------------------
   65|     19|        return ret;
   66|     19|      }
   67|     28|    } else {
   68|     28|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|     28|      MeshData md;
   70|     28|      md.Set(source->mesh(), ct,
   71|     28|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|     28|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|     28|      MeshPredictionSchemeFactoryT factory;
   74|     28|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|     28|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 28, False: 0]
  ------------------
   76|     28|        return ret;
   77|     28|      }
   78|     28|    }
   79|     52|  }
   80|     11|  return nullptr;
   81|     66|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    583|    uint16_t bitstream_version) {
   38|    583|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    583|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 583, False: 0]
  ------------------
   40|    583|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 88, False: 495]
  ------------------
   41|    495|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 92, False: 403]
  ------------------
   42|    403|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 95, False: 308]
  ------------------
   43|    308|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 32, False: 276]
  ------------------
   44|    276|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 250, False: 26]
  ------------------
   45|    569|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 12, False: 14]
  ------------------
   46|    569|    const CornerTable *const ct = source->GetCornerTable();
   47|    569|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    569|        source->GetAttributeEncodingData(att_id);
   49|    569|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 6, False: 563]
  |  Branch (49:26): [True: 0, False: 563]
  ------------------
   50|       |      // No connectivity data found.
   51|      6|      return nullptr;
   52|      6|    }
   53|       |    // Connectivity data exists.
   54|    563|    const MeshAttributeCornerTable *const att_ct =
   55|    563|        source->GetAttributeCornerTable(att_id);
   56|    563|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 233, False: 330]
  ------------------
   57|    233|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    233|      MeshData md;
   59|    233|      md.Set(source->mesh(), att_ct,
   60|    233|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    233|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    233|      MeshPredictionSchemeFactoryT factory;
   63|    233|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    233|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 233, False: 0]
  ------------------
   65|    233|        return ret;
   66|    233|      }
   67|    330|    } else {
   68|    330|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    330|      MeshData md;
   70|    330|      md.Set(source->mesh(), ct,
   71|    330|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    330|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    330|      MeshPredictionSchemeFactoryT factory;
   74|    330|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    330|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 330, False: 0]
  ------------------
   76|    330|        return ret;
   77|    330|      }
   78|    330|    }
   79|    563|  }
   80|     14|  return nullptr;
   81|    583|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|   252k|  bool IsInBottomLeft(const Point2 &p) const {
   93|   252k|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 95.3k, False: 157k]
  |  Branch (93:22): [True: 67.1k, False: 28.2k]
  ------------------
   94|  67.1k|      return true;
   95|  67.1k|    }
   96|   185k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 77.3k, False: 107k]
  |  Branch (96:25): [True: 36.1k, False: 41.1k]
  ------------------
   97|   252k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|   252k|  int32_t GetRotationCount(Point2 pred) const {
   51|   252k|    const DataType sign_x = pred[0];
   52|   252k|    const DataType sign_y = pred[1];
   53|       |
   54|   252k|    int32_t rotation_count = 0;
   55|   252k|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 95.3k, False: 157k]
  ------------------
   56|  95.3k|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 67.1k, False: 28.2k]
  ------------------
   57|  67.1k|        rotation_count = 0;
   58|  67.1k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 24.8k, False: 3.39k]
  ------------------
   59|  24.8k|        rotation_count = 3;
   60|  24.8k|      } else {
   61|  3.39k|        rotation_count = 1;
   62|  3.39k|      }
   63|   157k|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 79.7k, False: 77.3k]
  ------------------
   64|  79.7k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 37.7k, False: 41.9k]
  ------------------
   65|  37.7k|        rotation_count = 2;
   66|  41.9k|      } else {
   67|  41.9k|        rotation_count = 1;
   68|  41.9k|      }
   69|  79.7k|    } else {
   70|  77.3k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 36.1k, False: 41.1k]
  ------------------
   71|  36.1k|        rotation_count = 0;
   72|  41.1k|      } else {
   73|  41.1k|        rotation_count = 3;
   74|  41.1k|      }
   75|  77.3k|    }
   76|   252k|    return rotation_count;
   77|   252k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   298k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   298k|    switch (rotation_count) {
   81|   111k|      case 1:
  ------------------
  |  Branch (81:7): [True: 111k, False: 186k]
  ------------------
   82|   111k|        return Point2(p[1], -p[0]);
   83|  75.4k|      case 2:
  ------------------
  |  Branch (83:7): [True: 75.4k, False: 222k]
  ------------------
   84|  75.4k|        return Point2(-p[0], -p[1]);
   85|   111k|      case 3:
  ------------------
  |  Branch (85:7): [True: 111k, False: 186k]
  ------------------
   86|   111k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 298k]
  ------------------
   88|      0|        return p;
   89|   298k|    }
   90|   298k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|     66|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|    561|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|    504|  inline void set_min_value(const DataTypeT &v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|    504|  inline void set_max_value(const DataTypeT &v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|    504|  bool InitCorrectionBounds() {
   84|    504|    const int64_t dif =
   85|    504|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|    504|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 504]
  |  Branch (86:20): [True: 3, False: 501]
  ------------------
   87|      3|      return false;
   88|      3|    }
   89|    501|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|    501|    max_correction_ = max_dif_ / 2;
   91|    501|    min_correction_ = -max_correction_;
   92|    501|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 249, False: 252]
  ------------------
   93|    249|      max_correction_ -= 1;
   94|    249|    }
   95|    501|    return true;
   96|    504|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|    256|  void Init(int num_components) {
   56|    256|    num_components_ = num_components;
   57|    256|    clamped_value_.resize(num_components);
   58|    256|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|   583k|      const DataTypeT *predicted_val) const {
   64|  3.15M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 2.57M, False: 583k]
  ------------------
   65|  2.57M|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 36.7k, False: 2.53M]
  ------------------
   66|  36.7k|        clamped_value_[i] = max_value_;
   67|  2.53M|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 392k, False: 2.14M]
  ------------------
   68|   392k|        clamped_value_[i] = min_value_;
   69|  2.14M|      } else {
   70|  2.14M|        clamped_value_[i] = predicted_val[i];
   71|  2.14M|      }
   72|  2.57M|    }
   73|   583k|    return clamped_value_.data();
   74|   583k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|  6.31M|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|  2.57M|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|   368k|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|  2.56M|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|    231|  int quantization_bits() const {
   78|    231|    DRACO_DCHECK(false);
   79|    231|    return -1;
   80|    231|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   44|    583|      : num_components_(0),
   45|    583|        min_value_(0),
   46|    583|        max_value_(0),
   47|    583|        max_dif_(0),
   48|    583|        max_correction_(0),
   49|    583|        min_correction_(0) {}

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

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  1.12k|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|  98.1k|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|    699|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  3.36k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  1.25k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  1.25k|    portable_attribute_ = std::move(att);
   71|  1.25k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  3.94k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  4.45k|  virtual ~SequentialAttributeDecoder() = default;

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  3.07k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|    412|    DecoderBuffer *buffer) {
   30|    412|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 32, False: 380]
  ------------------
   31|     32|    return false;
   32|     32|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|    380|  const int32_t num_attributes = GetNumAttributes();
   35|    380|  sequential_decoders_.resize(num_attributes);
   36|  4.83k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 4.45k, False: 375]
  ------------------
   37|  4.45k|    uint8_t decoder_type;
   38|  4.45k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 1, False: 4.45k]
  ------------------
   39|      1|      return false;
   40|      1|    }
   41|       |    // Create the decoder from the id.
   42|  4.45k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  4.45k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 3, False: 4.45k]
  ------------------
   44|      3|      return false;
   45|      3|    }
   46|  4.45k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 1, False: 4.45k]
  ------------------
   47|      1|      return false;
   48|      1|    }
   49|  4.45k|  }
   50|    375|  return true;
   51|    380|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|    367|    DecoderBuffer *buffer) {
   55|    367|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 367]
  |  Branch (55:22): [True: 1, False: 366]
  ------------------
   56|      1|    return false;
   57|      1|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|    366|  const int32_t num_attributes = GetNumAttributes();
   60|  4.76k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 4.39k, False: 366]
  ------------------
   61|  4.39k|    PointAttribute *const pa =
   62|  4.39k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  4.39k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 0, False: 4.39k]
  ------------------
   64|      0|      return false;
   65|      0|    }
   66|  4.39k|  }
   67|    366|  return AttributesDecoder::DecodeAttributes(buffer);
   68|    366|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|    366|    DecoderBuffer *in_buffer) {
   72|    366|  const int32_t num_attributes = GetNumAttributes();
   73|  2.14k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 2.02k, False: 123]
  ------------------
   74|  2.02k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 243, False: 1.77k]
  ------------------
   75|  2.02k|                                                          in_buffer)) {
   76|    243|      return false;
   77|    243|    }
   78|  2.02k|  }
   79|    123|  return true;
   80|    366|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|    123|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|    123|  const int32_t num_attributes = GetNumAttributes();
   85|    655|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 573, False: 82]
  ------------------
   86|    573|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 41, False: 532]
  ------------------
   87|    573|            point_ids_, in_buffer)) {
   88|     41|      return false;
   89|     41|    }
   90|    573|  }
   91|     82|  return true;
   92|    123|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|     82|    TransformAttributesToOriginalFormat() {
   96|     82|  const int32_t num_attributes = GetNumAttributes();
   97|    539|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 498, False: 41]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|    498|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 498, False: 0]
  ------------------
  100|    498|      const PointAttribute *const attribute =
  101|    498|          sequential_decoders_[i]->attribute();
  102|    498|      const PointAttribute *const portable_attribute =
  103|    498|          sequential_decoders_[i]->GetPortableAttribute();
  104|    498|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 215, False: 283]
  |  Branch (104:11): [True: 61, False: 437]
  ------------------
  105|    215|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 61, False: 154]
  ------------------
  106|    215|              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|     61|        sequential_decoders_[i]->attribute()->CopyFrom(*portable_attribute);
  113|     61|        continue;
  114|     61|      }
  115|    498|    }
  116|    437|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 41, False: 396]
  ------------------
  117|    437|            point_ids_)) {
  118|     41|      return false;
  119|     41|    }
  120|    437|  }
  121|     41|  return true;
  122|     82|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  4.45k|    uint8_t decoder_type) {
  127|  4.45k|  switch (decoder_type) {
  128|  1.62k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 1.62k, False: 2.83k]
  ------------------
  129|  1.62k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  1.62k|          new SequentialAttributeDecoder());
  131|  2.67k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 2.67k, False: 1.78k]
  ------------------
  132|  2.67k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  2.67k|          new SequentialIntegerAttributeDecoder());
  134|     22|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 22, False: 4.43k]
  ------------------
  135|     22|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|     22|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|    141|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 141, False: 4.31k]
  ------------------
  139|    141|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|    141|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|      3|    default:
  ------------------
  |  Branch (142:5): [True: 3, False: 4.45k]
  ------------------
  143|      3|      break;
  144|  4.45k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|      3|  return nullptr;
  147|  4.45k|}

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

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

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

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

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

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

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

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|   245k|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|   245k|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|   245k|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|   245k|    const int remaining = 32 - num_used_bits_;
   54|   245k|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 236k, False: 9.66k]
  ------------------
   55|   236k|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 33, False: 236k]
  ------------------
   56|     33|        return false;
   57|     33|      }
   58|   236k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   236k|      num_used_bits_ += nbits;
   60|   236k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 7.96k, False: 228k]
  ------------------
   61|  7.96k|        ++pos_;
   62|  7.96k|        num_used_bits_ = 0;
   63|  7.96k|      }
   64|   236k|    } else {
   65|  9.66k|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 39, False: 9.62k]
  ------------------
   66|     39|        return false;
   67|     39|      }
   68|  9.62k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  9.62k|      num_used_bits_ = nbits - remaining;
   70|  9.62k|      ++pos_;
   71|  9.62k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  9.62k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  9.62k|    }
   74|   245k|    return true;
   75|   245k|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  2.19M|  bool DecodeNextBit() {
   35|  2.19M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  2.19M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 1.85M, False: 339k]
  ------------------
   37|  1.85M|      return false;
   38|  1.85M|    }
   39|   339k|    const bool bit = *pos_ & selector;
   40|   339k|    ++num_used_bits_;
   41|   339k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 10.5k, False: 329k]
  ------------------
   42|  10.5k|      ++pos_;
   43|  10.5k|      num_used_bits_ = 0;
   44|  10.5k|    }
   45|   339k|    return bit;
   46|  2.19M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    324|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    270|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    245|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  7.42k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 7.20k, False: 219]
  ------------------
   35|  7.20k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 26, False: 7.17k]
  ------------------
   36|     26|        return false;
   37|     26|      }
   38|  7.20k|    }
   39|    219|    return bit_decoder_.StartDecoding(source_buffer);
   40|    245|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  2.25M|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|  2.25M|    uint32_t result = 0;
   49|  14.0M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 11.7M, False: 2.25M]
  ------------------
   50|  11.7M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  11.7M|      result = (result << 1) + bit;
   52|  11.7M|    }
   53|  2.25M|    *value = result;
   54|  2.25M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|    108|  void EndDecoding() {
   57|  3.56k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 3.45k, False: 108]
  ------------------
   58|  3.45k|      folded_number_decoders_[i].EndDecoding();
   59|  3.45k|    }
   60|    108|    bit_decoder_.EndDecoding();
   61|    108|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    270|  FoldedBit32Decoder() {}

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  12.4k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  9.87k|                                const uint8_t *const buf, int offset) {
  301|  9.87k|  unsigned x;
  302|  9.87k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 12, False: 9.86k]
  ------------------
  303|     12|    return 1;
  304|     12|  }
  305|  9.86k|  ans->buf = buf;
  306|  9.86k|  x = buf[offset - 1] >> 6;
  307|  9.86k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 8.76k, False: 1.09k]
  ------------------
  308|  8.76k|    ans->buf_offset = offset - 1;
  309|  8.76k|    ans->state = buf[offset - 1] & 0x3F;
  310|  8.76k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 1.02k, False: 75]
  ------------------
  311|  1.02k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 1, False: 1.02k]
  ------------------
  312|      1|      return 1;
  313|      1|    }
  314|  1.02k|    ans->buf_offset = offset - 2;
  315|  1.02k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  1.02k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 61, False: 14]
  ------------------
  317|     61|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 0, False: 61]
  ------------------
  318|      0|      return 1;
  319|      0|    }
  320|     61|    ans->buf_offset = offset - 3;
  321|     61|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|     61|  } else {
  323|     14|    return 1;
  324|     14|  }
  325|  9.85k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  9.85k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  9.85k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  9.85k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  9.85k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 0, False: 9.85k]
  ------------------
  327|      0|    return 1;
  328|      0|  }
  329|  9.85k|  return 0;
  330|  9.85k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  1.02k|static uint32_t mem_get_le16(const void *vmem) {
   68|  1.02k|  uint32_t val;
   69|  1.02k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  1.02k|  val = mem[1] << 8;
   72|  1.02k|  val |= mem[0];
   73|  1.02k|  return val;
   74|  1.02k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|     61|static uint32_t mem_get_le24(const void *vmem) {
   77|     61|  uint32_t val;
   78|     61|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|     61|  val = mem[2] << 16;
   81|     61|  val |= mem[1] << 8;
   82|     61|  val |= mem[0];
   83|     61|  return val;
   84|     61|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|   429M|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|   429M|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|   429M|  unsigned quot, rem, x, xn;
  172|   429M|#endif
  173|   429M|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|   429M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|   429M|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|   858M|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 421M, False: 8.08M]
  |  Branch (174:40): [True: 41.4k, False: 421M]
  ------------------
  175|  41.4k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|  41.4k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|  41.4k|  }
  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|   429M|  x = ans->state;
  184|   429M|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|   429M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|   429M|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|   429M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|   429M|  xn = quot * p;
  187|   429M|  val = rem < p;
  188|   429M|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|   858M|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 422M, False: 7.04M]
  |  |  ------------------
  ------------------
  189|   422M|    ans->state = xn + rem;
  190|   422M|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|  7.04M|    ans->state = x - xn - p;
  193|  7.04M|  }
  194|   429M|#endif
  195|   429M|  return val;
  196|   429M|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  21.7k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  21.7k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  21.7k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  21.7k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|    372|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|    168|                                       uint32_t num_symbols) {
  482|    168|    lut_table_.resize(rans_precision);
  483|    168|    probability_table_.resize(num_symbols);
  484|    168|    uint32_t cum_prob = 0;
  485|    168|    uint32_t act_prob = 0;
  486|  1.53k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 1.40k, False: 129]
  ------------------
  487|  1.40k|      probability_table_[i].prob = token_probs[i];
  488|  1.40k|      probability_table_[i].cum_prob = cum_prob;
  489|  1.40k|      cum_prob += token_probs[i];
  490|  1.40k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 39, False: 1.36k]
  ------------------
  491|     39|        return false;
  492|     39|      }
  493|   420k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 418k, False: 1.36k]
  ------------------
  494|   418k|        lut_table_[j] = i;
  495|   418k|      }
  496|  1.36k|      act_prob = cum_prob;
  497|  1.36k|    }
  498|    129|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 34, False: 95]
  ------------------
  499|     34|      return false;
  500|     34|    }
  501|     95|    return true;
  502|    129|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|     73|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     73|    unsigned x;
  423|     73|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 67]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     67|    ans_.buf = buf;
  427|     67|    x = buf[offset - 1] >> 6;
  428|     67|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 38, False: 29]
  ------------------
  429|     38|      ans_.buf_offset = offset - 1;
  430|     38|      ans_.state = buf[offset - 1] & 0x3F;
  431|     38|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 8, False: 21]
  ------------------
  432|      8|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 8]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      8|      ans_.buf_offset = offset - 2;
  436|      8|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     21|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 11, False: 10]
  ------------------
  438|     11|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 11]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|     11|      ans_.buf_offset = offset - 3;
  442|     11|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     11|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 10, False: 0]
  ------------------
  444|     10|      ans_.buf_offset = offset - 4;
  445|     10|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     10|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     67|    ans_.state += l_rans_base;
  450|     67|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     67|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 10, False: 57]
  ------------------
  451|     10|      return 1;
  452|     10|    }
  453|     57|    return 0;
  454|     67|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|     18|static uint32_t mem_get_le16(const void *vmem) {
   68|     18|  uint32_t val;
   69|     18|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|     18|  val = mem[1] << 8;
   72|     18|  val |= mem[0];
   73|     18|  return val;
   74|     18|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|     15|static uint32_t mem_get_le24(const void *vmem) {
   77|     15|  uint32_t val;
   78|     15|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|     15|  val = mem[2] << 16;
   81|     15|  val |= mem[1] << 8;
   82|     15|  val |= mem[0];
   83|     15|  return val;
   84|     15|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|     16|static inline uint32_t mem_get_le32(const void *vmem) {
   87|     16|  uint32_t val;
   88|     16|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|     16|  val = mem[3] << 24;
   91|     16|  val |= mem[2] << 16;
   92|     16|  val |= mem[1] << 8;
   93|     16|  val |= mem[0];
   94|     16|  return val;
   95|     16|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|  2.88M|  inline int rans_read() {
  463|  2.88M|    unsigned rem;
  464|  2.88M|    unsigned quo;
  465|  2.88M|    struct rans_dec_sym sym;
  466|  2.89M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 1.10M, False: 1.78M]
  |  Branch (466:40): [True: 4.09k, False: 1.10M]
  ------------------
  467|  4.09k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  4.09k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  4.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|  2.88M|    quo = ans_.state / rans_precision;
  472|  2.88M|    rem = ans_.state % rans_precision;
  473|  2.88M|    fetch_sym(&sym, rem);
  474|  2.88M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  2.88M|    return sym.val;
  476|  2.88M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|  2.88M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  2.88M|    uint32_t symbol = lut_table_[rem];
  507|  2.88M|    out->val = symbol;
  508|  2.88M|    out->prob = probability_table_[symbol].prob;
  509|  2.88M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  2.88M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|     48|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|     19|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|     14|                                       uint32_t num_symbols) {
  482|     14|    lut_table_.resize(rans_precision);
  483|     14|    probability_table_.resize(num_symbols);
  484|     14|    uint32_t cum_prob = 0;
  485|     14|    uint32_t act_prob = 0;
  486|    218|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 209, False: 9]
  ------------------
  487|    209|      probability_table_[i].prob = token_probs[i];
  488|    209|      probability_table_[i].cum_prob = cum_prob;
  489|    209|      cum_prob += token_probs[i];
  490|    209|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 5, False: 204]
  ------------------
  491|      5|        return false;
  492|      5|      }
  493|  59.9k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 59.7k, False: 204]
  ------------------
  494|  59.7k|        lut_table_[j] = i;
  495|  59.7k|      }
  496|    204|      act_prob = cum_prob;
  497|    204|    }
  498|      9|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 5, False: 4]
  ------------------
  499|      5|      return false;
  500|      5|    }
  501|      4|    return true;
  502|      9|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|      3|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      3|    unsigned x;
  423|      3|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 3]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      3|    ans_.buf = buf;
  427|      3|    x = buf[offset - 1] >> 6;
  428|      3|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 1, False: 2]
  ------------------
  429|      1|      ans_.buf_offset = offset - 1;
  430|      1|      ans_.state = buf[offset - 1] & 0x3F;
  431|      2|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 0, False: 2]
  ------------------
  432|      0|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 0]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      0|      ans_.buf_offset = offset - 2;
  436|      0|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      2|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 0, False: 2]
  ------------------
  438|      0|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 0]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      0|      ans_.buf_offset = offset - 3;
  442|      0|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      2|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 2, False: 0]
  ------------------
  444|      2|      ans_.buf_offset = offset - 4;
  445|      2|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      2|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|      3|    ans_.state += l_rans_base;
  450|      3|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      3|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 2, False: 1]
  ------------------
  451|      2|      return 1;
  452|      2|    }
  453|      1|    return 0;
  454|      3|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|      6|  inline int rans_read() {
  463|      6|    unsigned rem;
  464|      6|    unsigned quo;
  465|      6|    struct rans_dec_sym sym;
  466|      7|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 1, False: 6]
  |  Branch (466:40): [True: 1, False: 0]
  ------------------
  467|      1|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|      1|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|      1|    }
  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|      6|    quo = ans_.state / rans_precision;
  472|      6|    rem = ans_.state % rans_precision;
  473|      6|    fetch_sym(&sym, rem);
  474|      6|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|      6|    return sym.val;
  476|      6|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|      6|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|      6|    uint32_t symbol = lut_table_[rem];
  507|      6|    out->val = symbol;
  508|      6|    out->prob = probability_table_[symbol].prob;
  509|      6|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|      6|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|      1|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|     26|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|     16|                                       uint32_t num_symbols) {
  482|     16|    lut_table_.resize(rans_precision);
  483|     16|    probability_table_.resize(num_symbols);
  484|     16|    uint32_t cum_prob = 0;
  485|     16|    uint32_t act_prob = 0;
  486|    273|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 259, False: 14]
  ------------------
  487|    259|      probability_table_[i].prob = token_probs[i];
  488|    259|      probability_table_[i].cum_prob = cum_prob;
  489|    259|      cum_prob += token_probs[i];
  490|    259|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 2, False: 257]
  ------------------
  491|      2|        return false;
  492|      2|      }
  493|   484k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 484k, False: 257]
  ------------------
  494|   484k|        lut_table_[j] = i;
  495|   484k|      }
  496|    257|      act_prob = cum_prob;
  497|    257|    }
  498|     14|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 0, False: 14]
  ------------------
  499|      0|      return false;
  500|      0|    }
  501|     14|    return true;
  502|     14|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|      5|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      5|    unsigned x;
  423|      5|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 5]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      5|    ans_.buf = buf;
  427|      5|    x = buf[offset - 1] >> 6;
  428|      5|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 0, False: 5]
  ------------------
  429|      0|      ans_.buf_offset = offset - 1;
  430|      0|      ans_.state = buf[offset - 1] & 0x3F;
  431|      5|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 4, False: 1]
  ------------------
  432|      4|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 4]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      4|      ans_.buf_offset = offset - 2;
  436|      4|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      4|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 0, False: 1]
  ------------------
  438|      0|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 0]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      0|      ans_.buf_offset = offset - 3;
  442|      0|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      1|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 1, False: 0]
  ------------------
  444|      1|      ans_.buf_offset = offset - 4;
  445|      1|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      1|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|      5|    ans_.state += l_rans_base;
  450|      5|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      5|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 1, False: 4]
  ------------------
  451|      1|      return 1;
  452|      1|    }
  453|      4|    return 0;
  454|      5|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|  51.8k|  inline int rans_read() {
  463|  51.8k|    unsigned rem;
  464|  51.8k|    unsigned quo;
  465|  51.8k|    struct rans_dec_sym sym;
  466|  55.5k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 26.4k, False: 29.1k]
  |  Branch (466:40): [True: 3.69k, False: 22.7k]
  ------------------
  467|  3.69k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  3.69k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  3.69k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  51.8k|    quo = ans_.state / rans_precision;
  472|  51.8k|    rem = ans_.state % rans_precision;
  473|  51.8k|    fetch_sym(&sym, rem);
  474|  51.8k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  51.8k|    return sym.val;
  476|  51.8k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|  51.8k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  51.8k|    uint32_t symbol = lut_table_[rem];
  507|  51.8k|    out->val = symbol;
  508|  51.8k|    out->prob = probability_table_[symbol].prob;
  509|  51.8k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  51.8k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|      4|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|     30|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|     15|                                       uint32_t num_symbols) {
  482|     15|    lut_table_.resize(rans_precision);
  483|     15|    probability_table_.resize(num_symbols);
  484|     15|    uint32_t cum_prob = 0;
  485|     15|    uint32_t act_prob = 0;
  486|  1.23k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 1.23k, False: 6]
  ------------------
  487|  1.23k|      probability_table_[i].prob = token_probs[i];
  488|  1.23k|      probability_table_[i].cum_prob = cum_prob;
  489|  1.23k|      cum_prob += token_probs[i];
  490|  1.23k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 9, False: 1.22k]
  ------------------
  491|      9|        return false;
  492|      9|      }
  493|   489k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 488k, False: 1.22k]
  ------------------
  494|   488k|        lut_table_[j] = i;
  495|   488k|      }
  496|  1.22k|      act_prob = cum_prob;
  497|  1.22k|    }
  498|      6|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 0, False: 6]
  ------------------
  499|      0|      return false;
  500|      0|    }
  501|      6|    return true;
  502|      6|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|      2|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      2|    unsigned x;
  423|      2|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 2]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      2|    ans_.buf = buf;
  427|      2|    x = buf[offset - 1] >> 6;
  428|      2|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 1, False: 1]
  ------------------
  429|      1|      ans_.buf_offset = offset - 1;
  430|      1|      ans_.state = buf[offset - 1] & 0x3F;
  431|      1|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 0, False: 1]
  ------------------
  432|      0|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 0]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      0|      ans_.buf_offset = offset - 2;
  436|      0|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      1|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 1, False: 0]
  ------------------
  438|      1|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 1]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      1|      ans_.buf_offset = offset - 3;
  442|      1|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      1|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 0, False: 0]
  ------------------
  444|      0|      ans_.buf_offset = offset - 4;
  445|      0|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      0|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|      2|    ans_.state += l_rans_base;
  450|      2|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      2|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 2]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|      2|    return 0;
  454|      2|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|    115|  inline int rans_read() {
  463|    115|    unsigned rem;
  464|    115|    unsigned quo;
  465|    115|    struct rans_dec_sym sym;
  466|    153|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 38, False: 115]
  |  Branch (466:40): [True: 38, False: 0]
  ------------------
  467|     38|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|     38|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|     38|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|    115|    quo = ans_.state / rans_precision;
  472|    115|    rem = ans_.state % rans_precision;
  473|    115|    fetch_sym(&sym, rem);
  474|    115|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|    115|    return sym.val;
  476|    115|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|    115|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|    115|    uint32_t symbol = lut_table_[rem];
  507|    115|    out->val = symbol;
  508|    115|    out->prob = probability_table_[symbol].prob;
  509|    115|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|    115|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|      2|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|     18|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|      8|                                       uint32_t num_symbols) {
  482|      8|    lut_table_.resize(rans_precision);
  483|      8|    probability_table_.resize(num_symbols);
  484|      8|    uint32_t cum_prob = 0;
  485|      8|    uint32_t act_prob = 0;
  486|     92|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 86, False: 6]
  ------------------
  487|     86|      probability_table_[i].prob = token_probs[i];
  488|     86|      probability_table_[i].cum_prob = cum_prob;
  489|     86|      cum_prob += token_probs[i];
  490|     86|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 2, False: 84]
  ------------------
  491|      2|        return false;
  492|      2|      }
  493|  1.26M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.26M, False: 84]
  ------------------
  494|  1.26M|        lut_table_[j] = i;
  495|  1.26M|      }
  496|     84|      act_prob = cum_prob;
  497|     84|    }
  498|      6|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 2, False: 4]
  ------------------
  499|      2|      return false;
  500|      2|    }
  501|      4|    return true;
  502|      6|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|      2|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      2|    unsigned x;
  423|      2|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 2]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      2|    ans_.buf = buf;
  427|      2|    x = buf[offset - 1] >> 6;
  428|      2|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 2, False: 0]
  ------------------
  429|      2|      ans_.buf_offset = offset - 1;
  430|      2|      ans_.state = buf[offset - 1] & 0x3F;
  431|      2|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 0, False: 0]
  ------------------
  432|      0|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 0]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      0|      ans_.buf_offset = offset - 2;
  436|      0|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      0|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 0, False: 0]
  ------------------
  438|      0|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 0]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      0|      ans_.buf_offset = offset - 3;
  442|      0|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      0|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 0, False: 0]
  ------------------
  444|      0|      ans_.buf_offset = offset - 4;
  445|      0|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      0|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|      2|    ans_.state += l_rans_base;
  450|      2|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      2|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 2]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|      2|    return 0;
  454|      2|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|  23.3k|  inline int rans_read() {
  463|  23.3k|    unsigned rem;
  464|  23.3k|    unsigned quo;
  465|  23.3k|    struct rans_dec_sym sym;
  466|  24.3k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 1.00k, False: 23.3k]
  |  Branch (466:40): [True: 1.00k, False: 0]
  ------------------
  467|  1.00k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.00k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.00k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  23.3k|    quo = ans_.state / rans_precision;
  472|  23.3k|    rem = ans_.state % rans_precision;
  473|  23.3k|    fetch_sym(&sym, rem);
  474|  23.3k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  23.3k|    return sym.val;
  476|  23.3k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|  23.3k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  23.3k|    uint32_t symbol = lut_table_[rem];
  507|  23.3k|    out->val = symbol;
  508|  23.3k|    out->prob = probability_table_[symbol].prob;
  509|  23.3k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  23.3k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|      2|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|     25|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|      9|                                       uint32_t num_symbols) {
  482|      9|    lut_table_.resize(rans_precision);
  483|      9|    probability_table_.resize(num_symbols);
  484|      9|    uint32_t cum_prob = 0;
  485|      9|    uint32_t act_prob = 0;
  486|     33|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 24, False: 9]
  ------------------
  487|     24|      probability_table_[i].prob = token_probs[i];
  488|     24|      probability_table_[i].cum_prob = cum_prob;
  489|     24|      cum_prob += token_probs[i];
  490|     24|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 0, False: 24]
  ------------------
  491|      0|        return false;
  492|      0|      }
  493|  3.70M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 3.70M, False: 24]
  ------------------
  494|  3.70M|        lut_table_[j] = i;
  495|  3.70M|      }
  496|     24|      act_prob = cum_prob;
  497|     24|    }
  498|      9|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 2, False: 7]
  ------------------
  499|      2|      return false;
  500|      2|    }
  501|      7|    return true;
  502|      9|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|      4|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      4|    unsigned x;
  423|      4|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 4]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      4|    ans_.buf = buf;
  427|      4|    x = buf[offset - 1] >> 6;
  428|      4|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 3, False: 1]
  ------------------
  429|      3|      ans_.buf_offset = offset - 1;
  430|      3|      ans_.state = buf[offset - 1] & 0x3F;
  431|      3|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 0, False: 1]
  ------------------
  432|      0|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 0]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      0|      ans_.buf_offset = offset - 2;
  436|      0|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      1|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 0, False: 1]
  ------------------
  438|      0|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 0]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      0|      ans_.buf_offset = offset - 3;
  442|      0|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      1|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 1, False: 0]
  ------------------
  444|      1|      ans_.buf_offset = offset - 4;
  445|      1|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      1|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|      4|    ans_.state += l_rans_base;
  450|      4|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      4|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 4]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|      4|    return 0;
  454|      4|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|  46.0k|  inline int rans_read() {
  463|  46.0k|    unsigned rem;
  464|  46.0k|    unsigned quo;
  465|  46.0k|    struct rans_dec_sym sym;
  466|  47.0k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 997, False: 46.0k]
  |  Branch (466:40): [True: 997, False: 0]
  ------------------
  467|    997|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    997|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    997|    }
  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.0k|    quo = ans_.state / rans_precision;
  472|  46.0k|    rem = ans_.state % rans_precision;
  473|  46.0k|    fetch_sym(&sym, rem);
  474|  46.0k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  46.0k|    return sym.val;
  476|  46.0k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|  46.0k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  46.0k|    uint32_t symbol = lut_table_[rem];
  507|  46.0k|    out->val = symbol;
  508|  46.0k|    out->prob = probability_table_[symbol].prob;
  509|  46.0k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  46.0k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|      4|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|     85|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|     48|                                       uint32_t num_symbols) {
  482|     48|    lut_table_.resize(rans_precision);
  483|     48|    probability_table_.resize(num_symbols);
  484|     48|    uint32_t cum_prob = 0;
  485|     48|    uint32_t act_prob = 0;
  486|    615|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 574, False: 41]
  ------------------
  487|    574|      probability_table_[i].prob = token_probs[i];
  488|    574|      probability_table_[i].cum_prob = cum_prob;
  489|    574|      cum_prob += token_probs[i];
  490|    574|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 7, False: 567]
  ------------------
  491|      7|        return false;
  492|      7|      }
  493|  41.9M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 41.9M, False: 567]
  ------------------
  494|  41.9M|        lut_table_[j] = i;
  495|  41.9M|      }
  496|    567|      act_prob = cum_prob;
  497|    567|    }
  498|     41|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 2, False: 39]
  ------------------
  499|      2|      return false;
  500|      2|    }
  501|     39|    return true;
  502|     41|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|     17|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     17|    unsigned x;
  423|     17|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 1, False: 16]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|     16|    ans_.buf = buf;
  427|     16|    x = buf[offset - 1] >> 6;
  428|     16|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 5, False: 11]
  ------------------
  429|      5|      ans_.buf_offset = offset - 1;
  430|      5|      ans_.state = buf[offset - 1] & 0x3F;
  431|     11|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 6, False: 5]
  ------------------
  432|      6|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 6]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      6|      ans_.buf_offset = offset - 2;
  436|      6|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      6|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 3, False: 2]
  ------------------
  438|      3|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 3]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      3|      ans_.buf_offset = offset - 3;
  442|      3|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      3|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 2, False: 0]
  ------------------
  444|      2|      ans_.buf_offset = offset - 4;
  445|      2|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      2|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     16|    ans_.state += l_rans_base;
  450|     16|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     16|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 16]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|     16|    return 0;
  454|     16|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  3.18M|  inline int rans_read() {
  463|  3.18M|    unsigned rem;
  464|  3.18M|    unsigned quo;
  465|  3.18M|    struct rans_dec_sym sym;
  466|  3.18M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 32.9k, False: 3.15M]
  |  Branch (466:40): [True: 862, False: 32.1k]
  ------------------
  467|    862|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    862|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    862|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  3.18M|    quo = ans_.state / rans_precision;
  472|  3.18M|    rem = ans_.state % rans_precision;
  473|  3.18M|    fetch_sym(&sym, rem);
  474|  3.18M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  3.18M|    return sym.val;
  476|  3.18M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  3.18M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  3.18M|    uint32_t symbol = lut_table_[rem];
  507|  3.18M|    out->val = symbol;
  508|  3.18M|    out->prob = probability_table_[symbol].prob;
  509|  3.18M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  3.18M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|     16|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|    118|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|    118|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    118|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 118]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    118|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    118|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    118|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 11, False: 107]
  ------------------
   67|     11|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 11]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     11|  } else
   72|    107|#endif
   73|    107|  {
   74|    107|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 106]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    107|  }
   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|    117|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 115]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|    115|  probability_table_.resize(num_symbols_);
   86|    115|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 55, False: 60]
  ------------------
   87|     55|    return true;
   88|     55|  }
   89|       |  // Decode the table.
   90|  68.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 68.6k, False: 40]
  ------------------
   91|  68.6k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  68.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 4, False: 68.5k]
  ------------------
   95|      4|      return false;
   96|      4|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  68.5k|    const int token = prob_data & 3;
  102|  68.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 21.3k, False: 47.2k]
  ------------------
  103|  21.3k|      const uint32_t offset = prob_data >> 2;
  104|  21.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 15, False: 21.3k]
  ------------------
  105|     15|        return false;
  106|     15|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   710k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 689k, False: 21.3k]
  ------------------
  109|   689k|        probability_table_[i + j] = 0;
  110|   689k|      }
  111|  21.3k|      i += offset;
  112|  47.2k|    } else {
  113|  47.2k|      const int extra_bytes = token;
  114|  47.2k|      uint32_t prob = prob_data >> 2;
  115|  83.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 36.6k, False: 47.2k]
  ------------------
  116|  36.6k|        uint8_t eb;
  117|  36.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 1, False: 36.6k]
  ------------------
  118|      1|          return false;
  119|      1|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  36.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  36.6k|      }
  124|  47.2k|      probability_table_[i] = prob;
  125|  47.2k|    }
  126|  68.5k|  }
  127|     40|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 26, False: 14]
  ------------------
  128|     26|    return false;
  129|     26|  }
  130|     14|  return true;
  131|     40|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|     34|    DecoderBuffer *buffer) {
  136|     34|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     34|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     34|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     34|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 5, False: 29]
  ------------------
  140|      5|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 5]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      5|  } else
  145|     29|#endif
  146|     29|  {
  147|     29|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 29]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     29|  }
  151|     34|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 4, False: 30]
  ------------------
  152|      4|    return false;
  153|      4|  }
  154|     30|  const uint8_t *const data_head =
  155|     30|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     30|  buffer->Advance(bytes_encoded);
  158|     30|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 7, False: 23]
  ------------------
  159|      7|    return false;
  160|      7|  }
  161|     23|  return true;
  162|     30|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|     58|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|   136k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|     14|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     14|  ans_.read_end();
  167|     14|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|     55|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|     55|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     55|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 55]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     55|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     55|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     55|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 21, False: 34]
  ------------------
   67|     21|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 21]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     21|  } else
   72|     34|#endif
   73|     34|  {
   74|     34|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 34]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     34|  }
   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|     55|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 8, False: 47]
  ------------------
   83|      8|    return false;
   84|      8|  }
   85|     47|  probability_table_.resize(num_symbols_);
   86|     47|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 45]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  3.62M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 3.62M, False: 26]
  ------------------
   91|  3.62M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  3.62M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 9, False: 3.62M]
  ------------------
   95|      9|      return false;
   96|      9|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  3.62M|    const int token = prob_data & 3;
  102|  3.62M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.30M, False: 2.32M]
  ------------------
  103|  1.30M|      const uint32_t offset = prob_data >> 2;
  104|  1.30M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 7, False: 1.30M]
  ------------------
  105|      7|        return false;
  106|      7|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  39.1M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 37.8M, False: 1.30M]
  ------------------
  109|  37.8M|        probability_table_[i + j] = 0;
  110|  37.8M|      }
  111|  1.30M|      i += offset;
  112|  2.32M|    } else {
  113|  2.32M|      const int extra_bytes = token;
  114|  2.32M|      uint32_t prob = prob_data >> 2;
  115|  2.40M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 80.0k, False: 2.32M]
  ------------------
  116|  80.0k|        uint8_t eb;
  117|  80.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 3, False: 80.0k]
  ------------------
  118|      3|          return false;
  119|      3|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  80.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  80.0k|      }
  124|  2.32M|      probability_table_[i] = prob;
  125|  2.32M|    }
  126|  3.62M|  }
  127|     26|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 23, False: 3]
  ------------------
  128|     23|    return false;
  129|     23|  }
  130|      3|  return true;
  131|     26|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|      5|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|      3|    DecoderBuffer *buffer) {
  136|      3|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      3|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      3|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      3|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 3]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|      3|#endif
  146|      3|  {
  147|      3|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 3]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      3|  }
  151|      3|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 0, False: 3]
  ------------------
  152|      0|    return false;
  153|      0|  }
  154|      3|  const uint8_t *const data_head =
  155|      3|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      3|  buffer->Advance(bytes_encoded);
  158|      3|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 2]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|      2|  return true;
  162|      3|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|    124|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|     62|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|     62|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     62|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 62]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     62|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     62|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     62|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 7, False: 55]
  ------------------
   67|      7|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 7]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      7|  } else
   72|     55|#endif
   73|     55|  {
   74|     55|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 55]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     55|  }
   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|     62|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 58]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|     58|  probability_table_.resize(num_symbols_);
   86|     58|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 57]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   542k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 542k, False: 32]
  ------------------
   91|   542k|    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|   542k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 12, False: 542k]
  ------------------
   95|     12|      return false;
   96|     12|    }
   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|   542k|    const int token = prob_data & 3;
  102|   542k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 179k, False: 363k]
  ------------------
  103|   179k|      const uint32_t offset = prob_data >> 2;
  104|   179k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 8, False: 179k]
  ------------------
  105|      8|        return false;
  106|      8|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  5.96M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 5.78M, False: 179k]
  ------------------
  109|  5.78M|        probability_table_[i + j] = 0;
  110|  5.78M|      }
  111|   179k|      i += offset;
  112|   363k|    } else {
  113|   363k|      const int extra_bytes = token;
  114|   363k|      uint32_t prob = prob_data >> 2;
  115|   645k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 281k, False: 363k]
  ------------------
  116|   281k|        uint8_t eb;
  117|   281k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 5, False: 281k]
  ------------------
  118|      5|          return false;
  119|      5|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   281k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   281k|      }
  124|   363k|      probability_table_[i] = prob;
  125|   363k|    }
  126|   542k|  }
  127|     32|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 8, False: 24]
  ------------------
  128|      8|    return false;
  129|      8|  }
  130|     24|  return true;
  131|     32|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|     25|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|     24|    DecoderBuffer *buffer) {
  136|     24|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     24|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     24|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     24|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 3, False: 21]
  ------------------
  140|      3|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 3]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      3|  } else
  145|     21|#endif
  146|     21|  {
  147|     21|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 21]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     21|  }
  151|     24|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 4, False: 20]
  ------------------
  152|      4|    return false;
  153|      4|  }
  154|     20|  const uint8_t *const data_head =
  155|     20|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     20|  buffer->Advance(bytes_encoded);
  158|     20|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 6, False: 14]
  ------------------
  159|      6|    return false;
  160|      6|  }
  161|     14|  return true;
  162|     20|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  1.94M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|     14|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     14|  ans_.read_end();
  167|     14|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|     33|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|     33|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     33|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 33]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     33|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     33|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     33|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 22, False: 11]
  ------------------
   67|     22|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 22]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     22|  } else
   72|     11|#endif
   73|     11|  {
   74|     11|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 11]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     11|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     33|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 33]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     33|  probability_table_.resize(num_symbols_);
   86|     33|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 32]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  3.72k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 3.69k, False: 29]
  ------------------
   91|  3.69k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  3.69k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 3.69k]
  ------------------
   95|      0|      return false;
   96|      0|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  3.69k|    const int token = prob_data & 3;
  102|  3.69k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.05k, False: 2.63k]
  ------------------
  103|  1.05k|      const uint32_t offset = prob_data >> 2;
  104|  1.05k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 2, False: 1.05k]
  ------------------
  105|      2|        return false;
  106|      2|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  41.7k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 40.6k, False: 1.05k]
  ------------------
  109|  40.6k|        probability_table_[i + j] = 0;
  110|  40.6k|      }
  111|  1.05k|      i += offset;
  112|  2.63k|    } else {
  113|  2.63k|      const int extra_bytes = token;
  114|  2.63k|      uint32_t prob = prob_data >> 2;
  115|  4.40k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.76k, False: 2.63k]
  ------------------
  116|  1.76k|        uint8_t eb;
  117|  1.76k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 1, False: 1.76k]
  ------------------
  118|      1|          return false;
  119|      1|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.76k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.76k|      }
  124|  2.63k|      probability_table_[i] = prob;
  125|  2.63k|    }
  126|  3.69k|  }
  127|     29|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 7, False: 22]
  ------------------
  128|      7|    return false;
  129|      7|  }
  130|     22|  return true;
  131|     29|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|     23|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|     22|    DecoderBuffer *buffer) {
  136|     22|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     22|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     22|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     22|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 21, False: 1]
  ------------------
  140|     21|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 21]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     21|  } else
  145|      1|#endif
  146|      1|  {
  147|      1|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 1]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      1|  }
  151|     22|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 18, False: 4]
  ------------------
  152|     18|    return false;
  153|     18|  }
  154|      4|  const uint8_t *const data_head =
  155|      4|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      4|  buffer->Advance(bytes_encoded);
  158|      4|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 3]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|      3|  return true;
  162|      4|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|     18|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|      3|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      3|  ans_.read_end();
  167|      3|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|     11|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|     11|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     11|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 11]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     11|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     11|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     11|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 0, False: 11]
  ------------------
   67|      0|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 0]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      0|  } else
   72|     11|#endif
   73|     11|  {
   74|     11|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 11]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     11|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     11|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 11]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     11|  probability_table_.resize(num_symbols_);
   86|     11|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 11]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  4.67k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 4.66k, False: 7]
  ------------------
   91|  4.66k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  4.66k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 4.66k]
  ------------------
   95|      0|      return false;
   96|      0|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  4.66k|    const int token = prob_data & 3;
  102|  4.66k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 298, False: 4.36k]
  ------------------
  103|    298|      const uint32_t offset = prob_data >> 2;
  104|    298|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 4, False: 294]
  ------------------
  105|      4|        return false;
  106|      4|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  8.26k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 7.97k, False: 294]
  ------------------
  109|  7.97k|        probability_table_[i + j] = 0;
  110|  7.97k|      }
  111|    294|      i += offset;
  112|  4.36k|    } else {
  113|  4.36k|      const int extra_bytes = token;
  114|  4.36k|      uint32_t prob = prob_data >> 2;
  115|  6.79k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.42k, False: 4.36k]
  ------------------
  116|  2.42k|        uint8_t eb;
  117|  2.42k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 2.42k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.42k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.42k|      }
  124|  4.36k|      probability_table_[i] = prob;
  125|  4.36k|    }
  126|  4.66k|  }
  127|      7|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 6]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|      6|  return true;
  131|      7|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|      6|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|      6|    DecoderBuffer *buffer) {
  136|      6|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      6|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      6|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      6|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 6]
  ------------------
  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|      6|#endif
  146|      6|  {
  147|      6|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 6]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      6|  }
  151|      6|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 0, False: 6]
  ------------------
  152|      0|    return false;
  153|      0|  }
  154|      6|  const uint8_t *const data_head =
  155|      6|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      6|  buffer->Advance(bytes_encoded);
  158|      6|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 6]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      6|  return true;
  162|      6|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  9.95k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|      6|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      6|  ans_.read_end();
  167|      6|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|     22|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|     22|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     22|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 22]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     22|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     22|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     22|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 17, False: 5]
  ------------------
   67|     17|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 17]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     17|  } else
   72|      5|#endif
   73|      5|  {
   74|      5|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 5]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      5|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     22|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 20]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|     20|  probability_table_.resize(num_symbols_);
   86|     20|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 20]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  21.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 21.5k, False: 15]
  ------------------
   91|  21.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|  21.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 21.5k]
  ------------------
   95|      0|      return false;
   96|      0|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  21.5k|    const int token = prob_data & 3;
  102|  21.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.15k, False: 16.3k]
  ------------------
  103|  5.15k|      const uint32_t offset = prob_data >> 2;
  104|  5.15k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 2, False: 5.14k]
  ------------------
  105|      2|        return false;
  106|      2|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   170k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 165k, False: 5.14k]
  ------------------
  109|   165k|        probability_table_[i + j] = 0;
  110|   165k|      }
  111|  5.14k|      i += offset;
  112|  16.3k|    } else {
  113|  16.3k|      const int extra_bytes = token;
  114|  16.3k|      uint32_t prob = prob_data >> 2;
  115|  32.6k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 16.2k, False: 16.3k]
  ------------------
  116|  16.2k|        uint8_t eb;
  117|  16.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 3, False: 16.2k]
  ------------------
  118|      3|          return false;
  119|      3|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  16.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  16.2k|      }
  124|  16.3k|      probability_table_[i] = prob;
  125|  16.3k|    }
  126|  21.5k|  }
  127|     15|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 3, False: 12]
  ------------------
  128|      3|    return false;
  129|      3|  }
  130|     12|  return true;
  131|     15|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|     12|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|     12|    DecoderBuffer *buffer) {
  136|     12|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     12|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     12|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     12|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 9, False: 3]
  ------------------
  140|      9|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 9]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      9|  } else
  145|      3|#endif
  146|      3|  {
  147|      3|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 3]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      3|  }
  151|     12|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 9, False: 3]
  ------------------
  152|      9|    return false;
  153|      9|  }
  154|      3|  const uint8_t *const data_head =
  155|      3|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      3|  buffer->Advance(bytes_encoded);
  158|      3|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 3]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      3|  return true;
  162|      3|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|   761k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|      3|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      3|  ans_.read_end();
  167|      3|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|     43|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|     43|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     43|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 43]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     43|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     43|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     43|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 19, False: 24]
  ------------------
   67|     19|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 19]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     19|  } else
   72|     24|#endif
   73|     24|  {
   74|     24|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 24]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     24|  }
   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|     43|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 39]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|     39|  probability_table_.resize(num_symbols_);
   86|     39|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 39]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  1.55M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.55M, False: 10]
  ------------------
   91|  1.55M|    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.55M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 19, False: 1.55M]
  ------------------
   95|     19|      return false;
   96|     19|    }
   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.55M|    const int token = prob_data & 3;
  102|  1.55M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 399k, False: 1.16M]
  ------------------
  103|   399k|      const uint32_t offset = prob_data >> 2;
  104|   399k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 6, False: 399k]
  ------------------
  105|      6|        return false;
  106|      6|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  13.4M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 13.0M, False: 399k]
  ------------------
  109|  13.0M|        probability_table_[i + j] = 0;
  110|  13.0M|      }
  111|   399k|      i += offset;
  112|  1.16M|    } else {
  113|  1.16M|      const int extra_bytes = token;
  114|  1.16M|      uint32_t prob = prob_data >> 2;
  115|  1.90M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 749k, False: 1.16M]
  ------------------
  116|   749k|        uint8_t eb;
  117|   749k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 4, False: 749k]
  ------------------
  118|      4|          return false;
  119|      4|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   749k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   749k|      }
  124|  1.16M|      probability_table_[i] = prob;
  125|  1.16M|    }
  126|  1.55M|  }
  127|     10|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 3, False: 7]
  ------------------
  128|      3|    return false;
  129|      3|  }
  130|      7|  return true;
  131|     10|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|      7|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|      7|    DecoderBuffer *buffer) {
  136|      7|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      7|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      7|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      7|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 7]
  ------------------
  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|      7|#endif
  146|      7|  {
  147|      7|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 7]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      7|  }
  151|      7|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 1, False: 6]
  ------------------
  152|      1|    return false;
  153|      1|  }
  154|      6|  const uint8_t *const data_head =
  155|      6|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      6|  buffer->Advance(bytes_encoded);
  158|      6|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 5]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|      5|  return true;
  162|      6|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  40.4k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|      5|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      5|  ans_.read_end();
  167|      5|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|     28|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|     28|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     28|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 28]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     28|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     28|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     28|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 20, False: 8]
  ------------------
   67|     20|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 20]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     20|  } else
   72|      8|#endif
   73|      8|  {
   74|      8|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 8]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      8|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     28|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 5, False: 23]
  ------------------
   83|      5|    return false;
   84|      5|  }
   85|     23|  probability_table_.resize(num_symbols_);
   86|     23|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 23]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   347k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 347k, False: 9]
  ------------------
   91|   347k|    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|   347k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 5, False: 347k]
  ------------------
   95|      5|      return false;
   96|      5|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   347k|    const int token = prob_data & 3;
  102|   347k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 101k, False: 245k]
  ------------------
  103|   101k|      const uint32_t offset = prob_data >> 2;
  104|   101k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 5, False: 101k]
  ------------------
  105|      5|        return false;
  106|      5|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.62M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.52M, False: 101k]
  ------------------
  109|  3.52M|        probability_table_[i + j] = 0;
  110|  3.52M|      }
  111|   101k|      i += offset;
  112|   245k|    } else {
  113|   245k|      const int extra_bytes = token;
  114|   245k|      uint32_t prob = prob_data >> 2;
  115|   425k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 179k, False: 245k]
  ------------------
  116|   179k|        uint8_t eb;
  117|   179k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 4, False: 179k]
  ------------------
  118|      4|          return false;
  119|      4|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   179k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   179k|      }
  124|   245k|      probability_table_[i] = prob;
  125|   245k|    }
  126|   347k|  }
  127|      9|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 2, False: 7]
  ------------------
  128|      2|    return false;
  129|      2|  }
  130|      7|  return true;
  131|      9|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|      7|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|      7|    DecoderBuffer *buffer) {
  136|      7|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      7|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      7|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      7|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 6, False: 1]
  ------------------
  140|      6|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 6]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      6|  } else
  145|      1|#endif
  146|      1|  {
  147|      1|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 1]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      1|  }
  151|      7|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 6, False: 1]
  ------------------
  152|      6|    return false;
  153|      6|  }
  154|      1|  const uint8_t *const data_head =
  155|      1|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      1|  buffer->Advance(bytes_encoded);
  158|      1|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 1]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      1|  return true;
  162|      1|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|      6|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|      1|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      1|  ans_.read_end();
  167|      1|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|     19|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|     19|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     19|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 19]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     19|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     19|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     19|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 7, False: 12]
  ------------------
   67|      7|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 7]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      7|  } else
   72|     12|#endif
   73|     12|  {
   74|     12|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 12]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     12|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     19|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 19]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     19|  probability_table_.resize(num_symbols_);
   86|     19|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 19]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  6.11k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 6.09k, False: 14]
  ------------------
   91|  6.09k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  6.09k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 6.09k]
  ------------------
   95|      0|      return false;
   96|      0|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  6.09k|    const int token = prob_data & 3;
  102|  6.09k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.56k, False: 4.53k]
  ------------------
  103|  1.56k|      const uint32_t offset = prob_data >> 2;
  104|  1.56k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 5, False: 1.56k]
  ------------------
  105|      5|        return false;
  106|      5|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  53.6k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 52.0k, False: 1.56k]
  ------------------
  109|  52.0k|        probability_table_[i + j] = 0;
  110|  52.0k|      }
  111|  1.56k|      i += offset;
  112|  4.53k|    } else {
  113|  4.53k|      const int extra_bytes = token;
  114|  4.53k|      uint32_t prob = prob_data >> 2;
  115|  7.72k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.19k, False: 4.53k]
  ------------------
  116|  3.19k|        uint8_t eb;
  117|  3.19k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 3.19k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.19k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.19k|      }
  124|  4.53k|      probability_table_[i] = prob;
  125|  4.53k|    }
  126|  6.09k|  }
  127|     14|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 10, False: 4]
  ------------------
  128|     10|    return false;
  129|     10|  }
  130|      4|  return true;
  131|     14|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|      4|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|      4|    DecoderBuffer *buffer) {
  136|      4|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      4|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      4|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      4|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 4]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|      4|#endif
  146|      4|  {
  147|      4|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 4]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      4|  }
  151|      4|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 1, False: 3]
  ------------------
  152|      1|    return false;
  153|      1|  }
  154|      3|  const uint8_t *const data_head =
  155|      3|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      3|  buffer->Advance(bytes_encoded);
  158|      3|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 2, False: 1]
  ------------------
  159|      2|    return false;
  160|      2|  }
  161|      1|  return true;
  162|      3|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|      6|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|      1|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      1|  ans_.read_end();
  167|      1|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|     26|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|     26|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     26|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 26]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     26|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     26|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     26|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 5, False: 21]
  ------------------
   67|      5|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 5]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      5|  } else
   72|     21|#endif
   73|     21|  {
   74|     21|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 21]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     21|  }
   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|     26|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 25]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|     25|  probability_table_.resize(num_symbols_);
   86|     25|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 25]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   147k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 147k, False: 16]
  ------------------
   91|   147k|    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|   147k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 147k]
  ------------------
   95|      1|      return false;
   96|      1|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   147k|    const int token = prob_data & 3;
  102|   147k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 53.9k, False: 93.8k]
  ------------------
  103|  53.9k|      const uint32_t offset = prob_data >> 2;
  104|  53.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 5, False: 53.9k]
  ------------------
  105|      5|        return false;
  106|      5|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.92M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.86M, False: 53.9k]
  ------------------
  109|  1.86M|        probability_table_[i + j] = 0;
  110|  1.86M|      }
  111|  53.9k|      i += offset;
  112|  93.8k|    } else {
  113|  93.8k|      const int extra_bytes = token;
  114|  93.8k|      uint32_t prob = prob_data >> 2;
  115|   172k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 78.4k, False: 93.8k]
  ------------------
  116|  78.4k|        uint8_t eb;
  117|  78.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 3, False: 78.4k]
  ------------------
  118|      3|          return false;
  119|      3|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  78.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  78.4k|      }
  124|  93.8k|      probability_table_[i] = prob;
  125|  93.8k|    }
  126|   147k|  }
  127|     16|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 2, False: 14]
  ------------------
  128|      2|    return false;
  129|      2|  }
  130|     14|  return true;
  131|     16|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|     14|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|     14|    DecoderBuffer *buffer) {
  136|     14|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     14|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     14|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     14|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 14]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|     14|#endif
  146|     14|  {
  147|     14|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 14]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     14|  }
  151|     14|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 9, False: 5]
  ------------------
  152|      9|    return false;
  153|      9|  }
  154|      5|  const uint8_t *const data_head =
  155|      5|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      5|  buffer->Advance(bytes_encoded);
  158|      5|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 4]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|      4|  return true;
  162|      5|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|  51.8k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|      4|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      4|  ans_.read_end();
  167|      4|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|     30|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|     30|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     30|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 30]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     30|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     30|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     30|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 22, False: 8]
  ------------------
   67|     22|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 22]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     22|  } else
   72|      8|#endif
   73|      8|  {
   74|      8|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 8]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      8|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     30|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 30]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     30|  probability_table_.resize(num_symbols_);
   86|     30|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 30]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  63.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 63.2k, False: 15]
  ------------------
   91|  63.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|  63.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 5, False: 63.2k]
  ------------------
   95|      5|      return false;
   96|      5|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  63.2k|    const int token = prob_data & 3;
  102|  63.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 22.4k, False: 40.7k]
  ------------------
  103|  22.4k|      const uint32_t offset = prob_data >> 2;
  104|  22.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 8, False: 22.4k]
  ------------------
  105|      8|        return false;
  106|      8|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.11M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.09M, False: 22.4k]
  ------------------
  109|  1.09M|        probability_table_[i + j] = 0;
  110|  1.09M|      }
  111|  22.4k|      i += offset;
  112|  40.7k|    } else {
  113|  40.7k|      const int extra_bytes = token;
  114|  40.7k|      uint32_t prob = prob_data >> 2;
  115|  64.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 24.1k, False: 40.7k]
  ------------------
  116|  24.1k|        uint8_t eb;
  117|  24.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 2, False: 24.1k]
  ------------------
  118|      2|          return false;
  119|      2|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  24.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  24.1k|      }
  124|  40.7k|      probability_table_[i] = prob;
  125|  40.7k|    }
  126|  63.2k|  }
  127|     15|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 9, False: 6]
  ------------------
  128|      9|    return false;
  129|      9|  }
  130|      6|  return true;
  131|     15|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|      6|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|      6|    DecoderBuffer *buffer) {
  136|      6|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      6|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      6|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      6|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 6]
  ------------------
  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|      6|#endif
  146|      6|  {
  147|      6|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 6]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      6|  }
  151|      6|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 4, False: 2]
  ------------------
  152|      4|    return false;
  153|      4|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|    115|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|     18|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|     18|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     18|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 18]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     18|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     18|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     18|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 1, False: 17]
  ------------------
   67|      1|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 1]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      1|  } else
   72|     17|#endif
   73|     17|  {
   74|     17|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 17]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     17|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     18|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 18]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     18|  probability_table_.resize(num_symbols_);
   86|     18|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 18]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   115k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 115k, False: 8]
  ------------------
   91|   115k|    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|   115k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 4, False: 115k]
  ------------------
   95|      4|      return false;
   96|      4|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   115k|    const int token = prob_data & 3;
  102|   115k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 9.48k, False: 105k]
  ------------------
  103|  9.48k|      const uint32_t offset = prob_data >> 2;
  104|  9.48k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 3, False: 9.48k]
  ------------------
  105|      3|        return false;
  106|      3|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   367k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 358k, False: 9.48k]
  ------------------
  109|   358k|        probability_table_[i + j] = 0;
  110|   358k|      }
  111|  9.48k|      i += offset;
  112|   105k|    } else {
  113|   105k|      const int extra_bytes = token;
  114|   105k|      uint32_t prob = prob_data >> 2;
  115|   123k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 17.3k, False: 105k]
  ------------------
  116|  17.3k|        uint8_t eb;
  117|  17.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 3, False: 17.3k]
  ------------------
  118|      3|          return false;
  119|      3|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  17.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  17.3k|      }
  124|   105k|      probability_table_[i] = prob;
  125|   105k|    }
  126|   115k|  }
  127|      8|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 4, False: 4]
  ------------------
  128|      4|    return false;
  129|      4|  }
  130|      4|  return true;
  131|      8|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|      4|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|      4|    DecoderBuffer *buffer) {
  136|      4|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      4|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      4|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      4|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 4]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|      4|#endif
  146|      4|  {
  147|      4|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 4]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      4|  }
  151|      4|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 2, False: 2]
  ------------------
  152|      2|    return false;
  153|      2|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|  23.3k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|     25|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|     25|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     25|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 25]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     25|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     25|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     25|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 2, False: 23]
  ------------------
   67|      2|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 2]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      2|  } else
   72|     23|#endif
   73|     23|  {
   74|     23|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 23]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     23|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     25|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 23]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|     23|  probability_table_.resize(num_symbols_);
   86|     23|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 22]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   442k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 442k, False: 9]
  ------------------
   91|   442k|    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|   442k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 8, False: 442k]
  ------------------
   95|      8|      return false;
   96|      8|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   442k|    const int token = prob_data & 3;
  102|   442k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 103k, False: 338k]
  ------------------
  103|   103k|      const uint32_t offset = prob_data >> 2;
  104|   103k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 4, False: 103k]
  ------------------
  105|      4|        return false;
  106|      4|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.66M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.56M, False: 103k]
  ------------------
  109|  3.56M|        probability_table_[i + j] = 0;
  110|  3.56M|      }
  111|   103k|      i += offset;
  112|   338k|    } else {
  113|   338k|      const int extra_bytes = token;
  114|   338k|      uint32_t prob = prob_data >> 2;
  115|   603k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 264k, False: 338k]
  ------------------
  116|   264k|        uint8_t eb;
  117|   264k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 1, False: 264k]
  ------------------
  118|      1|          return false;
  119|      1|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   264k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   264k|      }
  124|   338k|      probability_table_[i] = prob;
  125|   338k|    }
  126|   442k|  }
  127|      9|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 2, False: 7]
  ------------------
  128|      2|    return false;
  129|      2|  }
  130|      7|  return true;
  131|      9|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|      8|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|      7|    DecoderBuffer *buffer) {
  136|      7|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      7|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      7|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      7|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 7]
  ------------------
  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|      7|#endif
  146|      7|  {
  147|      7|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 7]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      7|  }
  151|      7|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 3, False: 4]
  ------------------
  152|      3|    return false;
  153|      3|  }
  154|      4|  const uint8_t *const data_head =
  155|      4|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      4|  buffer->Advance(bytes_encoded);
  158|      4|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 4]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      4|  return true;
  162|      4|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|  46.0k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|      4|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      4|  ans_.read_end();
  167|      4|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|     22|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|     22|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     22|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 22]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     22|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     22|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     22|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 10, False: 12]
  ------------------
   67|     10|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 10]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     10|  } else
   72|     12|#endif
   73|     12|  {
   74|     12|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 12]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     12|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     22|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 21]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|     21|  probability_table_.resize(num_symbols_);
   86|     21|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 21]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   263k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 263k, False: 8]
  ------------------
   91|   263k|    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|   263k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 3, False: 263k]
  ------------------
   95|      3|      return false;
   96|      3|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   263k|    const int token = prob_data & 3;
  102|   263k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 100k, False: 163k]
  ------------------
  103|   100k|      const uint32_t offset = prob_data >> 2;
  104|   100k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 8, False: 100k]
  ------------------
  105|      8|        return false;
  106|      8|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.87M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.77M, False: 100k]
  ------------------
  109|  4.77M|        probability_table_[i + j] = 0;
  110|  4.77M|      }
  111|   100k|      i += offset;
  112|   163k|    } else {
  113|   163k|      const int extra_bytes = token;
  114|   163k|      uint32_t prob = prob_data >> 2;
  115|   273k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 110k, False: 163k]
  ------------------
  116|   110k|        uint8_t eb;
  117|   110k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 2, False: 110k]
  ------------------
  118|      2|          return false;
  119|      2|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   110k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   110k|      }
  124|   163k|      probability_table_[i] = prob;
  125|   163k|    }
  126|   263k|  }
  127|      8|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 3, False: 5]
  ------------------
  128|      3|    return false;
  129|      3|  }
  130|      5|  return true;
  131|      8|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|      5|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|      5|    DecoderBuffer *buffer) {
  136|      5|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      5|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      5|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      5|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 5]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|      5|#endif
  146|      5|  {
  147|      5|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 5]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      5|  }
  151|      5|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 2, False: 3]
  ------------------
  152|      2|    return false;
  153|      2|  }
  154|      3|  const uint8_t *const data_head =
  155|      3|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      3|  buffer->Advance(bytes_encoded);
  158|      3|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 2]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|      2|  return true;
  162|      3|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  12.8k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|     17|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|     17|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     17|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 17]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     17|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     17|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     17|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 3, False: 14]
  ------------------
   67|      3|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 3]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      3|  } else
   72|     14|#endif
   73|     14|  {
   74|     14|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 14]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     14|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     17|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 17]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     17|  probability_table_.resize(num_symbols_);
   86|     17|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 17]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  87.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 87.5k, False: 7]
  ------------------
   91|  87.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|  87.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 5, False: 87.5k]
  ------------------
   95|      5|      return false;
   96|      5|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  87.5k|    const int token = prob_data & 3;
  102|  87.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 21.8k, False: 65.6k]
  ------------------
  103|  21.8k|      const uint32_t offset = prob_data >> 2;
  104|  21.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 2, False: 21.8k]
  ------------------
  105|      2|        return false;
  106|      2|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   937k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 915k, False: 21.8k]
  ------------------
  109|   915k|        probability_table_[i + j] = 0;
  110|   915k|      }
  111|  21.8k|      i += offset;
  112|  65.6k|    } else {
  113|  65.6k|      const int extra_bytes = token;
  114|  65.6k|      uint32_t prob = prob_data >> 2;
  115|   132k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 67.0k, False: 65.6k]
  ------------------
  116|  67.0k|        uint8_t eb;
  117|  67.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 3, False: 67.0k]
  ------------------
  118|      3|          return false;
  119|      3|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  67.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  67.0k|      }
  124|  65.6k|      probability_table_[i] = prob;
  125|  65.6k|    }
  126|  87.5k|  }
  127|      7|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 3, False: 4]
  ------------------
  128|      3|    return false;
  129|      3|  }
  130|      4|  return true;
  131|      7|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|      4|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|      4|    DecoderBuffer *buffer) {
  136|      4|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      4|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      4|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      4|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 2]
  ------------------
  140|      2|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 2]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      2|  } else
  145|      2|#endif
  146|      2|  {
  147|      2|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 2]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      2|  }
  151|      4|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 2, False: 2]
  ------------------
  152|      2|    return false;
  153|      2|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  12.2k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|      8|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|      8|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|      8|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 8]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|      8|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|      8|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      8|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 2, False: 6]
  ------------------
   67|      2|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 2]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      2|  } else
   72|      6|#endif
   73|      6|  {
   74|      6|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 6]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      6|  }
   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|      8|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 8]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|      8|  probability_table_.resize(num_symbols_);
   86|      8|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 8]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  7.70k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 7.70k, False: 4]
  ------------------
   91|  7.70k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  7.70k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 2, False: 7.70k]
  ------------------
   95|      2|      return false;
   96|      2|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  7.70k|    const int token = prob_data & 3;
  102|  7.70k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.18k, False: 5.51k]
  ------------------
  103|  2.18k|      const uint32_t offset = prob_data >> 2;
  104|  2.18k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 2, False: 2.18k]
  ------------------
  105|      2|        return false;
  106|      2|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  69.9k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 67.7k, False: 2.18k]
  ------------------
  109|  67.7k|        probability_table_[i + j] = 0;
  110|  67.7k|      }
  111|  2.18k|      i += offset;
  112|  5.51k|    } else {
  113|  5.51k|      const int extra_bytes = token;
  114|  5.51k|      uint32_t prob = prob_data >> 2;
  115|  9.26k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.74k, False: 5.51k]
  ------------------
  116|  3.74k|        uint8_t eb;
  117|  3.74k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 3.74k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.74k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.74k|      }
  124|  5.51k|      probability_table_[i] = prob;
  125|  5.51k|    }
  126|  7.70k|  }
  127|      4|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 3]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|      3|  return true;
  131|      4|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|      3|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|      3|    DecoderBuffer *buffer) {
  136|      3|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      3|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      3|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      3|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 1]
  ------------------
  140|      2|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 2]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      2|  } else
  145|      1|#endif
  146|      1|  {
  147|      1|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 1]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      1|  }
  151|      3|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 3, False: 0]
  ------------------
  152|      3|    return false;
  153|      3|  }
  154|      0|  const uint8_t *const data_head =
  155|      0|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      0|  buffer->Advance(bytes_encoded);
  158|      0|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 0]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      0|  return true;
  162|      0|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|     22|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|     22|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     22|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 22]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     22|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     22|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     22|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 3, False: 19]
  ------------------
   67|      3|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 3]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      3|  } else
   72|     19|#endif
   73|     19|  {
   74|     19|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 19]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     19|  }
   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|     22|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 22]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     22|  probability_table_.resize(num_symbols_);
   86|     22|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 22]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|    338|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 321, False: 17]
  ------------------
   91|    321|    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|    321|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 321]
  ------------------
   95|      0|      return false;
   96|      0|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|    321|    const int token = prob_data & 3;
  102|    321|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 146, False: 175]
  ------------------
  103|    146|      const uint32_t offset = prob_data >> 2;
  104|    146|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 5, False: 141]
  ------------------
  105|      5|        return false;
  106|      5|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  7.00k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 6.86k, False: 141]
  ------------------
  109|  6.86k|        probability_table_[i + j] = 0;
  110|  6.86k|      }
  111|    141|      i += offset;
  112|    175|    } else {
  113|    175|      const int extra_bytes = token;
  114|    175|      uint32_t prob = prob_data >> 2;
  115|    338|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 163, False: 175]
  ------------------
  116|    163|        uint8_t eb;
  117|    163|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 163]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|    163|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|    163|      }
  124|    175|      probability_table_[i] = prob;
  125|    175|    }
  126|    321|  }
  127|     17|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 16]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|     16|  return true;
  131|     17|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|     16|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|     16|    DecoderBuffer *buffer) {
  136|     16|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     16|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     16|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     16|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 3, False: 13]
  ------------------
  140|      3|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 3]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      3|  } else
  145|     13|#endif
  146|     13|  {
  147|     13|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 13]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     13|  }
  151|     16|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 6, False: 10]
  ------------------
  152|      6|    return false;
  153|      6|  }
  154|     10|  const uint8_t *const data_head =
  155|     10|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     10|  buffer->Advance(bytes_encoded);
  158|     10|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 10]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|     10|  return true;
  162|     10|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  15.4k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     10|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     10|  ans_.read_end();
  167|     10|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|     16|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|     16|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     16|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 16]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     16|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     16|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     16|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 11, False: 5]
  ------------------
   67|     11|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 11]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     11|  } else
   72|      5|#endif
   73|      5|  {
   74|      5|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 5]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      5|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     16|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 16]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     16|  probability_table_.resize(num_symbols_);
   86|     16|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 16]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   157k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 157k, False: 12]
  ------------------
   91|   157k|    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|   157k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 157k]
  ------------------
   95|      1|      return false;
   96|      1|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   157k|    const int token = prob_data & 3;
  102|   157k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 126k, False: 30.8k]
  ------------------
  103|   126k|      const uint32_t offset = prob_data >> 2;
  104|   126k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 2, False: 126k]
  ------------------
  105|      2|        return false;
  106|      2|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   907k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 781k, False: 126k]
  ------------------
  109|   781k|        probability_table_[i + j] = 0;
  110|   781k|      }
  111|   126k|      i += offset;
  112|   126k|    } else {
  113|  30.8k|      const int extra_bytes = token;
  114|  30.8k|      uint32_t prob = prob_data >> 2;
  115|  74.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 43.3k, False: 30.8k]
  ------------------
  116|  43.3k|        uint8_t eb;
  117|  43.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 1, False: 43.3k]
  ------------------
  118|      1|          return false;
  119|      1|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  43.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  43.3k|      }
  124|  30.8k|      probability_table_[i] = prob;
  125|  30.8k|    }
  126|   157k|  }
  127|     12|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 11]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|     11|  return true;
  131|     12|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|     11|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|     11|    DecoderBuffer *buffer) {
  136|     11|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     11|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     11|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     11|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 9, False: 2]
  ------------------
  140|      9|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 9]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      9|  } else
  145|      2|#endif
  146|      2|  {
  147|      2|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 2]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      2|  }
  151|     11|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 9, False: 2]
  ------------------
  152|      9|    return false;
  153|      9|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  3.14M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}

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

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

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

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

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

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

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|    786|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|    294|  const CornerTable *GetCornerTable() const override {
   67|    294|    return corner_table_.get();
   68|    294|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  7.59M|                       int *out_encoder_split_symbol_id) {
   87|  7.59M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 10.1k, False: 7.58M]
  ------------------
   88|  10.1k|      return false;
   89|  10.1k|    }
   90|  7.58M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 1, False: 7.58M]
  ------------------
   91|  7.58M|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|      1|      *out_encoder_split_symbol_id = -1;
   98|      1|      return true;
   99|      1|    }
  100|  7.58M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 7.58M, False: 41]
  ------------------
  101|  7.58M|      return false;
  102|  7.58M|    }
  103|     41|    *out_face_edge =
  104|     41|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|     41|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|     41|    topology_split_data_.pop_back();
  108|     41|    return true;
  109|  7.58M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  24.7M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  24.7M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  24.7M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  24.7M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  1.27k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|    537|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|    534|  const CornerTable *GetCornerTable() const override {
   67|    534|    return corner_table_.get();
   68|    534|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  1.36M|                       int *out_encoder_split_symbol_id) {
   87|  1.36M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 1.36M, False: 1.67k]
  ------------------
   88|  1.36M|      return false;
   89|  1.36M|    }
   90|  1.67k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 0, False: 1.67k]
  ------------------
   91|  1.67k|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|      0|      *out_encoder_split_symbol_id = -1;
   98|      0|      return true;
   99|      0|    }
  100|  1.67k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 1.59k, False: 72]
  ------------------
  101|  1.59k|      return false;
  102|  1.59k|    }
  103|     72|    *out_face_edge =
  104|     72|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|     72|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|     72|    topology_split_data_.pop_back();
  108|     72|    return true;
  109|  1.67k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  4.06M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  4.06M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  4.06M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  4.06M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|    401|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|    798|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|    146|  const CornerTable *GetCornerTable() const override {
   67|    146|    return corner_table_.get();
   68|    146|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  1.61M|                       int *out_encoder_split_symbol_id) {
   87|  1.61M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 1.60M, False: 11.4k]
  ------------------
   88|  1.60M|      return false;
   89|  1.60M|    }
   90|  11.4k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 1, False: 11.4k]
  ------------------
   91|  11.4k|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|      1|      *out_encoder_split_symbol_id = -1;
   98|      1|      return true;
   99|      1|    }
  100|  11.4k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 11.4k, False: 54]
  ------------------
  101|  11.4k|      return false;
  102|  11.4k|    }
  103|     54|    *out_face_edge =
  104|     54|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|     54|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|     54|    topology_split_data_.pop_back();
  108|     54|    return true;
  109|  11.4k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  1.50M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  1.50M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  1.50M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  1.50M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  1.55k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

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

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

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

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

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|    153|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|   817k|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|   817k|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 816k, False: 574]
  ------------------
   61|   816k|      return true;  // Already traversed.
   62|   816k|    }
   63|       |
   64|    574|    corner_traversal_stack_.clear();
   65|    574|    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|    574|    const VertexIndex next_vert =
   69|    574|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|    574|    const VertexIndex prev_vert =
   71|    574|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|    574|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 574]
  |  Branch (72:45): [True: 0, False: 574]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|    574|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 562, False: 12]
  ------------------
   76|    562|      this->MarkVertexVisited(next_vert);
   77|    562|      this->traversal_observer().OnNewVertexVisited(
   78|    562|          next_vert, this->corner_table()->Next(corner_id));
   79|    562|    }
   80|    574|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 539, False: 35]
  ------------------
   81|    539|      this->MarkVertexVisited(prev_vert);
   82|    539|      this->traversal_observer().OnNewVertexVisited(
   83|    539|          prev_vert, this->corner_table()->Previous(corner_id));
   84|    539|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  3.85k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 3.28k, False: 574]
  ------------------
   88|       |      // Currently processed corner.
   89|  3.28k|      corner_id = corner_traversal_stack_.back();
   90|  3.28k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  3.28k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 3.28k]
  |  Branch (92:47): [True: 130, False: 3.15k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    130|        corner_traversal_stack_.pop_back();
   95|    130|        continue;
   96|    130|      }
   97|   817k|      while (true) {
  ------------------
  |  Branch (97:14): [True: 817k, Folded]
  ------------------
   98|   817k|        this->MarkFaceVisited(face_id);
   99|   817k|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|   817k|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|   817k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 817k]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|   817k|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 408k, False: 408k]
  ------------------
  105|   408k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|   408k|          this->MarkVertexVisited(vert_id);
  107|   408k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|   408k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 407k, False: 1.40k]
  ------------------
  109|   407k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   407k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   407k|            continue;
  112|   407k|          }
  113|   408k|        }
  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|   409k|        const CornerIndex right_corner_id =
  118|   409k|            this->corner_table()->GetRightCorner(corner_id);
  119|   409k|        const CornerIndex left_corner_id =
  120|   409k|            this->corner_table()->GetLeftCorner(corner_id);
  121|   409k|        const FaceIndex right_face_id(
  122|   409k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 1.13k, False: 408k]
  ------------------
  123|   409k|                 ? kInvalidFaceIndex
  124|   409k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|   409k|        const FaceIndex left_face_id(
  126|   409k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 647, False: 408k]
  ------------------
  127|   409k|                 ? kInvalidFaceIndex
  128|   409k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|   409k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 406k, False: 2.57k]
  ------------------
  130|       |          // Right face has been already visited.
  131|   406k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 1.79k, False: 405k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  1.79k|            corner_traversal_stack_.pop_back();
  134|  1.79k|            break;  // Break from the while (true) loop.
  135|   405k|          } else {
  136|       |            // Go to the left face.
  137|   405k|            corner_id = left_corner_id;
  138|   405k|            face_id = left_face_id;
  139|   405k|          }
  140|   406k|        } else {
  141|       |          // Right face was not visited.
  142|  2.57k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 1.22k, False: 1.35k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  1.22k|            corner_id = right_corner_id;
  145|  1.22k|            face_id = right_face_id;
  146|  1.35k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  1.35k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  1.35k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  1.35k|            break;
  159|  1.35k|          }
  160|  2.57k|        }
  161|   409k|      }
  162|  3.15k|    }
  163|    574|    return true;
  164|    574|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|    153|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|    312|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|    154|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  87.7k|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  87.7k|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 42.6k, False: 45.1k]
  ------------------
   61|  42.6k|      return true;  // Already traversed.
   62|  42.6k|    }
   63|       |
   64|  45.1k|    corner_traversal_stack_.clear();
   65|  45.1k|    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|  45.1k|    const VertexIndex next_vert =
   69|  45.1k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  45.1k|    const VertexIndex prev_vert =
   71|  45.1k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  45.1k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 45.1k]
  |  Branch (72:45): [True: 0, False: 45.1k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  45.1k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 44.9k, False: 143]
  ------------------
   76|  44.9k|      this->MarkVertexVisited(next_vert);
   77|  44.9k|      this->traversal_observer().OnNewVertexVisited(
   78|  44.9k|          next_vert, this->corner_table()->Next(corner_id));
   79|  44.9k|    }
   80|  45.1k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 44.9k, False: 147]
  ------------------
   81|  44.9k|      this->MarkVertexVisited(prev_vert);
   82|  44.9k|      this->traversal_observer().OnNewVertexVisited(
   83|  44.9k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  44.9k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  93.6k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 48.5k, False: 45.1k]
  ------------------
   88|       |      // Currently processed corner.
   89|  48.5k|      corner_id = corner_traversal_stack_.back();
   90|  48.5k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  48.5k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 48.5k]
  |  Branch (92:47): [True: 250, False: 48.2k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    250|        corner_traversal_stack_.pop_back();
   95|    250|        continue;
   96|    250|      }
   97|  87.7k|      while (true) {
  ------------------
  |  Branch (97:14): [True: 87.7k, Folded]
  ------------------
   98|  87.7k|        this->MarkFaceVisited(face_id);
   99|  87.7k|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  87.7k|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  87.7k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 87.7k]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  87.7k|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 67.4k, False: 20.3k]
  ------------------
  105|  67.4k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  67.4k|          this->MarkVertexVisited(vert_id);
  107|  67.4k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  67.4k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 19.5k, False: 47.9k]
  ------------------
  109|  19.5k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  19.5k|            face_id = FaceIndex(corner_id.value() / 3);
  111|  19.5k|            continue;
  112|  19.5k|          }
  113|  67.4k|        }
  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|  68.2k|        const CornerIndex right_corner_id =
  118|  68.2k|            this->corner_table()->GetRightCorner(corner_id);
  119|  68.2k|        const CornerIndex left_corner_id =
  120|  68.2k|            this->corner_table()->GetLeftCorner(corner_id);
  121|  68.2k|        const FaceIndex right_face_id(
  122|  68.2k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 46.6k, False: 21.6k]
  ------------------
  123|  68.2k|                 ? kInvalidFaceIndex
  124|  68.2k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  68.2k|        const FaceIndex left_face_id(
  126|  68.2k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 46.3k, False: 21.9k]
  ------------------
  127|  68.2k|                 ? kInvalidFaceIndex
  128|  68.2k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  68.2k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 65.5k, False: 2.76k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  65.5k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 46.5k, False: 18.9k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  46.5k|            corner_traversal_stack_.pop_back();
  134|  46.5k|            break;  // Break from the while (true) loop.
  135|  46.5k|          } else {
  136|       |            // Go to the left face.
  137|  18.9k|            corner_id = left_corner_id;
  138|  18.9k|            face_id = left_face_id;
  139|  18.9k|          }
  140|  65.5k|        } else {
  141|       |          // Right face was not visited.
  142|  2.76k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 1.06k, False: 1.70k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  1.06k|            corner_id = right_corner_id;
  145|  1.06k|            face_id = right_face_id;
  146|  1.70k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  1.70k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  1.70k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  1.70k|            break;
  159|  1.70k|          }
  160|  2.76k|        }
  161|  68.2k|      }
  162|  48.2k|    }
  163|  45.1k|    return true;
  164|  45.1k|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|    154|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|    318|  DepthFirstTraverser() {}

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

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|     17|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|    464|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|    464|    const auto *corner_table = traverser_.corner_table();
   50|    464|    attribute->SetExplicitMapping(mesh_->num_points());
   51|    464|    const size_t num_faces = mesh_->num_faces();
   52|    464|    const size_t num_points = mesh_->num_points();
   53|   159k|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 158k, False: 464]
  ------------------
   54|   158k|      const auto &face = mesh_->face(f);
   55|   634k|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 475k, False: 158k]
  ------------------
   56|   475k|        const PointIndex point_id = face[p];
   57|   475k|        const VertexIndex vert_id =
   58|   475k|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|   475k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 475k]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|   475k|        const AttributeValueIndex att_entry_id(
   63|   475k|            encoding_data_
   64|   475k|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|   475k|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 475k]
  |  Branch (65:13): [True: 0, False: 475k]
  |  Branch (65:39): [True: 0, False: 475k]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|   475k|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|   475k|      }
   71|   158k|    }
   72|    464|    return true;
   73|    464|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|     17|  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|     17|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|     17|    traverser_.OnTraversalStart();
   82|     17|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 17]
  ------------------
   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|     17|    } else {
   89|     17|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  69.9k|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 69.8k, False: 17]
  ------------------
   91|  69.8k|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 69.8k]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  69.8k|      }
   95|     17|    }
   96|     17|    traverser_.OnTraversalEnd();
   97|     17|    return true;
   98|     17|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  69.8k|  bool ProcessCorner(CornerIndex corner_id) {
  102|  69.8k|    return traverser_.TraverseFromCorner(corner_id);
  103|  69.8k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|     17|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    156|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  1.22k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  1.22k|    const auto *corner_table = traverser_.corner_table();
   50|  1.22k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  1.22k|    const size_t num_faces = mesh_->num_faces();
   52|  1.22k|    const size_t num_points = mesh_->num_points();
   53|  1.73M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 1.72M, False: 1.22k]
  ------------------
   54|  1.72M|      const auto &face = mesh_->face(f);
   55|  6.91M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 5.18M, False: 1.72M]
  ------------------
   56|  5.18M|        const PointIndex point_id = face[p];
   57|  5.18M|        const VertexIndex vert_id =
   58|  5.18M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  5.18M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 5.18M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  5.18M|        const AttributeValueIndex att_entry_id(
   63|  5.18M|            encoding_data_
   64|  5.18M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  5.18M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 5.18M]
  |  Branch (65:13): [True: 0, False: 5.18M]
  |  Branch (65:39): [True: 0, False: 5.18M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  5.18M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  5.18M|      }
   71|  1.72M|    }
   72|  1.22k|    return true;
   73|  1.22k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    153|  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|    153|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    153|    traverser_.OnTraversalStart();
   82|    153|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 153]
  ------------------
   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|    153|    } else {
   89|    153|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|   817k|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 817k, False: 153]
  ------------------
   91|   817k|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 817k]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|   817k|      }
   95|    153|    }
   96|    153|    traverser_.OnTraversalEnd();
   97|    153|    return true;
   98|    153|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   817k|  bool ProcessCorner(CornerIndex corner_id) {
  102|   817k|    return traverser_.TraverseFromCorner(corner_id);
  103|   817k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    156|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    159|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  2.67k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  2.67k|    const auto *corner_table = traverser_.corner_table();
   50|  2.67k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  2.67k|    const size_t num_faces = mesh_->num_faces();
   52|  2.67k|    const size_t num_points = mesh_->num_points();
   53|   228k|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 226k, False: 2.67k]
  ------------------
   54|   226k|      const auto &face = mesh_->face(f);
   55|   905k|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 678k, False: 226k]
  ------------------
   56|   678k|        const PointIndex point_id = face[p];
   57|   678k|        const VertexIndex vert_id =
   58|   678k|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|   678k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 678k]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|   678k|        const AttributeValueIndex att_entry_id(
   63|   678k|            encoding_data_
   64|   678k|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|   678k|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 678k]
  |  Branch (65:13): [True: 0, False: 678k]
  |  Branch (65:39): [True: 0, False: 678k]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|   678k|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|   678k|      }
   71|   226k|    }
   72|  2.67k|    return true;
   73|  2.67k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    154|  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|    154|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    154|    traverser_.OnTraversalStart();
   82|    154|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 154]
  ------------------
   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|    154|    } else {
   89|    154|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  87.9k|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 87.7k, False: 154]
  ------------------
   91|  87.7k|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 87.7k]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  87.7k|      }
   95|    154|    }
   96|    154|    traverser_.OnTraversalEnd();
   97|    154|    return true;
   98|    154|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  87.7k|  bool ProcessCorner(CornerIndex corner_id) {
  102|  87.7k|    return traverser_.TraverseFromCorner(corner_id);
  103|  87.7k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    159|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|    318|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  3.12M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  1.20M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  1.20M|    return is_vertex_visited_[vert_id.value()];
   65|  1.20M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|   446k|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|   446k|    is_vertex_visited_[vert_id.value()] = true;
   68|   446k|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  1.33M|  inline TraversalObserverT &traversal_observer() {
   75|  1.33M|    return traversal_observer_;
   76|  1.33M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  1.08M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  1.08M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 3.12k, False: 1.08M]
  ------------------
   47|  3.12k|      return true;  // Invalid faces are always considered as visited.
   48|  3.12k|    }
   49|  1.08M|    return is_face_visited_[face_id.value()];
   50|  1.08M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|   886k|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|   886k|    is_face_visited_[face_id.value()] = true;
   62|   886k|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|    346|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|    346|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|    173|                    TraversalObserver traversal_observer) {
   37|    173|    corner_table_ = corner_table;
   38|    173|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|    173|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|    173|    traversal_observer_ = traversal_observer;
   41|    173|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|   817k|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|   817k|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 817k]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|   817k|    return is_face_visited_[corner_id.value() / 3];
   58|   817k|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|   584k|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  87.7k|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  87.7k|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 87.7k]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  87.7k|    return is_face_visited_[corner_id.value() / 3];
   58|  87.7k|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|   178k|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|   178k|    return is_vertex_visited_[vert_id.value()];
   65|   178k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|   157k|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|   157k|    is_vertex_visited_[vert_id.value()] = true;
   68|   157k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|   245k|  inline TraversalObserverT &traversal_observer() {
   75|   245k|    return traversal_observer_;
   76|   245k|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|   185k|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|   185k|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 93.0k, False: 92.0k]
  ------------------
   47|  93.0k|      return true;  // Invalid faces are always considered as visited.
   48|  93.0k|    }
   49|  92.0k|    return is_face_visited_[face_id.value()];
   50|   185k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  87.7k|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  87.7k|    is_face_visited_[face_id.value()] = true;
   62|  87.7k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|    318|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|    159|                    TraversalObserver traversal_observer) {
   37|    159|    corner_table_ = corner_table;
   38|    159|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|    159|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|    159|    traversal_observer_ = traversal_observer;
   41|    159|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     20|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     20|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 20]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     20|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 17]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|     17|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 17]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     17|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 4, False: 13]
  ------------------
  196|      4|    return true;
  197|      4|  }
  198|     13|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 3, False: 10]
  ------------------
  199|      3|    return false;
  200|      3|  }
  201|     10|  num_decoded_points_ = 0;
  202|       |
  203|     10|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 10]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|     10|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 10]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     10|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 9]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|      9|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 9]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      9|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 9, False: 0]
  ------------------
  217|      9|    return false;
  218|      9|  }
  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|      9|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|      9|    uint32_t num_points, OutputIteratorT &oit) {
  254|      9|  typedef DecodingStatus Status;
  255|      9|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|      9|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|      9|  DecodingStatus init_status(num_points, 0, 0);
  258|      9|  std::stack<Status> status_stack;
  259|      9|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  5.51k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 5.51k, False: 0]
  ------------------
  263|  5.51k|    const DecodingStatus status = status_stack.top();
  264|  5.51k|    status_stack.pop();
  265|       |
  266|  5.51k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  5.51k|    const uint32_t last_axis = status.last_axis;
  268|  5.51k|    const uint32_t stack_pos = status.stack_pos;
  269|  5.51k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  5.51k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  5.51k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 5.51k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  5.51k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  5.51k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 5.51k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  5.51k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  5.51k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 993, False: 4.52k]
  ------------------
  285|  2.95k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 1.96k, False: 993]
  ------------------
  286|  1.96k|        *oit = old_base;
  287|  1.96k|        ++oit;
  288|  1.96k|        ++num_decoded_points_;
  289|  1.96k|      }
  290|    993|      continue;
  291|    993|    }
  292|       |
  293|  4.52k|    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.52k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.65k, False: 2.87k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.65k|      axes_[0] = axis;
  300|  13.2k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 11.5k, False: 1.65k]
  ------------------
  301|  11.5k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  11.5k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 887, False: 10.6k]
  |  |  ------------------
  ------------------
  302|  11.5k|      }
  303|  4.45k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.80k, False: 1.65k]
  ------------------
  304|  25.2k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 22.4k, False: 2.80k]
  ------------------
  305|  22.4k|          p_[axes_[j]] = 0;
  306|  22.4k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  22.4k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 4.90k, False: 17.5k]
  ------------------
  308|  4.90k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 0, False: 4.90k]
  ------------------
  309|  4.90k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      0|              return false;
  311|      0|            }
  312|  4.90k|          }
  313|  22.4k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  22.4k|        }
  315|  2.80k|        *oit = p_;
  316|  2.80k|        ++oit;
  317|  2.80k|        ++num_decoded_points_;
  318|  2.80k|      }
  319|  1.65k|      continue;
  320|  1.65k|    }
  321|       |
  322|  2.87k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 2.87k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  2.87k|    const int num_remaining_bits = bit_length_ - level;
  327|  2.87k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  2.87k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  2.87k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  2.87k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  2.87k|    uint32_t number = 0;
  334|  2.87k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  2.87k|    uint32_t first_half = num_remaining_points / 2;
  337|  2.87k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 9, False: 2.86k]
  ------------------
  338|       |      // Invalid |number|.
  339|      9|      return false;
  340|      9|    }
  341|  2.86k|    first_half -= number;
  342|  2.86k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  2.86k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.97k, False: 888]
  ------------------
  345|  1.97k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.39k, False: 583]
  ------------------
  346|  1.39k|        std::swap(first_half, second_half);
  347|  1.39k|      }
  348|  1.97k|    }
  349|       |
  350|  2.86k|    levels_stack_[stack_pos][axis] += 1;
  351|  2.86k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  2.86k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 2.80k, False: 57]
  ------------------
  353|  2.80k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  2.80k|    }
  355|  2.86k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.77k, False: 89]
  ------------------
  356|  2.77k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.77k|    }
  358|  2.86k|  }
  359|      0|  return true;
  360|      9|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  134|  5.59k|        : num_remaining_points(num_remaining_points_),
  135|  5.59k|          last_axis(last_axis_),
  136|  5.59k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|  2.87k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.87k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.87k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|      4|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|     24|      : bit_length_(0),
   87|     24|        num_points_(0),
   88|     24|        num_decoded_points_(0),
   89|     24|        dimension_(dimension),
   90|     24|        p_(dimension, 0),
   91|     24|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     24|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     24|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     22|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     22|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 22]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     22|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 21]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     21|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 21]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     21|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 3, False: 18]
  ------------------
  196|      3|    return true;
  197|      3|  }
  198|     18|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 18]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     18|  num_decoded_points_ = 0;
  202|       |
  203|     18|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 18]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|     18|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 18]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     18|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 17]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     17|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 15]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     15|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 15, False: 0]
  ------------------
  217|     15|    return false;
  218|     15|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     15|    uint32_t num_points, OutputIteratorT &oit) {
  254|     15|  typedef DecodingStatus Status;
  255|     15|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     15|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     15|  DecodingStatus init_status(num_points, 0, 0);
  258|     15|  std::stack<Status> status_stack;
  259|     15|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  10.2k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 10.2k, False: 0]
  ------------------
  263|  10.2k|    const DecodingStatus status = status_stack.top();
  264|  10.2k|    status_stack.pop();
  265|       |
  266|  10.2k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  10.2k|    const uint32_t last_axis = status.last_axis;
  268|  10.2k|    const uint32_t stack_pos = status.stack_pos;
  269|  10.2k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  10.2k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  10.2k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 10.2k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  10.2k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  10.2k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 10.2k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  10.2k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  10.2k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 3.84k, False: 6.44k]
  ------------------
  285|  20.3k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 16.5k, False: 3.84k]
  ------------------
  286|  16.5k|        *oit = old_base;
  287|  16.5k|        ++oit;
  288|  16.5k|        ++num_decoded_points_;
  289|  16.5k|      }
  290|  3.84k|      continue;
  291|  3.84k|    }
  292|       |
  293|  6.44k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  6.44k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.10k, False: 5.34k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.10k|      axes_[0] = axis;
  300|  8.83k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 7.72k, False: 1.10k]
  ------------------
  301|  7.72k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  7.72k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 142, False: 7.58k]
  |  |  ------------------
  ------------------
  302|  7.72k|      }
  303|  3.08k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.97k, False: 1.10k]
  ------------------
  304|  17.7k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 15.8k, False: 1.97k]
  ------------------
  305|  15.8k|          p_[axes_[j]] = 0;
  306|  15.8k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  15.8k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.25k, False: 13.5k]
  ------------------
  308|  2.25k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 0, False: 2.25k]
  ------------------
  309|  2.25k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      0|              return false;
  311|      0|            }
  312|  2.25k|          }
  313|  15.8k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  15.8k|        }
  315|  1.97k|        *oit = p_;
  316|  1.97k|        ++oit;
  317|  1.97k|        ++num_decoded_points_;
  318|  1.97k|      }
  319|  1.10k|      continue;
  320|  1.10k|    }
  321|       |
  322|  5.34k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 5.34k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  5.34k|    const int num_remaining_bits = bit_length_ - level;
  327|  5.34k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  5.34k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  5.34k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  5.34k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  5.34k|    uint32_t number = 0;
  334|  5.34k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  5.34k|    uint32_t first_half = num_remaining_points / 2;
  337|  5.34k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 15, False: 5.32k]
  ------------------
  338|       |      // Invalid |number|.
  339|     15|      return false;
  340|     15|    }
  341|  5.32k|    first_half -= number;
  342|  5.32k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  5.32k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 3.82k, False: 1.50k]
  ------------------
  345|  3.82k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 2.91k, False: 914]
  ------------------
  346|  2.91k|        std::swap(first_half, second_half);
  347|  2.91k|      }
  348|  3.82k|    }
  349|       |
  350|  5.32k|    levels_stack_[stack_pos][axis] += 1;
  351|  5.32k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  5.32k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 5.27k, False: 56]
  ------------------
  353|  5.27k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  5.27k|    }
  355|  5.32k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 5.13k, False: 189]
  ------------------
  356|  5.13k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  5.13k|    }
  358|  5.32k|  }
  359|      0|  return true;
  360|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  134|  10.4k|        : num_remaining_points(num_remaining_points_),
  135|  10.4k|          last_axis(last_axis_),
  136|  10.4k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  10.2k|    uint32_t last_axis) {
  232|  10.2k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 10.2k, Folded]
  ------------------
  233|  10.2k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  10.2k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.96k, False: 7.32k]
  |  |  ------------------
  ------------------
  234|  10.2k|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  10.2k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  5.34k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  5.34k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  5.34k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|      3|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     18|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     18|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 18]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     18|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 17]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     17|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 17]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     17|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 2, False: 15]
  ------------------
  196|      2|    return true;
  197|      2|  }
  198|     15|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 15]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     15|  num_decoded_points_ = 0;
  202|       |
  203|     15|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 1, False: 14]
  ------------------
  204|      1|    return false;
  205|      1|  }
  206|     14|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 12]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     12|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 11, False: 1]
  ------------------
  210|     11|    return false;
  211|     11|  }
  212|      1|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 1]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      1|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 1, False: 0]
  ------------------
  217|      1|    return false;
  218|      1|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|      1|    uint32_t num_points, OutputIteratorT &oit) {
  254|      1|  typedef DecodingStatus Status;
  255|      1|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|      1|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|      1|  DecodingStatus init_status(num_points, 0, 0);
  258|      1|  std::stack<Status> status_stack;
  259|      1|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|      5|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 5, False: 0]
  ------------------
  263|      5|    const DecodingStatus status = status_stack.top();
  264|      5|    status_stack.pop();
  265|       |
  266|      5|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|      5|    const uint32_t last_axis = status.last_axis;
  268|      5|    const uint32_t stack_pos = status.stack_pos;
  269|      5|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|      5|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|      5|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 5]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|      5|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|      5|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 5]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|      5|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|      5|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 0, False: 5]
  ------------------
  285|      0|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 0, False: 0]
  ------------------
  286|      0|        *oit = old_base;
  287|      0|        ++oit;
  288|      0|        ++num_decoded_points_;
  289|      0|      }
  290|      0|      continue;
  291|      0|    }
  292|       |
  293|      5|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|      5|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 0, False: 5]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|      0|      axes_[0] = axis;
  300|      0|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 0, False: 0]
  ------------------
  301|      0|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|      0|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  302|      0|      }
  303|      0|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 0, False: 0]
  ------------------
  304|      0|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 0, False: 0]
  ------------------
  305|      0|          p_[axes_[j]] = 0;
  306|      0|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|      0|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 0, False: 0]
  ------------------
  308|      0|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 0, False: 0]
  ------------------
  309|      0|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      0|              return false;
  311|      0|            }
  312|      0|          }
  313|      0|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|      0|        }
  315|      0|        *oit = p_;
  316|      0|        ++oit;
  317|      0|        ++num_decoded_points_;
  318|      0|      }
  319|      0|      continue;
  320|      0|    }
  321|       |
  322|      5|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 5]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|      5|    const int num_remaining_bits = bit_length_ - level;
  327|      5|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|      5|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|      5|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|      5|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|      5|    uint32_t number = 0;
  334|      5|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|      5|    uint32_t first_half = num_remaining_points / 2;
  337|      5|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 4]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|      4|    first_half -= number;
  342|      4|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|      4|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 4, False: 0]
  ------------------
  345|      4|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 0, False: 4]
  ------------------
  346|      0|        std::swap(first_half, second_half);
  347|      0|      }
  348|      4|    }
  349|       |
  350|      4|    levels_stack_[stack_pos][axis] += 1;
  351|      4|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|      4|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 4, False: 0]
  ------------------
  353|      4|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|      4|    }
  355|      4|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 4, False: 0]
  ------------------
  356|      4|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|      4|    }
  358|      4|  }
  359|      0|  return true;
  360|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  134|    123|        : num_remaining_points(num_remaining_points_),
  135|    123|          last_axis(last_axis_),
  136|    123|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  127|     61|  void DecodeNumber(int nbits, uint32_t *value) {
  128|     61|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|     61|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  118|      2|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|     20|      : bit_length_(0),
   87|     20|        num_points_(0),
   88|     20|        num_decoded_points_(0),
   89|     20|        dimension_(dimension),
   90|     20|        p_(dimension, 0),
   91|     20|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     20|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     20|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|      5|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      5|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 5]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      5|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 2, False: 3]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|      3|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 3]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      3|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 3]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      3|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 3]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      3|  num_decoded_points_ = 0;
  202|       |
  203|      3|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 3]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|      3|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 2]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|      2|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 1]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|      1|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 1]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      1|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 1, False: 0]
  ------------------
  217|      1|    return false;
  218|      1|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|      1|    uint32_t num_points, OutputIteratorT &oit) {
  254|      1|  typedef DecodingStatus Status;
  255|      1|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|      1|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|      1|  DecodingStatus init_status(num_points, 0, 0);
  258|      1|  std::stack<Status> status_stack;
  259|      1|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.03k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.03k, False: 0]
  ------------------
  263|  1.03k|    const DecodingStatus status = status_stack.top();
  264|  1.03k|    status_stack.pop();
  265|       |
  266|  1.03k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.03k|    const uint32_t last_axis = status.last_axis;
  268|  1.03k|    const uint32_t stack_pos = status.stack_pos;
  269|  1.03k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.03k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.03k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.03k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.03k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.03k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.03k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.03k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.03k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 501, False: 534]
  ------------------
  285|  1.27k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 777, False: 501]
  ------------------
  286|    777|        *oit = old_base;
  287|    777|        ++oit;
  288|    777|        ++num_decoded_points_;
  289|    777|      }
  290|    501|      continue;
  291|    501|    }
  292|       |
  293|    534|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|    534|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 4, False: 530]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|      4|      axes_[0] = axis;
  300|     16|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 12, False: 4]
  ------------------
  301|     12|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|     12|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1, False: 11]
  |  |  ------------------
  ------------------
  302|     12|      }
  303|     11|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 7, False: 4]
  ------------------
  304|     35|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 28, False: 7]
  ------------------
  305|     28|          p_[axes_[j]] = 0;
  306|     28|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|     28|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 9, False: 19]
  ------------------
  308|      9|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 0, False: 9]
  ------------------
  309|      9|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      0|              return false;
  311|      0|            }
  312|      9|          }
  313|     28|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|     28|        }
  315|      7|        *oit = p_;
  316|      7|        ++oit;
  317|      7|        ++num_decoded_points_;
  318|      7|      }
  319|      4|      continue;
  320|      4|    }
  321|       |
  322|    530|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 530]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|    530|    const int num_remaining_bits = bit_length_ - level;
  327|    530|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|    530|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|    530|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|    530|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|    530|    uint32_t number = 0;
  334|    530|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|    530|    uint32_t first_half = num_remaining_points / 2;
  337|    530|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 529]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|    529|    first_half -= number;
  342|    529|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|    529|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 313, False: 216]
  ------------------
  345|    313|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 270, False: 43]
  ------------------
  346|    270|        std::swap(first_half, second_half);
  347|    270|      }
  348|    313|    }
  349|       |
  350|    529|    levels_stack_[stack_pos][axis] += 1;
  351|    529|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|    529|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 529, False: 0]
  ------------------
  353|    529|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|    529|    }
  355|    529|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 528, False: 1]
  ------------------
  356|    528|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|    528|    }
  358|    529|  }
  359|      0|  return true;
  360|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  134|  1.05k|        : num_remaining_points(num_remaining_points_),
  135|  1.05k|          last_axis(last_axis_),
  136|  1.05k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  1.03k|    uint32_t last_axis) {
  232|  1.03k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 1.03k, Folded]
  ------------------
  233|  1.03k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  1.03k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 277, False: 758]
  |  |  ------------------
  ------------------
  234|  1.03k|  }
  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.03k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  127|    530|  void DecodeNumber(int nbits, uint32_t *value) {
  128|    530|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|    530|  }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     85|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     85|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 85]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     85|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 85]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     85|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 85]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     85|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 85]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     85|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 2, False: 83]
  ------------------
  199|      2|    return false;
  200|      2|  }
  201|     83|  num_decoded_points_ = 0;
  202|       |
  203|     83|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 6, False: 77]
  ------------------
  204|      6|    return false;
  205|      6|  }
  206|     77|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 77]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     77|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 76]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     76|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 75]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     75|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 33, False: 42]
  ------------------
  217|     33|    return false;
  218|     33|  }
  219|       |
  220|     42|  numbers_decoder_.EndDecoding();
  221|     42|  remaining_bits_decoder_.EndDecoding();
  222|     42|  axis_decoder_.EndDecoding();
  223|     42|  half_decoder_.EndDecoding();
  224|       |
  225|     42|  return true;
  226|     75|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     75|    uint32_t num_points, OutputIteratorT &oit) {
  254|     75|  typedef DecodingStatus Status;
  255|     75|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     75|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     75|  DecodingStatus init_status(num_points, 0, 0);
  258|     75|  std::stack<Status> status_stack;
  259|     75|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.44M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.44M, False: 42]
  ------------------
  263|  1.44M|    const DecodingStatus status = status_stack.top();
  264|  1.44M|    status_stack.pop();
  265|       |
  266|  1.44M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.44M|    const uint32_t last_axis = status.last_axis;
  268|  1.44M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.44M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.44M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.44M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.44M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.44M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.44M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.44M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.44M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.44M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 640k, False: 800k]
  ------------------
  285|  64.7M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 64.0M, False: 640k]
  ------------------
  286|  64.0M|        *oit = old_base;
  287|  64.0M|        ++oit;
  288|  64.0M|        ++num_decoded_points_;
  289|  64.0M|      }
  290|   640k|      continue;
  291|   640k|    }
  292|       |
  293|   800k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   800k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 56.0k, False: 744k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  56.0k|      axes_[0] = axis;
  300|  95.7k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 39.6k, False: 56.0k]
  ------------------
  301|  39.6k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  39.6k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 12.8k, False: 26.8k]
  |  |  ------------------
  ------------------
  302|  39.6k|      }
  303|   141k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 85.6k, False: 56.0k]
  ------------------
  304|   225k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 139k, False: 85.5k]
  ------------------
  305|   139k|          p_[axes_[j]] = 0;
  306|   139k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   139k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 119k, False: 20.1k]
  ------------------
  308|   119k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 28, False: 119k]
  ------------------
  309|   119k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     28|              return false;
  311|     28|            }
  312|   119k|          }
  313|   139k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   139k|        }
  315|  85.5k|        *oit = p_;
  316|  85.5k|        ++oit;
  317|  85.5k|        ++num_decoded_points_;
  318|  85.5k|      }
  319|  56.0k|      continue;
  320|  56.0k|    }
  321|       |
  322|   744k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 744k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   744k|    const int num_remaining_bits = bit_length_ - level;
  327|   744k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   744k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   744k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   744k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   744k|    uint32_t number = 0;
  334|   744k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   744k|    uint32_t first_half = num_remaining_points / 2;
  337|   744k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 5, False: 744k]
  ------------------
  338|       |      // Invalid |number|.
  339|      5|      return false;
  340|      5|    }
  341|   744k|    first_half -= number;
  342|   744k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   744k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 707k, False: 36.3k]
  ------------------
  345|   707k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 672k, False: 35.5k]
  ------------------
  346|   672k|        std::swap(first_half, second_half);
  347|   672k|      }
  348|   707k|    }
  349|       |
  350|   744k|    levels_stack_[stack_pos][axis] += 1;
  351|   744k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   744k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 732k, False: 11.9k]
  ------------------
  353|   732k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   732k|    }
  355|   744k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 709k, False: 35.2k]
  ------------------
  356|   709k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   709k|    }
  358|   744k|  }
  359|     42|  return true;
  360|     75|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  134|  1.44M|        : num_remaining_points(num_remaining_points_),
  135|  1.44M|          last_axis(last_axis_),
  136|  1.44M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|   744k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   744k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   744k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     42|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|    103|      : bit_length_(0),
   87|    103|        num_points_(0),
   88|    103|        num_decoded_points_(0),
   89|    103|        dimension_(dimension),
   90|    103|        p_(dimension, 0),
   91|    103|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    103|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    103|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     93|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     93|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 93]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     93|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 92]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     92|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 92]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     92|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 92]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     92|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 1, False: 91]
  ------------------
  199|      1|    return false;
  200|      1|  }
  201|     91|  num_decoded_points_ = 0;
  202|       |
  203|     91|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 7, False: 84]
  ------------------
  204|      7|    return false;
  205|      7|  }
  206|     84|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 80]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     80|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 8, False: 72]
  ------------------
  210|      8|    return false;
  211|      8|  }
  212|     72|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 71]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     71|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 32, False: 39]
  ------------------
  217|     32|    return false;
  218|     32|  }
  219|       |
  220|     39|  numbers_decoder_.EndDecoding();
  221|     39|  remaining_bits_decoder_.EndDecoding();
  222|     39|  axis_decoder_.EndDecoding();
  223|     39|  half_decoder_.EndDecoding();
  224|       |
  225|     39|  return true;
  226|     71|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     71|    uint32_t num_points, OutputIteratorT &oit) {
  254|     71|  typedef DecodingStatus Status;
  255|     71|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     71|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     71|  DecodingStatus init_status(num_points, 0, 0);
  258|     71|  std::stack<Status> status_stack;
  259|     71|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.42M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.42M, False: 39]
  ------------------
  263|  2.42M|    const DecodingStatus status = status_stack.top();
  264|  2.42M|    status_stack.pop();
  265|       |
  266|  2.42M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.42M|    const uint32_t last_axis = status.last_axis;
  268|  2.42M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.42M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.42M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.42M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.42M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.42M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.42M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.42M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.42M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.42M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.07M, False: 1.34M]
  ------------------
  285|   100M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 99.6M, False: 1.07M]
  ------------------
  286|  99.6M|        *oit = old_base;
  287|  99.6M|        ++oit;
  288|  99.6M|        ++num_decoded_points_;
  289|  99.6M|      }
  290|  1.07M|      continue;
  291|  1.07M|    }
  292|       |
  293|  1.34M|    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.34M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 45.8k, False: 1.30M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  45.8k|      axes_[0] = axis;
  300|   208k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 162k, False: 45.8k]
  ------------------
  301|   162k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   162k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 12.3k, False: 150k]
  |  |  ------------------
  ------------------
  302|   162k|      }
  303|   112k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 66.6k, False: 45.8k]
  ------------------
  304|   408k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 342k, False: 66.5k]
  ------------------
  305|   342k|          p_[axes_[j]] = 0;
  306|   342k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   342k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 97.7k, False: 244k]
  ------------------
  308|  97.7k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 31, False: 97.7k]
  ------------------
  309|  97.7k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     31|              return false;
  311|     31|            }
  312|  97.7k|          }
  313|   342k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   342k|        }
  315|  66.5k|        *oit = p_;
  316|  66.5k|        ++oit;
  317|  66.5k|        ++num_decoded_points_;
  318|  66.5k|      }
  319|  45.8k|      continue;
  320|  45.8k|    }
  321|       |
  322|  1.30M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.30M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.30M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.30M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.30M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.30M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.30M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.30M|    uint32_t number = 0;
  334|  1.30M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.30M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.30M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 1.30M]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|  1.30M|    first_half -= number;
  342|  1.30M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.30M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.27M, False: 24.8k]
  ------------------
  345|  1.27M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.21M, False: 58.5k]
  ------------------
  346|  1.21M|        std::swap(first_half, second_half);
  347|  1.21M|      }
  348|  1.27M|    }
  349|       |
  350|  1.30M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.30M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.30M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.26M, False: 38.8k]
  ------------------
  353|  1.26M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.26M|    }
  355|  1.30M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.16M, False: 142k]
  ------------------
  356|  1.16M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.16M|    }
  358|  1.30M|  }
  359|     39|  return true;
  360|     71|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  134|  2.42M|        : num_remaining_points(num_remaining_points_),
  135|  2.42M|          last_axis(last_axis_),
  136|  2.42M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.42M|    uint32_t last_axis) {
  232|  2.42M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.42M, Folded]
  ------------------
  233|  2.42M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.42M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 617k, False: 1.80M]
  |  |  ------------------
  ------------------
  234|  2.42M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  2.42M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|  1.30M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.30M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.30M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     39|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     74|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     74|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 74]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     74|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 73]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     73|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 73]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     73|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 11, False: 62]
  ------------------
  196|     11|    return true;
  197|     11|  }
  198|     62|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 2, False: 60]
  ------------------
  199|      2|    return false;
  200|      2|  }
  201|     60|  num_decoded_points_ = 0;
  202|       |
  203|     60|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 2, False: 58]
  ------------------
  204|      2|    return false;
  205|      2|  }
  206|     58|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 58]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     58|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 56]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     56|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 54]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     54|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 27, False: 27]
  ------------------
  217|     27|    return false;
  218|     27|  }
  219|       |
  220|     27|  numbers_decoder_.EndDecoding();
  221|     27|  remaining_bits_decoder_.EndDecoding();
  222|     27|  axis_decoder_.EndDecoding();
  223|     27|  half_decoder_.EndDecoding();
  224|       |
  225|     27|  return true;
  226|     54|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  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|   203k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 203k, False: 27]
  ------------------
  263|   203k|    const DecodingStatus status = status_stack.top();
  264|   203k|    status_stack.pop();
  265|       |
  266|   203k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   203k|    const uint32_t last_axis = status.last_axis;
  268|   203k|    const uint32_t stack_pos = status.stack_pos;
  269|   203k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   203k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   203k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 203k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   203k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   203k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 8, False: 203k]
  ------------------
  278|      8|      return false;
  279|      8|    }
  280|       |
  281|   203k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   203k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 113, False: 203k]
  ------------------
  285|  1.07M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 1.07M, False: 113]
  ------------------
  286|  1.07M|        *oit = old_base;
  287|  1.07M|        ++oit;
  288|  1.07M|        ++num_decoded_points_;
  289|  1.07M|      }
  290|    113|      continue;
  291|    113|    }
  292|       |
  293|   203k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   203k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 143, False: 203k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    143|      axes_[0] = axis;
  300|  11.4k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 11.2k, False: 143]
  ------------------
  301|  11.2k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  11.2k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 132, False: 11.1k]
  |  |  ------------------
  ------------------
  302|  11.2k|      }
  303|    323|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 191, False: 132]
  ------------------
  304|  13.6k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 13.4k, False: 180]
  ------------------
  305|  13.4k|          p_[axes_[j]] = 0;
  306|  13.4k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  13.4k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 12.9k, False: 460]
  ------------------
  308|  12.9k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 11, False: 12.9k]
  ------------------
  309|  12.9k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     11|              return false;
  311|     11|            }
  312|  12.9k|          }
  313|  13.4k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  13.4k|        }
  315|    180|        *oit = p_;
  316|    180|        ++oit;
  317|    180|        ++num_decoded_points_;
  318|    180|      }
  319|    132|      continue;
  320|    143|    }
  321|       |
  322|   203k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 203k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   203k|    const int num_remaining_bits = bit_length_ - level;
  327|   203k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   203k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   203k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   203k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   203k|    uint32_t number = 0;
  334|   203k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   203k|    uint32_t first_half = num_remaining_points / 2;
  337|   203k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 8, False: 203k]
  ------------------
  338|       |      // Invalid |number|.
  339|      8|      return false;
  340|      8|    }
  341|   203k|    first_half -= number;
  342|   203k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   203k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 203k, False: 25]
  ------------------
  345|   203k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 173k, False: 29.2k]
  ------------------
  346|   173k|        std::swap(first_half, second_half);
  347|   173k|      }
  348|   203k|    }
  349|       |
  350|   203k|    levels_stack_[stack_pos][axis] += 1;
  351|   203k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   203k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 173k, False: 29.2k]
  ------------------
  353|   173k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   173k|    }
  355|   203k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 29.5k, False: 173k]
  ------------------
  356|  29.5k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  29.5k|    }
  358|   203k|  }
  359|     27|  return true;
  360|     54|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  134|   203k|        : num_remaining_points(num_remaining_points_),
  135|   203k|          last_axis(last_axis_),
  136|   203k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|   203k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   203k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   203k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     38|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|     74|      : bit_length_(0),
   87|     74|        num_points_(0),
   88|     74|        num_decoded_points_(0),
   89|     74|        dimension_(dimension),
   90|     74|        p_(dimension, 0),
   91|     74|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     74|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     74|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     10|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     10|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     10|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|     22|      : bit_length_(0),
   87|     22|        num_points_(0),
   88|     22|        num_decoded_points_(0),
   89|     22|        dimension_(dimension),
   90|     22|        p_(dimension, 0),
   91|     22|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     22|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     22|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     19|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     19|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     19|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     15|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     15|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|      6|      : bit_length_(0),
   87|      6|        num_points_(0),
   88|      6|        num_decoded_points_(0),
   89|      6|        dimension_(dimension),
   90|      6|        p_(dimension, 0),
   91|      6|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|      6|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|      6|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      4|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      4|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      4|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|     93|      : bit_length_(0),
   87|     93|        num_points_(0),
   88|     93|        num_decoded_points_(0),
   89|     93|        dimension_(dimension),
   90|     93|        p_(dimension, 0),
   91|     93|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     93|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     93|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  5.51k|    uint32_t last_axis) {
  232|  5.51k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 5.51k, Folded]
  ------------------
  233|  5.51k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  5.51k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.29k, False: 4.22k]
  |  |  ------------------
  ------------------
  234|  5.51k|  }
  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|  5.51k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|     87|    uint32_t last_axis) {
  232|     87|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 87, Folded]
  ------------------
  233|     87|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|     87|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 37, False: 50]
  |  |  ------------------
  ------------------
  234|     87|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|     87|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  1.44M|    uint32_t last_axis) {
  232|  1.44M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 1.44M, Folded]
  ------------------
  233|  1.44M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  1.44M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.27M, False: 165k]
  |  |  ------------------
  ------------------
  234|  1.44M|  }
  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.44M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   203k|    uint32_t last_axis) {
  232|   203k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded, False: 203k]
  ------------------
  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|   203k|  uint32_t best_axis = 0;
  237|   203k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 203k, False: 73]
  ------------------
  238|  32.1M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 31.9M, False: 203k]
  ------------------
  239|  31.9M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 201k, False: 31.7M]
  ------------------
  240|   201k|        best_axis = axis;
  241|   201k|      }
  242|  31.9M|    }
  243|   203k|  } else {
  244|     73|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|     73|  }
  246|       |
  247|   203k|  return best_axis;
  248|   203k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      4|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      4|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      4|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      4|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      4|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 4]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      4|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 3]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|      3|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 3]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      3|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 3]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      3|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 3]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      3|  num_decoded_points_ = 0;
  202|       |
  203|      3|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 3, False: 0]
  ------------------
  204|      3|    return false;
  205|      3|  }
  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|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      2|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      2|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      2|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      2|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 2]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      2|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 2]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      2|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 2]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      2|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 2]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      2|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 2]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      2|  num_decoded_points_ = 0;
  202|       |
  203|      2|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 2]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|      2|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 2]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      2|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 2]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      2|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 2]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      2|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 2, False: 0]
  ------------------
  217|      2|    return false;
  218|      2|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|      2|    uint32_t num_points, OutputIteratorT &oit) {
  254|      2|  typedef DecodingStatus Status;
  255|      2|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|      2|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|      2|  DecodingStatus init_status(num_points, 0, 0);
  258|      2|  std::stack<Status> status_stack;
  259|      2|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|     82|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 82, False: 0]
  ------------------
  263|     82|    const DecodingStatus status = status_stack.top();
  264|     82|    status_stack.pop();
  265|       |
  266|     82|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|     82|    const uint32_t last_axis = status.last_axis;
  268|     82|    const uint32_t stack_pos = status.stack_pos;
  269|     82|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|     82|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|     82|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 82]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|     82|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|     82|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 82]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|     82|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|     82|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 0, False: 82]
  ------------------
  285|      0|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 0, False: 0]
  ------------------
  286|      0|        *oit = old_base;
  287|      0|        ++oit;
  288|      0|        ++num_decoded_points_;
  289|      0|      }
  290|      0|      continue;
  291|      0|    }
  292|       |
  293|     82|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|     82|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 26, False: 56]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|     26|      axes_[0] = axis;
  300|     78|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 52, False: 26]
  ------------------
  301|     52|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|     52|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 12, False: 40]
  |  |  ------------------
  ------------------
  302|     52|      }
  303|     70|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 46, False: 24]
  ------------------
  304|    178|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 134, False: 44]
  ------------------
  305|    134|          p_[axes_[j]] = 0;
  306|    134|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|    134|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 134, False: 0]
  ------------------
  308|    134|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 2, False: 132]
  ------------------
  309|    134|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      2|              return false;
  311|      2|            }
  312|    134|          }
  313|    132|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|    132|        }
  315|     44|        *oit = p_;
  316|     44|        ++oit;
  317|     44|        ++num_decoded_points_;
  318|     44|      }
  319|     24|      continue;
  320|     26|    }
  321|       |
  322|     56|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 56]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|     56|    const int num_remaining_bits = bit_length_ - level;
  327|     56|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|     56|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|     56|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|     56|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|     56|    uint32_t number = 0;
  334|     56|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|     56|    uint32_t first_half = num_remaining_points / 2;
  337|     56|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 0, False: 56]
  ------------------
  338|       |      // Invalid |number|.
  339|      0|      return false;
  340|      0|    }
  341|     56|    first_half -= number;
  342|     56|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|     56|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 46, False: 10]
  ------------------
  345|     46|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 46, False: 0]
  ------------------
  346|     46|        std::swap(first_half, second_half);
  347|     46|      }
  348|     46|    }
  349|       |
  350|     56|    levels_stack_[stack_pos][axis] += 1;
  351|     56|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|     56|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 56, False: 0]
  ------------------
  353|     56|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|     56|    }
  355|     56|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 56, False: 0]
  ------------------
  356|     56|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|     56|    }
  358|     56|  }
  359|      0|  return true;
  360|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      1|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      1|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      1|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      1|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 1]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      1|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 0]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|      0|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 0]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      0|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 0]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      0|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 0]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      0|  num_decoded_points_ = 0;
  202|       |
  203|      0|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 0]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     18|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     18|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     18|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     18|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     18|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 18]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     18|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 17]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     17|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 17]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     17|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 6, False: 11]
  ------------------
  196|      6|    return true;
  197|      6|  }
  198|     11|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 11]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     11|  num_decoded_points_ = 0;
  202|       |
  203|     11|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 11, False: 0]
  ------------------
  204|     11|    return false;
  205|     11|  }
  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|     25|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|     25|  qinfo_.quantization_bits = 0;
   67|     25|  qinfo_.range = 0;
   68|     25|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|     25|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|     25|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 0, False: 25]
  ------------------
   73|      0|    return false;
   74|      0|  }
   75|     25|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 0, False: 25]
  ------------------
   76|      0|    return false;
   77|      0|  }
   78|     25|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 0, False: 25]
  ------------------
   79|      0|    return false;
   80|      0|  }
   81|     25|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 0, False: 25]
  ------------------
   82|      0|    return false;
   83|      0|  }
   84|     25|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 0, False: 25]
  |  Branch (84:38): [True: 0, False: 0]
  ------------------
   85|      0|    return false;
   86|      0|  }
   87|     25|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 0, False: 25]
  ------------------
   88|      0|    return false;
   89|      0|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|     25|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 0, False: 25]
  ------------------
   93|      0|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|      0|#define DRACO_LOGE printf
  ------------------
   94|      0|               compression_level_);
   95|      0|    return false;
   96|      0|  }
   97|       |
   98|     25|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|     25|      std::back_inserter(*qpoints);
  100|     25|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|     25|                           Converter>
  102|     25|      oit(oit_qpoints);
  103|     25|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 25, False: 0]
  ------------------
  104|     25|    qpoints->reserve(num_points_);
  105|     25|    switch (compression_level_) {
  106|      4|      case 0: {
  ------------------
  |  Branch (106:7): [True: 4, False: 21]
  ------------------
  107|      4|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|      4|        qpoints_decoder.DecodePoints(buffer, oit);
  109|      4|        break;
  110|      0|      }
  111|      0|      case 1: {
  ------------------
  |  Branch (111:7): [True: 0, False: 25]
  ------------------
  112|      0|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|      0|        qpoints_decoder.DecodePoints(buffer, oit);
  114|      0|        break;
  115|      0|      }
  116|      2|      case 2: {
  ------------------
  |  Branch (116:7): [True: 2, False: 23]
  ------------------
  117|      2|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|      2|        qpoints_decoder.DecodePoints(buffer, oit);
  119|      2|        break;
  120|      0|      }
  121|      1|      case 3: {
  ------------------
  |  Branch (121:7): [True: 1, False: 24]
  ------------------
  122|      1|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|      1|        qpoints_decoder.DecodePoints(buffer, oit);
  124|      1|        break;
  125|      0|      }
  126|     18|      case 4: {
  ------------------
  |  Branch (126:7): [True: 18, False: 7]
  ------------------
  127|     18|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     18|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     18|        break;
  130|      0|      }
  131|      0|      case 5: {
  ------------------
  |  Branch (131:7): [True: 0, False: 25]
  ------------------
  132|      0|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|      0|        qpoints_decoder.DecodePoints(buffer, oit);
  134|      0|        break;
  135|      0|      }
  136|      0|      case 6: {
  ------------------
  |  Branch (136:7): [True: 0, False: 25]
  ------------------
  137|      0|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|      0|        qpoints_decoder.DecodePoints(buffer, oit);
  139|      0|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 25]
  ------------------
  142|      0|        return false;
  143|     25|    }
  144|     25|  }
  145|       |
  146|     25|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 25, False: 0]
  ------------------
  147|     25|    return false;
  148|     25|  }
  149|      0|  return true;
  150|     25|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|     25|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|     44|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|     44|  const Self &operator=(const SourceType &source) {
   56|     44|    *oit_ = Converter()(source);
   57|     44|    return *this;
   58|     44|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|     44|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|     44|    return Point3ui(v[0], v[1], v[2]);
   31|     44|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|     44|  const Self &operator++() {
   46|     44|    ++oit_;
   47|     44|    return *this;
   48|     44|  }

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

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

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

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  27.9M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  27.9M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 27.9M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  27.9M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  27.9M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|  5.11M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|  5.11M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 31, False: 5.11M]
  ------------------
   78|     31|      return false;  // Buffer overflow.
   79|     31|    }
   80|  5.11M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|  5.11M|    pos_ += size_to_decode;
   82|  5.11M|    return true;
   83|  5.11M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  10.5k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  1.47k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  11.8k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   143k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|    586|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  27.9M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|   560k|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|    774|    inline void reset(const void *b, size_t s) {
  131|    774|      bit_offset_ = 0;
  132|    774|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|    774|      bit_buffer_end_ = bit_buffer_ + s;
  134|    774|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|    633|    inline uint64_t BitsDecoded() const {
  138|    633|      return static_cast<uint64_t>(bit_offset_);
  139|    633|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  27.9M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  27.9M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 0, False: 27.9M]
  ------------------
  162|      0|        return false;
  163|      0|      }
  164|  27.9M|      uint32_t value = 0;
  165|  65.3M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 37.4M, False: 27.9M]
  ------------------
  166|  37.4M|        value |= GetBit() << bit;
  167|  37.4M|      }
  168|  27.9M|      *x = value;
  169|  27.9M|      return true;
  170|  27.9M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  37.4M|    inline int GetBit() {
  176|  37.4M|      const size_t off = bit_offset_;
  177|  37.4M|      const size_t byte_offset = off >> 3;
  178|  37.4M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  37.4M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 35.9M, False: 1.43M]
  ------------------
  180|  35.9M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  35.9M|        bit_offset_ = off + 1;
  182|  35.9M|        return bit;
  183|  35.9M|      }
  184|  1.43M|      return 0;
  185|  37.4M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  10.3M|  bool Decode(T *out_val) {
   69|  10.3M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 225, False: 10.3M]
  ------------------
   70|    225|      return false;
   71|    225|    }
   72|  10.3M|    pos_ += sizeof(T);
   73|  10.3M|    return true;
   74|  10.3M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  10.3M|  bool Peek(T *out_val) {
   88|  10.3M|    const size_t size_to_decode = sizeof(T);
   89|  10.3M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 225, False: 10.3M]
  ------------------
   90|    225|      return false;  // Buffer overflow.
   91|    225|    }
   92|  10.3M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  10.3M|    return true;
   94|  10.3M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  1.82k|  bool Decode(T *out_val) {
   69|  1.82k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 1, False: 1.82k]
  ------------------
   70|      1|      return false;
   71|      1|    }
   72|  1.82k|    pos_ += sizeof(T);
   73|  1.82k|    return true;
   74|  1.82k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  1.82k|  bool Peek(T *out_val) {
   88|  1.82k|    const size_t size_to_decode = sizeof(T);
   89|  1.82k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 1, False: 1.82k]
  ------------------
   90|      1|      return false;  // Buffer overflow.
   91|      1|    }
   92|  1.82k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.82k|    return true;
   94|  1.82k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   433k|  bool Decode(T *out_val) {
   69|   433k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 26, False: 433k]
  ------------------
   70|     26|      return false;
   71|     26|    }
   72|   433k|    pos_ += sizeof(T);
   73|   433k|    return true;
   74|   433k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   433k|  bool Peek(T *out_val) {
   88|   433k|    const size_t size_to_decode = sizeof(T);
   89|   433k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 26, False: 433k]
  ------------------
   90|     26|      return false;  // Buffer overflow.
   91|     26|    }
   92|   433k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   433k|    return true;
   94|   433k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  2.93k|  bool Decode(T *out_val) {
   69|  2.93k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 2.93k]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|  2.93k|    pos_ += sizeof(T);
   73|  2.93k|    return true;
   74|  2.93k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  2.93k|  bool Peek(T *out_val) {
   88|  2.93k|    const size_t size_to_decode = sizeof(T);
   89|  2.93k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 2.93k]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|  2.93k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  2.93k|    return true;
   94|  2.93k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   764k|  bool Decode(T *out_val) {
   69|   764k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 39, False: 763k]
  ------------------
   70|     39|      return false;
   71|     39|    }
   72|   763k|    pos_ += sizeof(T);
   73|   763k|    return true;
   74|   764k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   764k|  bool Peek(T *out_val) {
   88|   764k|    const size_t size_to_decode = sizeof(T);
   89|   764k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 39, False: 763k]
  ------------------
   90|     39|      return false;  // Buffer overflow.
   91|     39|    }
   92|   763k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   763k|    return true;
   94|   764k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|   109k|  bool Decode(T *out_val) {
   69|   109k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 2, False: 109k]
  ------------------
   70|      2|      return false;
   71|      2|    }
   72|   109k|    pos_ += sizeof(T);
   73|   109k|    return true;
   74|   109k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|   109k|  bool Peek(T *out_val) {
   88|   109k|    const size_t size_to_decode = sizeof(T);
   89|   109k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 2, False: 109k]
  ------------------
   90|      2|      return false;  // Buffer overflow.
   91|      2|    }
   92|   109k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   109k|    return true;
   94|   109k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|    227|  bool Decode(T *out_val) {
   69|    227|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 227]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|    227|    pos_ += sizeof(T);
   73|    227|    return true;
   74|    227|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|    227|  bool Peek(T *out_val) {
   88|    227|    const size_t size_to_decode = sizeof(T);
   89|    227|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 227]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|    227|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    227|    return true;
   94|    227|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|     78|  bool Decode(T *out_val) {
   69|     78|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 78]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|     78|    pos_ += sizeof(T);
   73|     78|    return true;
   74|     78|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|     78|  bool Peek(T *out_val) {
   88|     78|    const size_t size_to_decode = sizeof(T);
   89|     78|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 78]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|     78|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|     78|    return true;
   94|     78|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   186M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   185M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  1.24M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  1.24M|    return value_ >= val;
  100|  1.24M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|  39.1M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|   547M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  3.36M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|  19.6M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  19.6M|    value_ = i.value_;
  153|  19.6M|    return *this;
  154|  19.6M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|  3.80M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  3.80M|    value_ = i.value_;
  153|  3.80M|    return *this;
  154|  3.80M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  3.36M|  inline ThisIndexType &operator++() {
  103|  3.36M|    ++value_;
  104|  3.36M|    return *this;
  105|  3.36M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|   405M|  constexpr bool operator==(const IndexType &i) const {
   76|   405M|    return value_ == i.value_;
   77|   405M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   127M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|  27.0M|  constexpr bool operator==(const IndexType &i) const {
   76|  27.0M|    return value_ == i.value_;
   77|  27.0M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|  51.3M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|  51.3M|    return ThisIndexType(value_ - val);
  133|  51.3M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   137M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   137M|    return ThisIndexType(value_ + val);
  127|   137M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  1.27M|  constexpr bool operator==(const IndexType &i) const {
   76|  1.27M|    return value_ == i.value_;
   77|  1.27M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|  44.4M|  constexpr bool operator!=(const IndexType &i) const {
   82|  44.4M|    return value_ != i.value_;
   83|  44.4M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|  80.7M|  constexpr bool operator!=(const IndexType &i) const {
   82|  80.7M|    return value_ != i.value_;
   83|  80.7M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|  98.2M|  inline ThisIndexType &operator++() {
  103|  98.2M|    ++value_;
  104|  98.2M|    return *this;
  105|  98.2M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|  89.5M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  89.5M|    value_ = i.value_;
  153|  89.5M|    return *this;
  154|  89.5M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|   176M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   176M|    value_ = i.value_;
  153|   176M|    return *this;
  154|   176M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  6.34M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  6.34M|    return value_ >= val;
  100|  6.34M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  1.27M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|   223M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  2.75G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|  30.3M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  1.93G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|  17.3M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  11.2M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  11.2M|    return ThisIndexType(value_ + val);
  127|  11.2M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|  44.0M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  3.78M|  constexpr bool operator<(const IndexType &i) const {
   88|  3.78M|    return value_ < i.value_;
   89|  3.78M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   202M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|  4.15M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  6.67M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|   180M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   235M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|   923k|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   923k|    value_ = i.value_;
  153|   923k|    return *this;
  154|   923k|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  1.27M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  1.27M|    value_ += val;
  141|  1.27M|    return *this;
  142|  1.27M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  4.08M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  4.08M|    value_ = val;
  157|  4.08M|    return *this;
  158|  4.08M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|  67.1k|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  1.87M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  1.87M|  inline ThisIndexType &operator++() {
  103|  1.87M|    ++value_;
  104|  1.87M|    return *this;
  105|  1.87M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  4.52M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|    256|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|   169M|  inline ThisIndexType &operator++() {
  103|   169M|    ++value_;
  104|   169M|    return *this;
  105|   169M|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|    238|  inline ThisIndexType &operator++() {
  103|    238|    ++value_;
  104|    238|    return *this;
  105|    238|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|   165M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|   165M|    return value_ >= val;
  100|   165M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  9.18M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  9.18M|    return vector_[index.value()];
   75|  9.18M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  4.52M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  1.80k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  4.73k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  10.8M|  inline reference operator[](const IndexTypeT &index) {
   71|  10.8M|    return vector_[index.value()];
   72|  10.8M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|   113k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  2.50M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|    363|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   70|  1.24M|  inline reference operator[](const IndexTypeT &index) {
   71|  1.24M|    return vector_[index.value()];
   72|  1.24M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  2.71M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  2.71M|    return vector_[index.value()];
   75|  2.71M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|  34.9M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  1.81M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|  72.5M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  72.5M|    return vector_[index.value()];
   75|  72.5M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   103M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   103M|    return vector_[index.value()];
   75|   103M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|  79.2M|  inline reference operator[](const IndexTypeT &index) {
   71|  79.2M|    return vector_[index.value()];
   72|  79.2M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  15.9M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  15.9M|    return vector_[index.value()];
   75|  15.9M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|  60.6M|  inline reference operator[](const IndexTypeT &index) {
   71|  60.6M|    return vector_[index.value()];
   72|  60.6M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  21.8M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|  42.7M|  inline reference operator[](const IndexTypeT &index) {
   71|  42.7M|    return vector_[index.value()];
   72|  42.7M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|    152|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|  6.53M|  inline reference operator[](const IndexTypeT &index) {
   71|  6.53M|    return vector_[index.value()];
   72|  6.53M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  5.70k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  69.8k|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  5.50k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|    682|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|    682|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|    682|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|    682|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  1.59k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  1.59k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  1.59k|    vector_.swap(arg.vector_);
   57|  1.59k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  1.59k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  1.59k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  1.59k|    vector_.swap(arg.vector_);
   57|  1.59k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|    682|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|    682|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|    682|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  1.09k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  9.05k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  14.3k|int32_t DataTypeLength(DataType dt) {
   20|  14.3k|  switch (dt) {
   21|  6.60k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 6.60k, False: 7.77k]
  ------------------
   22|  6.91k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 311, False: 14.0k]
  ------------------
   23|  6.91k|      return 1;
   24|  2.45k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 2.45k, False: 11.9k]
  ------------------
   25|  2.54k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 91, False: 14.2k]
  ------------------
   26|  2.54k|      return 2;
   27|  4.04k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 4.04k, False: 10.3k]
  ------------------
   28|  4.30k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 264, False: 14.1k]
  ------------------
   29|  4.30k|      return 4;
   30|      5|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 5, False: 14.3k]
  ------------------
   31|     58|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 53, False: 14.3k]
  ------------------
   32|     58|      return 8;
   33|    538|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 538, False: 13.8k]
  ------------------
   34|    538|      return 4;
   35|      0|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 0, False: 14.3k]
  ------------------
   36|      0|      return 8;
   37|     18|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 18, False: 14.3k]
  ------------------
   38|     18|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 14.3k]
  ------------------
   40|      0|      return -1;
   41|  14.3k|  }
   42|  14.3k|}

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

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

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

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

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

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

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

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   312k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   312k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 312k, Folded]
  ------------------
   65|   312k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 98, False: 311k]
  ------------------
   66|     98|      return false;
   67|     98|    }
   68|   312k|  } 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|   311k|  return true;
   77|   312k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   121k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   121k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   121k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 23, False: 121k]
  ------------------
   33|     23|    return false;
   34|     23|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   121k|  uint8_t in;
   39|   121k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 43, False: 120k]
  ------------------
   40|     43|    return false;
   41|     43|  }
   42|   120k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 5.88k, False: 115k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  5.88k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 115, False: 5.76k]
  ------------------
   45|    115|      return false;
   46|    115|    }
   47|       |    // Append decoded info from this byte.
   48|  5.76k|    *out_val <<= 7;
   49|  5.76k|    *out_val |= in & ((1 << 7) - 1);
   50|   115k|  } else {
   51|       |    // Last byte reached
   52|   115k|    *out_val = in;
   53|   115k|  }
   54|   120k|  return true;
   55|   120k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  1.10k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  1.10k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  1.10k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 1.10k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  1.10k|  uint8_t in;
   39|  1.10k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 1.10k]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|  1.10k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 224, False: 882]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    224|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 5, False: 219]
  ------------------
   45|      5|      return false;
   46|      5|    }
   47|       |    // Append decoded info from this byte.
   48|    219|    *out_val <<= 7;
   49|    219|    *out_val |= in & ((1 << 7) - 1);
   50|    882|  } else {
   51|       |    // Last byte reached
   52|    882|    *out_val = in;
   53|    882|  }
   54|  1.10k|  return true;
   55|  1.10k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|    506|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|    506|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 506, Folded]
  ------------------
   65|    506|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 506]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|    506|  } 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|    506|  return true;
   77|    506|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|    403|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    403|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    403|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 403]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    403|  uint8_t in;
   39|    403|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 403]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    403|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 26, False: 377]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     26|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 26]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|     26|    *out_val <<= 7;
   49|     26|    *out_val |= in & ((1 << 7) - 1);
   50|    377|  } else {
   51|       |    // Last byte reached
   52|    377|    *out_val = in;
   53|    377|  }
   54|    403|  return true;
   55|    403|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   176k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   176k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   176k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 12, False: 176k]
  ------------------
   33|     12|    return false;
   34|     12|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   176k|  uint8_t in;
   39|   176k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 6, False: 176k]
  ------------------
   40|      6|    return false;
   41|      6|  }
   42|   176k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 378, False: 176k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    378|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 60, False: 318]
  ------------------
   45|     60|      return false;
   46|     60|    }
   47|       |    // Append decoded info from this byte.
   48|    318|    *out_val <<= 7;
   49|    318|    *out_val |= in & ((1 << 7) - 1);
   50|   176k|  } else {
   51|       |    // Last byte reached
   52|   176k|    *out_val = in;
   53|   176k|  }
   54|   176k|  return true;
   55|   176k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  2.48k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  2.48k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 2.48k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  2.48k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  2.48k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  2.48k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 33, False: 2.44k]
  ------------------
   72|     33|      return false;
   73|     33|    }
   74|  2.44k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  2.44k|  }
   76|  2.44k|  return true;
   77|  2.48k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  2.86k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.86k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.86k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 15, False: 2.85k]
  ------------------
   33|     15|    return false;
   34|     15|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.85k|  uint8_t in;
   39|  2.85k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 18, False: 2.83k]
  ------------------
   40|     18|    return false;
   41|     18|  }
   42|  2.83k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 385, False: 2.44k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    385|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 75, False: 310]
  ------------------
   45|     75|      return false;
   46|     75|    }
   47|       |    // Append decoded info from this byte.
   48|    310|    *out_val <<= 7;
   49|    310|    *out_val |= in & ((1 << 7) - 1);
   50|  2.44k|  } else {
   51|       |    // Last byte reached
   52|  2.44k|    *out_val = in;
   53|  2.44k|  }
   54|  2.75k|  return true;
   55|  2.83k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|    350|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    350|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    350|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 347]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    347|  uint8_t in;
   39|    347|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 347]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    347|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 47, False: 300]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     47|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 15, False: 32]
  ------------------
   45|     15|      return false;
   46|     15|    }
   47|       |    // Append decoded info from this byte.
   48|     32|    *out_val <<= 7;
   49|     32|    *out_val |= in & ((1 << 7) - 1);
   50|    300|  } else {
   51|       |    // Last byte reached
   52|    300|    *out_val = in;
   53|    300|  }
   54|    332|  return true;
   55|    347|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  10.0k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  10.0k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  10.0k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 2, False: 10.0k]
  ------------------
   33|      2|    return false;
   34|      2|  }
   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: 1, False: 10.0k]
  ------------------
   40|      1|    return false;
   41|      1|  }
   42|  10.0k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 294, False: 9.79k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    294|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 10, False: 284]
  ------------------
   45|     10|      return false;
   46|     10|    }
   47|       |    // Append decoded info from this byte.
   48|    284|    *out_val <<= 7;
   49|    284|    *out_val |= in & ((1 << 7) - 1);
   50|  9.79k|  } else {
   51|       |    // Last byte reached
   52|  9.79k|    *out_val = in;
   53|  9.79k|  }
   54|  10.0k|  return true;
   55|  10.0k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|    602|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    602|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    602|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 601]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    601|  uint8_t in;
   39|    601|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 601]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    601|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 210, False: 391]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    210|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 5, False: 205]
  ------------------
   45|      5|      return false;
   46|      5|    }
   47|       |    // Append decoded info from this byte.
   48|    205|    *out_val <<= 7;
   49|    205|    *out_val |= in & ((1 << 7) - 1);
   50|    391|  } else {
   51|       |    // Last byte reached
   52|    391|    *out_val = in;
   53|    391|  }
   54|    596|  return true;
   55|    601|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|    361|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    361|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    361|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 361]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    361|  uint8_t in;
   39|    361|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 361]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    361|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 232, False: 129]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    232|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 232]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|    232|    *out_val <<= 7;
   49|    232|    *out_val |= in & ((1 << 7) - 1);
   50|    232|  } else {
   51|       |    // Last byte reached
   52|    129|    *out_val = in;
   53|    129|  }
   54|    361|  return true;
   55|    361|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  10.6k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  10.6k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  10.6k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 6, False: 10.6k]
  ------------------
   33|      6|    return false;
   34|      6|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  10.6k|  uint8_t in;
   39|  10.6k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 10.6k]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|  10.6k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.15k, False: 9.49k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.15k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 30, False: 1.12k]
  ------------------
   45|     30|      return false;
   46|     30|    }
   47|       |    // Append decoded info from this byte.
   48|  1.12k|    *out_val <<= 7;
   49|  1.12k|    *out_val |= in & ((1 << 7) - 1);
   50|  9.49k|  } else {
   51|       |    // Last byte reached
   52|  9.49k|    *out_val = in;
   53|  9.49k|  }
   54|  10.6k|  return true;
   55|  10.6k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|   115k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|   154k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  12.8k|  Self operator-(const Self &o) const {
  138|  12.8k|    Self ret;
  139|  51.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 38.5k, False: 12.8k]
  ------------------
  140|  38.5k|      ret[i] = (*this)[i] - o[i];
  141|  38.5k|    }
  142|  12.8k|    return ret;
  143|  12.8k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  32.1k|  VectorD() {
   41|   128k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 96.4k, False: 32.1k]
  ------------------
   42|  96.4k|      (*this)[i] = Scalar(0);
   43|  96.4k|    }
   44|  32.1k|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|    132|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|  51.9M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  4.25M|  Self operator-(const Self &o) const {
  138|  4.25M|    Self ret;
  139|  17.0M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 12.7M, False: 4.25M]
  ------------------
  140|  12.7M|      ret[i] = (*this)[i] - o[i];
  141|  12.7M|    }
  142|  4.25M|    return ret;
  143|  4.25M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  2.12M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  2.12M|  static_assert(std::is_signed<ScalarT>::value,
  321|  2.12M|                "ScalarT must be a signed type. ");
  322|  2.12M|  VectorD<ScalarT, 3> r;
  323|  2.12M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  2.12M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  2.12M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  2.12M|  return r;
  327|  2.12M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  2.12M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  2.12M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|   384k|  Scalar AbsSum() const {
  238|   384k|    Scalar result(0);
  239|  1.51M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 1.15M, False: 367k]
  ------------------
  240|  1.15M|      Scalar next_value = std::abs(v_[i]);
  241|  1.15M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 16.7k, False: 1.13M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  16.7k|        return std::numeric_limits<Scalar>::max();
  244|  16.7k|      }
  245|  1.13M|      result += next_value;
  246|  1.13M|    }
  247|   367k|    return result;
  248|   384k|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   295k|  Self operator/(const Scalar &o) const {
  183|   295k|    Self ret;
  184|  1.18M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 886k, False: 295k]
  ------------------
  185|   886k|      ret[i] = (*this)[i] / o;
  186|   886k|    }
  187|   295k|    return ret;
  188|   295k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|  60.9M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  2.21M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  1.15M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|   368k|  Self operator-() const {
  121|   368k|    Self ret;
  122|  1.47M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 1.10M, False: 368k]
  ------------------
  123|  1.10M|      ret[i] = -(*this)[i];
  124|  1.10M|    }
  125|   368k|    return ret;
  126|   368k|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  1.10M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|   172k|  Self operator-(const Self &o) const {
  138|   172k|    Self ret;
  139|   518k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 345k, False: 172k]
  ------------------
  140|   345k|      ret[i] = (*this)[i] - o[i];
  141|   345k|    }
  142|   172k|    return ret;
  143|   172k|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  2.07M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  3.11M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  9.18M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|   345k|  Self operator+(const Self &o) const {
  130|   345k|    Self ret;
  131|  1.03M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 691k, False: 345k]
  ------------------
  132|   691k|      ret[i] = (*this)[i] + o[i];
  133|   691k|    }
  134|   345k|    return ret;
  135|   345k|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  8.01M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|   252k|  Self operator-(const Self &o) const {
  138|   252k|    Self ret;
  139|   757k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 504k, False: 252k]
  ------------------
  140|   504k|      ret[i] = (*this)[i] - o[i];
  141|   504k|    }
  142|   252k|    return ret;
  143|   252k|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|   252k|  Self operator+(const Self &o) const {
  130|   252k|    Self ret;
  131|   757k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 504k, False: 252k]
  ------------------
  132|   504k|      ret[i] = (*this)[i] + o[i];
  133|   504k|    }
  134|   252k|    return ret;
  135|   252k|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|  6.79k|  bool operator==(const Self &o) const {
  207|  7.95k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 7.59k, False: 365]
  ------------------
  208|  7.59k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 6.42k, False: 1.16k]
  ------------------
  209|  6.42k|        return false;
  210|  6.42k|      }
  211|  7.59k|    }
  212|    365|    return true;
  213|  6.79k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  82.3k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  6.42k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  6.42k|  Scalar Dot(const Self &o) const {
  251|  6.42k|    Scalar ret(0);
  252|  25.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 19.2k, False: 6.42k]
  ------------------
  253|  19.2k|      ret += (*this)[i] * o[i];
  254|  19.2k|    }
  255|  6.42k|    return ret;
  256|  6.42k|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  6.42k|  Self operator-(const Self &o) const {
  138|  6.42k|    Self ret;
  139|  19.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 12.8k, False: 6.42k]
  ------------------
  140|  12.8k|      ret[i] = (*this)[i] - o[i];
  141|  12.8k|    }
  142|  6.42k|    return ret;
  143|  6.42k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  12.8k|  VectorD() {
   41|  38.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 25.7k, False: 12.8k]
  ------------------
   42|  25.7k|      (*this)[i] = Scalar(0);
   43|  25.7k|    }
   44|  12.8k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|  20.0k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  20.0k|    DRACO_DCHECK_EQ(dimension, 2);
   54|  20.0k|    v_[0] = c0;
   55|  20.0k|    v_[1] = c1;
   56|  20.0k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  51.4k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|    866|  bool operator==(const Self &o) const {
  207|  1.19k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 1.08k, False: 102]
  ------------------
  208|  1.08k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 764, False: 325]
  ------------------
  209|    764|        return false;
  210|    764|      }
  211|  1.08k|    }
  212|    102|    return true;
  213|    866|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  20.7k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  11.7M|  VectorD() {
   41|  46.8M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 35.1M, False: 11.7M]
  ------------------
   42|  35.1M|      (*this)[i] = Scalar(0);
   43|  35.1M|    }
   44|  11.7M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  1.46k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  2.18k|  Scalar Dot(const Self &o) const {
  251|  2.18k|    Scalar ret(0);
  252|  8.72k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 6.54k, False: 2.18k]
  ------------------
  253|  6.54k|      ret += (*this)[i] * o[i];
  254|  6.54k|    }
  255|  2.18k|    return ret;
  256|  2.18k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|    714|  Self operator-(const Self &o) const {
  138|    714|    Self ret;
  139|  2.14k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.42k, False: 714]
  ------------------
  140|  1.42k|      ret[i] = (*this)[i] - o[i];
  141|  1.42k|    }
  142|    714|    return ret;
  143|    714|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  2.10k|  Self operator*(const Scalar &o) const {
  175|  2.10k|    Self ret;
  176|  6.32k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 4.21k, False: 2.10k]
  ------------------
  177|  4.21k|      ret[i] = (*this)[i] * o;
  178|  4.21k|    }
  179|  2.10k|    return ret;
  180|  2.10k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|    703|  Self operator+(const Self &o) const {
  130|    703|    Self ret;
  131|  2.10k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.40k, False: 703]
  ------------------
  132|  1.40k|      ret[i] = (*this)[i] + o[i];
  133|  1.40k|    }
  134|    703|    return ret;
  135|    703|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|    703|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|    703|  return v * o;
  294|    703|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|    703|  Self operator+(const Self &o) const {
  130|    703|    Self ret;
  131|  2.81k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.10k, False: 703]
  ------------------
  132|  2.10k|      ret[i] = (*this)[i] + o[i];
  133|  2.10k|    }
  134|    703|    return ret;
  135|    703|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|    703|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|    703|  return v * o;
  294|    703|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|    703|  Self operator*(const Scalar &o) const {
  175|    703|    Self ret;
  176|  2.81k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 2.10k, False: 703]
  ------------------
  177|  2.10k|      ret[i] = (*this)[i] * o;
  178|  2.10k|    }
  179|    703|    return ret;
  180|    703|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|  2.43k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  2.43k|    DRACO_DCHECK_EQ(dimension, 2);
   54|  2.43k|    v_[0] = c0;
   55|  2.43k|    v_[1] = c1;
   56|  2.43k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  4.93k|  VectorD() {
   41|  14.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 9.86k, False: 4.93k]
  ------------------
   42|  9.86k|      (*this)[i] = Scalar(0);
   43|  9.86k|    }
   44|  4.93k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  1.40k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  4.21k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 2.81k, False: 1.40k]
  ------------------
  104|  2.81k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 2.81k, False: 0]
  ------------------
  105|  2.81k|        v_[i] = Scalar(src_vector[i]);
  106|  2.81k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  2.81k|    }
  110|  1.40k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|     74|  Self operator+(const Self &o) const {
  130|     74|    Self ret;
  131|    222|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 148, False: 74]
  ------------------
  132|    148|      ret[i] = (*this)[i] + o[i];
  133|    148|    }
  134|     74|    return ret;
  135|     74|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|    703|  VectorD() {
   41|  2.10k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 1.40k, False: 703]
  ------------------
   42|  1.40k|      (*this)[i] = Scalar(0);
   43|  1.40k|    }
   44|    703|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  4.21k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  2.81k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|    703|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  2.10k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 1.40k, False: 703]
  ------------------
  104|  1.40k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 1.40k, False: 0]
  ------------------
  105|  1.40k|        v_[i] = Scalar(src_vector[i]);
  106|  1.40k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  1.40k|    }
  110|    703|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|    703|  Self operator/(const Scalar &o) const {
  183|    703|    Self ret;
  184|  2.10k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 1.40k, False: 703]
  ------------------
  185|  1.40k|      ret[i] = (*this)[i] / o;
  186|  1.40k|    }
  187|    703|    return ret;
  188|    703|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|    629|  Self operator-(const Self &o) const {
  138|    629|    Self ret;
  139|  1.88k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.25k, False: 629]
  ------------------
  140|  1.25k|      ret[i] = (*this)[i] - o[i];
  141|  1.25k|    }
  142|    629|    return ret;
  143|    629|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  19.7k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|   368k|  VectorD() {
   41|  1.47M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 1.10M, False: 368k]
  ------------------
   42|  1.10M|      (*this)[i] = Scalar(0);
   43|  1.10M|    }
   44|   368k|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  1.82M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  1.82M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  1.82M|    v_[0] = c0;
   55|  1.82M|    v_[1] = c1;
   56|  1.82M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  1.03M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  3.11M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 2.07M, False: 1.03M]
  ------------------
  104|  2.07M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 2.07M, False: 0]
  ------------------
  105|  2.07M|        v_[i] = Scalar(src_vector[i]);
  106|  2.07M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  2.07M|    }
  110|  1.03M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|   518k|  VectorD() {
   41|  1.55M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 1.03M, False: 518k]
  ------------------
   42|  1.03M|      (*this)[i] = Scalar(0);
   43|  1.03M|    }
   44|   518k|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|   518k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  1.55M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 1.03M, False: 518k]
  ------------------
  104|  1.03M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 1.03M, False: 0]
  ------------------
  105|  1.03M|        v_[i] = Scalar(src_vector[i]);
  106|  1.03M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  1.03M|    }
  110|   518k|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  1.22M|  VectorD(const Self &o) {
   89|  3.68M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 2.45M, False: 1.22M]
  ------------------
   90|  2.45M|      (*this)[i] = o[i];
   91|  2.45M|    }
   92|  1.22M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|   504k|  VectorD() {
   41|  1.51M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 1.00M, False: 504k]
  ------------------
   42|  1.00M|      (*this)[i] = Scalar(0);
   43|  1.00M|    }
   44|   504k|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|     44|  VectorD(const Self &o) {
   89|    176|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 132, False: 44]
  ------------------
   90|    132|      (*this)[i] = o[i];
   91|    132|    }
   92|     44|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|    132|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|     44|      : v_({{c0, c1, c2}}) {
   60|     44|    DRACO_DCHECK_EQ(dimension, 3);
   61|     44|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|  13.1M|  inline int num_vertices() const {
   74|  13.1M|    return static_cast<int>(vertex_corners_.size());
   75|  13.1M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  1.27M|  inline int num_corners() const {
   77|  1.27M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  1.27M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|   542k|  inline int num_faces() const {
   80|   542k|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|   542k|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|  72.5M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|  72.5M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 72.5M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|  72.5M|    return opposite_corners_[corner];
   88|  72.5M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   102M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   102M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 3.81M, False: 98.2M]
  ------------------
   91|  3.81M|      return corner;
   92|  3.81M|    }
   93|  98.2M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 77.9M, False: 20.2M]
  ------------------
   94|   102M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|  73.0M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|  73.0M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 373k, False: 72.7M]
  ------------------
   97|   373k|      return corner;
   98|   373k|    }
   99|  72.7M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 31.0M, False: 41.6M]
  ------------------
  100|  73.0M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   103M|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|   103M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 103M]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|   103M|    return ConfidentVertex(corner);
  106|   103M|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|   103M|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|   103M|    DRACO_DCHECK_GE(corner.value(), 0);
  109|   103M|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|   103M|    return corner_to_vertex_map_[corner];
  111|   103M|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  5.05M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  5.05M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 5.05M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  5.05M|    return FaceIndex(corner.value() / 3);
  117|  5.05M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|   170M|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  15.9M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  15.9M|    return vertex_corners_[v];
  152|  15.9M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|   408k|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|   408k|    const CornerIndex corner = LeftMostCorner(vert);
  187|   408k|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 1.40k, False: 407k]
  ------------------
  188|  1.40k|      return true;
  189|  1.40k|    }
  190|   407k|    return false;
  191|   408k|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  16.9M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  16.9M|    return Previous(Opposite(Previous(corner)));
  202|  16.9M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  12.7M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  12.7M|    return Next(Opposite(Next(corner)));
  207|  12.7M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|   479k|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|   479k|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 479k]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|   479k|    return Opposite(Previous(corner_id));
  222|   479k|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|   886k|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|   886k|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 886k]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|   886k|    return Opposite(Next(corner_id));
  228|   886k|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|  60.6M|                                CornerIndex opp_corner_id) {
  249|  60.6M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|  60.6M|    opposite_corners_[corner_id] = opp_corner_id;
  251|  60.6M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|  79.2M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|  79.2M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|  79.2M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|  79.2M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|  21.8M|  VertexIndex AddNewVertex() {
  271|  21.8M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|  21.8M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|  21.8M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|  21.8M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|  40.6M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|  40.6M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|  40.6M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 40.6M, False: 0]
  ------------------
  295|  40.6M|      vertex_corners_[vert] = corner;
  296|  40.6M|    }
  297|  40.6M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|  2.02M|  void MakeVertexIsolated(VertexIndex vert) {
  329|  2.02M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|  2.02M|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|  2.02M|  }

_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  2.41M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  2.06M|  void Next() {
  248|  2.06M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 2.06M, False: 3.87k]
  ------------------
  249|  2.06M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  2.06M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 5.02k, False: 2.05M]
  ------------------
  251|       |        // Open boundary reached.
  252|  5.02k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  5.02k|        left_traversal_ = false;
  254|  2.05M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 343k, False: 1.71M]
  ------------------
  255|       |        // End reached.
  256|   343k|        corner_ = kInvalidCornerIndex;
  257|   343k|      }
  258|  2.06M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  3.87k|      corner_ = corner_table_->SwingRight(corner_);
  262|  3.87k|    }
  263|  2.06M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  4.13M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  97.2k|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|   123k|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  61.7k|  void Next() {
  248|  61.7k|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 58.9k, False: 2.82k]
  ------------------
  249|  58.9k|      corner_ = corner_table_->SwingLeft(corner_);
  250|  58.9k|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 31.0k, False: 27.8k]
  ------------------
  251|       |        // Open boundary reached.
  252|  31.0k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  31.0k|        left_traversal_ = false;
  254|  31.0k|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 4.38k, False: 23.4k]
  ------------------
  255|       |        // End reached.
  256|  4.38k|        corner_ = kInvalidCornerIndex;
  257|  4.38k|      }
  258|  58.9k|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  2.82k|      corner_ = corner_table_->SwingRight(corner_);
  262|  2.82k|    }
  263|  61.7k|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  35.4k|      : corner_table_(table),
  236|  35.4k|        start_corner_(corner_id),
  237|  35.4k|        corner_(start_corner_),
  238|  35.4k|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   348k|      : corner_table_(table),
  236|   348k|        start_corner_(corner_id),
  237|   348k|        corner_(start_corner_),
  238|   348k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  11.0M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  11.0M|    return is_edge_on_seam_[corner.value()];
   47|  11.0M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  2.50M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  2.50M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 2.50M]
  |  Branch (50:42): [True: 2.12M, False: 379k]
  ------------------
   51|  2.12M|      return kInvalidCornerIndex;
   52|  2.12M|    }
   53|   379k|    return corner_table_->Opposite(corner);
   54|  2.50M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  4.12M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  4.12M|    return corner_table_->Next(corner);
   58|  4.12M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|   805k|  inline CornerIndex Previous(CornerIndex corner) const {
   61|   805k|    return corner_table_->Previous(corner);
   62|   805k|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|   621k|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|   621k|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|   621k|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  68.2k|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  68.2k|    return Opposite(Previous(corner));
   73|  68.2k|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  87.7k|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  87.7k|    return Opposite(Next(corner));
   76|  87.7k|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|   241k|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|   241k|    return Previous(Opposite(Previous(corner)));
   81|   241k|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  1.89M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  1.89M|    return Next(Opposite(Next(corner)));
   86|  1.89M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  1.22k|  int num_vertices() const {
   89|  1.22k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  1.22k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|    313|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|    135|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|  8.86M|  VertexIndex Vertex(CornerIndex corner) const {
   95|  8.86M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|  8.86M|    return ConfidentVertex(corner);
   97|  8.86M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|  8.86M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|  8.86M|    return corner_to_vertex_map_[corner.value()];
  100|  8.86M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  67.4k|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  67.4k|    return vertex_to_left_most_corner_map_[v.value()];
  108|  67.4k|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  67.4k|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  67.4k|    const CornerIndex corner = LeftMostCorner(vert);
  124|  67.4k|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 67.4k]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  67.4k|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 47.9k, False: 19.5k]
  ------------------
  128|  47.9k|      return true;
  129|  47.9k|    }
  130|  19.5k|    return false;
  131|  67.4k|  }

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

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

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

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

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

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

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

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

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

