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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   57|    202|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|    178|  bool SetQuantizationBits(int32_t q) {
   60|    178|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 105, False: 73]
  |  Branch (60:18): [True: 16, False: 57]
  ------------------
   61|    121|      return false;
   62|    121|    }
   63|     57|    quantization_bits_ = q;
   64|     57|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|     57|    max_value_ = max_quantized_value_ - 1;
   66|     57|    dequantization_scale_ = 2.f / max_value_;
   67|     57|    center_value_ = max_value_ / 2;
   68|     57|    return true;
   69|    178|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  37.8k|                                           int32_t *out_t) const {
   77|  37.8k|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 433, False: 37.4k]
  |  Branch (77:20): [True: 0, False: 433]
  |  Branch (77:32): [True: 433, False: 37.4k]
  |  Branch (77:42): [True: 0, False: 433]
  ------------------
   78|  37.8k|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 6.41k, False: 31.4k]
  |  Branch (78:29): [True: 619, False: 5.79k]
  ------------------
   79|    619|      s = max_value_;
   80|    619|      t = max_value_;
   81|  37.2k|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 433, False: 36.7k]
  |  Branch (81:26): [True: 65, False: 368]
  ------------------
   82|     65|      t = center_value_ - (t - center_value_);
   83|  37.1k|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 5.79k, False: 31.3k]
  |  Branch (83:35): [True: 808, False: 4.98k]
  ------------------
   84|    808|      t = center_value_ + (center_value_ - t);
   85|  36.3k|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 6.31k, False: 30.0k]
  |  Branch (85:35): [True: 0, False: 6.31k]
  ------------------
   86|      0|      s = center_value_ + (center_value_ - s);
   87|  36.3k|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 1.49k, False: 34.8k]
  |  Branch (87:26): [True: 628, False: 866]
  ------------------
   88|    628|      s = center_value_ - (s - center_value_);
   89|    628|    }
   90|       |
   91|  37.8k|    *out_s = s;
   92|  37.8k|    *out_t = t;
   93|  37.8k|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  37.8k|                                                       int32_t *out_t) const {
  100|  37.8k|    DRACO_DCHECK_EQ(
  101|  37.8k|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  37.8k|        center_value_);
  103|  37.8k|    int32_t s, t;
  104|  37.8k|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 20.9k, False: 16.9k]
  ------------------
  105|       |      // Right hemisphere.
  106|  20.9k|      s = (int_vec[1] + center_value_);
  107|  20.9k|      t = (int_vec[2] + center_value_);
  108|  20.9k|    } else {
  109|       |      // Left hemisphere.
  110|  16.9k|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 5.50k, False: 11.4k]
  ------------------
  111|  5.50k|        s = std::abs(int_vec[2]);
  112|  11.4k|      } else {
  113|  11.4k|        s = (max_value_ - std::abs(int_vec[2]));
  114|  11.4k|      }
  115|  16.9k|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 6.31k, False: 10.6k]
  ------------------
  116|  6.31k|        t = std::abs(int_vec[1]);
  117|  10.6k|      } else {
  118|  10.6k|        t = (max_value_ - std::abs(int_vec[1]));
  119|  10.6k|      }
  120|  16.9k|    }
  121|  37.8k|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  37.8k|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|    551|                                                    float *out_vector) const {
  199|    551|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|    551|                                 in_t * dequantization_scale_ - 1.f,
  201|    551|                                 out_vector);
  202|    551|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  36.0k|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  36.0k|    DRACO_DCHECK_LE(s, center_value_);
  208|  36.0k|    DRACO_DCHECK_LE(t, center_value_);
  209|  36.0k|    DRACO_DCHECK_GE(s, -center_value_);
  210|  36.0k|    DRACO_DCHECK_GE(t, -center_value_);
  211|  36.0k|    const uint32_t st =
  212|  36.0k|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  36.0k|    return st <= center_value_;
  214|  36.0k|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  34.8k|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  34.8k|    DRACO_DCHECK_LE(*s, center_value_);
  219|  34.8k|    DRACO_DCHECK_LE(*t, center_value_);
  220|  34.8k|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  34.8k|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  34.8k|    int32_t sign_s = 0;
  223|  34.8k|    int32_t sign_t = 0;
  224|  34.8k|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 22.6k, False: 12.1k]
  |  Branch (224:20): [True: 15.3k, False: 7.33k]
  ------------------
  225|  15.3k|      sign_s = 1;
  226|  15.3k|      sign_t = 1;
  227|  19.4k|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 12.7k, False: 6.70k]
  |  Branch (227:27): [True: 6.54k, False: 6.20k]
  ------------------
  228|  6.54k|      sign_s = -1;
  229|  6.54k|      sign_t = -1;
  230|  12.9k|    } else {
  231|  12.9k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 6.70k, False: 6.20k]
  ------------------
  232|  12.9k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 6.20k, False: 6.70k]
  ------------------
  233|  12.9k|    }
  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|  34.8k|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  34.8k|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  34.8k|    uint32_t us = *s;
  241|  34.8k|    uint32_t ut = *t;
  242|  34.8k|    us = us + us - corner_point_s;
  243|  34.8k|    ut = ut + ut - corner_point_t;
  244|  34.8k|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 21.8k, False: 12.9k]
  ------------------
  245|  21.8k|      uint32_t temp = us;
  246|  21.8k|      us = -ut;
  247|  21.8k|      ut = -temp;
  248|  21.8k|    } else {
  249|  12.9k|      std::swap(us, ut);
  250|  12.9k|    }
  251|  34.8k|    us = us + corner_point_s;
  252|  34.8k|    ut = ut + corner_point_t;
  253|       |
  254|  34.8k|    *s = us;
  255|  34.8k|    *t = ut;
  256|  34.8k|    *s /= 2;
  257|  34.8k|    *t /= 2;
  258|  34.8k|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  72.1k|  int32_t ModMax(int32_t x) const {
  273|  72.1k|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 20, False: 72.1k]
  ------------------
  274|     20|      return x - this->max_quantized_value();
  275|     20|    }
  276|  72.1k|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 3, False: 72.1k]
  ------------------
  277|      3|      return x + this->max_quantized_value();
  278|      3|    }
  279|  72.1k|    return x;
  280|  72.1k|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|     61|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|     23|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|   216k|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|    551|                                           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|    551|    float y = in_s_scaled;
  329|    551|    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|    551|    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|    551|    float x_offset = -x;
  342|    551|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 0, False: 551]
  ------------------
  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|    551|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 30, False: 521]
  ------------------
  348|    551|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 20, False: 531]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|    551|    const float norm_squared = x * x + y * y + z * z;
  352|    551|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 551]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|    551|    } else {
  357|    551|      const float d = 1.0f / std::sqrt(norm_squared);
  358|    551|      out_vector[0] = x * d;
  359|    551|      out_vector[1] = y * d;
  360|    551|      out_vector[2] = z * d;
  361|    551|    }
  362|    551|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  37.8k|  void CanonicalizeIntegerVector(T *vec) const {
  174|  37.8k|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  37.8k|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  37.8k|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  37.8k|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  37.8k|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  37.8k|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 4.29k, False: 33.5k]
  ------------------
  181|  4.29k|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  33.5k|    } else {
  183|  33.5k|      vec[0] =
  184|  33.5k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|  33.5k|          abs_sum;
  186|  33.5k|      vec[1] =
  187|  33.5k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|  33.5k|          abs_sum;
  189|  33.5k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 17.6k, False: 15.8k]
  ------------------
  190|  17.6k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|  17.6k|      } else {
  192|  15.8k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|  15.8k|      }
  194|  33.5k|    }
  195|  37.8k|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   52|      3|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|      3|                                                                *buffer) {
  194|      3|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|      3|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|      3|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 0, False: 3]
  ------------------
  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|      3|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|      7|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 6, False: 1]
  ------------------
  211|      6|    uint32_t num_flags;
  212|      6|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 0, False: 6]
  ------------------
  213|      0|      return false;
  214|      0|    }
  215|      6|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 2, False: 4]
  ------------------
  216|      2|      return false;
  217|      2|    }
  218|      4|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 4, False: 0]
  ------------------
  219|      4|      is_crease_edge_[i].resize(num_flags);
  220|      4|      RAnsBitDecoder decoder;
  221|      4|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 0, False: 4]
  ------------------
  222|      0|        return false;
  223|      0|      }
  224|    276|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 272, False: 4]
  ------------------
  225|    272|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|    272|      }
  227|      4|      decoder.EndDecoding();
  228|      4|    }
  229|      4|  }
  230|      1|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|      1|                                     MeshDataT>::DecodePredictionData(buffer);
  232|      3|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|      1|                          const PointIndex * /* entry_to_point_id_map */) {
   87|      1|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|      1|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|      5|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 4, False: 1]
  ------------------
   93|      4|    pred_vals[i].resize(num_components, 0);
   94|      4|  }
   95|      1|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|      1|                                         out_data);
   97|       |
   98|      1|  const CornerTable *const table = this->mesh_data().corner_table();
   99|      1|  const std::vector<int32_t> *const vertex_to_data_map =
  100|      1|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|      1|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|      1|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|      1|  const int corner_map_size =
  109|      1|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    184|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 183, False: 1]
  ------------------
  111|    183|    const CornerIndex start_corner_id =
  112|    183|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|    183|    CornerIndex corner_id(start_corner_id);
  115|    183|    int num_parallelograms = 0;
  116|    183|    bool first_pass = true;
  117|    485|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 319, False: 166]
  ------------------
  118|    319|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 57, False: 262]
  ------------------
  119|    319|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|    319|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|     57|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|     57|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 1, False: 56]
  ------------------
  127|      1|          break;
  128|      1|        }
  129|     57|      }
  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|    318|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 284, False: 34]
  ------------------
  134|    284|        corner_id = table->SwingLeft(corner_id);
  135|    284|      } else {
  136|     34|        corner_id = table->SwingRight(corner_id);
  137|     34|      }
  138|    318|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 16, False: 302]
  ------------------
  139|     16|        break;
  140|     16|      }
  141|    302|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 180, False: 122]
  |  Branch (141:47): [True: 166, False: 14]
  ------------------
  142|    166|        first_pass = false;
  143|    166|        corner_id = table->SwingRight(start_corner_id);
  144|    166|      }
  145|    302|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|    183|    int num_used_parallelograms = 0;
  150|    183|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 40, False: 143]
  ------------------
  151|  2.12k|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 2.08k, False: 40]
  ------------------
  152|  2.08k|        multi_pred_vals[i] = 0;
  153|  2.08k|      }
  154|       |      // Check which parallelograms are actually used.
  155|     97|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 57, False: 40]
  ------------------
  156|     57|        const int context = num_parallelograms - 1;
  157|     57|        const int pos = is_crease_edge_pos[context]++;
  158|     57|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 0, False: 57]
  ------------------
  159|      0|          return false;
  160|      0|        }
  161|     57|        const bool is_crease = is_crease_edge_[context][pos];
  162|     57|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 50, False: 7]
  ------------------
  163|     50|          ++num_used_parallelograms;
  164|  2.65k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 2.60k, False: 50]
  ------------------
  165|  2.60k|            multi_pred_vals[j] =
  166|  2.60k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  2.60k|          }
  168|     50|        }
  169|     57|      }
  170|     40|    }
  171|    183|    const int dst_offset = p * num_components;
  172|    183|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 145, False: 38]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|    145|      const int src_offset = (p - 1) * num_components;
  176|    145|      this->transform().ComputeOriginalValue(
  177|    145|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|    145|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|  2.01k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 1.97k, False: 38]
  ------------------
  181|  1.97k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|  1.97k|      }
  183|     38|      this->transform().ComputeOriginalValue(
  184|     38|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|     38|    }
  186|    183|  }
  187|      1|  return true;
  188|      1|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   52|     14|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|     14|                                                                *buffer) {
  194|     14|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|     14|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     14|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 0, False: 14]
  ------------------
  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|     14|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|     63|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 52, False: 11]
  ------------------
  211|     52|    uint32_t num_flags;
  212|     52|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 0, False: 52]
  ------------------
  213|      0|      return false;
  214|      0|    }
  215|     52|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 1, False: 51]
  ------------------
  216|      1|      return false;
  217|      1|    }
  218|     51|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 29, False: 22]
  ------------------
  219|     29|      is_crease_edge_[i].resize(num_flags);
  220|     29|      RAnsBitDecoder decoder;
  221|     29|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 2, False: 27]
  ------------------
  222|      2|        return false;
  223|      2|      }
  224|  1.14k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.12k, False: 27]
  ------------------
  225|  1.12k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.12k|      }
  227|     27|      decoder.EndDecoding();
  228|     27|    }
  229|     51|  }
  230|     11|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|     11|                                     MeshDataT>::DecodePredictionData(buffer);
  232|     14|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|      9|                          const PointIndex * /* entry_to_point_id_map */) {
   87|      9|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|      9|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|     45|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 36, False: 9]
  ------------------
   93|     36|    pred_vals[i].resize(num_components, 0);
   94|     36|  }
   95|      9|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|      9|                                         out_data);
   97|       |
   98|      9|  const CornerTable *const table = this->mesh_data().corner_table();
   99|      9|  const std::vector<int32_t> *const vertex_to_data_map =
  100|      9|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|      9|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|      9|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|      9|  const int corner_map_size =
  109|      9|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|    284|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 282, False: 2]
  ------------------
  111|    282|    const CornerIndex start_corner_id =
  112|    282|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|    282|    CornerIndex corner_id(start_corner_id);
  115|    282|    int num_parallelograms = 0;
  116|    282|    bool first_pass = true;
  117|    982|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 811, False: 171]
  ------------------
  118|    811|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 96, False: 715]
  ------------------
  119|    811|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|    811|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|     96|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|     96|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 0, False: 96]
  ------------------
  127|      0|          break;
  128|      0|        }
  129|     96|      }
  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|    811|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 678, False: 133]
  ------------------
  134|    678|        corner_id = table->SwingLeft(corner_id);
  135|    678|      } else {
  136|    133|        corner_id = table->SwingRight(corner_id);
  137|    133|      }
  138|    811|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 111, False: 700]
  ------------------
  139|    111|        break;
  140|    111|      }
  141|    700|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 229, False: 471]
  |  Branch (141:47): [True: 171, False: 58]
  ------------------
  142|    171|        first_pass = false;
  143|    171|        corner_id = table->SwingRight(start_corner_id);
  144|    171|      }
  145|    700|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|    282|    int num_used_parallelograms = 0;
  150|    282|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 81, False: 201]
  ------------------
  151|  1.40k|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 1.32k, False: 81]
  ------------------
  152|  1.32k|        multi_pred_vals[i] = 0;
  153|  1.32k|      }
  154|       |      // Check which parallelograms are actually used.
  155|    170|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 96, False: 74]
  ------------------
  156|     96|        const int context = num_parallelograms - 1;
  157|     96|        const int pos = is_crease_edge_pos[context]++;
  158|     96|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 7, False: 89]
  ------------------
  159|      7|          return false;
  160|      7|        }
  161|     89|        const bool is_crease = is_crease_edge_[context][pos];
  162|     89|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 58, False: 31]
  ------------------
  163|     58|          ++num_used_parallelograms;
  164|    124|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 66, False: 58]
  ------------------
  165|     66|            multi_pred_vals[j] =
  166|     66|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|     66|          }
  168|     58|        }
  169|     89|      }
  170|     81|    }
  171|    275|    const int dst_offset = p * num_components;
  172|    275|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 220, False: 55]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|    220|      const int src_offset = (p - 1) * num_components;
  176|    220|      this->transform().ComputeOriginalValue(
  177|    220|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|    220|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|    113|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 58, False: 55]
  ------------------
  181|     58|        multi_pred_vals[c] /= num_used_parallelograms;
  182|     58|      }
  183|     55|      this->transform().ComputeOriginalValue(
  184|     55|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|     55|    }
  186|    275|  }
  187|      2|  return true;
  188|      9|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|     75|           const std::vector<int32_t> *vertex_to_data_map) {
   38|     75|    mesh_ = mesh;
   39|     75|    corner_table_ = table;
   40|     75|    data_to_corner_map_ = data_to_corner_map;
   41|     75|    vertex_to_data_map_ = vertex_to_data_map;
   42|     75|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  10.8k|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  6.72k|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  6.72k|    return vertex_to_data_map_;
   48|  6.72k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  6.05k|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  6.05k|    return data_to_corner_map_;
   51|  6.05k|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|    208|           const std::vector<int32_t> *vertex_to_data_map) {
   38|    208|    mesh_ = mesh;
   39|    208|    corner_table_ = table;
   40|    208|    data_to_corner_map_ = data_to_corner_map;
   41|    208|    vertex_to_data_map_ = vertex_to_data_map;
   42|    208|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|   505k|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|   468k|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|   468k|    return vertex_to_data_map_;
   48|   468k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  79.8k|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  79.8k|    return data_to_corner_map_;
   51|  79.8k|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   33|     75|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   33|    208|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|    274|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|    855|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  34.4k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|     66|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  6.91k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    183|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  46.6k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|      5|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|      8|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|      3|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|     16|        mesh_data_(mesh_data) {}

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

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|      8|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|      8|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 3, False: 5]
  ------------------
  105|      3|      this->normal_prediction_mode_ = mode;
  106|      3|      return true;
  107|      5|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 5, False: 0]
  ------------------
  108|      5|      this->normal_prediction_mode_ = mode;
  109|      5|      return true;
  110|      5|    }
  111|      0|    return false;
  112|      8|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|    270|                             DataTypeT *prediction) override {
   42|    270|    DRACO_DCHECK(this->IsInitialized());
   43|    270|    typedef typename MeshDataT::CornerTable CornerTable;
   44|    270|    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|    270|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|    270|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|    270|    VectorD<int64_t, 3> normal;
   53|    270|    CornerIndex c_next, c_prev;
   54|    576|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 306, False: 270]
  ------------------
   55|       |      // Getting corners.
   56|    306|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 18, False: 288]
  ------------------
   57|     18|        c_next = corner_table->Next(corner_id);
   58|     18|        c_prev = corner_table->Previous(corner_id);
   59|    288|      } else {
   60|    288|        c_next = corner_table->Next(cit.Corner());
   61|    288|        c_prev = corner_table->Previous(cit.Corner());
   62|    288|      }
   63|    306|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|    306|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|    306|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|    306|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|    306|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|    306|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|    306|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|    306|      normal_data[0] = normal_data[0] + cross_data[0];
   77|    306|      normal_data[1] = normal_data[1] + cross_data[1];
   78|    306|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|    306|      cit.Next();
   81|    306|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|    270|    constexpr int64_t upper_bound = 1 << 29;
   85|    270|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 12, False: 258]
  ------------------
   86|     12|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     12|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 0, False: 12]
  ------------------
   88|      0|        const int64_t quotient = abs_sum / upper_bound;
   89|      0|        normal = normal / quotient;
   90|      0|      }
   91|    258|    } else {
   92|    258|      const int64_t abs_sum = normal.AbsSum();
   93|    258|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 13, False: 245]
  ------------------
   94|     13|        const int64_t quotient = abs_sum / upper_bound;
   95|     13|        normal = normal / quotient;
   96|     13|      }
   97|    258|    }
   98|    270|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|    270|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|    270|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|    270|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|    270|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|     10|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|     10|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 0, False: 10]
  ------------------
  105|      0|      this->normal_prediction_mode_ = mode;
  106|      0|      return true;
  107|     10|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 10, False: 0]
  ------------------
  108|     10|      this->normal_prediction_mode_ = mode;
  109|     10|      return true;
  110|     10|    }
  111|      0|    return false;
  112|     10|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|      3|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|      3|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 0, False: 3]
  ------------------
  105|      0|      this->normal_prediction_mode_ = mode;
  106|      0|      return true;
  107|      3|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 3, False: 0]
  ------------------
  108|      3|      this->normal_prediction_mode_ = mode;
  109|      3|      return true;
  110|      3|    }
  111|      0|    return false;
  112|      3|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|    852|                             DataTypeT *prediction) override {
   42|    852|    DRACO_DCHECK(this->IsInitialized());
   43|    852|    typedef typename MeshDataT::CornerTable CornerTable;
   44|    852|    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|    852|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|    852|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|    852|    VectorD<int64_t, 3> normal;
   53|    852|    CornerIndex c_next, c_prev;
   54|  1.71k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 864, False: 852]
  ------------------
   55|       |      // Getting corners.
   56|    864|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 0, False: 864]
  ------------------
   57|      0|        c_next = corner_table->Next(corner_id);
   58|      0|        c_prev = corner_table->Previous(corner_id);
   59|    864|      } else {
   60|    864|        c_next = corner_table->Next(cit.Corner());
   61|    864|        c_prev = corner_table->Previous(cit.Corner());
   62|    864|      }
   63|    864|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|    864|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|    864|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|    864|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|    864|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|    864|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|    864|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|    864|      normal_data[0] = normal_data[0] + cross_data[0];
   77|    864|      normal_data[1] = normal_data[1] + cross_data[1];
   78|    864|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|    864|      cit.Next();
   81|    864|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|    852|    constexpr int64_t upper_bound = 1 << 29;
   85|    852|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 0, False: 852]
  ------------------
   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|    852|    } else {
   92|    852|      const int64_t abs_sum = normal.AbsSum();
   93|    852|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 177, False: 675]
  ------------------
   94|    177|        const int64_t quotient = abs_sum / upper_bound;
   95|    177|        normal = normal / quotient;
   96|    177|      }
   97|    852|    }
   98|    852|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|    852|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|    852|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|    852|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|    852|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|     16|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|     16|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 0, False: 16]
  ------------------
  105|      0|      this->normal_prediction_mode_ = mode;
  106|      0|      return true;
  107|     16|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 16, False: 0]
  ------------------
  108|     16|      this->normal_prediction_mode_ = mode;
  109|     16|      return true;
  110|     16|    }
  111|      0|    return false;
  112|     16|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  34.4k|                             DataTypeT *prediction) override {
   42|  34.4k|    DRACO_DCHECK(this->IsInitialized());
   43|  34.4k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  34.4k|    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|  34.4k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  34.4k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  34.4k|    VectorD<int64_t, 3> normal;
   53|  34.4k|    CornerIndex c_next, c_prev;
   54|   240k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 206k, False: 34.4k]
  ------------------
   55|       |      // Getting corners.
   56|   206k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 0, False: 206k]
  ------------------
   57|      0|        c_next = corner_table->Next(corner_id);
   58|      0|        c_prev = corner_table->Previous(corner_id);
   59|   206k|      } else {
   60|   206k|        c_next = corner_table->Next(cit.Corner());
   61|   206k|        c_prev = corner_table->Previous(cit.Corner());
   62|   206k|      }
   63|   206k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   206k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   206k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   206k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   206k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   206k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   206k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   206k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   206k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   206k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   206k|      cit.Next();
   81|   206k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  34.4k|    constexpr int64_t upper_bound = 1 << 29;
   85|  34.4k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 0, False: 34.4k]
  ------------------
   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|  34.4k|    } else {
   92|  34.4k|      const int64_t abs_sum = normal.AbsSum();
   93|  34.4k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 31.1k, False: 3.22k]
  ------------------
   94|  31.1k|        const int64_t quotient = abs_sum / upper_bound;
   95|  31.1k|        normal = normal / quotient;
   96|  31.1k|      }
   97|  34.4k|    }
   98|  34.4k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  34.4k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  34.4k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  34.4k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  34.4k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|     26|      : Base(md) {
   35|     26|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     26|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|     51|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|     51|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 25, False: 26]
  ------------------
  105|     25|      this->normal_prediction_mode_ = mode;
  106|     25|      return true;
  107|     26|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 26, False: 0]
  ------------------
  108|     26|      this->normal_prediction_mode_ = mode;
  109|     26|      return true;
  110|     26|    }
  111|      0|    return false;
  112|     51|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|    124|                             DataTypeT *prediction) override {
   42|    124|    DRACO_DCHECK(this->IsInitialized());
   43|    124|    typedef typename MeshDataT::CornerTable CornerTable;
   44|    124|    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|    124|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|    124|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|    124|    VectorD<int64_t, 3> normal;
   53|    124|    CornerIndex c_next, c_prev;
   54|    274|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 150, False: 124]
  ------------------
   55|       |      // Getting corners.
   56|    150|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 150, False: 0]
  ------------------
   57|    150|        c_next = corner_table->Next(corner_id);
   58|    150|        c_prev = corner_table->Previous(corner_id);
   59|    150|      } else {
   60|      0|        c_next = corner_table->Next(cit.Corner());
   61|      0|        c_prev = corner_table->Previous(cit.Corner());
   62|      0|      }
   63|    150|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|    150|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|    150|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|    150|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|    150|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|    150|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|    150|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|    150|      normal_data[0] = normal_data[0] + cross_data[0];
   77|    150|      normal_data[1] = normal_data[1] + cross_data[1];
   78|    150|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|    150|      cit.Next();
   81|    150|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|    124|    constexpr int64_t upper_bound = 1 << 29;
   85|    124|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 124, False: 0]
  ------------------
   86|    124|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    124|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 39, False: 85]
  ------------------
   88|     39|        const int64_t quotient = abs_sum / upper_bound;
   89|     39|        normal = normal / quotient;
   90|     39|      }
   91|    124|    } else {
   92|      0|      const int64_t abs_sum = normal.AbsSum();
   93|      0|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 0, False: 0]
  ------------------
   94|      0|        const int64_t quotient = abs_sum / upper_bound;
   95|      0|        normal = normal / quotient;
   96|      0|      }
   97|      0|    }
   98|    124|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|    124|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|    124|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|    124|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|    124|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|     82|      : Base(md) {
   35|     82|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     82|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    131|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    131|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 36, False: 95]
  ------------------
  105|     36|      this->normal_prediction_mode_ = mode;
  106|     36|      return true;
  107|     95|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 95, False: 0]
  ------------------
  108|     95|      this->normal_prediction_mode_ = mode;
  109|     95|      return true;
  110|     95|    }
  111|      0|    return false;
  112|    131|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|  2.18k|                             DataTypeT *prediction) override {
   42|  2.18k|    DRACO_DCHECK(this->IsInitialized());
   43|  2.18k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|  2.18k|    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|  2.18k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|  2.18k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|  2.18k|    VectorD<int64_t, 3> normal;
   53|  2.18k|    CornerIndex c_next, c_prev;
   54|  11.4k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 9.28k, False: 2.18k]
  ------------------
   55|       |      // Getting corners.
   56|  9.28k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 216, False: 9.06k]
  ------------------
   57|    216|        c_next = corner_table->Next(corner_id);
   58|    216|        c_prev = corner_table->Previous(corner_id);
   59|  9.06k|      } else {
   60|  9.06k|        c_next = corner_table->Next(cit.Corner());
   61|  9.06k|        c_prev = corner_table->Previous(cit.Corner());
   62|  9.06k|      }
   63|  9.28k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  9.28k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  9.28k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  9.28k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  9.28k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  9.28k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  9.28k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  9.28k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  9.28k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  9.28k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  9.28k|      cit.Next();
   81|  9.28k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|  2.18k|    constexpr int64_t upper_bound = 1 << 29;
   85|  2.18k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 198, False: 1.98k]
  ------------------
   86|    198|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    198|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 58, False: 140]
  ------------------
   88|     58|        const int64_t quotient = abs_sum / upper_bound;
   89|     58|        normal = normal / quotient;
   90|     58|      }
   91|  1.98k|    } else {
   92|  1.98k|      const int64_t abs_sum = normal.AbsSum();
   93|  1.98k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.15k, False: 836]
  ------------------
   94|  1.15k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.15k|        normal = normal / quotient;
   96|  1.15k|      }
   97|  1.98k|    }
   98|  2.18k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|  2.18k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|  2.18k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|  2.18k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|  2.18k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|      5|      : Base(md) {
   35|      5|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|      5|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|      8|      : Base(md) {
   35|      8|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|      8|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|      3|      : Base(md) {
   35|      3|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|      3|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|     16|      : Base(md) {
   35|     16|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     16|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|    882|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|    882|    DRACO_DCHECK(this->IsInitialized());
   73|    882|    const auto corner_table = mesh_data_.corner_table();
   74|    882|    const auto vert_id = corner_table->Vertex(ci).value();
   75|    882|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|    882|    return GetPositionForDataId(data_id);
   77|    882|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|    882|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|    882|    DRACO_DCHECK(this->IsInitialized());
   65|    882|    const auto point_id = entry_to_point_id_map_[data_id];
   66|    882|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|    882|    VectorD<int64_t, 3> pos;
   68|    882|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|    882|    return pos;
   70|    882|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|      5|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|      5|    pos_attribute_ = &position_attribute;
   43|      5|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|      4|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|      4|    entry_to_point_id_map_ = map;
   46|      4|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|      8|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|      8|    pos_attribute_ = &position_attribute;
   43|      8|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.58k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.58k|    DRACO_DCHECK(this->IsInitialized());
   73|  2.58k|    const auto corner_table = mesh_data_.corner_table();
   74|  2.58k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.58k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.58k|    return GetPositionForDataId(data_id);
   77|  2.58k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.58k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.58k|    DRACO_DCHECK(this->IsInitialized());
   65|  2.58k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.58k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.58k|    VectorD<int64_t, 3> pos;
   68|  2.58k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.58k|    return pos;
   70|  2.58k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|      3|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|      3|    pos_attribute_ = &position_attribute;
   43|      3|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|      3|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|      3|    entry_to_point_id_map_ = map;
   46|      3|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|   446k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|   446k|    DRACO_DCHECK(this->IsInitialized());
   73|   446k|    const auto corner_table = mesh_data_.corner_table();
   74|   446k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|   446k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|   446k|    return GetPositionForDataId(data_id);
   77|   446k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|   446k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|   446k|    DRACO_DCHECK(this->IsInitialized());
   65|   446k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|   446k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|   446k|    VectorD<int64_t, 3> pos;
   68|   446k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|   446k|    return pos;
   70|   446k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     16|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     16|    pos_attribute_ = &position_attribute;
   43|     16|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     10|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     10|    entry_to_point_id_map_ = map;
   46|     10|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   37|     26|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|     26|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|    424|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|    424|    DRACO_DCHECK(this->IsInitialized());
   73|    424|    const auto corner_table = mesh_data_.corner_table();
   74|    424|    const auto vert_id = corner_table->Vertex(ci).value();
   75|    424|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|    424|    return GetPositionForDataId(data_id);
   77|    424|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|    424|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|    424|    DRACO_DCHECK(this->IsInitialized());
   65|    424|    const auto point_id = entry_to_point_id_map_[data_id];
   66|    424|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|    424|    VectorD<int64_t, 3> pos;
   68|    424|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|    424|    return pos;
   70|    424|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     26|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     26|    pos_attribute_ = &position_attribute;
   43|     26|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     25|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     25|    entry_to_point_id_map_ = map;
   46|     25|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   37|     82|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|     82|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  20.7k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  20.7k|    DRACO_DCHECK(this->IsInitialized());
   73|  20.7k|    const auto corner_table = mesh_data_.corner_table();
   74|  20.7k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  20.7k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  20.7k|    return GetPositionForDataId(data_id);
   77|  20.7k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  20.7k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  20.7k|    DRACO_DCHECK(this->IsInitialized());
   65|  20.7k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  20.7k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  20.7k|    VectorD<int64_t, 3> pos;
   68|  20.7k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  20.7k|    return pos;
   70|  20.7k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     82|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     82|    pos_attribute_ = &position_attribute;
   43|     82|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     77|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     77|    entry_to_point_id_map_ = map;
   46|     77|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   37|      5|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|      5|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   37|      8|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|      8|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   37|      3|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|      3|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   37|     16|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|     16|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   44|      1|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|      1|                          const PointIndex * /* entry_to_point_id_map */) {
   64|      1|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|      1|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|      1|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|      1|      new DataTypeT[num_components]());
   70|       |
   71|      1|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|      1|  const CornerTable *const table = this->mesh_data().corner_table();
   74|      1|  const std::vector<int32_t> *const vertex_to_data_map =
   75|      1|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|      1|  const int corner_map_size =
   78|      1|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|      7|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 6, False: 1]
  ------------------
   80|      6|    const CornerIndex start_corner_id =
   81|      6|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|      6|    CornerIndex corner_id(start_corner_id);
   84|      6|    int num_parallelograms = 0;
   85|     24|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 18, False: 6]
  ------------------
   86|     18|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|     18|    }
   88|     26|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 20, False: 6]
  ------------------
   89|     20|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 7, False: 13]
  ------------------
   90|     20|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|     20|              num_components, parallelogram_pred_vals.get())) {
   92|     28|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 21, False: 7]
  ------------------
   93|     21|          pred_vals[c] =
   94|     21|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|     21|        }
   96|      7|        ++num_parallelograms;
   97|      7|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|     20|      corner_id = table->SwingRight(corner_id);
  101|     20|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 3, False: 17]
  ------------------
  102|      3|        corner_id = kInvalidCornerIndex;
  103|      3|      }
  104|     20|    }
  105|       |
  106|      6|    const int dst_offset = p * num_components;
  107|      6|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 2, False: 4]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|      2|      const int src_offset = (p - 1) * num_components;
  111|      2|      this->transform().ComputeOriginalValue(
  112|      2|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|      4|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|     16|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 12, False: 4]
  ------------------
  116|     12|        pred_vals[c] /= num_parallelograms;
  117|     12|      }
  118|      4|      this->transform().ComputeOriginalValue(
  119|      4|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|      4|    }
  121|      6|  }
  122|      1|  return true;
  123|      1|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   44|     23|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|     22|                          const PointIndex * /* entry_to_point_id_map */) {
   64|     22|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|     22|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|     22|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|     22|      new DataTypeT[num_components]());
   70|       |
   71|     22|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|     22|  const CornerTable *const table = this->mesh_data().corner_table();
   74|     22|  const std::vector<int32_t> *const vertex_to_data_map =
   75|     22|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|     22|  const int corner_map_size =
   78|     22|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|  34.6k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 34.5k, False: 22]
  ------------------
   80|  34.5k|    const CornerIndex start_corner_id =
   81|  34.5k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|  34.5k|    CornerIndex corner_id(start_corner_id);
   84|  34.5k|    int num_parallelograms = 0;
   85|   138k|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 103k, False: 34.5k]
  ------------------
   86|   103k|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|   103k|    }
   88|   241k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 207k, False: 34.5k]
  ------------------
   89|   207k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 66.6k, False: 140k]
  ------------------
   90|   207k|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|   207k|              num_components, parallelogram_pred_vals.get())) {
   92|   266k|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 200k, False: 66.6k]
  ------------------
   93|   200k|          pred_vals[c] =
   94|   200k|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|   200k|        }
   96|  66.6k|        ++num_parallelograms;
   97|  66.6k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|   207k|      corner_id = table->SwingRight(corner_id);
  101|   207k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 34.4k, False: 172k]
  ------------------
  102|  34.4k|        corner_id = kInvalidCornerIndex;
  103|  34.4k|      }
  104|   207k|    }
  105|       |
  106|  34.5k|    const int dst_offset = p * num_components;
  107|  34.5k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 59, False: 34.5k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|     59|      const int src_offset = (p - 1) * num_components;
  111|     59|      this->transform().ComputeOriginalValue(
  112|     59|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|  34.5k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|   138k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 103k, False: 34.5k]
  ------------------
  116|   103k|        pred_vals[c] /= num_parallelograms;
  117|   103k|      }
  118|  34.5k|      this->transform().ComputeOriginalValue(
  119|  34.5k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|  34.5k|    }
  121|  34.5k|  }
  122|     22|  return true;
  123|     22|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  3.48k|    int num_components, DataTypeT *out_prediction) {
   49|  3.48k|  const CornerIndex oci = table->Opposite(ci);
   50|  3.48k|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 3.01k, False: 469]
  ------------------
   51|  3.01k|    return false;
   52|  3.01k|  }
   53|    469|  int vert_opp, vert_next, vert_prev;
   54|    469|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|    469|                                        &vert_opp, &vert_next, &vert_prev);
   56|    469|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 344, False: 125]
  |  Branch (56:35): [True: 333, False: 11]
  ------------------
   57|    469|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 324, False: 9]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|    324|    const int v_opp_off = vert_opp * num_components;
   60|    324|    const int v_next_off = vert_next * num_components;
   61|    324|    const int v_prev_off = vert_prev * num_components;
   62|  6.46k|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 6.13k, False: 324]
  ------------------
   63|  6.13k|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  6.13k|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  6.13k|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  6.13k|      const int64_t result =
   67|  6.13k|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  6.13k|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  6.13k|    }
   71|    324|    return true;
   72|    324|  }
   73|    145|  return false;  // Not all data is available for prediction
   74|    469|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|    469|    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|    469|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|    469|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|    469|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|    469|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|   215k|    int num_components, DataTypeT *out_prediction) {
   49|   215k|  const CornerIndex oci = table->Opposite(ci);
   50|   215k|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 237, False: 215k]
  ------------------
   51|    237|    return false;
   52|    237|  }
   53|   215k|  int vert_opp, vert_next, vert_prev;
   54|   215k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   215k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   215k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 111k, False: 104k]
  |  Branch (56:35): [True: 80.3k, False: 31.1k]
  ------------------
   57|   215k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 74.6k, False: 5.66k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  74.6k|    const int v_opp_off = vert_opp * num_components;
   60|  74.6k|    const int v_next_off = vert_next * num_components;
   61|  74.6k|    const int v_prev_off = vert_prev * num_components;
   62|  1.13M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 1.05M, False: 74.6k]
  ------------------
   63|  1.05M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  1.05M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  1.05M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  1.05M|      const int64_t result =
   67|  1.05M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  1.05M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  1.05M|    }
   71|  74.6k|    return true;
   72|  74.6k|  }
   73|   140k|  return false;  // Not all data is available for prediction
   74|   215k|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   215k|    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|   215k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   215k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   215k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   215k|}

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

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

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   40|      8|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|      8|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|      8|    pos_attribute_ = &position_attribute;
   43|      8|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|      8|  void ResizeOrientations(int num_orientations) {
   74|      8|    orientations_.resize(num_orientations);
   75|      8|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|   252M|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|      8|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|      8|    entry_to_point_id_map_ = map;
   46|      8|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|  1.08k|                                                 int data_id) {
   94|       |  // Compute the predicted UV coordinate from the positions on all corners
   95|       |  // of the processed triangle. For the best prediction, the UV coordinates
   96|       |  // on the next/previous corners need to be already encoded/decoded.
   97|  1.08k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|  1.08k|  const CornerIndex prev_corner_id =
   99|  1.08k|      mesh_data_.corner_table()->Previous(corner_id);
  100|       |  // Get the encoded data ids from the next and previous corners.
  101|       |  // The data id is the encoding order of the UV coordinates.
  102|  1.08k|  int next_data_id, prev_data_id;
  103|       |
  104|  1.08k|  int next_vert_id, prev_vert_id;
  105|  1.08k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|  1.08k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|  1.08k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|  1.08k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|  1.08k|  typedef VectorD<int64_t, 2> Vec2;
  112|  1.08k|  typedef VectorD<int64_t, 3> Vec3;
  113|  1.08k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|  1.08k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 747, False: 340]
  |  Branch (115:33): [True: 407, False: 340]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|    407|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|    407|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|    407|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 92, False: 315]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|     92|      predicted_value_[0] = p_uv[0];
  122|     92|      predicted_value_[1] = p_uv[1];
  123|     92|      return true;
  124|     92|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|    315|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|    315|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|    315|    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|    315|    const Vec3 pn = prev_pos - next_pos;
  146|    315|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|    315|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 256, False: 59]
  ------------------
  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|    256|      const Vec3 cn = tip_pos - next_pos;
  153|    256|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|    256|      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|    256|      const int64_t n_uv_absmax_element =
  164|    256|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|    256|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 2, False: 254]
  ------------------
  166|    256|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|      2|        return false;
  169|      2|      }
  170|    254|      const int64_t pn_uv_absmax_element =
  171|    254|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|    254|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 4, False: 250]
  ------------------
  173|    254|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      4|        return false;
  176|      4|      }
  177|    250|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|    250|      const int64_t pn_absmax_element =
  179|    250|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|    250|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 0, False: 250]
  ------------------
  181|    250|          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|    250|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|    250|      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|    250|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|    250|      const uint64_t norm_squared =
  207|    250|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|    250|      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|    250|      Vec2 predicted_uv;
  214|    250|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded - Ignored]
  ------------------
  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|    250|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|    250|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 0, False: 250]
  ------------------
  233|      0|          return false;
  234|      0|        }
  235|    250|        const bool orientation = orientations_.back();
  236|    250|        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|    250|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 92, False: 158]
  ------------------
  240|     92|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    158|        } else {
  242|    158|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    158|        }
  244|    250|      }
  245|    250|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|    250|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|    250|      return true;
  248|    250|    }
  249|    315|  }
  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|    739|  int data_offset = 0;
  254|    739|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 399, False: 340]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|    399|    data_offset = prev_data_id * kNumComponents;
  257|    399|  }
  258|    739|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 59, False: 680]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|     59|    data_offset = next_data_id * kNumComponents;
  261|    680|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|    680|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 672, False: 8]
  ------------------
  265|    672|      data_offset = (data_id - 1) * kNumComponents;
  266|    672|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|     24|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 16, False: 8]
  ------------------
  269|     16|        predicted_value_[i] = 0;
  270|     16|      }
  271|      8|      return true;
  272|      8|    }
  273|    680|  }
  274|  2.19k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 1.46k, False: 731]
  ------------------
  275|  1.46k|    predicted_value_[i] = data[data_offset + i];
  276|  1.46k|  }
  277|    731|  return true;
  278|    739|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|    814|                                            const DataTypeT *data) const {
   59|    814|    const int data_offset = entry_id * kNumComponents;
   60|    814|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|    814|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|    945|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|    945|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|    945|    VectorD<int64_t, 3> pos;
   52|    945|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|    945|                                 &pos[0]);
   54|    945|    return pos;
   55|    945|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|  1.08k|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   40|     11|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     11|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     11|    pos_attribute_ = &position_attribute;
   43|     11|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|     10|  void ResizeOrientations(int num_orientations) {
   74|     10|    orientations_.resize(num_orientations);
   75|     10|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|   369M|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|      7|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|      7|    entry_to_point_id_map_ = map;
   46|      7|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|     29|                                                 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|     29|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|     29|  const CornerIndex prev_corner_id =
   99|     29|      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|     29|  int next_data_id, prev_data_id;
  103|       |
  104|     29|  int next_vert_id, prev_vert_id;
  105|     29|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|     29|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|     29|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|     29|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|     29|  typedef VectorD<int64_t, 2> Vec2;
  112|     29|  typedef VectorD<int64_t, 3> Vec3;
  113|     29|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|     29|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 22, False: 7]
  |  Branch (115:33): [True: 15, False: 7]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|     15|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|     15|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|     15|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 1, False: 14]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|      1|      predicted_value_[0] = p_uv[0];
  122|      1|      predicted_value_[1] = p_uv[1];
  123|      1|      return true;
  124|      1|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|     14|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|     14|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|     14|    const Vec3 prev_pos = GetPositionForEntryId(prev_data_id);
  130|       |    // We use the positions of the above triangle to predict the texture
  131|       |    // coordinate on the tip corner C.
  132|       |    // To convert the triangle into the UV coordinate system we first compute
  133|       |    // position X on the vector |prev_pos - next_pos| that is the projection of
  134|       |    // point C onto vector |prev_pos - next_pos|:
  135|       |    //
  136|       |    //              C
  137|       |    //             /.  \
  138|       |    //            / .     \
  139|       |    //           /  .        \
  140|       |    //          N---X----------P
  141|       |    //
  142|       |    // Where next_pos is point (N), prev_pos is point (P) and tip_pos is the
  143|       |    // position of predicted coordinate (C).
  144|       |    //
  145|     14|    const Vec3 pn = prev_pos - next_pos;
  146|     14|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|     14|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 13, False: 1]
  ------------------
  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|     13|      const Vec3 cn = tip_pos - next_pos;
  153|     13|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|     13|      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|     13|      const int64_t n_uv_absmax_element =
  164|     13|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|     13|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 0, False: 13]
  ------------------
  166|     13|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|      0|        return false;
  169|      0|      }
  170|     13|      const int64_t pn_uv_absmax_element =
  171|     13|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|     13|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 4, False: 9]
  ------------------
  173|     13|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      4|        return false;
  176|      4|      }
  177|      9|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|      9|      const int64_t pn_absmax_element =
  179|      9|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|      9|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 1, False: 8]
  ------------------
  181|      9|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|      1|        return false;
  184|      1|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|      8|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|      8|      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|      8|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|      8|      const uint64_t norm_squared =
  207|      8|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|      8|      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|      8|      Vec2 predicted_uv;
  214|      8|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded - Ignored]
  ------------------
  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|      8|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|      8|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 1, False: 7]
  ------------------
  233|      1|          return false;
  234|      1|        }
  235|      7|        const bool orientation = orientations_.back();
  236|      7|        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|      7|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 2, False: 5]
  ------------------
  240|      2|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|      5|        } else {
  242|      5|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|      5|        }
  244|      7|      }
  245|      7|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|      7|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|      7|      return true;
  248|      8|    }
  249|     14|  }
  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|     15|  int data_offset = 0;
  254|     15|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 8, False: 7]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|      8|    data_offset = prev_data_id * kNumComponents;
  257|      8|  }
  258|     15|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 1, False: 14]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|      1|    data_offset = next_data_id * kNumComponents;
  261|     14|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|     14|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 7, False: 7]
  ------------------
  265|      7|      data_offset = (data_id - 1) * kNumComponents;
  266|      7|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|     21|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 14, False: 7]
  ------------------
  269|     14|        predicted_value_[i] = 0;
  270|     14|      }
  271|      7|      return true;
  272|      7|    }
  273|     14|  }
  274|     24|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 16, False: 8]
  ------------------
  275|     16|    predicted_value_[i] = data[data_offset + i];
  276|     16|  }
  277|      8|  return true;
  278|     15|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|     30|                                            const DataTypeT *data) const {
   59|     30|    const int data_offset = entry_id * kNumComponents;
   60|     30|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|     30|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|     42|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|     42|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|     42|    VectorD<int64_t, 3> pos;
   52|     42|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|     42|                                 &pos[0]);
   54|     42|    return pos;
   55|     42|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|     23|  const DataTypeT *predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|      4|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|     17|  bool AreCorrectionsPositive() override {
   71|     17|    return transform_.AreCorrectionsPositive();
   72|     17|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|      4|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|      4|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 1, False: 3]
  ------------------
   50|      1|      return false;
   51|      1|    }
   52|      3|    return true;
   53|      4|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|    316|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|      8|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|     27|  bool AreCorrectionsPositive() override {
   71|     27|    return transform_.AreCorrectionsPositive();
   72|     27|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|      8|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|      8|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 4, False: 4]
  ------------------
   50|      4|      return false;
   51|      4|    }
   52|      4|    return true;
   53|      8|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  35.8k|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    269|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|    120|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|    256|  bool AreCorrectionsPositive() override {
   71|    256|    return transform_.AreCorrectionsPositive();
   72|    256|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    129|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    129|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 9, False: 120]
  ------------------
   50|      9|      return false;
   51|      9|    }
   52|    120|    return true;
   53|    129|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  50.6k|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|     17|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|     27|      : attribute_(attribute), transform_(transform) {}

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

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

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|     16|    uint16_t bitstream_version) {
   38|     16|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|     16|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 16, False: 0]
  ------------------
   40|     16|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 0, False: 16]
  ------------------
   41|     16|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 0, False: 16]
  ------------------
   42|     16|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 16]
  ------------------
   43|     16|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 1, False: 15]
  ------------------
   44|     16|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 14, False: 1]
  ------------------
   45|     16|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 0, False: 1]
  ------------------
   46|     15|    const CornerTable *const ct = source->GetCornerTable();
   47|     15|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|     15|        source->GetAttributeEncodingData(att_id);
   49|     15|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 2, False: 13]
  |  Branch (49:26): [True: 0, False: 13]
  ------------------
   50|       |      // No connectivity data found.
   51|      2|      return nullptr;
   52|      2|    }
   53|       |    // Connectivity data exists.
   54|     13|    const MeshAttributeCornerTable *const att_ct =
   55|     13|        source->GetAttributeCornerTable(att_id);
   56|     13|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 5, False: 8]
  ------------------
   57|      5|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|      5|      MeshData md;
   59|      5|      md.Set(source->mesh(), att_ct,
   60|      5|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|      5|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|      5|      MeshPredictionSchemeFactoryT factory;
   63|      5|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|      5|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 5, False: 0]
  ------------------
   65|      5|        return ret;
   66|      5|      }
   67|      8|    } else {
   68|      8|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|      8|      MeshData md;
   70|      8|      md.Set(source->mesh(), ct,
   71|      8|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|      8|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|      8|      MeshPredictionSchemeFactoryT factory;
   74|      8|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|      8|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 8, False: 0]
  ------------------
   76|      8|        return ret;
   77|      8|      }
   78|      8|    }
   79|     13|  }
   80|      1|  return nullptr;
   81|     16|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|     26|    uint16_t bitstream_version) {
   38|     26|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|     26|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 26, False: 0]
  ------------------
   40|     26|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 0, False: 26]
  ------------------
   41|     26|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 2, False: 24]
  ------------------
   42|     26|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 24]
  ------------------
   43|     26|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 1, False: 23]
  ------------------
   44|     26|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 21, False: 2]
  ------------------
   45|     26|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 0, False: 2]
  ------------------
   46|     24|    const CornerTable *const ct = source->GetCornerTable();
   47|     24|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|     24|        source->GetAttributeEncodingData(att_id);
   49|     24|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 3, False: 21]
  |  Branch (49:26): [True: 0, False: 21]
  ------------------
   50|       |      // No connectivity data found.
   51|      3|      return nullptr;
   52|      3|    }
   53|       |    // Connectivity data exists.
   54|     21|    const MeshAttributeCornerTable *const att_ct =
   55|     21|        source->GetAttributeCornerTable(att_id);
   56|     21|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 4, False: 17]
  ------------------
   57|      4|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|      4|      MeshData md;
   59|      4|      md.Set(source->mesh(), att_ct,
   60|      4|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|      4|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|      4|      MeshPredictionSchemeFactoryT factory;
   63|      4|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|      4|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 3, False: 1]
  ------------------
   65|      3|        return ret;
   66|      3|      }
   67|     17|    } else {
   68|     17|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|     17|      MeshData md;
   70|     17|      md.Set(source->mesh(), ct,
   71|     17|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|     17|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|     17|      MeshPredictionSchemeFactoryT factory;
   74|     17|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|     17|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 16, False: 1]
  ------------------
   76|     16|        return ret;
   77|     16|      }
   78|     17|    }
   79|     21|  }
   80|      4|  return nullptr;
   81|     26|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    269|    uint16_t bitstream_version) {
   38|    269|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    269|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 269, False: 0]
  ------------------
   40|    269|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 61, False: 208]
  ------------------
   41|    269|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 29, False: 179]
  ------------------
   42|    269|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 17, False: 162]
  ------------------
   43|    269|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 21, False: 141]
  ------------------
   44|    269|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 108, False: 33]
  ------------------
   45|    269|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 23, False: 10]
  ------------------
   46|    259|    const CornerTable *const ct = source->GetCornerTable();
   47|    259|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    259|        source->GetAttributeEncodingData(att_id);
   49|    259|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 10, False: 249]
  |  Branch (49:26): [True: 0, False: 249]
  ------------------
   50|       |      // No connectivity data found.
   51|     10|      return nullptr;
   52|     10|    }
   53|       |    // Connectivity data exists.
   54|    249|    const MeshAttributeCornerTable *const att_ct =
   55|    249|        source->GetAttributeCornerTable(att_id);
   56|    249|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 66, False: 183]
  ------------------
   57|     66|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|     66|      MeshData md;
   59|     66|      md.Set(source->mesh(), att_ct,
   60|     66|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|     66|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|     66|      MeshPredictionSchemeFactoryT factory;
   63|     66|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|     66|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 66, False: 0]
  ------------------
   65|     66|        return ret;
   66|     66|      }
   67|    183|    } else {
   68|    183|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    183|      MeshData md;
   70|    183|      md.Set(source->mesh(), ct,
   71|    183|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    183|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    183|      MeshPredictionSchemeFactoryT factory;
   74|    183|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    183|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 183, False: 0]
  ------------------
   76|    183|        return ret;
   77|    183|      }
   78|    183|    }
   79|    249|  }
   80|     10|  return nullptr;
   81|    269|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  35.7k|  bool IsInBottomLeft(const Point2 &p) const {
   93|  35.7k|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 8.63k, False: 27.1k]
  |  Branch (93:22): [True: 3.97k, False: 4.66k]
  ------------------
   94|  3.97k|      return true;
   95|  3.97k|    }
   96|  31.8k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 13.6k, False: 18.1k]
  |  Branch (96:25): [True: 6.74k, False: 6.93k]
  ------------------
   97|  35.7k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  35.7k|  int32_t GetRotationCount(Point2 pred) const {
   51|  35.7k|    const DataType sign_x = pred[0];
   52|  35.7k|    const DataType sign_y = pred[1];
   53|       |
   54|  35.7k|    int32_t rotation_count = 0;
   55|  35.7k|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 8.63k, False: 27.1k]
  ------------------
   56|  8.63k|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 3.97k, False: 4.66k]
  ------------------
   57|  3.97k|        rotation_count = 0;
   58|  4.66k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 2.37k, False: 2.29k]
  ------------------
   59|  2.37k|        rotation_count = 3;
   60|  2.37k|      } else {
   61|  2.29k|        rotation_count = 1;
   62|  2.29k|      }
   63|  27.1k|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 13.4k, False: 13.6k]
  ------------------
   64|  13.4k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 6.36k, False: 7.10k]
  ------------------
   65|  6.36k|        rotation_count = 2;
   66|  7.10k|      } else {
   67|  7.10k|        rotation_count = 1;
   68|  7.10k|      }
   69|  13.6k|    } else {
   70|  13.6k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 6.74k, False: 6.93k]
  ------------------
   71|  6.74k|        rotation_count = 0;
   72|  6.93k|      } else {
   73|  6.93k|        rotation_count = 3;
   74|  6.93k|      }
   75|  13.6k|    }
   76|  35.7k|    return rotation_count;
   77|  35.7k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|  50.1k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|  50.1k|    switch (rotation_count) {
   81|  18.7k|      case 1:
  ------------------
  |  Branch (81:7): [True: 18.7k, False: 31.4k]
  ------------------
   82|  18.7k|        return Point2(p[1], -p[0]);
   83|  12.7k|      case 2:
  ------------------
  |  Branch (83:7): [True: 12.7k, False: 37.4k]
  ------------------
   84|  12.7k|        return Point2(-p[0], -p[1]);
   85|  18.7k|      case 3:
  ------------------
  |  Branch (85:7): [True: 18.7k, False: 31.4k]
  ------------------
   86|  18.7k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 50.1k]
  ------------------
   88|      0|        return p;
   89|  50.1k|    }
   90|  50.1k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|     27|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|    256|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|    226|  inline void set_min_value(const DataTypeT &v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|    226|  inline void set_max_value(const DataTypeT &v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|    226|  bool InitCorrectionBounds() {
   84|    226|    const int64_t dif =
   85|    226|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|    226|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 226]
  |  Branch (86:20): [True: 0, False: 226]
  ------------------
   87|      0|      return false;
   88|      0|    }
   89|    226|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|    226|    max_correction_ = max_dif_ / 2;
   91|    226|    min_correction_ = -max_correction_;
   92|    226|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 108, False: 118]
  ------------------
   93|    108|      max_correction_ -= 1;
   94|    108|    }
   95|    226|    return true;
   96|    226|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|    120|  void Init(int num_components) {
   56|    120|    num_components_ = num_components;
   57|    120|    clamped_value_.resize(num_components);
   58|    120|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|  50.3k|      const DataTypeT *predicted_val) const {
   64|  1.08M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 1.03M, False: 50.3k]
  ------------------
   65|  1.03M|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 2.26k, False: 1.03M]
  ------------------
   66|  2.26k|        clamped_value_[i] = max_value_;
   67|  1.03M|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 43.7k, False: 986k]
  ------------------
   68|  43.7k|        clamped_value_[i] = min_value_;
   69|   986k|      } else {
   70|   986k|        clamped_value_[i] = predicted_val[i];
   71|   986k|      }
   72|  1.03M|    }
   73|  50.3k|    return clamped_value_.data();
   74|  50.3k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|  2.16M|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|  1.03M|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|  38.5k|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|  1.03M|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|    102|  int quantization_bits() const {
   78|    102|    DRACO_DCHECK(false);
   79|    102|    return -1;
   80|    102|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   49|    269|        min_correction_(0) {}

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

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|    630|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|  5.24k|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|    313|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  1.74k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|    675|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|    675|    portable_attribute_ = std::move(att);
   71|    675|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  2.18k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  2.93k|  virtual ~SequentialAttributeDecoder() = default;

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

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

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

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

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

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

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

_ZN5draco16DirectBitDecoderC2Ev:
   19|    691|DirectBitDecoder::DirectBitDecoder() : pos_(bits_.end()), num_used_bits_(0) {}
_ZN5draco16DirectBitDecoderD2Ev:
   21|    691|DirectBitDecoder::~DirectBitDecoder() { Clear(); }
_ZN5draco16DirectBitDecoder13StartDecodingEPNS_13DecoderBufferE:
   23|    474|bool DirectBitDecoder::StartDecoding(DecoderBuffer *source_buffer) {
   24|    474|  Clear();
   25|    474|  uint32_t size_in_bytes;
   26|    474|  if (!source_buffer->Decode(&size_in_bytes)) {
  ------------------
  |  Branch (26:7): [True: 1, False: 473]
  ------------------
   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|    473|  if (size_in_bytes == 0 || size_in_bytes & 0x3) {
  ------------------
  |  Branch (32:7): [True: 2, False: 471]
  |  Branch (32:29): [True: 12, False: 459]
  ------------------
   33|     14|    return false;
   34|     14|  }
   35|    459|  if (size_in_bytes > source_buffer->remaining_size()) {
  ------------------
  |  Branch (35:7): [True: 13, False: 446]
  ------------------
   36|     13|    return false;
   37|     13|  }
   38|    446|  const uint32_t num_32bit_elements = size_in_bytes / 4;
   39|    446|  bits_.resize(num_32bit_elements);
   40|    446|  if (!source_buffer->Decode(bits_.data(), size_in_bytes)) {
  ------------------
  |  Branch (40:7): [True: 0, False: 446]
  ------------------
   41|      0|    return false;
   42|      0|  }
   43|    446|  pos_ = bits_.begin();
   44|    446|  num_used_bits_ = 0;
   45|    446|  return true;
   46|    446|}
_ZN5draco16DirectBitDecoder5ClearEv:
   48|  1.16k|void DirectBitDecoder::Clear() {
   49|  1.16k|  bits_.clear();
   50|  1.16k|  num_used_bits_ = 0;
   51|  1.16k|  pos_ = bits_.end();
   52|  1.16k|}

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|   277k|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|   277k|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|   277k|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|   277k|    const int remaining = 32 - num_used_bits_;
   54|   277k|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 207k, False: 69.7k]
  ------------------
   55|   207k|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 16.5k, False: 191k]
  ------------------
   56|  16.5k|        return false;
   57|  16.5k|      }
   58|   191k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   191k|      num_used_bits_ += nbits;
   60|   191k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 6.20k, False: 184k]
  ------------------
   61|  6.20k|        ++pos_;
   62|  6.20k|        num_used_bits_ = 0;
   63|  6.20k|      }
   64|   191k|    } else {
   65|  69.7k|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 65.5k, False: 4.21k]
  ------------------
   66|  65.5k|        return false;
   67|  65.5k|      }
   68|  4.21k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  4.21k|      num_used_bits_ = nbits - remaining;
   70|  4.21k|      ++pos_;
   71|  4.21k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  4.21k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  4.21k|    }
   74|   195k|    return true;
   75|   277k|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  2.37M|  bool DecodeNextBit() {
   35|  2.37M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  2.37M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 2.23M, False: 140k]
  ------------------
   37|  2.23M|      return false;
   38|  2.23M|    }
   39|   140k|    const bool bit = *pos_ & selector;
   40|   140k|    ++num_used_bits_;
   41|   140k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 4.36k, False: 135k]
  ------------------
   42|  4.36k|      ++pos_;
   43|  4.36k|      num_used_bits_ = 0;
   44|  4.36k|    }
   45|   140k|    return bit;
   46|  2.37M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    124|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    159|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    147|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  4.52k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 4.39k, False: 131]
  ------------------
   35|  4.39k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 16, False: 4.37k]
  ------------------
   36|     16|        return false;
   37|     16|      }
   38|  4.39k|    }
   39|    131|    return bit_decoder_.StartDecoding(source_buffer);
   40|    147|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  2.43M|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|  2.43M|    uint32_t result = 0;
   49|  15.1M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 12.7M, False: 2.43M]
  ------------------
   50|  12.7M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  12.7M|      result = (result << 1) + bit;
   52|  12.7M|    }
   53|  2.43M|    *value = result;
   54|  2.43M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|     40|  void EndDecoding() {
   57|  1.32k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 1.28k, False: 40]
  ------------------
   58|  1.28k|      folded_number_decoders_[i].EndDecoding();
   59|  1.28k|    }
   60|     40|    bit_decoder_.EndDecoding();
   61|     40|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    159|  FoldedBit32Decoder() {}

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  6.77k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  5.55k|                                const uint8_t *const buf, int offset) {
  301|  5.55k|  unsigned x;
  302|  5.55k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 11, False: 5.53k]
  ------------------
  303|     11|    return 1;
  304|     11|  }
  305|  5.53k|  ans->buf = buf;
  306|  5.53k|  x = buf[offset - 1] >> 6;
  307|  5.53k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 4.88k, False: 652]
  ------------------
  308|  4.88k|    ans->buf_offset = offset - 1;
  309|  4.88k|    ans->state = buf[offset - 1] & 0x3F;
  310|  4.88k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 606, False: 46]
  ------------------
  311|    606|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 1, False: 605]
  ------------------
  312|      1|      return 1;
  313|      1|    }
  314|    605|    ans->buf_offset = offset - 2;
  315|    605|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|    605|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 41, False: 5]
  ------------------
  317|     41|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 2, False: 39]
  ------------------
  318|      2|      return 1;
  319|      2|    }
  320|     39|    ans->buf_offset = offset - 3;
  321|     39|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|     39|  } else {
  323|      5|    return 1;
  324|      5|  }
  325|  5.53k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  5.53k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  5.53k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  5.53k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  5.53k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 0, False: 5.53k]
  ------------------
  327|      0|    return 1;
  328|      0|  }
  329|  5.53k|  return 0;
  330|  5.53k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    605|static uint32_t mem_get_le16(const void *vmem) {
   68|    605|  uint32_t val;
   69|    605|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    605|  val = mem[1] << 8;
   72|    605|  val |= mem[0];
   73|    605|  return val;
   74|    605|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|     39|static uint32_t mem_get_le24(const void *vmem) {
   77|     39|  uint32_t val;
   78|     39|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|     39|  val = mem[2] << 16;
   81|     39|  val |= mem[1] << 8;
   82|     39|  val |= mem[0];
   83|     39|  return val;
   84|     39|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|   647M|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|   647M|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|   647M|  unsigned quot, rem, x, xn;
  172|   647M|#endif
  173|   647M|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|   647M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|   647M|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  1.29G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 270M, False: 376M]
  |  Branch (174:40): [True: 22.2k, False: 270M]
  ------------------
  175|  22.2k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|  22.2k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|  22.2k|  }
  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|   647M|  x = ans->state;
  184|   647M|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|   647M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|   647M|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|   647M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|   647M|  xn = quot * p;
  187|   647M|  val = rem < p;
  188|   647M|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  1.29G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 271M, False: 376M]
  |  |  ------------------
  ------------------
  189|   271M|    ans->state = xn + rem;
  190|   376M|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   376M|    ans->state = x - xn - p;
  193|   376M|  }
  194|   647M|#endif
  195|   647M|  return val;
  196|   647M|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  12.0k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  12.0k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  12.0k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  12.0k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|    182|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|     74|                                       uint32_t num_symbols) {
  482|     74|    lut_table_.resize(rans_precision);
  483|     74|    probability_table_.resize(num_symbols);
  484|     74|    uint32_t cum_prob = 0;
  485|     74|    uint32_t act_prob = 0;
  486|  6.52k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 6.47k, False: 52]
  ------------------
  487|  6.47k|      probability_table_[i].prob = token_probs[i];
  488|  6.47k|      probability_table_[i].cum_prob = cum_prob;
  489|  6.47k|      cum_prob += token_probs[i];
  490|  6.47k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 22, False: 6.44k]
  ------------------
  491|     22|        return false;
  492|     22|      }
  493|   131k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 125k, False: 6.44k]
  ------------------
  494|   125k|        lut_table_[j] = i;
  495|   125k|      }
  496|  6.44k|      act_prob = cum_prob;
  497|  6.44k|    }
  498|     52|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 25, False: 27]
  ------------------
  499|     25|      return false;
  500|     25|    }
  501|     27|    return true;
  502|     52|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|     23|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     23|    unsigned x;
  423|     23|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 2, False: 21]
  ------------------
  424|      2|      return 1;
  425|      2|    }
  426|     21|    ans_.buf = buf;
  427|     21|    x = buf[offset - 1] >> 6;
  428|     21|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 16, False: 5]
  ------------------
  429|     16|      ans_.buf_offset = offset - 1;
  430|     16|      ans_.state = buf[offset - 1] & 0x3F;
  431|     16|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 3, False: 2]
  ------------------
  432|      3|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 3]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      3|      ans_.buf_offset = offset - 2;
  436|      3|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      3|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 0, False: 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|     21|    ans_.state += l_rans_base;
  450|     21|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     21|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 2, False: 19]
  ------------------
  451|      2|      return 1;
  452|      2|    }
  453|     19|    return 0;
  454|     21|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|      6|static uint32_t mem_get_le16(const void *vmem) {
   68|      6|  uint32_t val;
   69|      6|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|      6|  val = mem[1] << 8;
   72|      6|  val |= mem[0];
   73|      6|  return val;
   74|      6|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|      1|static uint32_t mem_get_le24(const void *vmem) {
   77|      1|  uint32_t val;
   78|      1|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|      1|  val = mem[2] << 16;
   81|      1|  val |= mem[1] << 8;
   82|      1|  val |= mem[0];
   83|      1|  return val;
   84|      1|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|      4|static inline uint32_t mem_get_le32(const void *vmem) {
   87|      4|  uint32_t val;
   88|      4|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|      4|  val = mem[3] << 24;
   91|      4|  val |= mem[2] << 16;
   92|      4|  val |= mem[1] << 8;
   93|      4|  val |= mem[0];
   94|      4|  return val;
   95|      4|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|  4.94M|  inline int rans_read() {
  463|  4.94M|    unsigned rem;
  464|  4.94M|    unsigned quo;
  465|  4.94M|    struct rans_dec_sym sym;
  466|  4.94M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 2.38M, False: 2.56M]
  |  Branch (466:40): [True: 2.63k, False: 2.37M]
  ------------------
  467|  2.63k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  2.63k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  2.63k|    }
  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|  4.94M|    quo = ans_.state / rans_precision;
  472|  4.94M|    rem = ans_.state % rans_precision;
  473|  4.94M|    fetch_sym(&sym, rem);
  474|  4.94M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  4.94M|    return sym.val;
  476|  4.94M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|  4.94M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  4.94M|    uint32_t symbol = lut_table_[rem];
  507|  4.94M|    out->val = symbol;
  508|  4.94M|    out->prob = probability_table_[symbol].prob;
  509|  4.94M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  4.94M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|     15|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|      9|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|      3|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|      4|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|      2|                                       uint32_t num_symbols) {
  482|      2|    lut_table_.resize(rans_precision);
  483|      2|    probability_table_.resize(num_symbols);
  484|      2|    uint32_t cum_prob = 0;
  485|      2|    uint32_t act_prob = 0;
  486|    774|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 773, False: 1]
  ------------------
  487|    773|      probability_table_[i].prob = token_probs[i];
  488|    773|      probability_table_[i].cum_prob = cum_prob;
  489|    773|      cum_prob += token_probs[i];
  490|    773|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 1, False: 772]
  ------------------
  491|      1|        return false;
  492|      1|      }
  493|  30.6k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 29.8k, False: 772]
  ------------------
  494|  29.8k|        lut_table_[j] = i;
  495|  29.8k|      }
  496|    772|      act_prob = cum_prob;
  497|    772|    }
  498|      1|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 1, False: 0]
  ------------------
  499|      1|      return false;
  500|      1|    }
  501|      0|    return true;
  502|      1|  }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|      8|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|      5|                                       uint32_t num_symbols) {
  482|      5|    lut_table_.resize(rans_precision);
  483|      5|    probability_table_.resize(num_symbols);
  484|      5|    uint32_t cum_prob = 0;
  485|      5|    uint32_t act_prob = 0;
  486|     18|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 13, False: 5]
  ------------------
  487|     13|      probability_table_[i].prob = token_probs[i];
  488|     13|      probability_table_[i].cum_prob = cum_prob;
  489|     13|      cum_prob += token_probs[i];
  490|     13|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 0, False: 13]
  ------------------
  491|      0|        return false;
  492|      0|      }
  493|  1.31M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.31M, False: 13]
  ------------------
  494|  1.31M|        lut_table_[j] = i;
  495|  1.31M|      }
  496|     13|      act_prob = cum_prob;
  497|     13|    }
  498|      5|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 0, False: 5]
  ------------------
  499|      0|      return false;
  500|      0|    }
  501|      5|    return true;
  502|      5|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|      2|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      2|    unsigned x;
  423|      2|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 2]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      2|    ans_.buf = buf;
  427|      2|    x = buf[offset - 1] >> 6;
  428|      2|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 1, False: 1]
  ------------------
  429|      1|      ans_.buf_offset = offset - 1;
  430|      1|      ans_.state = buf[offset - 1] & 0x3F;
  431|      1|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 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|      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: 1, False: 1]
  ------------------
  451|      1|      return 1;
  452|      1|    }
  453|      1|    return 0;
  454|      2|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|  3.58k|  inline int rans_read() {
  463|  3.58k|    unsigned rem;
  464|  3.58k|    unsigned quo;
  465|  3.58k|    struct rans_dec_sym sym;
  466|  3.58k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 5, False: 3.58k]
  |  Branch (466:40): [True: 5, False: 0]
  ------------------
  467|      5|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|      5|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|      5|    }
  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.58k|    quo = ans_.state / rans_precision;
  472|  3.58k|    rem = ans_.state % rans_precision;
  473|  3.58k|    fetch_sym(&sym, rem);
  474|  3.58k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  3.58k|    return sym.val;
  476|  3.58k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|  3.58k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  3.58k|    uint32_t symbol = lut_table_[rem];
  507|  3.58k|    out->val = symbol;
  508|  3.58k|    out->prob = probability_table_[symbol].prob;
  509|  3.58k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  3.58k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|      1|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|      8|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|      2|                                       uint32_t num_symbols) {
  482|      2|    lut_table_.resize(rans_precision);
  483|      2|    probability_table_.resize(num_symbols);
  484|      2|    uint32_t cum_prob = 0;
  485|      2|    uint32_t act_prob = 0;
  486|      6|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 4, False: 2]
  ------------------
  487|      4|      probability_table_[i].prob = token_probs[i];
  488|      4|      probability_table_[i].cum_prob = cum_prob;
  489|      4|      cum_prob += token_probs[i];
  490|      4|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 0, False: 4]
  ------------------
  491|      0|        return false;
  492|      0|      }
  493|  1.04M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.04M, False: 4]
  ------------------
  494|  1.04M|        lut_table_[j] = i;
  495|  1.04M|      }
  496|      4|      act_prob = cum_prob;
  497|      4|    }
  498|      2|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 0, False: 2]
  ------------------
  499|      0|      return false;
  500|      0|    }
  501|      2|    return true;
  502|      2|  }
_ZN5draco11RAnsDecoderILi19EE9read_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: 1, False: 1]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|      1|    ans_.buf = buf;
  427|      1|    x = buf[offset - 1] >> 6;
  428|      1|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 1, False: 0]
  ------------------
  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: 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|      1|    ans_.state += l_rans_base;
  450|      1|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      1|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 1]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|      1|    return 0;
  454|      1|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|  5.47k|  inline int rans_read() {
  463|  5.47k|    unsigned rem;
  464|  5.47k|    unsigned quo;
  465|  5.47k|    struct rans_dec_sym sym;
  466|  5.47k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 2, False: 5.47k]
  |  Branch (466:40): [True: 2, False: 0]
  ------------------
  467|      2|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|      2|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|      2|    }
  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|  5.47k|    quo = ans_.state / rans_precision;
  472|  5.47k|    rem = ans_.state % rans_precision;
  473|  5.47k|    fetch_sym(&sym, rem);
  474|  5.47k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  5.47k|    return sym.val;
  476|  5.47k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|  5.47k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  5.47k|    uint32_t symbol = lut_table_[rem];
  507|  5.47k|    out->val = symbol;
  508|  5.47k|    out->prob = probability_table_[symbol].prob;
  509|  5.47k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  5.47k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|      1|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|     54|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|     29|                                       uint32_t num_symbols) {
  482|     29|    lut_table_.resize(rans_precision);
  483|     29|    probability_table_.resize(num_symbols);
  484|     29|    uint32_t cum_prob = 0;
  485|     29|    uint32_t act_prob = 0;
  486|    240|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 218, False: 22]
  ------------------
  487|    218|      probability_table_[i].prob = token_probs[i];
  488|    218|      probability_table_[i].cum_prob = cum_prob;
  489|    218|      cum_prob += token_probs[i];
  490|    218|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 7, False: 211]
  ------------------
  491|      7|        return false;
  492|      7|      }
  493|  15.7M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 15.7M, False: 211]
  ------------------
  494|  15.7M|        lut_table_[j] = i;
  495|  15.7M|      }
  496|    211|      act_prob = cum_prob;
  497|    211|    }
  498|     22|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 8, False: 14]
  ------------------
  499|      8|      return false;
  500|      8|    }
  501|     14|    return true;
  502|     22|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|     11|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     11|    unsigned x;
  423|     11|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 11]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     11|    ans_.buf = buf;
  427|     11|    x = buf[offset - 1] >> 6;
  428|     11|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 6, False: 5]
  ------------------
  429|      6|      ans_.buf_offset = offset - 1;
  430|      6|      ans_.state = buf[offset - 1] & 0x3F;
  431|      6|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 3, False: 2]
  ------------------
  432|      3|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 3]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      3|      ans_.buf_offset = offset - 2;
  436|      3|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      3|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 1, False: 1]
  ------------------
  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: 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|     11|    ans_.state += l_rans_base;
  450|     11|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     11|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 11]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|     11|    return 0;
  454|     11|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  1.62M|  inline int rans_read() {
  463|  1.62M|    unsigned rem;
  464|  1.62M|    unsigned quo;
  465|  1.62M|    struct rans_dec_sym sym;
  466|  1.62M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 1.45M, False: 169k]
  |  Branch (466:40): [True: 268, False: 1.45M]
  ------------------
  467|    268|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    268|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    268|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  1.62M|    quo = ans_.state / rans_precision;
  472|  1.62M|    rem = ans_.state % rans_precision;
  473|  1.62M|    fetch_sym(&sym, rem);
  474|  1.62M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  1.62M|    return sym.val;
  476|  1.62M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  1.62M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  1.62M|    uint32_t symbol = lut_table_[rem];
  507|  1.62M|    out->val = symbol;
  508|  1.62M|    out->prob = probability_table_[symbol].prob;
  509|  1.62M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  1.62M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|     11|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|     79|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|     79|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     79|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 79]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     79|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     79|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     79|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 16, False: 63]
  ------------------
   67|     16|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 16]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     16|  } else
   72|     63|#endif
   73|     63|  {
   74|     63|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 63]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     63|  }
   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|     79|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 75]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|     75|  probability_table_.resize(num_symbols_);
   86|     75|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 26, False: 49]
  ------------------
   87|     26|    return true;
   88|     26|  }
   89|       |  // Decode the table.
   90|  1.44M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.44M, False: 26]
  ------------------
   91|  1.44M|    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.44M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 9, False: 1.44M]
  ------------------
   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|  1.44M|    const int token = prob_data & 3;
  102|  1.44M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 324k, False: 1.12M]
  ------------------
  103|   324k|      const uint32_t offset = prob_data >> 2;
  104|   324k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 11, False: 324k]
  ------------------
  105|     11|        return false;
  106|     11|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  9.05M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 8.73M, False: 324k]
  ------------------
  109|  8.73M|        probability_table_[i + j] = 0;
  110|  8.73M|      }
  111|   324k|      i += offset;
  112|  1.12M|    } else {
  113|  1.12M|      const int extra_bytes = token;
  114|  1.12M|      uint32_t prob = prob_data >> 2;
  115|  1.38M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 255k, False: 1.12M]
  ------------------
  116|   255k|        uint8_t eb;
  117|   255k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 3, False: 255k]
  ------------------
  118|      3|          return false;
  119|      3|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   255k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   255k|      }
  124|  1.12M|      probability_table_[i] = prob;
  125|  1.12M|    }
  126|  1.44M|  }
  127|     26|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 19, False: 7]
  ------------------
  128|     19|    return false;
  129|     19|  }
  130|      7|  return true;
  131|     26|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|     19|    DecoderBuffer *buffer) {
  136|     19|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     19|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     19|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     19|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 7, False: 12]
  ------------------
  140|      7|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 7]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      7|  } else
  145|     12|#endif
  146|     12|  {
  147|     12|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 12]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     12|  }
  151|     19|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 6, False: 13]
  ------------------
  152|      6|    return false;
  153|      6|  }
  154|     13|  const uint8_t *const data_head =
  155|     13|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     13|  buffer->Advance(bytes_encoded);
  158|     13|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 2, False: 11]
  ------------------
  159|      2|    return false;
  160|      2|  }
  161|     11|  return true;
  162|     13|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|     25|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  1.63M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|      7|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      7|  ans_.read_end();
  167|      7|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|     22|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_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: 2, False: 20]
  ------------------
   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|     20|#endif
   73|     20|  {
   74|     20|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 20]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     20|  }
   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|  77.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 77.5k, False: 17]
  ------------------
   91|  77.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|  77.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 2, False: 77.5k]
  ------------------
   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|  77.5k|    const int token = prob_data & 3;
  102|  77.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 45.8k, False: 31.6k]
  ------------------
  103|  45.8k|      const uint32_t offset = prob_data >> 2;
  104|  45.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 1, False: 45.8k]
  ------------------
  105|      1|        return false;
  106|      1|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.14M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.09M, False: 45.8k]
  ------------------
  109|  1.09M|        probability_table_[i + j] = 0;
  110|  1.09M|      }
  111|  45.8k|      i += offset;
  112|  45.8k|    } else {
  113|  31.6k|      const int extra_bytes = token;
  114|  31.6k|      uint32_t prob = prob_data >> 2;
  115|  45.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 14.1k, False: 31.6k]
  ------------------
  116|  14.1k|        uint8_t eb;
  117|  14.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 14.1k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  14.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  14.1k|      }
  124|  31.6k|      probability_table_[i] = prob;
  125|  31.6k|    }
  126|  77.5k|  }
  127|     17|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 14, False: 3]
  ------------------
  128|     14|    return false;
  129|     14|  }
  130|      3|  return true;
  131|     17|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|      3|  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: 1, False: 2]
  ------------------
  152|      1|    return false;
  153|      1|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  3.23M|  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|     18|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_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: 4, False: 14]
  ------------------
   67|      4|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 4]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      4|  } else
   72|     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|     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|  86.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 86.3k, False: 12]
  ------------------
   91|  86.3k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  86.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 86.3k]
  ------------------
   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|  86.3k|    const int token = prob_data & 3;
  102|  86.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 45.9k, False: 40.3k]
  ------------------
  103|  45.9k|      const uint32_t offset = prob_data >> 2;
  104|  45.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 3, False: 45.9k]
  ------------------
  105|      3|        return false;
  106|      3|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.76M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.72M, False: 45.9k]
  ------------------
  109|  1.72M|        probability_table_[i + j] = 0;
  110|  1.72M|      }
  111|  45.9k|      i += offset;
  112|  45.9k|    } else {
  113|  40.3k|      const int extra_bytes = token;
  114|  40.3k|      uint32_t prob = prob_data >> 2;
  115|  49.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 8.83k, False: 40.3k]
  ------------------
  116|  8.83k|        uint8_t eb;
  117|  8.83k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 2, False: 8.83k]
  ------------------
  118|      2|          return false;
  119|      2|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  8.83k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  8.83k|      }
  124|  40.3k|      probability_table_[i] = prob;
  125|  40.3k|    }
  126|  86.3k|  }
  127|     12|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 4, False: 8]
  ------------------
  128|      4|    return false;
  129|      4|  }
  130|      8|  return true;
  131|     12|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|      8|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|      8|    DecoderBuffer *buffer) {
  136|      8|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      8|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      8|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      8|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 4, False: 4]
  ------------------
  140|      4|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 4]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      4|  } else
  145|      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|      8|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 4, False: 4]
  ------------------
  152|      4|    return false;
  153|      4|  }
  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|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  26.8k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|      3|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      3|  ans_.read_end();
  167|      3|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|     17|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_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: 2, False: 12]
  ------------------
   75|      2|      return false;
   76|      2|    }
   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|     15|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 15]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     15|  probability_table_.resize(num_symbols_);
   86|     15|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 15]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   298k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 298k, False: 3]
  ------------------
   91|   298k|    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|   298k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 5, False: 298k]
  ------------------
   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|   298k|    const int token = prob_data & 3;
  102|   298k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 193k, False: 105k]
  ------------------
  103|   193k|      const uint32_t offset = prob_data >> 2;
  104|   193k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 2, False: 193k]
  ------------------
  105|      2|        return false;
  106|      2|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.86M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.66M, False: 193k]
  ------------------
  109|  4.66M|        probability_table_[i + j] = 0;
  110|  4.66M|      }
  111|   193k|      i += offset;
  112|   193k|    } else {
  113|   105k|      const int extra_bytes = token;
  114|   105k|      uint32_t prob = prob_data >> 2;
  115|   170k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 65.0k, False: 105k]
  ------------------
  116|  65.0k|        uint8_t eb;
  117|  65.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 5, False: 65.0k]
  ------------------
  118|      5|          return false;
  119|      5|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  65.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  65.0k|      }
  124|   105k|      probability_table_[i] = prob;
  125|   105k|    }
  126|   298k|  }
  127|      3|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 2]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|      2|  return true;
  131|      3|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|      2|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|      2|    DecoderBuffer *buffer) {
  136|      2|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      2|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      2|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      2|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 2]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|      2|#endif
  146|      2|  {
  147|      2|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 2]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      2|  }
  151|      2|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 1, False: 1]
  ------------------
  152|      1|    return false;
  153|      1|  }
  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|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|     21|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|      1|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      1|  ans_.read_end();
  167|      1|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|     20|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|     20|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     20|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 20]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     20|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     20|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     20|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 15, False: 5]
  ------------------
   67|     15|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 15]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     15|  } else
   72|      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|     20|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 19]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|     19|  probability_table_.resize(num_symbols_);
   86|     19|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 18]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  39.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 39.3k, False: 3]
  ------------------
   91|  39.3k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  39.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 39.3k]
  ------------------
   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|  39.3k|    const int token = prob_data & 3;
  102|  39.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 9.40k, False: 29.9k]
  ------------------
  103|  9.40k|      const uint32_t offset = prob_data >> 2;
  104|  9.40k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 12, False: 9.39k]
  ------------------
  105|     12|        return false;
  106|     12|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   265k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 256k, False: 9.39k]
  ------------------
  109|   256k|        probability_table_[i + j] = 0;
  110|   256k|      }
  111|  9.39k|      i += offset;
  112|  29.9k|    } else {
  113|  29.9k|      const int extra_bytes = token;
  114|  29.9k|      uint32_t prob = prob_data >> 2;
  115|  50.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 20.9k, False: 29.9k]
  ------------------
  116|  20.9k|        uint8_t eb;
  117|  20.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 2, False: 20.9k]
  ------------------
  118|      2|          return false;
  119|      2|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  20.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  20.9k|      }
  124|  29.9k|      probability_table_[i] = prob;
  125|  29.9k|    }
  126|  39.3k|  }
  127|      3|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 2]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|      2|  return true;
  131|      3|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|      3|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|      2|    DecoderBuffer *buffer) {
  136|      2|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      2|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      2|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      2|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 1]
  ------------------
  140|      1|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 1]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      1|  } else
  145|      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|      2|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 2, False: 0]
  ------------------
  152|      2|    return false;
  153|      2|  }
  154|      0|  const uint8_t *const data_head =
  155|      0|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      0|  buffer->Advance(bytes_encoded);
  158|      0|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 0]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      0|  return true;
  162|      0|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|      8|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_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: 0, False: 8]
  ------------------
   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|      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|      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|  27.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 27.5k, False: 4]
  ------------------
   91|  27.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|  27.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 2, False: 27.5k]
  ------------------
   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|  27.5k|    const int token = prob_data & 3;
  102|  27.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 16.7k, False: 10.8k]
  ------------------
  103|  16.7k|      const uint32_t offset = prob_data >> 2;
  104|  16.7k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 2, False: 16.7k]
  ------------------
  105|      2|        return false;
  106|      2|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   591k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 574k, False: 16.7k]
  ------------------
  109|   574k|        probability_table_[i + j] = 0;
  110|   574k|      }
  111|  16.7k|      i += offset;
  112|  16.7k|    } else {
  113|  10.8k|      const int extra_bytes = token;
  114|  10.8k|      uint32_t prob = prob_data >> 2;
  115|  16.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 5.39k, False: 10.8k]
  ------------------
  116|  5.39k|        uint8_t eb;
  117|  5.39k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 5.39k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  5.39k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  5.39k|      }
  124|  10.8k|      probability_table_[i] = prob;
  125|  10.8k|    }
  126|  27.5k|  }
  127|      4|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 2, False: 2]
  ------------------
  128|      2|    return false;
  129|      2|  }
  130|      2|  return true;
  131|      4|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|      2|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|      2|    DecoderBuffer *buffer) {
  136|      2|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      2|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      2|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      2|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 2]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|      2|#endif
  146|      2|  {
  147|      2|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 2]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      2|  }
  151|      2|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 0, False: 2]
  ------------------
  152|      0|    return false;
  153|      0|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  49.4k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|     14|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|     14|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     14|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 14]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     14|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     14|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     14|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 5, False: 9]
  ------------------
   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|      9|#endif
   73|      9|  {
   74|      9|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 9]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      9|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     14|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 14]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     14|  probability_table_.resize(num_symbols_);
   86|     14|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 14]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  64.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 64.6k, False: 6]
  ------------------
   91|  64.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|  64.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 4, False: 64.6k]
  ------------------
   95|      4|      return false;
   96|      4|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  64.6k|    const int token = prob_data & 3;
  102|  64.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 8.78k, False: 55.8k]
  ------------------
  103|  8.78k|      const uint32_t offset = prob_data >> 2;
  104|  8.78k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 4, False: 8.77k]
  ------------------
  105|      4|        return false;
  106|      4|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   315k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 306k, False: 8.77k]
  ------------------
  109|   306k|        probability_table_[i + j] = 0;
  110|   306k|      }
  111|  8.77k|      i += offset;
  112|  55.8k|    } else {
  113|  55.8k|      const int extra_bytes = token;
  114|  55.8k|      uint32_t prob = prob_data >> 2;
  115|  70.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 14.4k, False: 55.8k]
  ------------------
  116|  14.4k|        uint8_t eb;
  117|  14.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 14.4k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  14.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  14.4k|      }
  124|  55.8k|      probability_table_[i] = prob;
  125|  55.8k|    }
  126|  64.6k|  }
  127|      6|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 5, False: 1]
  ------------------
  128|      5|    return false;
  129|      5|  }
  130|      1|  return true;
  131|      6|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|      1|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|      1|    DecoderBuffer *buffer) {
  136|      1|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      1|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      1|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      1|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 0]
  ------------------
  140|      1|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 1]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      1|  } else
  145|      0|#endif
  146|      0|  {
  147|      0|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 0]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      0|  }
  151|      1|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 1, False: 0]
  ------------------
  152|      1|    return false;
  153|      1|  }
  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|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|      4|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|      4|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|      4|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 4]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|      4|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|      4|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      4|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 2, False: 2]
  ------------------
   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|      2|#endif
   73|      2|  {
   74|      2|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 2]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      2|  }
   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|      4|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 4]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|      4|  probability_table_.resize(num_symbols_);
   86|      4|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 4]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|    936|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 933, False: 3]
  ------------------
   91|    933|    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|    933|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 932]
  ------------------
   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|    932|    const int token = prob_data & 3;
  102|    932|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 313, False: 619]
  ------------------
  103|    313|      const uint32_t offset = prob_data >> 2;
  104|    313|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 0, False: 313]
  ------------------
  105|      0|        return false;
  106|      0|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  5.89k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 5.58k, False: 313]
  ------------------
  109|  5.58k|        probability_table_[i + j] = 0;
  110|  5.58k|      }
  111|    313|      i += offset;
  112|    619|    } else {
  113|    619|      const int extra_bytes = token;
  114|    619|      uint32_t prob = prob_data >> 2;
  115|    762|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 143, False: 619]
  ------------------
  116|    143|        uint8_t eb;
  117|    143|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 143]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|    143|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|    143|      }
  124|    619|      probability_table_[i] = prob;
  125|    619|    }
  126|    932|  }
  127|      3|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 2]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|      2|  return true;
  131|      3|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|      2|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|      2|    DecoderBuffer *buffer) {
  136|      2|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      2|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      2|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      2|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 0]
  ------------------
  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|      0|#endif
  146|      0|  {
  147|      0|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 0]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      0|  }
  151|      2|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 1, False: 1]
  ------------------
  152|      1|    return false;
  153|      1|  }
  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: 1, False: 0]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|      0|  return true;
  162|      1|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|      9|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|      9|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|      9|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 9]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|      9|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|      9|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      9|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 0, False: 9]
  ------------------
   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|      9|#endif
   73|      9|  {
   74|      9|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 9]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      9|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|      9|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 9]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|      9|  probability_table_.resize(num_symbols_);
   86|      9|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 7]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  2.76k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 2.76k, False: 0]
  ------------------
   91|  2.76k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  2.76k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 2.76k]
  ------------------
   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|  2.76k|    const int token = prob_data & 3;
  102|  2.76k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.19k, False: 1.57k]
  ------------------
  103|  1.19k|      const uint32_t offset = prob_data >> 2;
  104|  1.19k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 6, False: 1.18k]
  ------------------
  105|      6|        return false;
  106|      6|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  34.9k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 33.7k, False: 1.18k]
  ------------------
  109|  33.7k|        probability_table_[i + j] = 0;
  110|  33.7k|      }
  111|  1.18k|      i += offset;
  112|  1.57k|    } else {
  113|  1.57k|      const int extra_bytes = token;
  114|  1.57k|      uint32_t prob = prob_data >> 2;
  115|  2.80k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.23k, False: 1.57k]
  ------------------
  116|  1.23k|        uint8_t eb;
  117|  1.23k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 1.23k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.23k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.23k|      }
  124|  1.57k|      probability_table_[i] = prob;
  125|  1.57k|    }
  126|  2.76k|  }
  127|      0|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 0, False: 0]
  ------------------
  128|      0|    return false;
  129|      0|  }
  130|      0|  return true;
  131|      0|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|      2|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|      3|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|      3|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|      3|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 3]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|      3|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|      3|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      3|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 0, False: 3]
  ------------------
   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|      3|#endif
   73|      3|  {
   74|      3|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 3]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      3|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|      3|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 3]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|      3|  probability_table_.resize(num_symbols_);
   86|      3|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 3]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  56.9k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 56.9k, False: 0]
  ------------------
   91|  56.9k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  56.9k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 2, False: 56.9k]
  ------------------
   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|  56.9k|    const int token = prob_data & 3;
  102|  56.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.94k, False: 50.9k]
  ------------------
  103|  5.94k|      const uint32_t offset = prob_data >> 2;
  104|  5.94k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 1, False: 5.93k]
  ------------------
  105|      1|        return false;
  106|      1|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   134k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 128k, False: 5.93k]
  ------------------
  109|   128k|        probability_table_[i + j] = 0;
  110|   128k|      }
  111|  5.93k|      i += offset;
  112|  50.9k|    } else {
  113|  50.9k|      const int extra_bytes = token;
  114|  50.9k|      uint32_t prob = prob_data >> 2;
  115|   126k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 75.3k, False: 50.9k]
  ------------------
  116|  75.3k|        uint8_t eb;
  117|  75.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 75.3k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  75.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  75.3k|      }
  124|  50.9k|      probability_table_[i] = prob;
  125|  50.9k|    }
  126|  56.9k|  }
  127|      0|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 0, False: 0]
  ------------------
  128|      0|    return false;
  129|      0|  }
  130|      0|  return true;
  131|      0|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|      4|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|      4|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|      4|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 4]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|      4|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|      4|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      4|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 0, False: 4]
  ------------------
   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|      4|#endif
   73|      4|  {
   74|      4|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 4]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      4|  }
   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|      4|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 4]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|      4|  probability_table_.resize(num_symbols_);
   86|      4|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 4]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   180k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 180k, False: 2]
  ------------------
   91|   180k|    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|   180k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 180k]
  ------------------
   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|   180k|    const int token = prob_data & 3;
  102|   180k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 89.2k, False: 91.5k]
  ------------------
  103|  89.2k|      const uint32_t offset = prob_data >> 2;
  104|  89.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 0, False: 89.2k]
  ------------------
  105|      0|        return false;
  106|      0|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.25M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.16M, False: 89.2k]
  ------------------
  109|  2.16M|        probability_table_[i + j] = 0;
  110|  2.16M|      }
  111|  89.2k|      i += offset;
  112|  91.5k|    } else {
  113|  91.5k|      const int extra_bytes = token;
  114|  91.5k|      uint32_t prob = prob_data >> 2;
  115|   172k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 80.6k, False: 91.5k]
  ------------------
  116|  80.6k|        uint8_t eb;
  117|  80.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 1, False: 80.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|  80.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  80.6k|      }
  124|  91.5k|      probability_table_[i] = prob;
  125|  91.5k|    }
  126|   180k|  }
  127|      2|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 2, False: 0]
  ------------------
  128|      2|    return false;
  129|      2|  }
  130|      0|  return true;
  131|      2|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|      8|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_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: 5, False: 3]
  ------------------
   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|      3|#endif
   73|      3|  {
   74|      3|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 3]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      3|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|      8|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 7]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|      7|  probability_table_.resize(num_symbols_);
   86|      7|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 7]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  2.86k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 2.85k, False: 5]
  ------------------
   91|  2.85k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  2.85k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 2.85k]
  ------------------
   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|  2.85k|    const int token = prob_data & 3;
  102|  2.85k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.23k, False: 1.61k]
  ------------------
  103|  1.23k|      const uint32_t offset = prob_data >> 2;
  104|  1.23k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 1, False: 1.23k]
  ------------------
  105|      1|        return false;
  106|      1|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  36.9k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 35.6k, False: 1.23k]
  ------------------
  109|  35.6k|        probability_table_[i + j] = 0;
  110|  35.6k|      }
  111|  1.23k|      i += offset;
  112|  1.61k|    } else {
  113|  1.61k|      const int extra_bytes = token;
  114|  1.61k|      uint32_t prob = prob_data >> 2;
  115|  2.47k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 851, False: 1.61k]
  ------------------
  116|    851|        uint8_t eb;
  117|    851|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 851]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|    851|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|    851|      }
  124|  1.61k|      probability_table_[i] = prob;
  125|  1.61k|    }
  126|  2.85k|  }
  127|      5|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 0, False: 5]
  ------------------
  128|      0|    return false;
  129|      0|  }
  130|      5|  return true;
  131|      5|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|      5|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_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: 3, False: 2]
  ------------------
  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|      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|      5|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 3, False: 2]
  ------------------
  152|      3|    return false;
  153|      3|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 1]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|      1|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|  3.58k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|      1|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      1|  ans_.read_end();
  167|      1|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|      8|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_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: 6, False: 2]
  ------------------
   67|      6|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 6]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      6|  } else
   72|      2|#endif
   73|      2|  {
   74|      2|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 2]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      2|  }
   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: 6, False: 2]
  ------------------
   83|      6|    return false;
   84|      6|  }
   85|      2|  probability_table_.resize(num_symbols_);
   86|      2|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 2]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|      6|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 4, False: 2]
  ------------------
   91|      4|    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|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 4]
  ------------------
   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|    const int token = prob_data & 3;
  102|      4|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 0, False: 4]
  ------------------
  103|      0|      const uint32_t offset = prob_data >> 2;
  104|      0|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 0, False: 0]
  ------------------
  105|      0|        return false;
  106|      0|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|      0|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 0, False: 0]
  ------------------
  109|      0|        probability_table_[i + j] = 0;
  110|      0|      }
  111|      0|      i += offset;
  112|      4|    } else {
  113|      4|      const int extra_bytes = token;
  114|      4|      uint32_t prob = prob_data >> 2;
  115|     10|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 6, False: 4]
  ------------------
  116|      6|        uint8_t eb;
  117|      6|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 6]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|      6|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|      6|      }
  124|      4|      probability_table_[i] = prob;
  125|      4|    }
  126|      4|  }
  127|      2|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 0, False: 2]
  ------------------
  128|      0|    return false;
  129|      0|  }
  130|      2|  return true;
  131|      2|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|      2|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|      2|    DecoderBuffer *buffer) {
  136|      2|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      2|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      2|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      2|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 2]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|      2|#endif
  146|      2|  {
  147|      2|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 2]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      2|  }
  151|      2|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 0, False: 2]
  ------------------
  152|      0|    return false;
  153|      0|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 1]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|      1|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|  5.47k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|      1|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      1|  ans_.read_end();
  167|      1|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|     18|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_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: 3, False: 15]
  ------------------
   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|     15|#endif
   73|     15|  {
   74|     15|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 15]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     15|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     18|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 17]
  ------------------
   83|      1|    return false;
   84|      1|  }
   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|   560k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 560k, False: 12]
  ------------------
   91|   560k|    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|   560k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 3, False: 560k]
  ------------------
   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|   560k|    const int token = prob_data & 3;
  102|   560k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 162k, False: 397k]
  ------------------
  103|   162k|      const uint32_t offset = prob_data >> 2;
  104|   162k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 2, False: 162k]
  ------------------
  105|      2|        return false;
  106|      2|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.03M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.86M, False: 162k]
  ------------------
  109|  1.86M|        probability_table_[i + j] = 0;
  110|  1.86M|      }
  111|   162k|      i += offset;
  112|   397k|    } else {
  113|   397k|      const int extra_bytes = token;
  114|   397k|      uint32_t prob = prob_data >> 2;
  115|   626k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 229k, False: 397k]
  ------------------
  116|   229k|        uint8_t eb;
  117|   229k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 229k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   229k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   229k|      }
  124|   397k|      probability_table_[i] = prob;
  125|   397k|    }
  126|   560k|  }
  127|     12|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 5, False: 7]
  ------------------
  128|      5|    return false;
  129|      5|  }
  130|      7|  return true;
  131|     12|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|      7|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_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: 0, False: 7]
  ------------------
  152|      0|    return false;
  153|      0|  }
  154|      7|  const uint8_t *const data_head =
  155|      7|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      7|  buffer->Advance(bytes_encoded);
  158|      7|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 7]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      7|  return true;
  162|      7|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  49.0k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|      7|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      7|  ans_.read_end();
  167|      7|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|      5|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|      5|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|      5|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 5]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|      5|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|      5|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      5|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 1, False: 4]
  ------------------
   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|      4|#endif
   73|      4|  {
   74|      4|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 4]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      4|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|      5|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 5]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|      5|  probability_table_.resize(num_symbols_);
   86|      5|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 5]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|    493|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 490, False: 3]
  ------------------
   91|    490|    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|    490|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 490]
  ------------------
   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|    490|    const int token = prob_data & 3;
  102|    490|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 133, False: 357]
  ------------------
  103|    133|      const uint32_t offset = prob_data >> 2;
  104|    133|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 2, False: 131]
  ------------------
  105|      2|        return false;
  106|      2|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.16k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.03k, False: 131]
  ------------------
  109|  3.03k|        probability_table_[i + j] = 0;
  110|  3.03k|      }
  111|    131|      i += offset;
  112|    357|    } else {
  113|    357|      const int extra_bytes = token;
  114|    357|      uint32_t prob = prob_data >> 2;
  115|    626|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 269, False: 357]
  ------------------
  116|    269|        uint8_t eb;
  117|    269|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 269]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|    269|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|    269|      }
  124|    357|      probability_table_[i] = prob;
  125|    357|    }
  126|    490|  }
  127|      3|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 2, False: 1]
  ------------------
  128|      2|    return false;
  129|      2|  }
  130|      1|  return true;
  131|      3|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|      1|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|      1|    DecoderBuffer *buffer) {
  136|      1|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      1|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      1|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      1|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 0]
  ------------------
  140|      1|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 1]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      1|  } else
  145|      0|#endif
  146|      0|  {
  147|      0|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 0]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      0|  }
  151|      1|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 1, False: 0]
  ------------------
  152|      1|    return false;
  153|      1|  }
  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|}
_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: 1, False: 7]
  ------------------
   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|      7|#endif
   73|      7|  {
   74|      7|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 7]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      7|  }
   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|  18.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 18.3k, False: 3]
  ------------------
   91|  18.3k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  18.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 2, False: 18.3k]
  ------------------
   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|  18.3k|    const int token = prob_data & 3;
  102|  18.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.66k, False: 16.6k]
  ------------------
  103|  1.66k|      const uint32_t offset = prob_data >> 2;
  104|  1.66k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 3, False: 1.66k]
  ------------------
  105|      3|        return false;
  106|      3|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  74.4k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 72.7k, False: 1.66k]
  ------------------
  109|  72.7k|        probability_table_[i + j] = 0;
  110|  72.7k|      }
  111|  1.66k|      i += offset;
  112|  16.6k|    } else {
  113|  16.6k|      const int extra_bytes = token;
  114|  16.6k|      uint32_t prob = prob_data >> 2;
  115|  17.4k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 814, False: 16.6k]
  ------------------
  116|    814|        uint8_t eb;
  117|    814|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 814]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|    814|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|    814|      }
  124|  16.6k|      probability_table_[i] = prob;
  125|  16.6k|    }
  126|  18.3k|  }
  127|      3|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 2, False: 1]
  ------------------
  128|      2|    return false;
  129|      2|  }
  130|      1|  return true;
  131|      3|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|      1|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|      1|    DecoderBuffer *buffer) {
  136|      1|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      1|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      1|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      1|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 1]
  ------------------
  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|      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|      1|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 0, False: 1]
  ------------------
  152|      0|    return false;
  153|      0|  }
  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|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  1.57M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|      1|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      1|  ans_.read_end();
  167|      1|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|     16|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_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: 6, False: 10]
  ------------------
   67|      6|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 6]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      6|  } else
   72|     10|#endif
   73|     10|  {
   74|     10|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 10]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     10|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     16|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 15]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|     15|  probability_table_.resize(num_symbols_);
   86|     15|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 15]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  68.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 68.2k, False: 7]
  ------------------
   91|  68.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|  68.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 4, False: 68.2k]
  ------------------
   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.2k|    const int token = prob_data & 3;
  102|  68.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 31.9k, False: 36.2k]
  ------------------
  103|  31.9k|      const uint32_t offset = prob_data >> 2;
  104|  31.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 3, False: 31.9k]
  ------------------
  105|      3|        return false;
  106|      3|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.01M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 984k, False: 31.9k]
  ------------------
  109|   984k|        probability_table_[i + j] = 0;
  110|   984k|      }
  111|  31.9k|      i += offset;
  112|  36.2k|    } else {
  113|  36.2k|      const int extra_bytes = token;
  114|  36.2k|      uint32_t prob = prob_data >> 2;
  115|  62.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 26.6k, False: 36.2k]
  ------------------
  116|  26.6k|        uint8_t eb;
  117|  26.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 1, False: 26.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|  26.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  26.6k|      }
  124|  36.2k|      probability_table_[i] = prob;
  125|  36.2k|    }
  126|  68.2k|  }
  127|      7|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 5, False: 2]
  ------------------
  128|      5|    return false;
  129|      5|  }
  130|      2|  return true;
  131|      7|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|      2|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|      2|    DecoderBuffer *buffer) {
  136|      2|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      2|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      2|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      2|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 2]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|      2|#endif
  146|      2|  {
  147|      2|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 2]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      2|  }
  151|      2|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 0, False: 2]
  ------------------
  152|      0|    return false;
  153|      0|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|    231|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|      7|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|      7|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|      7|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 7]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|      7|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|      7|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      7|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 0, False: 7]
  ------------------
   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|      7|#endif
   73|      7|  {
   74|      7|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 7]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      7|  }
   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|      7|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 7]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|      7|  probability_table_.resize(num_symbols_);
   86|      7|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 7]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|    141|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 137, False: 4]
  ------------------
   91|    137|    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|    137|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 137]
  ------------------
   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|    137|    const int token = prob_data & 3;
  102|    137|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 23, False: 114]
  ------------------
  103|     23|      const uint32_t offset = prob_data >> 2;
  104|     23|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 3, False: 20]
  ------------------
  105|      3|        return false;
  106|      3|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|    442|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 422, False: 20]
  ------------------
  109|    422|        probability_table_[i + j] = 0;
  110|    422|      }
  111|     20|      i += offset;
  112|    114|    } else {
  113|    114|      const int extra_bytes = token;
  114|    114|      uint32_t prob = prob_data >> 2;
  115|    219|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 105, False: 114]
  ------------------
  116|    105|        uint8_t eb;
  117|    105|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 105]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|    105|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|    105|      }
  124|    114|      probability_table_[i] = prob;
  125|    114|    }
  126|    137|  }
  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|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|      3|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_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: 2, False: 1]
  ------------------
  152|      2|    return false;
  153|      2|  }
  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|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  5.86k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|      1|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      1|  ans_.read_end();
  167|      1|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|    366|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|    366|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 0, False: 366]
  ------------------
   35|      0|    return true;
   36|      0|  }
   37|       |  // Decode which scheme to use.
   38|    366|  uint8_t scheme;
   39|    366|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 366]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    366|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 60, False: 306]
  ------------------
   43|     60|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|     60|                                                  src_buffer, out_values);
   45|    306|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 213, False: 93]
  ------------------
   46|    213|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|    213|                                               out_values);
   48|    213|  }
   49|     93|  return false;
   50|    366|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|     60|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|     60|  SymbolDecoderT<5> tag_decoder;
   57|     60|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 44, False: 16]
  ------------------
   58|     44|    return false;
   59|     44|  }
   60|       |
   61|     16|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 8, False: 8]
  ------------------
   62|      8|    return false;
   63|      8|  }
   64|       |
   65|      8|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 8, False: 0]
  |  Branch (65:25): [True: 4, False: 4]
  ------------------
   66|      4|    return false;  // Wrong number of symbols.
   67|      4|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|      4|  src_buffer->StartBitDecoding(false, nullptr);
   72|      4|  int value_id = 0;
   73|    474|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 470, False: 4]
  ------------------
   74|       |    // Decode the tag.
   75|    470|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|    940|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 470, False: 470]
  ------------------
   78|    470|      uint32_t val;
   79|    470|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 0, False: 470]
  ------------------
   80|      0|        return false;
   81|      0|      }
   82|    470|      out_values[value_id++] = val;
   83|    470|    }
   84|    470|  }
   85|      4|  tag_decoder.EndDecoding();
   86|      4|  src_buffer->EndBitDecoding();
   87|      4|  return true;
   88|      4|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|    213|                      uint32_t *out_values) {
  117|    213|  uint8_t max_bit_length;
  118|    213|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 0, False: 213]
  ------------------
  119|      0|    return false;
  120|      0|  }
  121|    213|  switch (max_bit_length) {
  122|     22|    case 1:
  ------------------
  |  Branch (122:5): [True: 22, False: 191]
  ------------------
  123|     22|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|     22|                                                         out_values);
  125|     18|    case 2:
  ------------------
  |  Branch (125:5): [True: 18, False: 195]
  ------------------
  126|     18|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|     18|                                                         out_values);
  128|     17|    case 3:
  ------------------
  |  Branch (128:5): [True: 17, False: 196]
  ------------------
  129|     17|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|     17|                                                         out_values);
  131|     20|    case 4:
  ------------------
  |  Branch (131:5): [True: 20, False: 193]
  ------------------
  132|     20|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|     20|                                                         out_values);
  134|     19|    case 5:
  ------------------
  |  Branch (134:5): [True: 19, False: 194]
  ------------------
  135|     19|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|     19|                                                         out_values);
  137|      8|    case 6:
  ------------------
  |  Branch (137:5): [True: 8, False: 205]
  ------------------
  138|      8|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|      8|                                                         out_values);
  140|     14|    case 7:
  ------------------
  |  Branch (140:5): [True: 14, False: 199]
  ------------------
  141|     14|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|     14|                                                         out_values);
  143|      4|    case 8:
  ------------------
  |  Branch (143:5): [True: 4, False: 209]
  ------------------
  144|      4|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|      4|                                                         out_values);
  146|      9|    case 9:
  ------------------
  |  Branch (146:5): [True: 9, False: 204]
  ------------------
  147|      9|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|      9|                                                         out_values);
  149|      3|    case 10:
  ------------------
  |  Branch (149:5): [True: 3, False: 210]
  ------------------
  150|      3|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|      3|          num_values, src_buffer, out_values);
  152|      4|    case 11:
  ------------------
  |  Branch (152:5): [True: 4, False: 209]
  ------------------
  153|      4|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|      4|          num_values, src_buffer, out_values);
  155|      8|    case 12:
  ------------------
  |  Branch (155:5): [True: 8, False: 205]
  ------------------
  156|      8|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|      8|          num_values, src_buffer, out_values);
  158|      8|    case 13:
  ------------------
  |  Branch (158:5): [True: 8, False: 205]
  ------------------
  159|      8|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|      8|          num_values, src_buffer, out_values);
  161|     18|    case 14:
  ------------------
  |  Branch (161:5): [True: 18, False: 195]
  ------------------
  162|     18|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|     18|          num_values, src_buffer, out_values);
  164|      5|    case 15:
  ------------------
  |  Branch (164:5): [True: 5, False: 208]
  ------------------
  165|      5|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|      5|          num_values, src_buffer, out_values);
  167|      8|    case 16:
  ------------------
  |  Branch (167:5): [True: 8, False: 205]
  ------------------
  168|      8|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|      8|          num_values, src_buffer, out_values);
  170|     16|    case 17:
  ------------------
  |  Branch (170:5): [True: 16, False: 197]
  ------------------
  171|     16|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|     16|          num_values, src_buffer, out_values);
  173|      7|    case 18:
  ------------------
  |  Branch (173:5): [True: 7, False: 206]
  ------------------
  174|      7|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|      7|          num_values, src_buffer, out_values);
  176|      5|    default:
  ------------------
  |  Branch (176:5): [True: 5, False: 208]
  ------------------
  177|      5|      return false;
  178|    213|  }
  179|    213|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|     22|                              uint32_t *out_values) {
   93|     22|  SymbolDecoderT decoder;
   94|     22|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 19, False: 3]
  ------------------
   95|     19|    return false;
   96|     19|  }
   97|       |
   98|      3|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 3, False: 0]
  |  Branch (98:25): [True: 0, False: 3]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      3|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 1, False: 2]
  ------------------
  103|      1|    return false;
  104|      1|  }
  105|  3.23M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.23M, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.23M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.23M|    out_values[i] = value;
  109|  3.23M|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      3|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|     18|                              uint32_t *out_values) {
   93|     18|  SymbolDecoderT decoder;
   94|     18|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 10, False: 8]
  ------------------
   95|     10|    return false;
   96|     10|  }
   97|       |
   98|      8|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 8, False: 0]
  |  Branch (98:25): [True: 0, False: 8]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      8|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 5, False: 3]
  ------------------
  103|      5|    return false;
  104|      5|  }
  105|  26.8k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 26.8k, False: 3]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  26.8k|    const uint32_t value = decoder.DecodeSymbol();
  108|  26.8k|    out_values[i] = value;
  109|  26.8k|  }
  110|      3|  decoder.EndDecoding();
  111|      3|  return true;
  112|      8|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|     17|                              uint32_t *out_values) {
   93|     17|  SymbolDecoderT decoder;
   94|     17|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 15, False: 2]
  ------------------
   95|     15|    return false;
   96|     15|  }
   97|       |
   98|      2|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 2, False: 0]
  |  Branch (98:25): [True: 0, False: 2]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      2|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 1, False: 1]
  ------------------
  103|      1|    return false;
  104|      1|  }
  105|     22|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 21, False: 1]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|     21|    const uint32_t value = decoder.DecodeSymbol();
  108|     21|    out_values[i] = value;
  109|     21|  }
  110|      1|  decoder.EndDecoding();
  111|      1|  return true;
  112|      2|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|     20|                              uint32_t *out_values) {
   93|     20|  SymbolDecoderT decoder;
   94|     20|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 17, False: 3]
  ------------------
   95|     17|    return false;
   96|     17|  }
   97|       |
   98|      3|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 3, False: 0]
  |  Branch (98:25): [True: 1, False: 2]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|      2|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 2, False: 0]
  ------------------
  103|      2|    return false;
  104|      2|  }
  105|      0|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 0, False: 0]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|      0|    const uint32_t value = decoder.DecodeSymbol();
  108|      0|    out_values[i] = value;
  109|      0|  }
  110|      0|  decoder.EndDecoding();
  111|      0|  return true;
  112|      2|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|     19|                              uint32_t *out_values) {
   93|     19|  SymbolDecoderT decoder;
   94|     19|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 2, False: 17]
  ------------------
   95|      2|    return false;
   96|      2|  }
   97|       |
   98|     17|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 17, False: 0]
  |  Branch (98:25): [True: 14, False: 3]
  ------------------
   99|     14|    return false;  // Wrong number of symbols.
  100|     14|  }
  101|       |
  102|      3|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 3]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|  1.63M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.63M, False: 3]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.63M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.63M|    out_values[i] = value;
  109|  1.63M|  }
  110|      3|  decoder.EndDecoding();
  111|      3|  return true;
  112|      3|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|      8|                              uint32_t *out_values) {
   93|      8|  SymbolDecoderT decoder;
   94|      8|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 6, False: 2]
  ------------------
   95|      6|    return false;
   96|      6|  }
   97|       |
   98|      2|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 2, False: 0]
  |  Branch (98:25): [True: 0, False: 2]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      2|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 2]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|  49.4k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 49.4k, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  49.4k|    const uint32_t value = decoder.DecodeSymbol();
  108|  49.4k|    out_values[i] = value;
  109|  49.4k|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      2|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|     14|                              uint32_t *out_values) {
   93|     14|  SymbolDecoderT decoder;
   94|     14|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 13, False: 1]
  ------------------
   95|     13|    return false;
   96|     13|  }
   97|       |
   98|      1|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 1, False: 0]
  |  Branch (98:25): [True: 0, False: 1]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      1|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 1, False: 0]
  ------------------
  103|      1|    return false;
  104|      1|  }
  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|      1|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|      4|                              uint32_t *out_values) {
   93|      4|  SymbolDecoderT decoder;
   94|      4|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 2, False: 2]
  ------------------
   95|      2|    return false;
   96|      2|  }
   97|       |
   98|      2|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 2, False: 0]
  |  Branch (98:25): [True: 0, False: 2]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      2|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 2, False: 0]
  ------------------
  103|      2|    return false;
  104|      2|  }
  105|      0|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 0, False: 0]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|      0|    const uint32_t value = decoder.DecodeSymbol();
  108|      0|    out_values[i] = value;
  109|      0|  }
  110|      0|  decoder.EndDecoding();
  111|      0|  return true;
  112|      2|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|      9|                              uint32_t *out_values) {
   93|      9|  SymbolDecoderT decoder;
   94|      9|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 7, False: 2]
  ------------------
   95|      7|    return false;
   96|      7|  }
   97|       |
   98|      2|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 2, False: 0]
  |  Branch (98:25): [True: 2, False: 0]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|      0|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 0]
  ------------------
  103|      0|    return false;
  104|      0|  }
  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|      0|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|      3|                              uint32_t *out_values) {
   93|      3|  SymbolDecoderT decoder;
   94|      3|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 3, False: 0]
  ------------------
   95|      3|    return false;
   96|      3|  }
   97|       |
   98|      0|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 0, False: 0]
  |  Branch (98:25): [True: 0, False: 0]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      0|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 0]
  ------------------
  103|      0|    return false;
  104|      0|  }
  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|      0|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|      4|                              uint32_t *out_values) {
   93|      4|  SymbolDecoderT decoder;
   94|      4|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 4, False: 0]
  ------------------
   95|      4|    return false;
   96|      4|  }
   97|       |
   98|      0|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 0, False: 0]
  |  Branch (98:25): [True: 0, False: 0]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      0|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 0]
  ------------------
  103|      0|    return false;
  104|      0|  }
  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|      0|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|      8|                              uint32_t *out_values) {
   93|      8|  SymbolDecoderT decoder;
   94|      8|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 3, False: 5]
  ------------------
   95|      3|    return false;
   96|      3|  }
   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: 4, False: 1]
  ------------------
  103|      4|    return false;
  104|      4|  }
  105|  3.58k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.58k, False: 1]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.58k|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.58k|    out_values[i] = value;
  109|  3.58k|  }
  110|      1|  decoder.EndDecoding();
  111|      1|  return true;
  112|      5|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|      8|                              uint32_t *out_values) {
   93|      8|  SymbolDecoderT decoder;
   94|      8|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 6, False: 2]
  ------------------
   95|      6|    return false;
   96|      6|  }
   97|       |
   98|      2|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 2, False: 0]
  |  Branch (98:25): [True: 0, False: 2]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      2|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 1, False: 1]
  ------------------
  103|      1|    return false;
  104|      1|  }
  105|  5.47k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.47k, False: 1]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.47k|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.47k|    out_values[i] = value;
  109|  5.47k|  }
  110|      1|  decoder.EndDecoding();
  111|      1|  return true;
  112|      2|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|     18|                              uint32_t *out_values) {
   93|     18|  SymbolDecoderT decoder;
   94|     18|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 11, False: 7]
  ------------------
   95|     11|    return false;
   96|     11|  }
   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: 0, False: 7]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|  49.1k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 49.0k, False: 7]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  49.0k|    const uint32_t value = decoder.DecodeSymbol();
  108|  49.0k|    out_values[i] = value;
  109|  49.0k|  }
  110|      7|  decoder.EndDecoding();
  111|      7|  return true;
  112|      7|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|      5|                              uint32_t *out_values) {
   93|      5|  SymbolDecoderT decoder;
   94|      5|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 4, False: 1]
  ------------------
   95|      4|    return false;
   96|      4|  }
   97|       |
   98|      1|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 1, False: 0]
  |  Branch (98:25): [True: 0, False: 1]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      1|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 1, False: 0]
  ------------------
  103|      1|    return false;
  104|      1|  }
  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|      1|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|      8|                              uint32_t *out_values) {
   93|      8|  SymbolDecoderT decoder;
   94|      8|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 7, False: 1]
  ------------------
   95|      7|    return false;
   96|      7|  }
   97|       |
   98|      1|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 1, False: 0]
  |  Branch (98:25): [True: 0, False: 1]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      1|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 1]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|  1.57M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.57M, False: 1]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.57M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.57M|    out_values[i] = value;
  109|  1.57M|  }
  110|      1|  decoder.EndDecoding();
  111|      1|  return true;
  112|      1|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|     16|                              uint32_t *out_values) {
   93|     16|  SymbolDecoderT decoder;
   94|     16|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 14, False: 2]
  ------------------
   95|     14|    return false;
   96|     14|  }
   97|       |
   98|      2|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 2, False: 0]
  |  Branch (98:25): [True: 0, False: 2]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      2|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 2]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|    233|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 231, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|    231|    const uint32_t value = decoder.DecodeSymbol();
  108|    231|    out_values[i] = value;
  109|    231|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      2|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|      7|                              uint32_t *out_values) {
   93|      7|  SymbolDecoderT decoder;
   94|      7|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 4, False: 3]
  ------------------
   95|      4|    return false;
   96|      4|  }
   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: 2, False: 1]
  ------------------
  103|      2|    return false;
  104|      2|  }
  105|  5.86k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.86k, False: 1]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.86k|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.86k|    out_values[i] = value;
  109|  5.86k|  }
  110|      1|  decoder.EndDecoding();
  111|      1|  return true;
  112|      3|}

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

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

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

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

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

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|    417|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|    167|  const CornerTable *GetCornerTable() const override {
   67|    167|    return corner_table_.get();
   68|    167|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  8.23M|                       int *out_encoder_split_symbol_id) {
   87|  8.23M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 7.99k, False: 8.22M]
  ------------------
   88|  7.99k|      return false;
   89|  7.99k|    }
   90|  8.22M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 0, False: 8.22M]
  ------------------
   91|  8.22M|        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|  8.22M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 8.22M, False: 34]
  ------------------
  101|  8.22M|      return false;
  102|  8.22M|    }
  103|     34|    *out_face_edge =
  104|     34|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|     34|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|     34|    topology_split_data_.pop_back();
  108|     34|    return true;
  109|  8.22M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  21.3M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  21.3M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  21.3M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  21.3M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|    318|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|    189|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|    173|  const CornerTable *GetCornerTable() const override {
   67|    173|    return corner_table_.get();
   68|    173|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  4.42M|                       int *out_encoder_split_symbol_id) {
   87|  4.42M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 4.42M, False: 1.07k]
  ------------------
   88|  4.42M|      return false;
   89|  4.42M|    }
   90|  1.07k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 0, False: 1.07k]
  ------------------
   91|  1.07k|        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.07k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 1.02k, False: 48]
  ------------------
  101|  1.02k|      return false;
  102|  1.02k|    }
  103|     48|    *out_face_edge =
  104|     48|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|     48|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|     48|    topology_split_data_.pop_back();
  108|     48|    return true;
  109|  1.07k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  13.2M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  13.2M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  13.2M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  13.2M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|    285|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|    465|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|     90|  const CornerTable *GetCornerTable() const override {
   67|     90|    return corner_table_.get();
   68|     90|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  3.19M|                       int *out_encoder_split_symbol_id) {
   87|  3.19M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 3.19M, False: 4]
  ------------------
   88|  3.19M|      return false;
   89|  3.19M|    }
   90|      4|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 0, False: 4]
  ------------------
   91|      4|        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|      4|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 4, False: 0]
  ------------------
  101|      4|      return false;
  102|      4|    }
  103|      0|    *out_face_edge =
  104|      0|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|      0|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|      0|    topology_split_data_.pop_back();
  108|      0|    return true;
  109|      4|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  2.47M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  2.47M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  2.47M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  2.47M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|    219|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

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

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

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

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

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|     75|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  84.2k|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  84.2k|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 84.0k, False: 160]
  ------------------
   61|  84.0k|      return true;  // Already traversed.
   62|  84.0k|    }
   63|       |
   64|    160|    corner_traversal_stack_.clear();
   65|    160|    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|    160|    const VertexIndex next_vert =
   69|    160|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|    160|    const VertexIndex prev_vert =
   71|    160|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|    160|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 160]
  |  Branch (72:45): [True: 0, False: 160]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|    160|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 134, False: 26]
  ------------------
   76|    134|      this->MarkVertexVisited(next_vert);
   77|    134|      this->traversal_observer().OnNewVertexVisited(
   78|    134|          next_vert, this->corner_table()->Next(corner_id));
   79|    134|    }
   80|    160|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 154, False: 6]
  ------------------
   81|    154|      this->MarkVertexVisited(prev_vert);
   82|    154|      this->traversal_observer().OnNewVertexVisited(
   83|    154|          prev_vert, this->corner_table()->Previous(corner_id));
   84|    154|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|    776|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 616, False: 160]
  ------------------
   88|       |      // Currently processed corner.
   89|    616|      corner_id = corner_traversal_stack_.back();
   90|    616|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|    616|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 616]
  |  Branch (92:47): [True: 27, False: 589]
  ------------------
   93|       |        // This face has been already traversed.
   94|     27|        corner_traversal_stack_.pop_back();
   95|     27|        continue;
   96|     27|      }
   97|  84.2k|      while (true) {
  ------------------
  |  Branch (97:14): [Folded - Ignored]
  ------------------
   98|  84.2k|        this->MarkFaceVisited(face_id);
   99|  84.2k|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  84.2k|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  84.2k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 84.2k]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  84.2k|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 42.3k, False: 41.9k]
  ------------------
  105|  42.3k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  42.3k|          this->MarkVertexVisited(vert_id);
  107|  42.3k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  42.3k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 41.8k, False: 480]
  ------------------
  109|  41.8k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  41.8k|            face_id = FaceIndex(corner_id.value() / 3);
  111|  41.8k|            continue;
  112|  41.8k|          }
  113|  42.3k|        }
  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|  42.4k|        const CornerIndex right_corner_id =
  118|  42.4k|            this->corner_table()->GetRightCorner(corner_id);
  119|  42.4k|        const CornerIndex left_corner_id =
  120|  42.4k|            this->corner_table()->GetLeftCorner(corner_id);
  121|  42.4k|        const FaceIndex right_face_id(
  122|  42.4k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 375, False: 42.0k]
  ------------------
  123|  42.4k|                 ? kInvalidFaceIndex
  124|  42.4k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  42.4k|        const FaceIndex left_face_id(
  126|  42.4k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 229, False: 42.1k]
  ------------------
  127|  42.4k|                 ? kInvalidFaceIndex
  128|  42.4k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  42.4k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 41.9k, False: 499]
  ------------------
  130|       |          // Right face has been already visited.
  131|  41.9k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 361, False: 41.5k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|    361|            corner_traversal_stack_.pop_back();
  134|    361|            break;  // Break from the while (true) loop.
  135|  41.5k|          } else {
  136|       |            // Go to the left face.
  137|  41.5k|            corner_id = left_corner_id;
  138|  41.5k|            face_id = left_face_id;
  139|  41.5k|          }
  140|  41.9k|        } else {
  141|       |          // Right face was not visited.
  142|    499|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 271, False: 228]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|    271|            corner_id = right_corner_id;
  145|    271|            face_id = right_face_id;
  146|    271|          } 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|    228|            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|    228|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|    228|            break;
  159|    228|          }
  160|    499|        }
  161|  42.4k|      }
  162|    589|    }
  163|    160|    return true;
  164|    160|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|     75|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|    152|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|     53|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.41k|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.41k|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 671, False: 1.74k]
  ------------------
   61|    671|      return true;  // Already traversed.
   62|    671|    }
   63|       |
   64|  1.74k|    corner_traversal_stack_.clear();
   65|  1.74k|    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|  1.74k|    const VertexIndex next_vert =
   69|  1.74k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  1.74k|    const VertexIndex prev_vert =
   71|  1.74k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  1.74k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 1.74k]
  |  Branch (72:45): [True: 0, False: 1.74k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  1.74k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 1.69k, False: 51]
  ------------------
   76|  1.69k|      this->MarkVertexVisited(next_vert);
   77|  1.69k|      this->traversal_observer().OnNewVertexVisited(
   78|  1.69k|          next_vert, this->corner_table()->Next(corner_id));
   79|  1.69k|    }
   80|  1.74k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 1.74k, False: 6]
  ------------------
   81|  1.74k|      this->MarkVertexVisited(prev_vert);
   82|  1.74k|      this->traversal_observer().OnNewVertexVisited(
   83|  1.74k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  1.74k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  3.69k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 1.94k, False: 1.74k]
  ------------------
   88|       |      // Currently processed corner.
   89|  1.94k|      corner_id = corner_traversal_stack_.back();
   90|  1.94k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  1.94k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 1.94k]
  |  Branch (92:47): [True: 15, False: 1.92k]
  ------------------
   93|       |        // This face has been already traversed.
   94|     15|        corner_traversal_stack_.pop_back();
   95|     15|        continue;
   96|     15|      }
   97|  2.41k|      while (true) {
  ------------------
  |  Branch (97:14): [Folded - Ignored]
  ------------------
   98|  2.41k|        this->MarkFaceVisited(face_id);
   99|  2.41k|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.41k|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.41k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.41k]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.41k|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 2.11k, False: 309]
  ------------------
  105|  2.11k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  2.11k|          this->MarkVertexVisited(vert_id);
  107|  2.11k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  2.11k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 218, False: 1.89k]
  ------------------
  109|    218|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|    218|            face_id = FaceIndex(corner_id.value() / 3);
  111|    218|            continue;
  112|    218|          }
  113|  2.11k|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  2.20k|        const CornerIndex right_corner_id =
  118|  2.20k|            this->corner_table()->GetRightCorner(corner_id);
  119|  2.20k|        const CornerIndex left_corner_id =
  120|  2.20k|            this->corner_table()->GetLeftCorner(corner_id);
  121|  2.20k|        const FaceIndex right_face_id(
  122|  2.20k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 1.83k, False: 362]
  ------------------
  123|  2.20k|                 ? kInvalidFaceIndex
  124|  2.20k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  2.20k|        const FaceIndex left_face_id(
  126|  2.20k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 1.79k, False: 410]
  ------------------
  127|  2.20k|                 ? kInvalidFaceIndex
  128|  2.20k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  2.20k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 2.01k, False: 189]
  ------------------
  130|       |          // Right face has been already visited.
  131|  2.01k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 1.83k, False: 181]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  1.83k|            corner_traversal_stack_.pop_back();
  134|  1.83k|            break;  // Break from the while (true) loop.
  135|  1.83k|          } else {
  136|       |            // Go to the left face.
  137|    181|            corner_id = left_corner_id;
  138|    181|            face_id = left_face_id;
  139|    181|          }
  140|  2.01k|        } else {
  141|       |          // Right face was not visited.
  142|    189|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 91, False: 98]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|     91|            corner_id = right_corner_id;
  145|     91|            face_id = right_face_id;
  146|     98|          } 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|     98|            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|     98|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|     98|            break;
  159|     98|          }
  160|    189|        }
  161|  2.20k|      }
  162|  1.92k|    }
  163|  1.74k|    return true;
  164|  1.74k|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|     53|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|    106|  DepthFirstTraverser() {}

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

_ZN5draco36MeshAttributeIndicesEncodingObserverINS_11CornerTableEE18OnNewVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS3_IjNS_21CornerIndex_tag_type_EEE:
   50|  43.3k|  inline void OnNewVertexVisited(VertexIndex vertex, CornerIndex corner) {
   51|  43.3k|    const PointIndex point_id =
   52|  43.3k|        mesh_->face(FaceIndex(corner.value() / 3))[corner.value() % 3];
   53|       |    // Append the visited attribute to the encoding order.
   54|  43.3k|    sequencer_->AddPointId(point_id);
   55|       |
   56|       |    // Keep track of visited corners.
   57|  43.3k|    encoding_data_->encoded_attribute_value_index_to_corner_map.push_back(
   58|  43.3k|        corner);
   59|       |
   60|  43.3k|    encoding_data_
   61|  43.3k|        ->vertex_to_encoded_attribute_value_index_map[vertex.value()] =
   62|  43.3k|        encoding_data_->num_values;
   63|       |
   64|  43.3k|    encoding_data_->num_values++;
   65|  43.3k|  }
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_11CornerTableEE16OnNewFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   48|  85.4k|  void OnNewFaceVisited(FaceIndex /* face */) {}
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_11CornerTableEEC2EPKS1_PKNS_4MeshEPNS_15PointsSequencerEPNS_32MeshAttributeIndicesEncodingDataE:
   44|     97|        sequencer_(sequencer) {}
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_11CornerTableEEC2Ev:
   36|    194|        sequencer_(nullptr) {}
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_24MeshAttributeCornerTableEE18OnNewVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS3_IjNS_21CornerIndex_tag_type_EEE:
   50|  5.54k|  inline void OnNewVertexVisited(VertexIndex vertex, CornerIndex corner) {
   51|  5.54k|    const PointIndex point_id =
   52|  5.54k|        mesh_->face(FaceIndex(corner.value() / 3))[corner.value() % 3];
   53|       |    // Append the visited attribute to the encoding order.
   54|  5.54k|    sequencer_->AddPointId(point_id);
   55|       |
   56|       |    // Keep track of visited corners.
   57|  5.54k|    encoding_data_->encoded_attribute_value_index_to_corner_map.push_back(
   58|  5.54k|        corner);
   59|       |
   60|  5.54k|    encoding_data_
   61|  5.54k|        ->vertex_to_encoded_attribute_value_index_map[vertex.value()] =
   62|  5.54k|        encoding_data_->num_values;
   63|       |
   64|  5.54k|    encoding_data_->num_values++;
   65|  5.54k|  }
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_24MeshAttributeCornerTableEE16OnNewFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   48|  2.41k|  void OnNewFaceVisited(FaceIndex /* face */) {}
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_24MeshAttributeCornerTableEEC2EPKS1_PKNS_4MeshEPNS_15PointsSequencerEPNS_32MeshAttributeIndicesEncodingDataE:
   44|     53|        sequencer_(sequencer) {}
_ZN5draco36MeshAttributeIndicesEncodingObserverINS_24MeshAttributeCornerTableEEC2Ev:
   36|    106|        sequencer_(nullptr) {}

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|     21|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|     41|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|     41|    const auto *corner_table = traverser_.corner_table();
   50|     41|    attribute->SetExplicitMapping(mesh_->num_points());
   51|     41|    const size_t num_faces = mesh_->num_faces();
   52|     41|    const size_t num_points = mesh_->num_points();
   53|  2.60k|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 2.56k, False: 41]
  ------------------
   54|  2.56k|      const auto &face = mesh_->face(f);
   55|  10.2k|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 7.68k, False: 2.56k]
  ------------------
   56|  7.68k|        const PointIndex point_id = face[p];
   57|  7.68k|        const VertexIndex vert_id =
   58|  7.68k|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  7.68k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 7.68k]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  7.68k|        const AttributeValueIndex att_entry_id(
   63|  7.68k|            encoding_data_
   64|  7.68k|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  7.68k|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 7.68k]
  |  Branch (65:13): [True: 0, False: 7.68k]
  |  Branch (65:39): [True: 0, False: 7.68k]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  7.68k|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  7.68k|      }
   71|  2.56k|    }
   72|     41|    return true;
   73|     41|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|     21|  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|     21|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|     21|    traverser_.OnTraversalStart();
   82|     21|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 21]
  ------------------
   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|     21|    } else {
   89|     21|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  1.25k|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 1.23k, False: 21]
  ------------------
   91|  1.23k|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 1.23k]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  1.23k|      }
   95|     21|    }
   96|     21|    traverser_.OnTraversalEnd();
   97|     21|    return true;
   98|     21|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.23k|  bool ProcessCorner(CornerIndex corner_id) {
  102|  1.23k|    return traverser_.TraverseFromCorner(corner_id);
  103|  1.23k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|     21|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|     76|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  1.37k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  1.37k|    const auto *corner_table = traverser_.corner_table();
   50|  1.37k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  1.37k|    const size_t num_faces = mesh_->num_faces();
   52|  1.37k|    const size_t num_points = mesh_->num_points();
   53|   219k|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 218k, False: 1.37k]
  ------------------
   54|   218k|      const auto &face = mesh_->face(f);
   55|   873k|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 655k, False: 218k]
  ------------------
   56|   655k|        const PointIndex point_id = face[p];
   57|   655k|        const VertexIndex vert_id =
   58|   655k|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|   655k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 655k]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|   655k|        const AttributeValueIndex att_entry_id(
   63|   655k|            encoding_data_
   64|   655k|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|   655k|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 655k]
  |  Branch (65:13): [True: 0, False: 655k]
  |  Branch (65:39): [True: 0, False: 655k]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|   655k|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|   655k|      }
   71|   218k|    }
   72|  1.37k|    return true;
   73|  1.37k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|     75|  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|     75|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|     75|    traverser_.OnTraversalStart();
   82|     75|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 75]
  ------------------
   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|     75|    } else {
   89|     75|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  84.3k|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 84.2k, False: 75]
  ------------------
   91|  84.2k|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 84.2k]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  84.2k|      }
   95|     75|    }
   96|     75|    traverser_.OnTraversalEnd();
   97|     75|    return true;
   98|     75|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  84.2k|  bool ProcessCorner(CornerIndex corner_id) {
  102|  84.2k|    return traverser_.TraverseFromCorner(corner_id);
  103|  84.2k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|     76|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|     53|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|    997|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|    997|    const auto *corner_table = traverser_.corner_table();
   50|    997|    attribute->SetExplicitMapping(mesh_->num_points());
   51|    997|    const size_t num_faces = mesh_->num_faces();
   52|    997|    const size_t num_points = mesh_->num_points();
   53|  6.95k|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 5.95k, False: 997]
  ------------------
   54|  5.95k|      const auto &face = mesh_->face(f);
   55|  23.8k|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 17.8k, False: 5.95k]
  ------------------
   56|  17.8k|        const PointIndex point_id = face[p];
   57|  17.8k|        const VertexIndex vert_id =
   58|  17.8k|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  17.8k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 17.8k]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  17.8k|        const AttributeValueIndex att_entry_id(
   63|  17.8k|            encoding_data_
   64|  17.8k|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  17.8k|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 17.8k]
  |  Branch (65:13): [True: 0, False: 17.8k]
  |  Branch (65:39): [True: 0, False: 17.8k]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  17.8k|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  17.8k|      }
   71|  5.95k|    }
   72|    997|    return true;
   73|    997|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|     53|  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|     53|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|     53|    traverser_.OnTraversalStart();
   82|     53|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 53]
  ------------------
   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|     53|    } else {
   89|     53|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.47k|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.41k, False: 53]
  ------------------
   91|  2.41k|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.41k]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.41k|      }
   95|     53|    }
   96|     53|    traverser_.OnTraversalEnd();
   97|     53|    return true;
   98|     53|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.41k|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.41k|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.41k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|     53|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|    106|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|   267k|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  91.2k|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  91.2k|    return is_vertex_visited_[vert_id.value()];
   65|  91.2k|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  43.3k|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  43.3k|    is_vertex_visited_[vert_id.value()] = true;
   68|  43.3k|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|   128k|  inline TraversalObserverT &traversal_observer() {
   75|   128k|    return traversal_observer_;
   76|   128k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  90.1k|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  90.1k|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 726, False: 89.4k]
  ------------------
   47|    726|      return true;  // Invalid faces are always considered as visited.
   48|    726|    }
   49|  89.4k|    return is_face_visited_[face_id.value()];
   50|  90.1k|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  85.4k|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  85.4k|    is_face_visited_[face_id.value()] = true;
   62|  85.4k|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|    194|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|    194|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|     97|                    TraversalObserver traversal_observer) {
   37|     97|    corner_table_ = corner_table;
   38|     97|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|     97|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|     97|    traversal_observer_ = traversal_observer;
   41|     97|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  84.2k|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  84.2k|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 84.2k]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  84.2k|    return is_face_visited_[corner_id.value() / 3];
   58|  84.2k|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  20.6k|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.41k|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.41k|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.41k]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.41k|    return is_face_visited_[corner_id.value() / 3];
   58|  2.41k|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  5.91k|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  5.91k|    return is_vertex_visited_[vert_id.value()];
   65|  5.91k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  5.54k|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  5.54k|    is_vertex_visited_[vert_id.value()] = true;
   68|  5.54k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  7.96k|  inline TraversalObserverT &traversal_observer() {
   75|  7.96k|    return traversal_observer_;
   76|  7.96k|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  6.34k|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  6.34k|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 3.63k, False: 2.71k]
  ------------------
   47|  3.63k|      return true;  // Invalid faces are always considered as visited.
   48|  3.63k|    }
   49|  2.71k|    return is_face_visited_[face_id.value()];
   50|  6.34k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  2.41k|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  2.41k|    is_face_visited_[face_id.value()] = true;
   62|  2.41k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|    106|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|     53|                    TraversalObserver traversal_observer) {
   37|     53|    corner_table_ = corner_table;
   38|     53|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|     53|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|     53|    traversal_observer_ = traversal_observer;
   41|     53|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     11|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     11|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 11]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     11|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 11]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     11|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 11]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     11|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 3, False: 8]
  ------------------
  196|      3|    return true;
  197|      3|  }
  198|      8|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 8]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      8|  num_decoded_points_ = 0;
  202|       |
  203|      8|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 8]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|      8|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 7]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|      7|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 7]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      7|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 7]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      7|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 6, False: 1]
  ------------------
  217|      6|    return false;
  218|      6|  }
  219|       |
  220|      1|  numbers_decoder_.EndDecoding();
  221|      1|  remaining_bits_decoder_.EndDecoding();
  222|      1|  axis_decoder_.EndDecoding();
  223|      1|  half_decoder_.EndDecoding();
  224|       |
  225|      1|  return true;
  226|      7|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|      7|    uint32_t num_points, OutputIteratorT &oit) {
  254|      7|  typedef DecodingStatus Status;
  255|      7|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|      7|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|      7|  DecodingStatus init_status(num_points, 0, 0);
  258|      7|  std::stack<Status> status_stack;
  259|      7|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   133k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 133k, False: 1]
  ------------------
  263|   133k|    const DecodingStatus status = status_stack.top();
  264|   133k|    status_stack.pop();
  265|       |
  266|   133k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   133k|    const uint32_t last_axis = status.last_axis;
  268|   133k|    const uint32_t stack_pos = status.stack_pos;
  269|   133k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   133k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   133k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 133k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   133k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   133k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 133k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   133k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   133k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 65.7k, False: 68.0k]
  ------------------
  285|   302M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 302M, False: 65.7k]
  ------------------
  286|   302M|        *oit = old_base;
  287|   302M|        ++oit;
  288|   302M|        ++num_decoded_points_;
  289|   302M|      }
  290|  65.7k|      continue;
  291|  65.7k|    }
  292|       |
  293|  68.0k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  68.0k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.05k, False: 66.9k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.05k|      axes_[0] = axis;
  300|  8.42k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 7.37k, False: 1.05k]
  ------------------
  301|  7.37k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  7.37k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 394, False: 6.97k]
  |  |  ------------------
  ------------------
  302|  7.37k|      }
  303|  2.86k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.81k, False: 1.05k]
  ------------------
  304|  16.2k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 14.4k, False: 1.80k]
  ------------------
  305|  14.4k|          p_[axes_[j]] = 0;
  306|  14.4k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  14.4k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.93k, False: 10.5k]
  ------------------
  308|  3.93k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 1, False: 3.93k]
  ------------------
  309|  3.93k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      1|              return false;
  311|      1|            }
  312|  3.93k|          }
  313|  14.4k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  14.4k|        }
  315|  1.80k|        *oit = p_;
  316|  1.80k|        ++oit;
  317|  1.80k|        ++num_decoded_points_;
  318|  1.80k|      }
  319|  1.05k|      continue;
  320|  1.05k|    }
  321|       |
  322|  66.9k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 66.9k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  66.9k|    const int num_remaining_bits = bit_length_ - level;
  327|  66.9k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  66.9k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  66.9k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  66.9k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  66.9k|    uint32_t number = 0;
  334|  66.9k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  66.9k|    uint32_t first_half = num_remaining_points / 2;
  337|  66.9k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 5, False: 66.9k]
  ------------------
  338|       |      // Invalid |number|.
  339|      5|      return false;
  340|      5|    }
  341|  66.9k|    first_half -= number;
  342|  66.9k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  66.9k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 33.8k, False: 33.1k]
  ------------------
  345|  33.8k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 28.1k, False: 5.68k]
  ------------------
  346|  28.1k|        std::swap(first_half, second_half);
  347|  28.1k|      }
  348|  33.8k|    }
  349|       |
  350|  66.9k|    levels_stack_[stack_pos][axis] += 1;
  351|  66.9k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  66.9k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 66.9k, False: 6]
  ------------------
  353|  66.9k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  66.9k|    }
  355|  66.9k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 66.9k, False: 62]
  ------------------
  356|  66.9k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  66.9k|    }
  358|  66.9k|  }
  359|      1|  return true;
  360|      7|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  136|   133k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|  66.9k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  66.9k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  66.9k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|      3|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   95|     18|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|      7|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      7|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 7]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      7|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 6]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|      6|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 6]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      6|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 5]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|      5|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 5]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      5|  num_decoded_points_ = 0;
  202|       |
  203|      5|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 5]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|      5|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 5]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      5|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 5]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      5|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 5]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      5|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 5, False: 0]
  ------------------
  217|      5|    return false;
  218|      5|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      5|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|      5|    uint32_t num_points, OutputIteratorT &oit) {
  254|      5|  typedef DecodingStatus Status;
  255|      5|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|      5|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|      5|  DecodingStatus init_status(num_points, 0, 0);
  258|      5|  std::stack<Status> status_stack;
  259|      5|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  34.9k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 34.9k, False: 0]
  ------------------
  263|  34.9k|    const DecodingStatus status = status_stack.top();
  264|  34.9k|    status_stack.pop();
  265|       |
  266|  34.9k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  34.9k|    const uint32_t last_axis = status.last_axis;
  268|  34.9k|    const uint32_t stack_pos = status.stack_pos;
  269|  34.9k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  34.9k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  34.9k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 34.9k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  34.9k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  34.9k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 34.9k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  34.9k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  34.9k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 17.1k, False: 17.7k]
  ------------------
  285|  68.9k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 51.7k, False: 17.1k]
  ------------------
  286|  51.7k|        *oit = old_base;
  287|  51.7k|        ++oit;
  288|  51.7k|        ++num_decoded_points_;
  289|  51.7k|      }
  290|  17.1k|      continue;
  291|  17.1k|    }
  292|       |
  293|  17.7k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  17.7k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 214, False: 17.5k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    214|      axes_[0] = axis;
  300|  2.48k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.27k, False: 214]
  ------------------
  301|  2.27k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.27k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 50, False: 2.22k]
  |  |  ------------------
  ------------------
  302|  2.27k|      }
  303|    591|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 379, False: 212]
  ------------------
  304|  4.53k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 4.15k, False: 377]
  ------------------
  305|  4.15k|          p_[axes_[j]] = 0;
  306|  4.15k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  4.15k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.57k, False: 1.58k]
  ------------------
  308|  2.57k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 2, False: 2.57k]
  ------------------
  309|  2.57k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      2|              return false;
  311|      2|            }
  312|  2.57k|          }
  313|  4.15k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  4.15k|        }
  315|    377|        *oit = p_;
  316|    377|        ++oit;
  317|    377|        ++num_decoded_points_;
  318|    377|      }
  319|    212|      continue;
  320|    214|    }
  321|       |
  322|  17.5k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 17.5k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  17.5k|    const int num_remaining_bits = bit_length_ - level;
  327|  17.5k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  17.5k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  17.5k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  17.5k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  17.5k|    uint32_t number = 0;
  334|  17.5k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  17.5k|    uint32_t first_half = num_remaining_points / 2;
  337|  17.5k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 3, False: 17.5k]
  ------------------
  338|       |      // Invalid |number|.
  339|      3|      return false;
  340|      3|    }
  341|  17.5k|    first_half -= number;
  342|  17.5k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  17.5k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 9.10k, False: 8.39k]
  ------------------
  345|  9.10k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 5.99k, False: 3.11k]
  ------------------
  346|  5.99k|        std::swap(first_half, second_half);
  347|  5.99k|      }
  348|  9.10k|    }
  349|       |
  350|  17.5k|    levels_stack_[stack_pos][axis] += 1;
  351|  17.5k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  17.5k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 17.4k, False: 20]
  ------------------
  353|  17.4k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  17.4k|    }
  355|  17.5k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 17.4k, False: 43]
  ------------------
  356|  17.4k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  17.4k|    }
  358|  17.5k|  }
  359|      0|  return true;
  360|      5|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  136|  34.9k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  34.9k|    uint32_t last_axis) {
  232|  34.9k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded - Ignored]
  ------------------
  233|  34.9k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  34.9k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 33.5k, False: 1.35k]
  |  |  ------------------
  ------------------
  234|  34.9k|  }
  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|  34.9k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  17.5k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  17.5k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  17.5k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|      1|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_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: 1, False: 4]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|      4|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 4]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      4|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 4]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      4|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 2, False: 2]
  ------------------
  199|      2|    return false;
  200|      2|  }
  201|      2|  num_decoded_points_ = 0;
  202|       |
  203|      2|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 2, False: 0]
  ------------------
  204|      2|    return false;
  205|      2|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   95|      6|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     13|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     13|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 13]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     13|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 4, False: 9]
  ------------------
  190|      4|    return false;
  191|      4|  }
  192|      9|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 9]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      9|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 2, False: 7]
  ------------------
  196|      2|    return true;
  197|      2|  }
  198|      7|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 1, False: 6]
  ------------------
  199|      1|    return false;
  200|      1|  }
  201|      6|  num_decoded_points_ = 0;
  202|       |
  203|      6|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 1, False: 5]
  ------------------
  204|      1|    return false;
  205|      1|  }
  206|      5|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 3]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|      3|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 2]
  ------------------
  210|      1|    return false;
  211|      1|  }
  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|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  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|     28|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 28, False: 0]
  ------------------
  263|     28|    const DecodingStatus status = status_stack.top();
  264|     28|    status_stack.pop();
  265|       |
  266|     28|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|     28|    const uint32_t last_axis = status.last_axis;
  268|     28|    const uint32_t stack_pos = status.stack_pos;
  269|     28|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|     28|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|     28|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 28]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|     28|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|     28|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 28]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|     28|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|     28|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 0, False: 28]
  ------------------
  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|     28|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|     28|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 2, False: 26]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|      2|      axes_[0] = axis;
  300|      4|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2, False: 2]
  ------------------
  301|      2|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|      2|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  302|      2|      }
  303|      4|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2, False: 2]
  ------------------
  304|      6|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 4, False: 2]
  ------------------
  305|      4|          p_[axes_[j]] = 0;
  306|      4|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|      4|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 4, False: 0]
  ------------------
  308|      4|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 0, False: 4]
  ------------------
  309|      4|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      0|              return false;
  311|      0|            }
  312|      4|          }
  313|      4|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|      4|        }
  315|      2|        *oit = p_;
  316|      2|        ++oit;
  317|      2|        ++num_decoded_points_;
  318|      2|      }
  319|      2|      continue;
  320|      2|    }
  321|       |
  322|     26|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 26]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|     26|    const int num_remaining_bits = bit_length_ - level;
  327|     26|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|     26|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|     26|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|     26|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|     26|    uint32_t number = 0;
  334|     26|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|     26|    uint32_t first_half = num_remaining_points / 2;
  337|     26|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 2, False: 24]
  ------------------
  338|       |      // Invalid |number|.
  339|      2|      return false;
  340|      2|    }
  341|     24|    first_half -= number;
  342|     24|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|     24|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 22, False: 2]
  ------------------
  345|     22|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 22, False: 0]
  ------------------
  346|     22|        std::swap(first_half, second_half);
  347|     22|      }
  348|     22|    }
  349|       |
  350|     24|    levels_stack_[stack_pos][axis] += 1;
  351|     24|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|     24|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 24, False: 0]
  ------------------
  353|     24|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|     24|    }
  355|     24|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 24, False: 0]
  ------------------
  356|     24|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|     24|    }
  358|     24|  }
  359|      0|  return true;
  360|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  136|    443|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|    405|    uint32_t last_axis) {
  232|    405|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded - Ignored]
  ------------------
  233|    405|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|    405|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 121, False: 284]
  |  |  ------------------
  ------------------
  234|    405|  }
  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|    405|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  127|    223|  void DecodeNumber(int nbits, uint32_t *value) {
  128|    223|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|    223|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  118|      1|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     70|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     70|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 70]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     70|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 70]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     70|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 70]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     70|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 70]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     70|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 70]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     70|  num_decoded_points_ = 0;
  202|       |
  203|     70|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 7, False: 63]
  ------------------
  204|      7|    return false;
  205|      7|  }
  206|     63|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 61]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     61|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 61]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     61|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 60]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     60|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 42, False: 18]
  ------------------
  217|     42|    return false;
  218|     42|  }
  219|       |
  220|     18|  numbers_decoder_.EndDecoding();
  221|     18|  remaining_bits_decoder_.EndDecoding();
  222|     18|  axis_decoder_.EndDecoding();
  223|     18|  half_decoder_.EndDecoding();
  224|       |
  225|     18|  return true;
  226|     60|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     60|    uint32_t num_points, OutputIteratorT &oit) {
  254|     60|  typedef DecodingStatus Status;
  255|     60|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     60|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     60|  DecodingStatus init_status(num_points, 0, 0);
  258|     60|  std::stack<Status> status_stack;
  259|     60|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.40M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.40M, False: 18]
  ------------------
  263|  2.40M|    const DecodingStatus status = status_stack.top();
  264|  2.40M|    status_stack.pop();
  265|       |
  266|  2.40M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.40M|    const uint32_t last_axis = status.last_axis;
  268|  2.40M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.40M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.40M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.40M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.40M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.40M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.40M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.40M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.40M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.40M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.13M, False: 1.27M]
  ------------------
  285|  51.4M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 50.3M, False: 1.13M]
  ------------------
  286|  50.3M|        *oit = old_base;
  287|  50.3M|        ++oit;
  288|  50.3M|        ++num_decoded_points_;
  289|  50.3M|      }
  290|  1.13M|      continue;
  291|  1.13M|    }
  292|       |
  293|  1.27M|    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.27M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 69.4k, False: 1.20M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  69.4k|      axes_[0] = axis;
  300|  91.1k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 21.7k, False: 69.4k]
  ------------------
  301|  21.7k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  21.7k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 6.60k, False: 15.1k]
  |  |  ------------------
  ------------------
  302|  21.7k|      }
  303|   183k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 113k, False: 69.3k]
  ------------------
  304|   259k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 146k, False: 113k]
  ------------------
  305|   146k|          p_[axes_[j]] = 0;
  306|   146k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   146k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 130k, False: 15.7k]
  ------------------
  308|   130k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 36, False: 130k]
  ------------------
  309|   130k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     36|              return false;
  311|     36|            }
  312|   130k|          }
  313|   146k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   146k|        }
  315|   113k|        *oit = p_;
  316|   113k|        ++oit;
  317|   113k|        ++num_decoded_points_;
  318|   113k|      }
  319|  69.3k|      continue;
  320|  69.4k|    }
  321|       |
  322|  1.20M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.20M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.20M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.20M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.20M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.20M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.20M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.20M|    uint32_t number = 0;
  334|  1.20M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.20M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.20M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 6, False: 1.20M]
  ------------------
  338|       |      // Invalid |number|.
  339|      6|      return false;
  340|      6|    }
  341|  1.20M|    first_half -= number;
  342|  1.20M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.20M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.14M, False: 64.0k]
  ------------------
  345|  1.14M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.12M, False: 19.5k]
  ------------------
  346|  1.12M|        std::swap(first_half, second_half);
  347|  1.12M|      }
  348|  1.14M|    }
  349|       |
  350|  1.20M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.20M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.20M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.20M, False: 2.05k]
  ------------------
  353|  1.20M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.20M|    }
  355|  1.20M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.20M, False: 3.26k]
  ------------------
  356|  1.20M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.20M|    }
  358|  1.20M|  }
  359|     18|  return true;
  360|     60|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  136|  2.40M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|  1.20M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.20M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.20M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     18|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   95|     73|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     38|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     38|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 38]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     38|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 38]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     38|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 38]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     38|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 38]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     38|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 38]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     38|  num_decoded_points_ = 0;
  202|       |
  203|     38|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 38]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|     38|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 37]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     37|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 37]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     37|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 36]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     36|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 18, False: 18]
  ------------------
  217|     18|    return false;
  218|     18|  }
  219|       |
  220|     18|  numbers_decoder_.EndDecoding();
  221|     18|  remaining_bits_decoder_.EndDecoding();
  222|     18|  axis_decoder_.EndDecoding();
  223|     18|  half_decoder_.EndDecoding();
  224|       |
  225|     18|  return true;
  226|     36|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     36|    uint32_t num_points, OutputIteratorT &oit) {
  254|     36|  typedef DecodingStatus Status;
  255|     36|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     36|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     36|  DecodingStatus init_status(num_points, 0, 0);
  258|     36|  std::stack<Status> status_stack;
  259|     36|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.35M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.35M, False: 18]
  ------------------
  263|  2.35M|    const DecodingStatus status = status_stack.top();
  264|  2.35M|    status_stack.pop();
  265|       |
  266|  2.35M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.35M|    const uint32_t last_axis = status.last_axis;
  268|  2.35M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.35M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.35M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.35M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.35M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.35M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.35M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.35M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.35M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.35M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.13M, False: 1.21M]
  ------------------
  285|  65.6M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 64.5M, False: 1.13M]
  ------------------
  286|  64.5M|        *oit = old_base;
  287|  64.5M|        ++oit;
  288|  64.5M|        ++num_decoded_points_;
  289|  64.5M|      }
  290|  1.13M|      continue;
  291|  1.13M|    }
  292|       |
  293|  1.21M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  1.21M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 27.3k, False: 1.18M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  27.3k|      axes_[0] = axis;
  300|   113k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 86.3k, False: 27.3k]
  ------------------
  301|  86.3k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  86.3k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 849, False: 85.4k]
  |  |  ------------------
  ------------------
  302|  86.3k|      }
  303|  74.7k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 47.4k, False: 27.3k]
  ------------------
  304|   248k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 200k, False: 47.3k]
  ------------------
  305|   200k|          p_[axes_[j]] = 0;
  306|   200k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   200k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 50.7k, False: 149k]
  ------------------
  308|  50.7k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 15, False: 50.7k]
  ------------------
  309|  50.7k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     15|              return false;
  311|     15|            }
  312|  50.7k|          }
  313|   200k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   200k|        }
  315|  47.3k|        *oit = p_;
  316|  47.3k|        ++oit;
  317|  47.3k|        ++num_decoded_points_;
  318|  47.3k|      }
  319|  27.3k|      continue;
  320|  27.3k|    }
  321|       |
  322|  1.18M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.18M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.18M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.18M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.18M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.18M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.18M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.18M|    uint32_t number = 0;
  334|  1.18M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.18M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.18M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 3, False: 1.18M]
  ------------------
  338|       |      // Invalid |number|.
  339|      3|      return false;
  340|      3|    }
  341|  1.18M|    first_half -= number;
  342|  1.18M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.18M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.14M, False: 42.8k]
  ------------------
  345|  1.14M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.12M, False: 13.5k]
  ------------------
  346|  1.12M|        std::swap(first_half, second_half);
  347|  1.12M|      }
  348|  1.14M|    }
  349|       |
  350|  1.18M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.18M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.18M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.17M, False: 5.96k]
  ------------------
  353|  1.17M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.17M|    }
  355|  1.18M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.17M, False: 12.4k]
  ------------------
  356|  1.17M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.17M|    }
  358|  1.18M|  }
  359|     18|  return true;
  360|     36|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  136|  2.35M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.35M|    uint32_t last_axis) {
  232|  2.35M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded - Ignored]
  ------------------
  233|  2.35M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.35M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.35M, False: 993k]
  |  |  ------------------
  ------------------
  234|  2.35M|  }
  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.35M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|  1.18M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.18M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.18M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     18|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     47|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     47|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 47]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     47|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 46]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     46|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 46]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     46|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 8, False: 38]
  ------------------
  196|      8|    return true;
  197|      8|  }
  198|     38|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 3, False: 35]
  ------------------
  199|      3|    return false;
  200|      3|  }
  201|     35|  num_decoded_points_ = 0;
  202|       |
  203|     35|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 5, False: 30]
  ------------------
  204|      5|    return false;
  205|      5|  }
  206|     30|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 28]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     28|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 28]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     28|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 27]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     27|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 23, False: 4]
  ------------------
  217|     23|    return false;
  218|     23|  }
  219|       |
  220|      4|  numbers_decoder_.EndDecoding();
  221|      4|  remaining_bits_decoder_.EndDecoding();
  222|      4|  axis_decoder_.EndDecoding();
  223|      4|  half_decoder_.EndDecoding();
  224|       |
  225|      4|  return true;
  226|     27|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     27|    uint32_t num_points, OutputIteratorT &oit) {
  254|     27|  typedef DecodingStatus Status;
  255|     27|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     27|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     27|  DecodingStatus init_status(num_points, 0, 0);
  258|     27|  std::stack<Status> status_stack;
  259|     27|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  46.1k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 46.1k, False: 4]
  ------------------
  263|  46.1k|    const DecodingStatus status = status_stack.top();
  264|  46.1k|    status_stack.pop();
  265|       |
  266|  46.1k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  46.1k|    const uint32_t last_axis = status.last_axis;
  268|  46.1k|    const uint32_t stack_pos = status.stack_pos;
  269|  46.1k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  46.1k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  46.1k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 46.1k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  46.1k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  46.1k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 46.1k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  46.1k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  46.1k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 56, False: 46.0k]
  ------------------
  285|    405|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 349, False: 56]
  ------------------
  286|    349|        *oit = old_base;
  287|    349|        ++oit;
  288|    349|        ++num_decoded_points_;
  289|    349|      }
  290|     56|      continue;
  291|     56|    }
  292|       |
  293|  46.0k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  46.0k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 91, False: 45.9k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|     91|      axes_[0] = axis;
  300|  4.37k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 4.28k, False: 91]
  ------------------
  301|  4.28k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  4.28k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 84, False: 4.19k]
  |  |  ------------------
  ------------------
  302|  4.28k|      }
  303|    209|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 126, False: 83]
  ------------------
  304|  5.57k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 5.45k, False: 118]
  ------------------
  305|  5.45k|          p_[axes_[j]] = 0;
  306|  5.45k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  5.45k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 5.22k, False: 231]
  ------------------
  308|  5.22k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 8, False: 5.21k]
  ------------------
  309|  5.22k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      8|              return false;
  311|      8|            }
  312|  5.22k|          }
  313|  5.44k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  5.44k|        }
  315|    118|        *oit = p_;
  316|    118|        ++oit;
  317|    118|        ++num_decoded_points_;
  318|    118|      }
  319|     83|      continue;
  320|     91|    }
  321|       |
  322|  45.9k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 45.9k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  45.9k|    const int num_remaining_bits = bit_length_ - level;
  327|  45.9k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  45.9k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  45.9k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  45.9k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  45.9k|    uint32_t number = 0;
  334|  45.9k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  45.9k|    uint32_t first_half = num_remaining_points / 2;
  337|  45.9k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 15, False: 45.9k]
  ------------------
  338|       |      // Invalid |number|.
  339|     15|      return false;
  340|     15|    }
  341|  45.9k|    first_half -= number;
  342|  45.9k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  45.9k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 45.9k, False: 11]
  ------------------
  345|  45.9k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 39.8k, False: 6.08k]
  ------------------
  346|  39.8k|        std::swap(first_half, second_half);
  347|  39.8k|      }
  348|  45.9k|    }
  349|       |
  350|  45.9k|    levels_stack_[stack_pos][axis] += 1;
  351|  45.9k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  45.9k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 39.9k, False: 6.05k]
  ------------------
  353|  39.9k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  39.9k|    }
  355|  45.9k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 6.22k, False: 39.7k]
  ------------------
  356|  6.22k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  6.22k|    }
  358|  45.9k|  }
  359|      4|  return true;
  360|     27|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  136|  46.1k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|  45.9k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  45.9k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  45.9k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     12|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   95|     48|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      8|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      8|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      8|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   95|     10|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      6|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      6|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      6|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      3|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      3|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      3|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   95|     28|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      6|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      6|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      6|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      1|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      1|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   95|     38|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   133k|    uint32_t last_axis) {
  232|   133k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded - Ignored]
  ------------------
  233|   133k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|   133k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 33.7k, False: 100k]
  |  |  ------------------
  ------------------
  234|   133k|  }
  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|   133k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.40M|    uint32_t last_axis) {
  232|  2.40M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded - Ignored]
  ------------------
  233|  2.40M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.40M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.31M, False: 91.6k]
  |  |  ------------------
  ------------------
  234|  2.40M|  }
  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.40M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  46.1k|    uint32_t last_axis) {
  232|  46.1k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded - Ignored]
  ------------------
  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|  46.1k|  uint32_t best_axis = 0;
  237|  46.1k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 46.1k, False: 5]
  ------------------
  238|  4.27M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 4.23M, False: 46.1k]
  ------------------
  239|  4.23M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 45.2k, False: 4.18M]
  ------------------
  240|  45.2k|        best_axis = axis;
  241|  45.2k|      }
  242|  4.23M|    }
  243|  46.1k|  } else {
  244|      5|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      5|  }
  246|       |
  247|  46.1k|  return best_axis;
  248|  46.1k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      7|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      7|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      7|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      7|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      7|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 7]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      7|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 7]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      7|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 7]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      7|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 7]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      7|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 7]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      7|  num_decoded_points_ = 0;
  202|       |
  203|      7|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 6, False: 1]
  ------------------
  204|      6|    return false;
  205|      6|  }
  206|      1|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 0]
  ------------------
  207|      1|    return false;
  208|      1|  }
  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|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      3|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      3|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      3|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      3|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      3|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 3]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      3|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 3]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      3|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 3]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      3|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 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: 0, False: 2]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      2|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 0]
  ------------------
  213|      2|    return false;
  214|      2|  }
  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|      1|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      1|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_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: 0, False: 1]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      1|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 1]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      1|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 1]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      1|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 1]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      1|  num_decoded_points_ = 0;
  202|       |
  203|      1|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 1, False: 0]
  ------------------
  204|      1|    return false;
  205|      1|  }
  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|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     15|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     15|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     15|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     15|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 15]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     15|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 15]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     15|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 15]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     15|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 14]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     14|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 14]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     14|  num_decoded_points_ = 0;
  202|       |
  203|     14|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 7, False: 7]
  ------------------
  204|      7|    return false;
  205|      7|  }
  206|      7|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 5]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|      5|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 4, False: 1]
  ------------------
  210|      4|    return false;
  211|      4|  }
  212|      1|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 1]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      1|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 1, False: 0]
  ------------------
  217|      1|    return false;
  218|      1|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  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|    377|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 377, False: 0]
  ------------------
  263|    377|    const DecodingStatus status = status_stack.top();
  264|    377|    status_stack.pop();
  265|       |
  266|    377|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|    377|    const uint32_t last_axis = status.last_axis;
  268|    377|    const uint32_t stack_pos = status.stack_pos;
  269|    377|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|    377|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|    377|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 377]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|    377|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|    377|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 377]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|    377|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|    377|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 180, False: 197]
  ------------------
  285|   164k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 164k, False: 180]
  ------------------
  286|   164k|        *oit = old_base;
  287|   164k|        ++oit;
  288|   164k|        ++num_decoded_points_;
  289|   164k|      }
  290|    180|      continue;
  291|    180|    }
  292|       |
  293|    197|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|    197|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 0, False: 197]
  ------------------
  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|    197|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 197]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|    197|    const int num_remaining_bits = bit_length_ - level;
  327|    197|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|    197|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|    197|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|    197|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|    197|    uint32_t number = 0;
  334|    197|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|    197|    uint32_t first_half = num_remaining_points / 2;
  337|    197|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 196]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|    196|    first_half -= number;
  342|    196|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|    196|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 101, False: 95]
  ------------------
  345|    101|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 54, False: 47]
  ------------------
  346|     54|        std::swap(first_half, second_half);
  347|     54|      }
  348|    101|    }
  349|       |
  350|    196|    levels_stack_[stack_pos][axis] += 1;
  351|    196|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|    196|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 196, False: 0]
  ------------------
  353|    196|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|    196|    }
  355|    196|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 196, False: 0]
  ------------------
  356|    196|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|    196|    }
  358|    196|  }
  359|      0|  return true;
  360|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      3|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      3|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      3|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      3|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      3|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 3]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      3|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 3]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      3|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 3]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      3|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 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|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_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|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_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: 0, False: 1]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      1|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 1]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      1|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 1]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      1|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 1]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      1|  num_decoded_points_ = 0;
  202|       |
  203|      1|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 1, False: 0]
  ------------------
  204|      1|    return false;
  205|      1|  }
  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|     34|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|     34|  qinfo_.quantization_bits = 0;
   67|     34|  qinfo_.range = 0;
   68|     34|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|     33|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|     33|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 0, False: 33]
  ------------------
   73|      0|    return false;
   74|      0|  }
   75|     33|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 0, False: 33]
  ------------------
   76|      0|    return false;
   77|      0|  }
   78|     33|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 0, False: 33]
  ------------------
   79|      0|    return false;
   80|      0|  }
   81|     33|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 0, False: 33]
  ------------------
   82|      0|    return false;
   83|      0|  }
   84|     33|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 0, False: 33]
  |  Branch (84:38): [True: 0, False: 0]
  ------------------
   85|      0|    return false;
   86|      0|  }
   87|     33|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 0, False: 33]
  ------------------
   88|      0|    return false;
   89|      0|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|     33|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 3, False: 30]
  ------------------
   93|      3|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|      3|#define DRACO_LOGE printf
  ------------------
   94|      3|               compression_level_);
   95|      3|    return false;
   96|      3|  }
   97|       |
   98|     30|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|     30|      std::back_inserter(*qpoints);
  100|     30|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|     30|                           Converter>
  102|     30|      oit(oit_qpoints);
  103|     30|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 30, False: 0]
  ------------------
  104|     30|    qpoints->reserve(num_points_);
  105|     30|    switch (compression_level_) {
  106|      7|      case 0: {
  ------------------
  |  Branch (106:7): [True: 7, False: 23]
  ------------------
  107|      7|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|      7|        qpoints_decoder.DecodePoints(buffer, oit);
  109|      7|        break;
  110|      0|      }
  111|      3|      case 1: {
  ------------------
  |  Branch (111:7): [True: 3, False: 27]
  ------------------
  112|      3|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|      3|        qpoints_decoder.DecodePoints(buffer, oit);
  114|      3|        break;
  115|      0|      }
  116|      1|      case 2: {
  ------------------
  |  Branch (116:7): [True: 1, False: 29]
  ------------------
  117|      1|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|      1|        qpoints_decoder.DecodePoints(buffer, oit);
  119|      1|        break;
  120|      0|      }
  121|     15|      case 3: {
  ------------------
  |  Branch (121:7): [True: 15, False: 15]
  ------------------
  122|     15|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|     15|        qpoints_decoder.DecodePoints(buffer, oit);
  124|     15|        break;
  125|      0|      }
  126|      3|      case 4: {
  ------------------
  |  Branch (126:7): [True: 3, False: 27]
  ------------------
  127|      3|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|      3|        qpoints_decoder.DecodePoints(buffer, oit);
  129|      3|        break;
  130|      0|      }
  131|      0|      case 5: {
  ------------------
  |  Branch (131:7): [True: 0, False: 30]
  ------------------
  132|      0|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|      0|        qpoints_decoder.DecodePoints(buffer, oit);
  134|      0|        break;
  135|      0|      }
  136|      1|      case 6: {
  ------------------
  |  Branch (136:7): [True: 1, False: 29]
  ------------------
  137|      1|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|      1|        qpoints_decoder.DecodePoints(buffer, oit);
  139|      1|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 30]
  ------------------
  142|      0|        return false;
  143|     30|    }
  144|     30|  }
  145|       |
  146|     30|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 30, False: 0]
  ------------------
  147|     30|    return false;
  148|     30|  }
  149|      0|  return true;
  150|     30|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|     30|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|   164k|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|   164k|  const Self &operator=(const SourceType &source) {
   56|   164k|    *oit_ = Converter()(source);
   57|   164k|    return *this;
   58|   164k|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|   164k|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|   164k|    return Point3ui(v[0], v[1], v[2]);
   31|   164k|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|   164k|  const Self &operator++() {
   46|   164k|    ++oit_;
   47|   164k|    return *this;
   48|   164k|  }

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

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

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

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

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

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

_ZN5draco18MostSignificantBitEj:
   58|  2.52M|inline int MostSignificantBit(uint32_t n) {
   59|  2.52M|#if defined(__GNUC__)
   60|  2.52M|  return 31 ^ __builtin_clz(n);
   61|       |#elif defined(_MSC_VER)
   62|       |
   63|       |  unsigned long where;
   64|       |  _BitScanReverse(&where, n);
   65|       |  return (int)where;
   66|       |#else
   67|       |  // TODO(fgalligan): Optimize this code.
   68|       |  int msb = -1;
   69|       |  while (n != 0) {
   70|       |    msb++;
   71|       |    n >>= 1;
   72|       |  }
   73|       |  return msb;
   74|       |#endif
   75|  2.52M|}
_ZN5draco24ConvertSymbolToSignedIntIjEENSt3__111make_signedIT_E4typeES3_:
  109|  1.19M|    IntTypeT val) {
  110|  1.19M|  static_assert(std::is_integral<IntTypeT>::value, "IntTypeT is not integral.");
  111|  1.19M|  typedef typename std::make_signed<IntTypeT>::type SignedType;
  112|  1.19M|  const bool is_positive = !static_cast<bool>(val & 1);
  113|  1.19M|  val >>= 1;
  114|  1.19M|  if (is_positive) {
  ------------------
  |  Branch (114:7): [True: 1.05M, False: 141k]
  ------------------
  115|  1.05M|    return static_cast<SignedType>(val);
  116|  1.05M|  }
  117|   141k|  SignedType ret = static_cast<SignedType>(val);
  118|   141k|  ret = -ret - 1;
  119|   141k|  return ret;
  120|  1.19M|}

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  23.2M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  23.2M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 23.2M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  23.2M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  23.2M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|  1.39M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|  1.39M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 16, False: 1.39M]
  ------------------
   78|     16|      return false;  // Buffer overflow.
   79|     16|    }
   80|  1.39M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|  1.39M|    pos_ += size_to_decode;
   82|  1.39M|    return true;
   83|  1.39M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  5.93k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|    801|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  6.61k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|  78.9k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|    286|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  23.2M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  2.12M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|    426|    inline void reset(const void *b, size_t s) {
  131|    426|      bit_offset_ = 0;
  132|    426|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|    426|      bit_buffer_end_ = bit_buffer_ + s;
  134|    426|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|    332|    inline uint64_t BitsDecoded() const {
  138|    332|      return static_cast<uint64_t>(bit_offset_);
  139|    332|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  23.2M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  23.2M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 0, False: 23.2M]
  ------------------
  162|      0|        return false;
  163|      0|      }
  164|  23.2M|      uint32_t value = 0;
  165|  54.9M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 31.6M, False: 23.2M]
  ------------------
  166|  31.6M|        value |= GetBit() << bit;
  167|  31.6M|      }
  168|  23.2M|      *x = value;
  169|  23.2M|      return true;
  170|  23.2M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  31.6M|    inline int GetBit() {
  176|  31.6M|      const size_t off = bit_offset_;
  177|  31.6M|      const size_t byte_offset = off >> 3;
  178|  31.6M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  31.6M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 27.0M, False: 4.62M]
  ------------------
  180|  27.0M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  27.0M|        bit_offset_ = off + 1;
  182|  27.0M|        return bit;
  183|  27.0M|      }
  184|  4.62M|      return 0;
  185|  31.6M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  4.31M|  bool Decode(T *out_val) {
   69|  4.31M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 118, False: 4.31M]
  ------------------
   70|    118|      return false;
   71|    118|    }
   72|  4.31M|    pos_ += sizeof(T);
   73|  4.31M|    return true;
   74|  4.31M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  4.31M|  bool Peek(T *out_val) {
   88|  4.31M|    const size_t size_to_decode = sizeof(T);
   89|  4.31M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 118, False: 4.31M]
  ------------------
   90|    118|      return false;  // Buffer overflow.
   91|    118|    }
   92|  4.31M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  4.31M|    return true;
   94|  4.31M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|    876|  bool Decode(T *out_val) {
   69|    876|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 4, False: 872]
  ------------------
   70|      4|      return false;
   71|      4|    }
   72|    872|    pos_ += sizeof(T);
   73|    872|    return true;
   74|    876|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|    876|  bool Peek(T *out_val) {
   88|    876|    const size_t size_to_decode = sizeof(T);
   89|    876|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 4, False: 872]
  ------------------
   90|      4|      return false;  // Buffer overflow.
   91|      4|    }
   92|    872|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    872|    return true;
   94|    876|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   220k|  bool Decode(T *out_val) {
   69|   220k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 19, False: 220k]
  ------------------
   70|     19|      return false;
   71|     19|    }
   72|   220k|    pos_ += sizeof(T);
   73|   220k|    return true;
   74|   220k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   220k|  bool Peek(T *out_val) {
   88|   220k|    const size_t size_to_decode = sizeof(T);
   89|   220k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 19, False: 220k]
  ------------------
   90|     19|      return false;  // Buffer overflow.
   91|     19|    }
   92|   220k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   220k|    return true;
   94|   220k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  1.56k|  bool Decode(T *out_val) {
   69|  1.56k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 1, False: 1.56k]
  ------------------
   70|      1|      return false;
   71|      1|    }
   72|  1.56k|    pos_ += sizeof(T);
   73|  1.56k|    return true;
   74|  1.56k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  1.56k|  bool Peek(T *out_val) {
   88|  1.56k|    const size_t size_to_decode = sizeof(T);
   89|  1.56k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 1, False: 1.56k]
  ------------------
   90|      1|      return false;  // Buffer overflow.
   91|      1|    }
   92|  1.56k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.56k|    return true;
   94|  1.56k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   472k|  bool Decode(T *out_val) {
   69|   472k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 30, False: 472k]
  ------------------
   70|     30|      return false;
   71|     30|    }
   72|   472k|    pos_ += sizeof(T);
   73|   472k|    return true;
   74|   472k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   472k|  bool Peek(T *out_val) {
   88|   472k|    const size_t size_to_decode = sizeof(T);
   89|   472k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 30, False: 472k]
  ------------------
   90|     30|      return false;  // Buffer overflow.
   91|     30|    }
   92|   472k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   472k|    return true;
   94|   472k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|   216k|  bool Decode(T *out_val) {
   69|   216k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 4, False: 216k]
  ------------------
   70|      4|      return false;
   71|      4|    }
   72|   216k|    pos_ += sizeof(T);
   73|   216k|    return true;
   74|   216k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|   216k|  bool Peek(T *out_val) {
   88|   216k|    const size_t size_to_decode = sizeof(T);
   89|   216k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 4, False: 216k]
  ------------------
   90|      4|      return false;  // Buffer overflow.
   91|      4|    }
   92|   216k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   216k|    return true;
   94|   216k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|    190|  bool Decode(T *out_val) {
   69|    190|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 190]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|    190|    pos_ += sizeof(T);
   73|    190|    return true;
   74|    190|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|    190|  bool Peek(T *out_val) {
   88|    190|    const size_t size_to_decode = sizeof(T);
   89|    190|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 190]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|    190|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    190|    return true;
   94|    190|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|     63|  bool Decode(T *out_val) {
   69|     63|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 63]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|     63|    pos_ += sizeof(T);
   73|     63|    return true;
   74|     63|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|     63|  bool Peek(T *out_val) {
   88|     63|    const size_t size_to_decode = sizeof(T);
   89|     63|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 63]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|     63|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|     63|    return true;
   94|     63|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   72|   118M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   72|   419M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   97|   199k|  constexpr bool operator>=(const ValueTypeT &val) const {
   98|   199k|    return value_ >= val;
   99|   199k|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   72|  29.2M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   72|   442M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   89|   429k|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  150|  2.67M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  151|  2.67M|    value_ = i.value_;
  152|  2.67M|    return *this;
  153|  2.67M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  150|   664k|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  151|   664k|    value_ = i.value_;
  152|   664k|    return *this;
  153|   664k|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  101|   426k|  inline ThisIndexType &operator++() {
  102|   426k|    ++value_;
  103|   426k|    return *this;
  104|   426k|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   74|   293M|  constexpr bool operator==(const IndexType &i) const {
   75|   293M|    return value_ == i.value_;
   76|   293M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   72|   120M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   86|  1.52k|  constexpr bool operator<(const IndexType &i) const {
   87|  1.52k|    return value_ < i.value_;
   88|  1.52k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   74|  22.6M|  constexpr bool operator==(const IndexType &i) const {
   75|  22.6M|    return value_ == i.value_;
   76|  22.6M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  130|  10.7M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  131|  10.7M|    return ThisIndexType(value_ - val);
  132|  10.7M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  124|   135M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  125|   135M|    return ThisIndexType(value_ + val);
  126|   135M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   74|  96.5k|  constexpr bool operator==(const IndexType &i) const {
   75|  96.5k|    return value_ == i.value_;
   76|  96.5k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   80|  45.9M|  constexpr bool operator!=(const IndexType &i) const {
   81|  45.9M|    return value_ != i.value_;
   82|  45.9M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   80|  44.4M|  constexpr bool operator!=(const IndexType &i) const {
   81|  44.4M|    return value_ != i.value_;
   82|  44.4M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  101|  76.2M|  inline ThisIndexType &operator++() {
  102|  76.2M|    ++value_;
  103|  76.2M|    return *this;
  104|  76.2M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  150|  85.1M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  151|  85.1M|    value_ = i.value_;
  152|  85.1M|    return *this;
  153|  85.1M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  150|   189M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  151|   189M|    value_ = i.value_;
  152|   189M|    return *this;
  153|   189M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   97|   681k|  constexpr bool operator>=(const ValueTypeT &val) const {
   98|   681k|    return value_ >= val;
   99|   681k|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   89|   175k|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   70|   175M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   70|  28.3M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|  40.3M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  124|  5.07M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  125|  5.07M|    return ThisIndexType(value_ + val);
  126|  5.07M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   70|  28.0M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   86|   520k|  constexpr bool operator<(const IndexType &i) const {
   87|   520k|    return value_ < i.value_;
   88|   520k|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|  1.07M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   70|   420M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  150|  85.3k|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  151|  85.3k|    value_ = i.value_;
  152|  85.3k|    return *this;
  153|  85.3k|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  138|   174k|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  139|   174k|    value_ += val;
  140|   174k|    return *this;
  141|   174k|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  154|  1.01M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  155|  1.01M|    value_ = val;
  156|  1.01M|    return *this;
  157|  1.01M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   70|  66.1k|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   89|   344k|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  101|   344k|  inline ThisIndexType &operator++() {
  102|   344k|    ++value_;
  103|   344k|    return *this;
  104|   344k|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   89|   474k|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   89|     42|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  101|   418M|  inline ThisIndexType &operator++() {
  102|   418M|    ++value_;
  103|   418M|    return *this;
  104|   418M|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  101|     34|  inline ThisIndexType &operator++() {
  102|     34|    ++value_;
  103|     34|    return *this;
  104|     34|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   97|   417M|  constexpr bool operator>=(const ValueTypeT &val) const {
   98|   417M|    return value_ >= val;
   99|   417M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|   947k|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   947k|    return vector_[index.value()];
   75|   947k|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|   475k|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  1.19k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  2.64k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  1.15M|  inline reference operator[](const IndexTypeT &index) {
   71|  1.15M|    return vector_[index.value()];
   72|  1.15M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|   137k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|   402k|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|    168|  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|   199k|  inline reference operator[](const IndexTypeT &index) {
   71|   199k|    return vector_[index.value()];
   72|   199k|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|   275k|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   275k|    return vector_[index.value()];
   75|   275k|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|  37.2M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|   692k|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|  42.6M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  42.6M|    return vector_[index.value()];
   75|  42.6M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   112M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   112M|    return vector_[index.value()];
   75|   112M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|  83.1M|  inline reference operator[](const IndexTypeT &index) {
   71|  83.1M|    return vector_[index.value()];
   72|  83.1M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  12.5M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  12.5M|    return vector_[index.value()];
   75|  12.5M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|  73.9M|  inline reference operator[](const IndexTypeT &index) {
   71|  73.9M|    return vector_[index.value()];
   72|  73.9M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  20.9M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|  45.5M|  inline reference operator[](const IndexTypeT &index) {
   71|  45.5M|    return vector_[index.value()];
   72|  45.5M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|     95|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|  12.7M|  inline reference operator[](const IndexTypeT &index) {
   71|  12.7M|    return vector_[index.value()];
   72|  12.7M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  2.02k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  1.23k|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  1.88k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|    342|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|    342|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|    342|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|    342|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|    720|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|    720|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|    720|    vector_.swap(arg.vector_);
   57|    720|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|    720|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|    720|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|    720|    vector_.swap(arg.vector_);
   57|    720|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|    342|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|    342|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|    342|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|    548|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  10.6k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  13.5k|int32_t DataTypeLength(DataType dt) {
   20|  13.5k|  switch (dt) {
   21|  4.66k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 4.66k, False: 8.84k]
  ------------------
   22|  6.64k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 1.97k, False: 11.5k]
  ------------------
   23|  6.64k|      return 1;
   24|  3.96k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 3.96k, False: 9.54k]
  ------------------
   25|  4.17k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 214, False: 13.2k]
  ------------------
   26|  4.17k|      return 2;
   27|  2.20k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 2.20k, False: 11.3k]
  ------------------
   28|  2.40k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 199, False: 13.3k]
  ------------------
   29|  2.40k|      return 4;
   30|      2|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 2, False: 13.5k]
  ------------------
   31|      8|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 6, False: 13.4k]
  ------------------
   32|      8|      return 8;
   33|    270|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 270, False: 13.2k]
  ------------------
   34|    270|      return 4;
   35|      0|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 0, False: 13.5k]
  ------------------
   36|      0|      return 8;
   37|      3|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 3, False: 13.5k]
  ------------------
   38|      3|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 13.5k]
  ------------------
   40|      0|      return -1;
   41|  13.5k|  }
   42|  13.5k|}

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

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    253|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    548|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|    801|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|    801|  bool ok() const { return status_.ok(); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|    770|  StatusOr(const Status &status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|    801|  T &&value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|     31|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|    253|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|    253|  T &&value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|    548|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|    548|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   206k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   206k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded - Ignored]
  ------------------
   65|   206k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 60, False: 206k]
  ------------------
   66|     60|      return false;
   67|     60|    }
   68|   206k|  } 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|   206k|  return true;
   77|   206k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  74.2k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  74.2k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  74.2k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 7, False: 74.1k]
  ------------------
   33|      7|    return false;
   34|      7|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  74.1k|  uint8_t in;
   39|  74.1k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 34, False: 74.1k]
  ------------------
   40|     34|    return false;
   41|     34|  }
   42|  74.1k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.93k, False: 71.2k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.93k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 37, False: 2.89k]
  ------------------
   45|     37|      return false;
   46|     37|    }
   47|       |    // Append decoded info from this byte.
   48|  2.89k|    *out_val <<= 7;
   49|  2.89k|    *out_val |= in & ((1 << 7) - 1);
   50|  71.2k|  } else {
   51|       |    // Last byte reached
   52|  71.2k|    *out_val = in;
   53|  71.2k|  }
   54|  74.1k|  return true;
   55|  74.1k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|    196|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    196|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    196|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 196]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    196|  uint8_t in;
   39|    196|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 196]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    196|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 26, False: 170]
  ------------------
   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|    170|  } else {
   51|       |    // Last byte reached
   52|    170|    *out_val = in;
   53|    170|  }
   54|    196|  return true;
   55|    196|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|    181|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|    181|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded - Ignored]
  ------------------
   65|    181|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 181]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|    181|  } 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|    181|  return true;
   77|    181|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|    149|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    149|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    149|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 149]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    149|  uint8_t in;
   39|    149|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 149]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    149|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 9, False: 140]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|      9|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 9]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|      9|    *out_val <<= 7;
   49|      9|    *out_val |= in & ((1 << 7) - 1);
   50|    140|  } else {
   51|       |    // Last byte reached
   52|    140|    *out_val = in;
   53|    140|  }
   54|    149|  return true;
   55|    149|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   127k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   127k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   127k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 4, False: 127k]
  ------------------
   33|      4|    return false;
   34|      4|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   127k|  uint8_t in;
   39|   127k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 9, False: 127k]
  ------------------
   40|      9|    return false;
   41|      9|  }
   42|   127k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 501, False: 126k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    501|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 22, False: 479]
  ------------------
   45|     22|      return false;
   46|     22|    }
   47|       |    // Append decoded info from this byte.
   48|    479|    *out_val <<= 7;
   49|    479|    *out_val |= in & ((1 << 7) - 1);
   50|   126k|  } else {
   51|       |    // Last byte reached
   52|   126k|    *out_val = in;
   53|   126k|  }
   54|   127k|  return true;
   55|   127k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|    266|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|    266|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded - Ignored]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|    266|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|    266|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|    266|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 266]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|    266|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|    266|  }
   76|    266|  return true;
   77|    266|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|    268|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    268|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    268|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 268]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    268|  uint8_t in;
   39|    268|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 268]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    268|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2, False: 266]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|      2|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 2]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|      2|    *out_val <<= 7;
   49|      2|    *out_val |= in & ((1 << 7) - 1);
   50|    266|  } else {
   51|       |    // Last byte reached
   52|    266|    *out_val = in;
   53|    266|  }
   54|    268|  return true;
   55|    268|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|     89|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|     89|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|     89|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 88]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|     88|  uint8_t in;
   39|     88|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 88]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|     88|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 21, False: 67]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     21|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 5, False: 16]
  ------------------
   45|      5|      return false;
   46|      5|    }
   47|       |    // Append decoded info from this byte.
   48|     16|    *out_val <<= 7;
   49|     16|    *out_val |= in & ((1 << 7) - 1);
   50|     67|  } else {
   51|       |    // Last byte reached
   52|     67|    *out_val = in;
   53|     67|  }
   54|     83|  return true;
   55|     88|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  5.57k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  5.57k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  5.57k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 5.57k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  5.57k|  uint8_t in;
   39|  5.57k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 5.57k]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|  5.57k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 166, False: 5.40k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    166|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 5, False: 161]
  ------------------
   45|      5|      return false;
   46|      5|    }
   47|       |    // Append decoded info from this byte.
   48|    161|    *out_val <<= 7;
   49|    161|    *out_val |= in & ((1 << 7) - 1);
   50|  5.40k|  } else {
   51|       |    // Last byte reached
   52|  5.40k|    *out_val = in;
   53|  5.40k|  }
   54|  5.56k|  return true;
   55|  5.57k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|    314|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    314|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    314|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 2, False: 312]
  ------------------
   33|      2|    return false;
   34|      2|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    312|  uint8_t in;
   39|    312|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 312]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    312|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 115, False: 197]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    115|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 10, False: 105]
  ------------------
   45|     10|      return false;
   46|     10|    }
   47|       |    // Append decoded info from this byte.
   48|    105|    *out_val <<= 7;
   49|    105|    *out_val |= in & ((1 << 7) - 1);
   50|    197|  } else {
   51|       |    // Last byte reached
   52|    197|    *out_val = in;
   53|    197|  }
   54|    302|  return true;
   55|    312|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|     75|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|     75|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|     75|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 75]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|     75|  uint8_t in;
   39|     75|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 75]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|     75|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 34, False: 41]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     34|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 34]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|     34|    *out_val <<= 7;
   49|     34|    *out_val |= in & ((1 << 7) - 1);
   50|     41|  } else {
   51|       |    // Last byte reached
   52|     41|    *out_val = in;
   53|     41|  }
   54|     75|  return true;
   55|     75|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  2.93k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.93k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.93k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 2.92k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.92k|  uint8_t in;
   39|  2.92k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 1, False: 2.92k]
  ------------------
   40|      1|    return false;
   41|      1|  }
   42|  2.92k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 19, False: 2.90k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     19|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 5, False: 14]
  ------------------
   45|      5|      return false;
   46|      5|    }
   47|       |    // Append decoded info from this byte.
   48|     14|    *out_val <<= 7;
   49|     14|    *out_val |= in & ((1 << 7) - 1);
   50|  2.90k|  } else {
   51|       |    // Last byte reached
   52|  2.90k|    *out_val = in;
   53|  2.90k|  }
   54|  2.92k|  return true;
   55|  2.92k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|  5.39k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|  5.59k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|    466|  Self operator-(const Self &o) const {
  138|    466|    Self ret;
  139|  1.86k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.39k, False: 466]
  ------------------
  140|  1.39k|      ret[i] = (*this)[i] - o[i];
  141|  1.39k|    }
  142|    466|    return ret;
  143|    466|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  1.11k|  VectorD() {
   41|  4.46k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.34k, False: 1.11k]
  ------------------
   42|  3.34k|      (*this)[i] = Scalar(0);
   43|  3.34k|    }
   44|  1.11k|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|   492k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|  5.31M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|   434k|  Self operator-(const Self &o) const {
  138|   434k|    Self ret;
  139|  1.73M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.30M, False: 434k]
  ------------------
  140|  1.30M|      ret[i] = (*this)[i] - o[i];
  141|  1.30M|    }
  142|   434k|    return ret;
  143|   434k|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|   216k|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|   216k|  static_assert(std::is_signed<ScalarT>::value,
  321|   216k|                "ScalarT must be a signed type. ");
  322|   216k|  VectorD<ScalarT, 3> r;
  323|   216k|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|   216k|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|   216k|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|   216k|  return r;
  327|   216k|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|   216k|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|   216k|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  37.8k|  Scalar AbsSum() const {
  238|  37.8k|    Scalar result(0);
  239|   148k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 112k, False: 35.7k]
  ------------------
  240|   112k|      Scalar next_value = std::abs(v_[i]);
  241|   112k|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 2.07k, False: 110k]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  2.07k|        return std::numeric_limits<Scalar>::max();
  244|  2.07k|      }
  245|   110k|      result += next_value;
  246|   110k|    }
  247|  35.7k|    return result;
  248|  37.8k|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|  32.8k|  Self operator/(const Scalar &o) const {
  183|  32.8k|    Self ret;
  184|   131k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 98.6k, False: 32.8k]
  ------------------
  185|  98.6k|      ret[i] = (*this)[i] / o;
  186|  98.6k|    }
  187|  32.8k|    return ret;
  188|  32.8k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|  6.22M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|   225k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|   113k|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  37.5k|  Self operator-() const {
  121|  37.5k|    Self ret;
  122|   150k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 112k, False: 37.5k]
  ------------------
  123|   112k|      ret[i] = -(*this)[i];
  124|   112k|    }
  125|  37.5k|    return ret;
  126|  37.5k|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|   112k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|    296|  Self operator-(const Self &o) const {
  138|    296|    Self ret;
  139|    888|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 592, False: 296]
  ------------------
  140|    592|      ret[i] = (*this)[i] - o[i];
  141|    592|    }
  142|    296|    return ret;
  143|    296|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  3.55k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  5.32k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  1.05M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|    592|  Self operator+(const Self &o) const {
  130|    592|    Self ret;
  131|  1.77k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.18k, False: 592]
  ------------------
  132|  1.18k|      ret[i] = (*this)[i] + o[i];
  133|  1.18k|    }
  134|    592|    return ret;
  135|    592|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|   767k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|  35.7k|  Self operator-(const Self &o) const {
  138|  35.7k|    Self ret;
  139|   107k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 71.5k, False: 35.7k]
  ------------------
  140|  71.5k|      ret[i] = (*this)[i] - o[i];
  141|  71.5k|    }
  142|  35.7k|    return ret;
  143|  35.7k|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|  35.7k|  Self operator+(const Self &o) const {
  130|  35.7k|    Self ret;
  131|   107k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 71.5k, False: 35.7k]
  ------------------
  132|  71.5k|      ret[i] = (*this)[i] + o[i];
  133|  71.5k|    }
  134|  35.7k|    return ret;
  135|  35.7k|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|    264|  bool operator==(const Self &o) const {
  207|    460|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 379, False: 81]
  ------------------
  208|    379|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 183, False: 196]
  ------------------
  209|    183|        return false;
  210|    183|      }
  211|    379|    }
  212|     81|    return true;
  213|    264|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  3.23k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|    283|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|    383|  Scalar Dot(const Self &o) const {
  251|    383|    Scalar ret(0);
  252|  1.53k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 1.14k, False: 383]
  ------------------
  253|  1.14k|      ret += (*this)[i] * o[i];
  254|  1.14k|    }
  255|    383|    return ret;
  256|    383|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    100|  Self operator*(const Scalar &o) const {
  175|    100|    Self ret;
  176|    400|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 300, False: 100]
  ------------------
  177|    300|      ret[i] = (*this)[i] * o;
  178|    300|    }
  179|    100|    return ret;
  180|    100|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|    183|  Self operator-(const Self &o) const {
  138|    183|    Self ret;
  139|    549|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 366, False: 183]
  ------------------
  140|    366|      ret[i] = (*this)[i] - o[i];
  141|    366|    }
  142|    183|    return ret;
  143|    183|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|    366|  VectorD() {
   41|  1.09k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 732, False: 366]
  ------------------
   42|    732|      (*this)[i] = Scalar(0);
   43|    732|    }
   44|    366|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|    708|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|    708|    DRACO_DCHECK_EQ(dimension, 2);
   54|    708|    v_[0] = c0;
   55|    708|    v_[1] = c1;
   56|    708|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  1.45k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|    422|  bool operator==(const Self &o) const {
  207|    653|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 560, False: 93]
  ------------------
  208|    560|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 329, False: 231]
  ------------------
  209|    329|        return false;
  210|    329|      }
  211|    560|    }
  212|     93|    return true;
  213|    422|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  8.10k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  1.19M|  VectorD() {
   41|  4.77M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.58M, False: 1.19M]
  ------------------
   42|  3.58M|      (*this)[i] = Scalar(0);
   43|  3.58M|    }
   44|  1.19M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|    587|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|    856|  Scalar Dot(const Self &o) const {
  251|    856|    Scalar ret(0);
  252|  3.42k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 2.56k, False: 856]
  ------------------
  253|  2.56k|      ret += (*this)[i] * o[i];
  254|  2.56k|    }
  255|    856|    return ret;
  256|    856|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|    269|  Self operator-(const Self &o) const {
  138|    269|    Self ret;
  139|    807|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 538, False: 269]
  ------------------
  140|    538|      ret[i] = (*this)[i] - o[i];
  141|    538|    }
  142|    269|    return ret;
  143|    269|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|    776|  Self operator*(const Scalar &o) const {
  175|    776|    Self ret;
  176|  2.32k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 1.55k, False: 776]
  ------------------
  177|  1.55k|      ret[i] = (*this)[i] * o;
  178|  1.55k|    }
  179|    776|    return ret;
  180|    776|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|    259|  Self operator+(const Self &o) const {
  130|    259|    Self ret;
  131|    777|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 518, False: 259]
  ------------------
  132|    518|      ret[i] = (*this)[i] + o[i];
  133|    518|    }
  134|    259|    return ret;
  135|    259|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|    259|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|    259|  return v * o;
  294|    259|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|    258|  Self operator+(const Self &o) const {
  130|    258|    Self ret;
  131|  1.03k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 774, False: 258]
  ------------------
  132|    774|      ret[i] = (*this)[i] + o[i];
  133|    774|    }
  134|    258|    return ret;
  135|    258|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|    258|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|    258|  return v * o;
  294|    258|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|    258|  Self operator*(const Scalar &o) const {
  175|    258|    Self ret;
  176|  1.03k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 774, False: 258]
  ------------------
  177|    774|      ret[i] = (*this)[i] * o;
  178|    774|    }
  179|    258|    return ret;
  180|    258|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|  1.10k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  1.10k|    DRACO_DCHECK_EQ(dimension, 2);
   54|  1.10k|    v_[0] = c0;
   55|  1.10k|    v_[1] = c1;
   56|  1.10k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  1.81k|  VectorD() {
   41|  5.45k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.63k, False: 1.81k]
  ------------------
   42|  3.63k|      (*this)[i] = Scalar(0);
   43|  3.63k|    }
   44|  1.81k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|    514|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  1.54k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 1.02k, False: 514]
  ------------------
  104|  1.02k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 1.02k, False: 0]
  ------------------
  105|  1.02k|        v_[i] = Scalar(src_vector[i]);
  106|  1.02k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  1.02k|    }
  110|    514|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|     94|  Self operator+(const Self &o) const {
  130|     94|    Self ret;
  131|    282|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 188, False: 94]
  ------------------
  132|    188|      ret[i] = (*this)[i] + o[i];
  133|    188|    }
  134|     94|    return ret;
  135|     94|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|    257|  VectorD() {
   41|    771|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 514, False: 257]
  ------------------
   42|    514|      (*this)[i] = Scalar(0);
   43|    514|    }
   44|    257|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  1.54k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  1.02k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|    257|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|    771|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 514, False: 257]
  ------------------
  104|    514|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 514, False: 0]
  ------------------
  105|    514|        v_[i] = Scalar(src_vector[i]);
  106|    514|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|    514|    }
  110|    257|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|    257|  Self operator/(const Scalar &o) const {
  183|    257|    Self ret;
  184|    771|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 514, False: 257]
  ------------------
  185|    514|      ret[i] = (*this)[i] / o;
  186|    514|    }
  187|    257|    return ret;
  188|    257|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|    163|  Self operator-(const Self &o) const {
  138|    163|    Self ret;
  139|    489|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 326, False: 163]
  ------------------
  140|    326|      ret[i] = (*this)[i] - o[i];
  141|    326|    }
  142|    163|    return ret;
  143|    163|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  7.27k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  37.6k|  VectorD() {
   41|   150k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 112k, False: 37.6k]
  ------------------
   42|   112k|      (*this)[i] = Scalar(0);
   43|   112k|    }
   44|  37.6k|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|   194k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   194k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   194k|    v_[0] = c0;
   55|   194k|    v_[1] = c1;
   56|   194k|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  1.77k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  5.32k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 3.55k, False: 1.77k]
  ------------------
  104|  3.55k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 3.55k, False: 0]
  ------------------
  105|  3.55k|        v_[i] = Scalar(src_vector[i]);
  106|  3.55k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  3.55k|    }
  110|  1.77k|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|    888|  VectorD() {
   41|  2.66k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 1.77k, False: 888]
  ------------------
   42|  1.77k|      (*this)[i] = Scalar(0);
   43|  1.77k|    }
   44|    888|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|    888|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  2.66k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 1.77k, False: 888]
  ------------------
  104|  1.77k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 1.77k, False: 0]
  ------------------
  105|  1.77k|        v_[i] = Scalar(src_vector[i]);
  106|  1.77k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  1.77k|    }
  110|    888|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|   157k|  VectorD(const Self &o) {
   89|   473k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 315k, False: 157k]
  ------------------
   90|   315k|      (*this)[i] = o[i];
   91|   315k|    }
   92|   157k|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  71.5k|  VectorD() {
   41|   214k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 143k, False: 71.5k]
  ------------------
   42|   143k|      (*this)[i] = Scalar(0);
   43|   143k|    }
   44|  71.5k|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|   164k|  VectorD(const Self &o) {
   89|   656k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 492k, False: 164k]
  ------------------
   90|   492k|      (*this)[i] = o[i];
   91|   492k|    }
   92|   164k|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|   492k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|   164k|      : v_({{c0, c1, c2}}) {
   60|   164k|    DRACO_DCHECK_EQ(dimension, 3);
   61|   164k|  }

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

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

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  231|  1.23k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|   266k|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  13.4k|  VertexCornersIterator &operator++() {
  268|  13.4k|    Next();
  269|  13.4k|    return *this;
  270|  13.4k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|   228k|  void Next() {
  248|   228k|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 219k, False: 9.84k]
  ------------------
  249|   219k|      corner_ = corner_table_->SwingLeft(corner_);
  250|   219k|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 1.33k, False: 217k]
  ------------------
  251|       |        // Open boundary reached.
  252|  1.33k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  1.33k|        left_traversal_ = false;
  254|   217k|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 36.4k, False: 181k]
  ------------------
  255|       |        // End reached.
  256|  36.4k|        corner_ = kInvalidCornerIndex;
  257|  36.4k|      }
  258|   219k|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  9.84k|      corner_ = corner_table_->SwingRight(corner_);
  262|  9.84k|    }
  263|   228k|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|   443k|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  2.56k|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  2.30k|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  1.32k|  void Next() {
  248|  1.32k|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 1.28k, False: 36]
  ------------------
  249|  1.28k|      corner_ = corner_table_->SwingLeft(corner_);
  250|  1.28k|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 1.24k, False: 38]
  ------------------
  251|       |        // Open boundary reached.
  252|  1.24k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  1.24k|        left_traversal_ = false;
  254|  1.24k|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 0, False: 38]
  ------------------
  255|       |        // End reached.
  256|      0|        corner_ = kInvalidCornerIndex;
  257|      0|      }
  258|  1.28k|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|     36|      corner_ = corner_table_->SwingRight(corner_);
  262|     36|    }
  263|  1.32k|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  238|  1.24k|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  238|  36.5k|        left_traversal_(true) {}

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

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

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

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

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

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

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

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

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

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

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

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

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

