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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|    429|      : quantization_bits_(-1),
   54|    429|        max_quantized_value_(-1),
   55|    429|        max_value_(-1),
   56|    429|        dequantization_scale_(1.f),
   57|    429|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|    395|  bool SetQuantizationBits(int32_t q) {
   60|    395|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 230, False: 165]
  |  Branch (60:18): [True: 27, False: 138]
  ------------------
   61|    257|      return false;
   62|    257|    }
   63|    138|    quantization_bits_ = q;
   64|    138|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|    138|    max_value_ = max_quantized_value_ - 1;
   66|    138|    dequantization_scale_ = 2.f / max_value_;
   67|    138|    center_value_ = max_value_ / 2;
   68|    138|    return true;
   69|    395|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|   370k|                                           int32_t *out_t) const {
   77|   370k|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 3.34k, False: 367k]
  |  Branch (77:20): [True: 0, False: 3.34k]
  |  Branch (77:32): [True: 3.34k, False: 367k]
  |  Branch (77:42): [True: 0, False: 3.34k]
  ------------------
   78|   370k|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 85.2k, False: 285k]
  |  Branch (78:29): [True: 2.67k, False: 82.5k]
  ------------------
   79|  2.67k|      s = max_value_;
   80|  2.67k|      t = max_value_;
   81|   367k|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 3.34k, False: 364k]
  |  Branch (81:26): [True: 1.14k, False: 2.19k]
  ------------------
   82|  1.14k|      t = center_value_ - (t - center_value_);
   83|   366k|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 82.5k, False: 284k]
  |  Branch (83:35): [True: 2.77k, False: 79.7k]
  ------------------
   84|  2.77k|      t = center_value_ + (center_value_ - t);
   85|   363k|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 81.7k, False: 282k]
  |  Branch (85:35): [True: 405, False: 81.3k]
  ------------------
   86|    405|      s = center_value_ + (center_value_ - s);
   87|   363k|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 4.37k, False: 359k]
  |  Branch (87:26): [True: 1.53k, False: 2.83k]
  ------------------
   88|  1.53k|      s = center_value_ - (s - center_value_);
   89|  1.53k|    }
   90|       |
   91|   370k|    *out_s = s;
   92|   370k|    *out_t = t;
   93|   370k|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|   370k|                                                       int32_t *out_t) const {
  100|   370k|    DRACO_DCHECK_EQ(
  101|   370k|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|   370k|        center_value_);
  103|   370k|    int32_t s, t;
  104|   370k|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 185k, False: 185k]
  ------------------
  105|       |      // Right hemisphere.
  106|   185k|      s = (int_vec[1] + center_value_);
  107|   185k|      t = (int_vec[2] + center_value_);
  108|   185k|    } else {
  109|       |      // Left hemisphere.
  110|   185k|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 58.6k, False: 126k]
  ------------------
  111|  58.6k|        s = std::abs(int_vec[2]);
  112|   126k|      } else {
  113|   126k|        s = (max_value_ - std::abs(int_vec[2]));
  114|   126k|      }
  115|   185k|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 63.7k, False: 121k]
  ------------------
  116|  63.7k|        t = std::abs(int_vec[1]);
  117|   121k|      } else {
  118|   121k|        t = (max_value_ - std::abs(int_vec[1]));
  119|   121k|      }
  120|   185k|    }
  121|   370k|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|   370k|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|    101|                                                    float *out_vector) const {
  199|    101|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|    101|                                 in_t * dequantization_scale_ - 1.f,
  201|    101|                                 out_vector);
  202|    101|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|   362k|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|   362k|    DRACO_DCHECK_LE(s, center_value_);
  208|   362k|    DRACO_DCHECK_LE(t, center_value_);
  209|   362k|    DRACO_DCHECK_GE(s, -center_value_);
  210|   362k|    DRACO_DCHECK_GE(t, -center_value_);
  211|   362k|    const uint32_t st =
  212|   362k|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|   362k|    return st <= center_value_;
  214|   362k|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|   416k|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|   416k|    DRACO_DCHECK_LE(*s, center_value_);
  219|   416k|    DRACO_DCHECK_LE(*t, center_value_);
  220|   416k|    DRACO_DCHECK_GE(*s, -center_value_);
  221|   416k|    DRACO_DCHECK_GE(*t, -center_value_);
  222|   416k|    int32_t sign_s = 0;
  223|   416k|    int32_t sign_t = 0;
  224|   416k|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 296k, False: 119k]
  |  Branch (224:20): [True: 220k, False: 76.3k]
  ------------------
  225|   220k|      sign_s = 1;
  226|   220k|      sign_t = 1;
  227|   220k|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 121k, False: 74.5k]
  |  Branch (227:27): [True: 55.9k, False: 65.7k]
  ------------------
  228|  55.9k|      sign_s = -1;
  229|  55.9k|      sign_t = -1;
  230|   140k|    } else {
  231|   140k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 74.5k, False: 65.7k]
  ------------------
  232|   140k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 65.7k, False: 74.5k]
  ------------------
  233|   140k|    }
  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|   416k|    const uint32_t corner_point_s = sign_s * center_value_;
  239|   416k|    const uint32_t corner_point_t = sign_t * center_value_;
  240|   416k|    uint32_t us = *s;
  241|   416k|    uint32_t ut = *t;
  242|   416k|    us = us + us - corner_point_s;
  243|   416k|    ut = ut + ut - corner_point_t;
  244|   416k|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 276k, False: 140k]
  ------------------
  245|   276k|      uint32_t temp = us;
  246|   276k|      us = -ut;
  247|   276k|      ut = -temp;
  248|   276k|    } else {
  249|   140k|      std::swap(us, ut);
  250|   140k|    }
  251|   416k|    us = us + corner_point_s;
  252|   416k|    ut = ut + corner_point_t;
  253|       |
  254|   416k|    *s = us;
  255|   416k|    *t = ut;
  256|   416k|    *s /= 2;
  257|   416k|    *t /= 2;
  258|   416k|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|   724k|  int32_t ModMax(int32_t x) const {
  273|   724k|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 80, False: 724k]
  ------------------
  274|     80|      return x - this->max_quantized_value();
  275|     80|    }
  276|   724k|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 0, False: 724k]
  ------------------
  277|      0|      return x + this->max_quantized_value();
  278|      0|    }
  279|   724k|    return x;
  280|   724k|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|    147|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|     80|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  2.17M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|    101|                                           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|    101|    float y = in_s_scaled;
  329|    101|    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|    101|    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|    101|    float x_offset = -x;
  342|    101|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 0, False: 101]
  ------------------
  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|    101|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 53, False: 48]
  ------------------
  348|    101|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 54, False: 47]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|    101|    const float norm_squared = x * x + y * y + z * z;
  352|    101|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 101]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|    101|    } else {
  357|    101|      const float d = 1.0f / std::sqrt(norm_squared);
  358|    101|      out_vector[0] = x * d;
  359|    101|      out_vector[1] = y * d;
  360|    101|      out_vector[2] = z * d;
  361|    101|    }
  362|    101|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|   370k|  void CanonicalizeIntegerVector(T *vec) const {
  174|   370k|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|   370k|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|   370k|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|   370k|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|   370k|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|   370k|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 76.0k, False: 294k]
  ------------------
  181|  76.0k|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|   294k|    } else {
  183|   294k|      vec[0] =
  184|   294k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   294k|          abs_sum;
  186|   294k|      vec[1] =
  187|   294k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   294k|          abs_sum;
  189|   294k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 155k, False: 139k]
  ------------------
  190|   155k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   155k|      } else {
  192|   139k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   139k|      }
  194|   294k|    }
  195|   370k|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|     46|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|     46|            attribute, transform, mesh_data),
   52|     46|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|     37|                                                                *buffer) {
  194|     37|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|     37|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     37|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 8, False: 29]
  ------------------
  196|       |    // Decode prediction mode.
  197|      8|    uint8_t mode;
  198|      8|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 8]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      8|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 5, False: 3]
  ------------------
  203|       |      // Unsupported mode.
  204|      5|      return false;
  205|      5|    }
  206|      8|  }
  207|     32|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|    132|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 108, False: 24]
  ------------------
  211|    108|    uint32_t num_flags;
  212|    108|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 1, False: 107]
  ------------------
  213|      1|      return false;
  214|      1|    }
  215|    107|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 6, False: 101]
  ------------------
  216|      6|      return false;
  217|      6|    }
  218|    101|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 67, False: 34]
  ------------------
  219|     67|      is_crease_edge_[i].resize(num_flags);
  220|     67|      RAnsBitDecoder decoder;
  221|     67|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 1, False: 66]
  ------------------
  222|      1|        return false;
  223|      1|      }
  224|    869|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 803, False: 66]
  ------------------
  225|    803|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|    803|      }
  227|     66|      decoder.EndDecoding();
  228|     66|    }
  229|    101|  }
  230|     24|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|     24|                                     MeshDataT>::DecodePredictionData(buffer);
  232|     32|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|     24|                          const PointIndex * /* entry_to_point_id_map */) {
   87|     24|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|     24|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    120|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 96, False: 24]
  ------------------
   93|     96|    pred_vals[i].resize(num_components, 0);
   94|     96|  }
   95|     24|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|     24|                                         out_data);
   97|       |
   98|     24|  const CornerTable *const table = this->mesh_data().corner_table();
   99|     24|  const std::vector<int32_t> *const vertex_to_data_map =
  100|     24|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|     24|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|     24|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|     24|  const int corner_map_size =
  109|     24|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  3.05k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 3.04k, False: 14]
  ------------------
  111|  3.04k|    const CornerIndex start_corner_id =
  112|  3.04k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  3.04k|    CornerIndex corner_id(start_corner_id);
  115|  3.04k|    int num_parallelograms = 0;
  116|  3.04k|    bool first_pass = true;
  117|  7.24k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 4.29k, False: 2.95k]
  ------------------
  118|  4.29k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 417, False: 3.87k]
  ------------------
  119|  4.29k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  4.29k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|    417|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|    417|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 0, False: 417]
  ------------------
  127|      0|          break;
  128|      0|        }
  129|    417|      }
  130|       |
  131|       |      // Proceed to the next corner attached to the vertex. First swing left
  132|       |      // and if we reach a boundary, swing right from the start corner.
  133|  4.29k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 3.74k, False: 551]
  ------------------
  134|  3.74k|        corner_id = table->SwingLeft(corner_id);
  135|  3.74k|      } else {
  136|    551|        corner_id = table->SwingRight(corner_id);
  137|    551|      }
  138|  4.29k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 87, False: 4.20k]
  ------------------
  139|     87|        break;
  140|     87|      }
  141|  4.20k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 3.41k, False: 792]
  |  Branch (141:47): [True: 2.95k, False: 458]
  ------------------
  142|  2.95k|        first_pass = false;
  143|  2.95k|        corner_id = table->SwingRight(start_corner_id);
  144|  2.95k|      }
  145|  4.20k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  3.04k|    int num_used_parallelograms = 0;
  150|  3.04k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 417, False: 2.62k]
  ------------------
  151|  3.58k|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 3.16k, False: 417]
  ------------------
  152|  3.16k|        multi_pred_vals[i] = 0;
  153|  3.16k|      }
  154|       |      // Check which parallelograms are actually used.
  155|    824|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 417, False: 407]
  ------------------
  156|    417|        const int context = num_parallelograms - 1;
  157|    417|        const int pos = is_crease_edge_pos[context]++;
  158|    417|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 10, False: 407]
  ------------------
  159|     10|          return false;
  160|     10|        }
  161|    407|        const bool is_crease = is_crease_edge_[context][pos];
  162|    407|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 3, False: 404]
  ------------------
  163|      3|          ++num_used_parallelograms;
  164|    768|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 765, False: 3]
  ------------------
  165|    765|            multi_pred_vals[j] =
  166|    765|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|    765|          }
  168|      3|        }
  169|    407|      }
  170|    417|    }
  171|  3.03k|    const int dst_offset = p * num_components;
  172|  3.03k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 3.02k, False: 3]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  3.02k|      const int src_offset = (p - 1) * num_components;
  176|  3.02k|      this->transform().ComputeOriginalValue(
  177|  3.02k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  3.02k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|    768|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 765, False: 3]
  ------------------
  181|    765|        multi_pred_vals[c] /= num_used_parallelograms;
  182|    765|      }
  183|      3|      this->transform().ComputeOriginalValue(
  184|      3|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|      3|    }
  186|  3.03k|  }
  187|     14|  return true;
  188|     24|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|     60|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|     60|            attribute, transform, mesh_data),
   52|     60|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|     57|                                                                *buffer) {
  194|     57|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|     57|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     57|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 0, False: 57]
  ------------------
  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|     57|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|    259|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 212, False: 47]
  ------------------
  211|    212|    uint32_t num_flags;
  212|    212|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 2, False: 210]
  ------------------
  213|      2|      return false;
  214|      2|    }
  215|    210|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 5, False: 205]
  ------------------
  216|      5|      return false;
  217|      5|    }
  218|    205|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 156, False: 49]
  ------------------
  219|    156|      is_crease_edge_[i].resize(num_flags);
  220|    156|      RAnsBitDecoder decoder;
  221|    156|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 3, False: 153]
  ------------------
  222|      3|        return false;
  223|      3|      }
  224|  17.0k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 16.8k, False: 153]
  ------------------
  225|  16.8k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  16.8k|      }
  227|    153|      decoder.EndDecoding();
  228|    153|    }
  229|    205|  }
  230|     47|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|     47|                                     MeshDataT>::DecodePredictionData(buffer);
  232|     57|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|     43|                          const PointIndex * /* entry_to_point_id_map */) {
   87|     43|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|     43|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    215|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 172, False: 43]
  ------------------
   93|    172|    pred_vals[i].resize(num_components, 0);
   94|    172|  }
   95|     43|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|     43|                                         out_data);
   97|       |
   98|     43|  const CornerTable *const table = this->mesh_data().corner_table();
   99|     43|  const std::vector<int32_t> *const vertex_to_data_map =
  100|     43|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|     43|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|     43|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|     43|  const int corner_map_size =
  109|     43|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  4.55k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 4.52k, False: 26]
  ------------------
  111|  4.52k|    const CornerIndex start_corner_id =
  112|  4.52k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  4.52k|    CornerIndex corner_id(start_corner_id);
  115|  4.52k|    int num_parallelograms = 0;
  116|  4.52k|    bool first_pass = true;
  117|  19.9k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 18.2k, False: 1.73k]
  ------------------
  118|  18.2k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 4.50k, False: 13.7k]
  ------------------
  119|  18.2k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  18.2k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  4.50k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  4.50k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 5, False: 4.49k]
  ------------------
  127|      5|          break;
  128|      5|        }
  129|  4.50k|      }
  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|  18.2k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 16.9k, False: 1.33k]
  ------------------
  134|  16.9k|        corner_id = table->SwingLeft(corner_id);
  135|  16.9k|      } else {
  136|  1.33k|        corner_id = table->SwingRight(corner_id);
  137|  1.33k|      }
  138|  18.2k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 2.78k, False: 15.4k]
  ------------------
  139|  2.78k|        break;
  140|  2.78k|      }
  141|  15.4k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 2.32k, False: 13.1k]
  |  Branch (141:47): [True: 1.73k, False: 593]
  ------------------
  142|  1.73k|        first_pass = false;
  143|  1.73k|        corner_id = table->SwingRight(start_corner_id);
  144|  1.73k|      }
  145|  15.4k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  4.52k|    int num_used_parallelograms = 0;
  150|  4.52k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 2.62k, False: 1.90k]
  ------------------
  151|   108k|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 106k, False: 2.62k]
  ------------------
  152|   106k|        multi_pred_vals[i] = 0;
  153|   106k|      }
  154|       |      // Check which parallelograms are actually used.
  155|  7.09k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 4.49k, False: 2.60k]
  ------------------
  156|  4.49k|        const int context = num_parallelograms - 1;
  157|  4.49k|        const int pos = is_crease_edge_pos[context]++;
  158|  4.49k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 17, False: 4.47k]
  ------------------
  159|     17|          return false;
  160|     17|        }
  161|  4.47k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  4.47k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 3.81k, False: 656]
  ------------------
  163|  3.81k|          ++num_used_parallelograms;
  164|   167k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 163k, False: 3.81k]
  ------------------
  165|   163k|            multi_pred_vals[j] =
  166|   163k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|   163k|          }
  168|  3.81k|        }
  169|  4.47k|      }
  170|  2.62k|    }
  171|  4.51k|    const int dst_offset = p * num_components;
  172|  4.51k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 2.28k, False: 2.22k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  2.28k|      const int src_offset = (p - 1) * num_components;
  176|  2.28k|      this->transform().ComputeOriginalValue(
  177|  2.28k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  2.28k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|  87.1k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 84.9k, False: 2.22k]
  ------------------
  181|  84.9k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|  84.9k|      }
  183|  2.22k|      this->transform().ComputeOriginalValue(
  184|  2.22k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  2.22k|    }
  186|  4.51k|  }
  187|     26|  return true;
  188|     43|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|    223|           const std::vector<int32_t> *vertex_to_data_map) {
   38|    223|    mesh_ = mesh;
   39|    223|    corner_table_ = table;
   40|    223|    data_to_corner_map_ = data_to_corner_map;
   41|    223|    vertex_to_data_map_ = vertex_to_data_map;
   42|    223|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|   200k|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|   161k|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|   161k|    return vertex_to_data_map_;
   48|   161k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  69.7k|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  69.7k|    return data_to_corner_map_;
   51|  69.7k|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|    343|           const std::vector<int32_t> *vertex_to_data_map) {
   38|    343|    mesh_ = mesh;
   39|    343|    corner_table_ = table;
   40|    343|    data_to_corner_map_ = data_to_corner_map;
   41|    343|    vertex_to_data_map_ = vertex_to_data_map;
   42|    343|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  4.63M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  4.29M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  4.29M|    return vertex_to_data_map_;
   48|  4.29M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|   670k|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|   670k|    return data_to_corner_map_;
   51|   670k|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|    223|      : mesh_(nullptr),
   31|    223|        corner_table_(nullptr),
   32|    223|        vertex_to_data_map_(nullptr),
   33|    223|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|    343|      : mesh_(nullptr),
   31|    343|        corner_table_(nullptr),
   32|    343|        vertex_to_data_map_(nullptr),
   33|    343|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  21.7k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   137k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   178k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    203|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    203|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  50.1k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    295|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    295|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   355k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|     10|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|     10|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|     20|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|     20|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|      9|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|      9|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|     27|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|     27|        mesh_data_(mesh_data) {}

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

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

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

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|     11|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|     11|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|      8|                          const PointIndex * /* entry_to_point_id_map */) {
   64|      8|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|      8|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|      8|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|      8|      new DataTypeT[num_components]());
   70|       |
   71|      8|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|      8|  const CornerTable *const table = this->mesh_data().corner_table();
   74|      8|  const std::vector<int32_t> *const vertex_to_data_map =
   75|      8|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|      8|  const int corner_map_size =
   78|      8|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|  24.9k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 24.9k, False: 8]
  ------------------
   80|  24.9k|    const CornerIndex start_corner_id =
   81|  24.9k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|  24.9k|    CornerIndex corner_id(start_corner_id);
   84|  24.9k|    int num_parallelograms = 0;
   85|   262k|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 237k, False: 24.9k]
  ------------------
   86|   237k|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|   237k|    }
   88|  66.3k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 41.3k, False: 24.9k]
  ------------------
   89|  41.3k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 6.73k, False: 34.6k]
  ------------------
   90|  41.3k|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  41.3k|              num_components, parallelogram_pred_vals.get())) {
   92|  71.1k|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 64.4k, False: 6.73k]
  ------------------
   93|  64.4k|          pred_vals[c] =
   94|  64.4k|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  64.4k|        }
   96|  6.73k|        ++num_parallelograms;
   97|  6.73k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  41.3k|      corner_id = table->SwingRight(corner_id);
  101|  41.3k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 3.13k, False: 38.2k]
  ------------------
  102|  3.13k|        corner_id = kInvalidCornerIndex;
  103|  3.13k|      }
  104|  41.3k|    }
  105|       |
  106|  24.9k|    const int dst_offset = p * num_components;
  107|  24.9k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 21.3k, False: 3.63k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  21.3k|      const int src_offset = (p - 1) * num_components;
  111|  21.3k|      this->transform().ComputeOriginalValue(
  112|  21.3k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|  21.3k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  39.1k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 35.4k, False: 3.63k]
  ------------------
  116|  35.4k|        pred_vals[c] /= num_parallelograms;
  117|  35.4k|      }
  118|  3.63k|      this->transform().ComputeOriginalValue(
  119|  3.63k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|  3.63k|    }
  121|  24.9k|  }
  122|      8|  return true;
  123|      8|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|     55|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|     55|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|     49|                          const PointIndex * /* entry_to_point_id_map */) {
   64|     49|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|     49|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|     49|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|     49|      new DataTypeT[num_components]());
   70|       |
   71|     49|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|     49|  const CornerTable *const table = this->mesh_data().corner_table();
   74|     49|  const std::vector<int32_t> *const vertex_to_data_map =
   75|     49|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|     49|  const int corner_map_size =
   78|     49|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   322k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 322k, False: 49]
  ------------------
   80|   322k|    const CornerIndex start_corner_id =
   81|   322k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   322k|    CornerIndex corner_id(start_corner_id);
   84|   322k|    int num_parallelograms = 0;
   85|  1.29M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 969k, False: 322k]
  ------------------
   86|   969k|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|   969k|    }
   88|  2.25M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 1.93M, False: 322k]
  ------------------
   89|  1.93M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 622k, False: 1.31M]
  ------------------
   90|  1.93M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  1.93M|              num_components, parallelogram_pred_vals.get())) {
   92|  2.49M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 1.87M, False: 622k]
  ------------------
   93|  1.87M|          pred_vals[c] =
   94|  1.87M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  1.87M|        }
   96|   622k|        ++num_parallelograms;
   97|   622k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  1.93M|      corner_id = table->SwingRight(corner_id);
  101|  1.93M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 322k, False: 1.61M]
  ------------------
  102|   322k|        corner_id = kInvalidCornerIndex;
  103|   322k|      }
  104|  1.93M|    }
  105|       |
  106|   322k|    const int dst_offset = p * num_components;
  107|   322k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 239, False: 322k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|    239|      const int src_offset = (p - 1) * num_components;
  111|    239|      this->transform().ComputeOriginalValue(
  112|    239|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   322k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  1.29M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 968k, False: 322k]
  ------------------
  116|   968k|        pred_vals[c] /= num_parallelograms;
  117|   968k|      }
  118|   322k|      this->transform().ComputeOriginalValue(
  119|   322k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   322k|    }
  121|   322k|  }
  122|     49|  return true;
  123|     49|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  50.1k|    int num_components, DataTypeT *out_prediction) {
   49|  50.1k|  const CornerIndex oci = table->Opposite(ci);
   50|  50.1k|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 28.5k, False: 21.6k]
  ------------------
   51|  28.5k|    return false;
   52|  28.5k|  }
   53|  21.6k|  int vert_opp, vert_next, vert_prev;
   54|  21.6k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  21.6k|                                        &vert_opp, &vert_next, &vert_prev);
   56|  21.6k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 10.8k, False: 10.7k]
  |  Branch (56:35): [True: 8.21k, False: 2.67k]
  ------------------
   57|  8.21k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 7.66k, False: 547]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  7.66k|    const int v_opp_off = vert_opp * num_components;
   60|  7.66k|    const int v_next_off = vert_next * num_components;
   61|  7.66k|    const int v_prev_off = vert_prev * num_components;
   62|  76.7k|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 69.0k, False: 7.66k]
  ------------------
   63|  69.0k|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  69.0k|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  69.0k|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  69.0k|      const int64_t result =
   67|  69.0k|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  69.0k|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  69.0k|    }
   71|  7.66k|    return true;
   72|  7.66k|  }
   73|  14.0k|  return false;  // Not all data is available for prediction
   74|  21.6k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  21.6k|    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|  21.6k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  21.6k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  21.6k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  21.6k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  1.96M|    int num_components, DataTypeT *out_prediction) {
   49|  1.96M|  const CornerIndex oci = table->Opposite(ci);
   50|  1.96M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 1.78k, False: 1.95M]
  ------------------
   51|  1.78k|    return false;
   52|  1.78k|  }
   53|  1.95M|  int vert_opp, vert_next, vert_prev;
   54|  1.95M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  1.95M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  1.95M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 981k, False: 977k]
  |  Branch (56:35): [True: 692k, False: 289k]
  ------------------
   57|   692k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 635k, False: 56.9k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   635k|    const int v_opp_off = vert_opp * num_components;
   60|   635k|    const int v_next_off = vert_next * num_components;
   61|   635k|    const int v_prev_off = vert_prev * num_components;
   62|  2.86M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 2.23M, False: 635k]
  ------------------
   63|  2.23M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  2.23M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  2.23M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  2.23M|      const int64_t result =
   67|  2.23M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  2.23M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  2.23M|    }
   71|   635k|    return true;
   72|   635k|  }
   73|  1.32M|  return false;  // Not all data is available for prediction
   74|  1.95M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  1.95M|    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|  1.95M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  1.95M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  1.95M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  1.95M|}

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

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

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|     24|      : pos_attribute_(nullptr),
   39|     24|        entry_to_point_id_map_(nullptr),
   40|     24|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     24|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     24|    pos_attribute_ = &position_attribute;
   43|     24|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|     23|  void ResizeOrientations(int num_orientations) {
   74|     23|    orientations_.resize(num_orientations);
   75|     23|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|   328M|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     20|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     20|    entry_to_point_id_map_ = map;
   46|     20|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|  1.81k|                                                 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.81k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|  1.81k|  const CornerIndex prev_corner_id =
   99|  1.81k|      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.81k|  int next_data_id, prev_data_id;
  103|       |
  104|  1.81k|  int next_vert_id, prev_vert_id;
  105|  1.81k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|  1.81k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|  1.81k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|  1.81k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|  1.81k|  typedef VectorD<int64_t, 2> Vec2;
  112|  1.81k|  typedef VectorD<int64_t, 3> Vec3;
  113|  1.81k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|  1.81k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 1.27k, False: 539]
  |  Branch (115:33): [True: 735, False: 540]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|    735|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|    735|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|    735|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 84, False: 651]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|     84|      predicted_value_[0] = p_uv[0];
  122|     84|      predicted_value_[1] = p_uv[1];
  123|     84|      return true;
  124|     84|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|    651|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|    651|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|    651|    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|    651|    const Vec3 pn = prev_pos - next_pos;
  146|    651|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|    651|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 607, False: 44]
  ------------------
  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|    607|      const Vec3 cn = tip_pos - next_pos;
  153|    607|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|    607|      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|    607|      const int64_t n_uv_absmax_element =
  164|    607|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|    607|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 2, False: 605]
  ------------------
  166|    607|          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|    605|      const int64_t pn_uv_absmax_element =
  171|    605|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|    605|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 3, False: 602]
  ------------------
  173|    605|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      3|        return false;
  176|      3|      }
  177|    602|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|    602|      const int64_t pn_absmax_element =
  179|    602|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|    602|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 0, False: 602]
  ------------------
  181|    602|          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|    602|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|    602|      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|    602|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|    602|      const uint64_t norm_squared =
  207|    602|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|    602|      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|    602|      Vec2 predicted_uv;
  214|    602|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 602]
  ------------------
  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|    602|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|    602|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 0, False: 602]
  ------------------
  233|      0|          return false;
  234|      0|        }
  235|    602|        const bool orientation = orientations_.back();
  236|    602|        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|    602|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 61, False: 541]
  ------------------
  240|     61|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    541|        } else {
  242|    541|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    541|        }
  244|    602|      }
  245|    602|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|    602|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|    602|      return true;
  248|    602|    }
  249|    651|  }
  250|       |  // Else we don't have available textures on both corners or the position data
  251|       |  // is invalid. For such cases we can't use positions for predicting the uv
  252|       |  // value and we resort to delta coding.
  253|  1.12k|  int data_offset = 0;
  254|  1.12k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 584, False: 539]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|    584|    data_offset = prev_data_id * kNumComponents;
  257|    584|  }
  258|  1.12k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 44, False: 1.07k]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|     44|    data_offset = next_data_id * kNumComponents;
  261|  1.07k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|  1.07k|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 1.05k, False: 20]
  ------------------
  265|  1.05k|      data_offset = (data_id - 1) * kNumComponents;
  266|  1.05k|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|     60|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 40, False: 20]
  ------------------
  269|     40|        predicted_value_[i] = 0;
  270|     40|      }
  271|     20|      return true;
  272|     20|    }
  273|  1.07k|  }
  274|  3.30k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 2.20k, False: 1.10k]
  ------------------
  275|  2.20k|    predicted_value_[i] = data[data_offset + i];
  276|  2.20k|  }
  277|  1.10k|  return true;
  278|  1.12k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|  1.47k|                                            const DataTypeT *data) const {
   59|  1.47k|    const int data_offset = entry_id * kNumComponents;
   60|  1.47k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|  1.47k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  1.95k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  1.95k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  1.95k|    VectorD<int64_t, 3> pos;
   52|  1.95k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  1.95k|                                 &pos[0]);
   54|  1.95k|    return pos;
   55|  1.95k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|  1.80k|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|      1|      : pos_attribute_(nullptr),
   39|      1|        entry_to_point_id_map_(nullptr),
   40|      1|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|      1|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|      1|    pos_attribute_ = &position_attribute;
   43|      1|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|      1|  void ResizeOrientations(int num_orientations) {
   74|      1|    orientations_.resize(num_orientations);
   75|      1|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|   139k|  void set_orientation(int i, bool v) { orientations_[i] = v; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     13|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|     43|  bool AreCorrectionsPositive() override {
   71|     43|    return transform_.AreCorrectionsPositive();
   72|     43|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     13|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     13|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 10, False: 3]
  ------------------
   50|     10|      return false;
   51|     10|    }
   52|      3|    return true;
   53|     13|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|   159k|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     15|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|     51|  bool AreCorrectionsPositive() override {
   71|     51|    return transform_.AreCorrectionsPositive();
   72|     51|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     15|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     15|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 4, False: 11]
  ------------------
   50|      4|      return false;
   51|      4|    }
   52|     11|    return true;
   53|     15|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|   203k|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    516|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|    251|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|    487|  bool AreCorrectionsPositive() override {
   71|    487|    return transform_.AreCorrectionsPositive();
   72|    487|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    236|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    236|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 24, False: 212]
  ------------------
   50|     24|      return false;
   51|     24|    }
   52|    212|    return true;
   53|    236|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|   425k|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|     43|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|     51|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|     43|                                 const PointCloudDecoder *decoder) {
  188|     43|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|     43|      method, att_id, decoder, TransformT());
  190|     43|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|     43|                                 const TransformT &transform) {
  156|     43|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 43]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|     43|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|     43|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 37, False: 6]
  ------------------
  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|     37|    const MeshDecoder *const mesh_decoder =
  167|     37|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|     37|    auto ret = CreateMeshPredictionScheme<
  170|     37|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|     37|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|     37|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|     37|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 30, False: 7]
  ------------------
  174|     30|      return ret;
  175|     30|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|     37|  }
  178|       |  // Create delta decoder.
  179|     13|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     13|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|     43|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|     10|      uint16_t bitstream_version) {
  143|     10|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|     10|        method, attribute, transform, mesh_data, bitstream_version);
  145|     10|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|     10|        uint16_t bitstream_version) {
  127|     10|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 10, False: 0]
  ------------------
  128|     10|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|     10|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|     10|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|     10|                                                  mesh_data));
  132|     10|      }
  133|      0|      return nullptr;
  134|     10|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|     21|      uint16_t bitstream_version) {
  143|     21|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|     21|        method, attribute, transform, mesh_data, bitstream_version);
  145|     21|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|     21|        uint16_t bitstream_version) {
  127|     21|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 20, False: 1]
  ------------------
  128|     20|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|     20|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|     20|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|     20|                                                  mesh_data));
  132|     20|      }
  133|      1|      return nullptr;
  134|     21|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|     51|                                 const PointCloudDecoder *decoder) {
  188|     51|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|     51|      method, att_id, decoder, TransformT());
  190|     51|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|     51|                                 const TransformT &transform) {
  156|     51|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 51]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|     51|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|     51|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 51, 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|     51|    const MeshDecoder *const mesh_decoder =
  167|     51|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|     51|    auto ret = CreateMeshPredictionScheme<
  170|     51|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|     51|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|     51|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|     51|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 36, False: 15]
  ------------------
  174|     36|      return ret;
  175|     36|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|     51|  }
  178|       |  // Create delta decoder.
  179|     15|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     15|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|     51|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|     10|      uint16_t bitstream_version) {
  143|     10|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|     10|        method, attribute, transform, mesh_data, bitstream_version);
  145|     10|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|     10|        uint16_t bitstream_version) {
  111|     10|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 9, False: 1]
  ------------------
  112|      9|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|      9|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|      9|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|      9|                                                  mesh_data));
  116|      9|      }
  117|      1|      return nullptr;
  118|     10|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|     27|      uint16_t bitstream_version) {
  143|     27|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|     27|        method, attribute, transform, mesh_data, bitstream_version);
  145|     27|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|     27|        uint16_t bitstream_version) {
  111|     27|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 27, False: 0]
  ------------------
  112|     27|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|     27|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|     27|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|     27|                                                  mesh_data));
  116|     27|      }
  117|      0|      return nullptr;
  118|     27|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    516|                                 const PointCloudDecoder *decoder) {
  188|    516|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    516|      method, att_id, decoder, TransformT());
  190|    516|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    516|                                 const TransformT &transform) {
  156|    516|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 516]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    516|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    516|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 516, 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|    516|    const MeshDecoder *const mesh_decoder =
  167|    516|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    516|    auto ret = CreateMeshPredictionScheme<
  170|    516|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    516|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    516|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    516|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 498, False: 18]
  ------------------
  174|    498|      return ret;
  175|    498|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    516|  }
  178|       |  // Create delta decoder.
  179|     18|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     18|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    516|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    203|      uint16_t bitstream_version) {
  143|    203|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    203|        method, attribute, transform, mesh_data, bitstream_version);
  145|    203|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|    203|        uint16_t bitstream_version) {
   53|    203|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 41, False: 162]
  ------------------
   54|     41|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|     41|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|     41|                                                         MeshDataT>(
   57|     41|                attribute, transform, mesh_data));
   58|     41|      }
   59|    162|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|    162|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 11, False: 151]
  ------------------
   61|     11|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|     11|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|     11|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|     11|                                                  mesh_data));
   65|     11|      }
   66|    151|#endif
   67|    151|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 46, False: 105]
  ------------------
   68|     46|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|     46|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|     46|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|     46|                                                  mesh_data));
   72|     46|      }
   73|    105|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    105|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 11, False: 94]
  ------------------
   75|     11|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|     11|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|     11|                                                     MeshDataT>(
   78|     11|                attribute, transform, mesh_data, bitstream_version));
   79|     11|      }
   80|     94|#endif
   81|     94|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 24, False: 70]
  ------------------
   82|     24|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|     24|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|     24|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|     24|                                                  mesh_data));
   86|     24|      }
   87|     70|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|     70|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 70, False: 0]
  ------------------
   89|     70|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|     70|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|     70|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|     70|                                                  mesh_data));
   93|     70|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|    203|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    295|      uint16_t bitstream_version) {
  143|    295|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    295|        method, attribute, transform, mesh_data, bitstream_version);
  145|    295|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|    295|        uint16_t bitstream_version) {
   53|    295|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 20, False: 275]
  ------------------
   54|     20|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|     20|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|     20|                                                         MeshDataT>(
   57|     20|                attribute, transform, mesh_data));
   58|     20|      }
   59|    275|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|    275|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 55, False: 220]
  ------------------
   61|     55|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|     55|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|     55|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|     55|                                                  mesh_data));
   65|     55|      }
   66|    220|#endif
   67|    220|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 60, False: 160]
  ------------------
   68|     60|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|     60|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|     60|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|     60|                                                  mesh_data));
   72|     60|      }
   73|    160|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    160|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 1, False: 159]
  ------------------
   75|      1|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|      1|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|      1|                                                     MeshDataT>(
   78|      1|                attribute, transform, mesh_data, bitstream_version));
   79|      1|      }
   80|    159|#endif
   81|    159|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 1, False: 158]
  ------------------
   82|      1|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|      1|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|      1|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|      1|                                                  mesh_data));
   86|      1|      }
   87|    158|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    158|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 158, False: 0]
  ------------------
   89|    158|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    158|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    158|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    158|                                                  mesh_data));
   93|    158|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|    295|    }

_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|     20|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 17, False: 3]
  ------------------
   57|     17|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|     17|                                           in_corr + i, out_data + i);
   59|     17|  }
   60|      3|  return true;
   61|      3|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_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|  24.7k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 24.7k, False: 11]
  ------------------
   57|  24.7k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  24.7k|                                           in_corr + i, out_data + i);
   59|  24.7k|  }
   60|     11|  return true;
   61|     11|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   35|     18|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|      9|    const PointIndex *) {
   50|      9|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|      9|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|      9|  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|  22.0k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 22.0k, False: 9]
  ------------------
   57|  22.0k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  22.0k|                                           in_corr + i, out_data + i);
   59|  22.0k|  }
   60|      9|  return true;
   61|      9|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|     13|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|     15|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|     37|    uint16_t bitstream_version) {
   38|     37|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|     37|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 37, False: 0]
  ------------------
   40|     37|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 0, False: 37]
  ------------------
   41|     37|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 1, False: 36]
  ------------------
   42|     36|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 36]
  ------------------
   43|     36|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 0, False: 36]
  ------------------
   44|     36|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 30, False: 6]
  ------------------
   45|     35|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 4, False: 2]
  ------------------
   46|     35|    const CornerTable *const ct = source->GetCornerTable();
   47|     35|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|     35|        source->GetAttributeEncodingData(att_id);
   49|     35|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 4, False: 31]
  |  Branch (49:26): [True: 0, False: 31]
  ------------------
   50|       |      // No connectivity data found.
   51|      4|      return nullptr;
   52|      4|    }
   53|       |    // Connectivity data exists.
   54|     31|    const MeshAttributeCornerTable *const att_ct =
   55|     31|        source->GetAttributeCornerTable(att_id);
   56|     31|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 10, False: 21]
  ------------------
   57|     10|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|     10|      MeshData md;
   59|     10|      md.Set(source->mesh(), att_ct,
   60|     10|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|     10|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|     10|      MeshPredictionSchemeFactoryT factory;
   63|     10|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|     10|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 10, False: 0]
  ------------------
   65|     10|        return ret;
   66|     10|      }
   67|     21|    } else {
   68|     21|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|     21|      MeshData md;
   70|     21|      md.Set(source->mesh(), ct,
   71|     21|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|     21|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|     21|      MeshPredictionSchemeFactoryT factory;
   74|     21|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|     21|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 20, False: 1]
  ------------------
   76|     20|        return ret;
   77|     20|      }
   78|     21|    }
   79|     31|  }
   80|      3|  return nullptr;
   81|     37|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|     51|    uint16_t bitstream_version) {
   38|     51|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|     51|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 51, False: 0]
  ------------------
   40|     51|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 3, False: 48]
  ------------------
   41|     48|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 1, False: 47]
  ------------------
   42|     47|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 47]
  ------------------
   43|     47|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 3, False: 44]
  ------------------
   44|     44|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 37, False: 7]
  ------------------
   45|     48|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 4, False: 3]
  ------------------
   46|     48|    const CornerTable *const ct = source->GetCornerTable();
   47|     48|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|     48|        source->GetAttributeEncodingData(att_id);
   49|     48|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 11, False: 37]
  |  Branch (49:26): [True: 0, False: 37]
  ------------------
   50|       |      // No connectivity data found.
   51|     11|      return nullptr;
   52|     11|    }
   53|       |    // Connectivity data exists.
   54|     37|    const MeshAttributeCornerTable *const att_ct =
   55|     37|        source->GetAttributeCornerTable(att_id);
   56|     37|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 10, False: 27]
  ------------------
   57|     10|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|     10|      MeshData md;
   59|     10|      md.Set(source->mesh(), att_ct,
   60|     10|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|     10|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|     10|      MeshPredictionSchemeFactoryT factory;
   63|     10|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|     10|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 9, False: 1]
  ------------------
   65|      9|        return ret;
   66|      9|      }
   67|     27|    } else {
   68|     27|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|     27|      MeshData md;
   70|     27|      md.Set(source->mesh(), ct,
   71|     27|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|     27|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|     27|      MeshPredictionSchemeFactoryT factory;
   74|     27|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|     27|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 27, False: 0]
  ------------------
   76|     27|        return ret;
   77|     27|      }
   78|     27|    }
   79|     37|  }
   80|      4|  return nullptr;
   81|     51|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    516|    uint16_t bitstream_version) {
   38|    516|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    516|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 516, False: 0]
  ------------------
   40|    516|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 61, False: 455]
  ------------------
   41|    455|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 68, False: 387]
  ------------------
   42|    387|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 106, False: 281]
  ------------------
   43|    281|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 25, False: 256]
  ------------------
   44|    256|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 229, False: 27]
  ------------------
   45|    502|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 13, False: 14]
  ------------------
   46|    502|    const CornerTable *const ct = source->GetCornerTable();
   47|    502|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    502|        source->GetAttributeEncodingData(att_id);
   49|    502|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 4, False: 498]
  |  Branch (49:26): [True: 0, False: 498]
  ------------------
   50|       |      // No connectivity data found.
   51|      4|      return nullptr;
   52|      4|    }
   53|       |    // Connectivity data exists.
   54|    498|    const MeshAttributeCornerTable *const att_ct =
   55|    498|        source->GetAttributeCornerTable(att_id);
   56|    498|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 203, False: 295]
  ------------------
   57|    203|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    203|      MeshData md;
   59|    203|      md.Set(source->mesh(), att_ct,
   60|    203|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    203|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    203|      MeshPredictionSchemeFactoryT factory;
   63|    203|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    203|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 203, False: 0]
  ------------------
   65|    203|        return ret;
   66|    203|      }
   67|    295|    } else {
   68|    295|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    295|      MeshData md;
   70|    295|      md.Set(source->mesh(), ct,
   71|    295|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    295|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    295|      MeshPredictionSchemeFactoryT factory;
   74|    295|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    295|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 295, False: 0]
  ------------------
   76|    295|        return ret;
   77|    295|      }
   78|    295|    }
   79|    498|  }
   80|     14|  return nullptr;
   81|    516|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|   203k|  bool IsInBottomLeft(const Point2 &p) const {
   93|   203k|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 47.7k, False: 155k]
  |  Branch (93:22): [True: 41.1k, False: 6.56k]
  ------------------
   94|  41.1k|      return true;
   95|  41.1k|    }
   96|   162k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 76.7k, False: 85.3k]
  |  Branch (96:25): [True: 36.4k, False: 40.2k]
  ------------------
   97|   203k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|   203k|  int32_t GetRotationCount(Point2 pred) const {
   51|   203k|    const DataType sign_x = pred[0];
   52|   203k|    const DataType sign_y = pred[1];
   53|       |
   54|   203k|    int32_t rotation_count = 0;
   55|   203k|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 47.7k, False: 155k]
  ------------------
   56|  47.7k|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 41.1k, False: 6.56k]
  ------------------
   57|  41.1k|        rotation_count = 0;
   58|  41.1k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 3.43k, False: 3.13k]
  ------------------
   59|  3.43k|        rotation_count = 3;
   60|  3.43k|      } else {
   61|  3.13k|        rotation_count = 1;
   62|  3.13k|      }
   63|   155k|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 78.7k, False: 76.7k]
  ------------------
   64|  78.7k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 37.1k, False: 41.6k]
  ------------------
   65|  37.1k|        rotation_count = 2;
   66|  41.6k|      } else {
   67|  41.6k|        rotation_count = 1;
   68|  41.6k|      }
   69|  78.7k|    } else {
   70|  76.7k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 36.4k, False: 40.2k]
  ------------------
   71|  36.4k|        rotation_count = 0;
   72|  40.2k|      } else {
   73|  40.2k|        rotation_count = 3;
   74|  40.2k|      }
   75|  76.7k|    }
   76|   203k|    return rotation_count;
   77|   203k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   251k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   251k|    switch (rotation_count) {
   81|  88.4k|      case 1:
  ------------------
  |  Branch (81:7): [True: 88.4k, False: 162k]
  ------------------
   82|  88.4k|        return Point2(p[1], -p[0]);
   83|  74.2k|      case 2:
  ------------------
  |  Branch (83:7): [True: 74.2k, False: 176k]
  ------------------
   84|  74.2k|        return Point2(-p[0], -p[1]);
   85|  88.4k|      case 3:
  ------------------
  |  Branch (85:7): [True: 88.4k, False: 162k]
  ------------------
   86|  88.4k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 251k]
  ------------------
   88|      0|        return p;
   89|   251k|    }
   90|   251k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|     51|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

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

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

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  1.07k|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|  48.7k|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|    610|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  3.11k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  1.17k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  1.17k|    portable_attribute_ = std::move(att);
   71|  1.17k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  3.70k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  4.53k|  virtual ~SequentialAttributeDecoder() = default;

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

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

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

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

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

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

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

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

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

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    227|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    206|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  6.46k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 6.27k, False: 191]
  ------------------
   35|  6.27k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 15, False: 6.25k]
  ------------------
   36|     15|        return false;
   37|     15|      }
   38|  6.27k|    }
   39|    191|    return bit_decoder_.StartDecoding(source_buffer);
   40|    206|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  1.89M|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|  1.89M|    uint32_t result = 0;
   49|  11.6M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 9.77M, False: 1.89M]
  ------------------
   50|  9.77M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  9.77M|      result = (result << 1) + bit;
   52|  9.77M|    }
   53|  1.89M|    *value = result;
   54|  1.89M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|     97|  void EndDecoding() {
   57|  3.20k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 3.10k, False: 97]
  ------------------
   58|  3.10k|      folded_number_decoders_[i].EndDecoding();
   59|  3.10k|    }
   60|     97|    bit_decoder_.EndDecoding();
   61|     97|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    227|  FoldedBit32Decoder() {}

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  10.6k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  8.75k|                                const uint8_t *const buf, int offset) {
  301|  8.75k|  unsigned x;
  302|  8.75k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 10, False: 8.74k]
  ------------------
  303|     10|    return 1;
  304|     10|  }
  305|  8.74k|  ans->buf = buf;
  306|  8.74k|  x = buf[offset - 1] >> 6;
  307|  8.74k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 7.71k, False: 1.03k]
  ------------------
  308|  7.71k|    ans->buf_offset = offset - 1;
  309|  7.71k|    ans->state = buf[offset - 1] & 0x3F;
  310|  7.71k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 974, False: 60]
  ------------------
  311|    974|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 0, False: 974]
  ------------------
  312|      0|      return 1;
  313|      0|    }
  314|    974|    ans->buf_offset = offset - 2;
  315|    974|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|    974|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 56, False: 4]
  ------------------
  317|     56|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 1, False: 55]
  ------------------
  318|      1|      return 1;
  319|      1|    }
  320|     55|    ans->buf_offset = offset - 3;
  321|     55|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|     55|  } else {
  323|      4|    return 1;
  324|      4|  }
  325|  8.73k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  8.73k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  8.73k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  8.73k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  8.73k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 0, False: 8.73k]
  ------------------
  327|      0|    return 1;
  328|      0|  }
  329|  8.73k|  return 0;
  330|  8.73k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    974|static uint32_t mem_get_le16(const void *vmem) {
   68|    974|  uint32_t val;
   69|    974|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    974|  val = mem[1] << 8;
   72|    974|  val |= mem[0];
   73|    974|  return val;
   74|    974|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|     55|static uint32_t mem_get_le24(const void *vmem) {
   77|     55|  uint32_t val;
   78|     55|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|     55|  val = mem[2] << 16;
   81|     55|  val |= mem[1] << 8;
   82|     55|  val |= mem[0];
   83|     55|  return val;
   84|     55|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|   344M|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|   344M|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|   344M|  unsigned quot, rem, x, xn;
  172|   344M|#endif
  173|   344M|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|   344M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|   344M|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|   689M|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 339M, False: 5.17M]
  |  Branch (174:40): [True: 46.7k, False: 339M]
  ------------------
  175|  46.7k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|  46.7k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|  46.7k|  }
  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|   344M|  x = ans->state;
  184|   344M|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|   344M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|   344M|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|   344M|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|   344M|  xn = quot * p;
  187|   344M|  val = rem < p;
  188|   344M|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|   689M|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 340M, False: 4.31M]
  |  |  ------------------
  ------------------
  189|   340M|    ans->state = xn + rem;
  190|   340M|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|  4.31M|    ans->state = x - xn - p;
  193|  4.31M|  }
  194|   344M|#endif
  195|   344M|  return val;
  196|   344M|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  18.9k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  18.9k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  18.9k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  18.9k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|    312|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|    131|                                       uint32_t num_symbols) {
  482|    131|    lut_table_.resize(rans_precision);
  483|    131|    probability_table_.resize(num_symbols);
  484|    131|    uint32_t cum_prob = 0;
  485|    131|    uint32_t act_prob = 0;
  486|  2.27k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 2.18k, False: 99]
  ------------------
  487|  2.18k|      probability_table_[i].prob = token_probs[i];
  488|  2.18k|      probability_table_[i].cum_prob = cum_prob;
  489|  2.18k|      cum_prob += token_probs[i];
  490|  2.18k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 32, False: 2.14k]
  ------------------
  491|     32|        return false;
  492|     32|      }
  493|   278k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 275k, False: 2.14k]
  ------------------
  494|   275k|        lut_table_[j] = i;
  495|   275k|      }
  496|  2.14k|      act_prob = cum_prob;
  497|  2.14k|    }
  498|     99|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 33, False: 66]
  ------------------
  499|     33|      return false;
  500|     33|    }
  501|     66|    return true;
  502|     99|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|     48|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     48|    unsigned x;
  423|     48|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 5, False: 43]
  ------------------
  424|      5|      return 1;
  425|      5|    }
  426|     43|    ans_.buf = buf;
  427|     43|    x = buf[offset - 1] >> 6;
  428|     43|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 24, False: 19]
  ------------------
  429|     24|      ans_.buf_offset = offset - 1;
  430|     24|      ans_.state = buf[offset - 1] & 0x3F;
  431|     24|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 5, False: 14]
  ------------------
  432|      5|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 5]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      5|      ans_.buf_offset = offset - 2;
  436|      5|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     14|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 10, False: 4]
  ------------------
  438|     10|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 10]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|     10|      ans_.buf_offset = offset - 3;
  442|     10|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     10|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 4, False: 0]
  ------------------
  444|      4|      ans_.buf_offset = offset - 4;
  445|      4|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      4|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     43|    ans_.state += l_rans_base;
  450|     43|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     43|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 4, False: 39]
  ------------------
  451|      4|      return 1;
  452|      4|    }
  453|     39|    return 0;
  454|     43|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|     13|static uint32_t mem_get_le16(const void *vmem) {
   68|     13|  uint32_t val;
   69|     13|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|     13|  val = mem[1] << 8;
   72|     13|  val |= mem[0];
   73|     13|  return val;
   74|     13|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|     13|static uint32_t mem_get_le24(const void *vmem) {
   77|     13|  uint32_t val;
   78|     13|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|     13|  val = mem[2] << 16;
   81|     13|  val |= mem[1] << 8;
   82|     13|  val |= mem[0];
   83|     13|  return val;
   84|     13|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|      8|static inline uint32_t mem_get_le32(const void *vmem) {
   87|      8|  uint32_t val;
   88|      8|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|      8|  val = mem[3] << 24;
   91|      8|  val |= mem[2] << 16;
   92|      8|  val |= mem[1] << 8;
   93|      8|  val |= mem[0];
   94|      8|  return val;
   95|      8|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|  1.09M|  inline int rans_read() {
  463|  1.09M|    unsigned rem;
  464|  1.09M|    unsigned quo;
  465|  1.09M|    struct rans_dec_sym sym;
  466|  1.09M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 972k, False: 122k]
  |  Branch (466:40): [True: 2.75k, False: 969k]
  ------------------
  467|  2.75k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  2.75k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  2.75k|    }
  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.09M|    quo = ans_.state / rans_precision;
  472|  1.09M|    rem = ans_.state % rans_precision;
  473|  1.09M|    fetch_sym(&sym, rem);
  474|  1.09M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  1.09M|    return sym.val;
  476|  1.09M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|  1.09M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  1.09M|    uint32_t symbol = lut_table_[rem];
  507|  1.09M|    out->val = symbol;
  508|  1.09M|    out->prob = probability_table_[symbol].prob;
  509|  1.09M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  1.09M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|     32|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|     22|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|     15|                                       uint32_t num_symbols) {
  482|     15|    lut_table_.resize(rans_precision);
  483|     15|    probability_table_.resize(num_symbols);
  484|     15|    uint32_t cum_prob = 0;
  485|     15|    uint32_t act_prob = 0;
  486|    217|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 209, False: 8]
  ------------------
  487|    209|      probability_table_[i].prob = token_probs[i];
  488|    209|      probability_table_[i].cum_prob = cum_prob;
  489|    209|      cum_prob += token_probs[i];
  490|    209|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 7, False: 202]
  ------------------
  491|      7|        return false;
  492|      7|      }
  493|  51.7k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 51.5k, False: 202]
  ------------------
  494|  51.5k|        lut_table_[j] = i;
  495|  51.5k|      }
  496|    202|      act_prob = cum_prob;
  497|    202|    }
  498|      8|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 5, False: 3]
  ------------------
  499|      5|      return false;
  500|      5|    }
  501|      3|    return true;
  502|      8|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|      1|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      1|    unsigned x;
  423|      1|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 1]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  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|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|      6|  inline int rans_read() {
  463|      6|    unsigned rem;
  464|      6|    unsigned quo;
  465|      6|    struct rans_dec_sym sym;
  466|      7|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 1, False: 6]
  |  Branch (466:40): [True: 1, False: 0]
  ------------------
  467|      1|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|      1|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|      1|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|      6|    quo = ans_.state / rans_precision;
  472|      6|    rem = ans_.state % rans_precision;
  473|      6|    fetch_sym(&sym, rem);
  474|      6|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|      6|    return sym.val;
  476|      6|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|      6|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|      6|    uint32_t symbol = lut_table_[rem];
  507|      6|    out->val = symbol;
  508|      6|    out->prob = probability_table_[symbol].prob;
  509|      6|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|      6|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|      1|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|     23|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|     15|                                       uint32_t num_symbols) {
  482|     15|    lut_table_.resize(rans_precision);
  483|     15|    probability_table_.resize(num_symbols);
  484|     15|    uint32_t cum_prob = 0;
  485|     15|    uint32_t act_prob = 0;
  486|     81|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 67, False: 14]
  ------------------
  487|     67|      probability_table_[i].prob = token_probs[i];
  488|     67|      probability_table_[i].cum_prob = cum_prob;
  489|     67|      cum_prob += token_probs[i];
  490|     67|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 1, False: 66]
  ------------------
  491|      1|        return false;
  492|      1|      }
  493|   475k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 475k, False: 66]
  ------------------
  494|   475k|        lut_table_[j] = i;
  495|   475k|      }
  496|     66|      act_prob = cum_prob;
  497|     66|    }
  498|     14|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 0, False: 14]
  ------------------
  499|      0|      return false;
  500|      0|    }
  501|     14|    return true;
  502|     14|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|      5|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      5|    unsigned x;
  423|      5|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 5]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      5|    ans_.buf = buf;
  427|      5|    x = buf[offset - 1] >> 6;
  428|      5|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 0, False: 5]
  ------------------
  429|      0|      ans_.buf_offset = offset - 1;
  430|      0|      ans_.state = buf[offset - 1] & 0x3F;
  431|      5|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 4, False: 1]
  ------------------
  432|      4|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 4]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      4|      ans_.buf_offset = offset - 2;
  436|      4|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      4|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 0, False: 1]
  ------------------
  438|      0|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 0]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      0|      ans_.buf_offset = offset - 3;
  442|      0|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      1|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 1, False: 0]
  ------------------
  444|      1|      ans_.buf_offset = offset - 4;
  445|      1|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      1|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|      5|    ans_.state += l_rans_base;
  450|      5|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      5|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 1, False: 4]
  ------------------
  451|      1|      return 1;
  452|      1|    }
  453|      4|    return 0;
  454|      5|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|  51.8k|  inline int rans_read() {
  463|  51.8k|    unsigned rem;
  464|  51.8k|    unsigned quo;
  465|  51.8k|    struct rans_dec_sym sym;
  466|  55.5k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 26.4k, False: 29.1k]
  |  Branch (466:40): [True: 3.69k, False: 22.7k]
  ------------------
  467|  3.69k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  3.69k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  3.69k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  51.8k|    quo = ans_.state / rans_precision;
  472|  51.8k|    rem = ans_.state % rans_precision;
  473|  51.8k|    fetch_sym(&sym, rem);
  474|  51.8k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  51.8k|    return sym.val;
  476|  51.8k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|  51.8k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  51.8k|    uint32_t symbol = lut_table_[rem];
  507|  51.8k|    out->val = symbol;
  508|  51.8k|    out->prob = probability_table_[symbol].prob;
  509|  51.8k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  51.8k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|      4|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|     20|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|     13|                                       uint32_t num_symbols) {
  482|     13|    lut_table_.resize(rans_precision);
  483|     13|    probability_table_.resize(num_symbols);
  484|     13|    uint32_t cum_prob = 0;
  485|     13|    uint32_t act_prob = 0;
  486|  2.23k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 2.23k, False: 3]
  ------------------
  487|  2.23k|      probability_table_[i].prob = token_probs[i];
  488|  2.23k|      probability_table_[i].cum_prob = cum_prob;
  489|  2.23k|      cum_prob += token_probs[i];
  490|  2.23k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 10, False: 2.22k]
  ------------------
  491|     10|        return false;
  492|     10|      }
  493|   359k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 356k, False: 2.22k]
  ------------------
  494|   356k|        lut_table_[j] = i;
  495|   356k|      }
  496|  2.22k|      act_prob = cum_prob;
  497|  2.22k|    }
  498|      3|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 0, False: 3]
  ------------------
  499|      0|      return false;
  500|      0|    }
  501|      3|    return true;
  502|      3|  }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|     12|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|      3|                                       uint32_t num_symbols) {
  482|      3|    lut_table_.resize(rans_precision);
  483|      3|    probability_table_.resize(num_symbols);
  484|      3|    uint32_t cum_prob = 0;
  485|      3|    uint32_t act_prob = 0;
  486|      7|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 5, False: 2]
  ------------------
  487|      5|      probability_table_[i].prob = token_probs[i];
  488|      5|      probability_table_[i].cum_prob = cum_prob;
  489|      5|      cum_prob += token_probs[i];
  490|      5|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 1, False: 4]
  ------------------
  491|      1|        return false;
  492|      1|      }
  493|   262k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 262k, False: 4]
  ------------------
  494|   262k|        lut_table_[j] = i;
  495|   262k|      }
  496|      4|      act_prob = cum_prob;
  497|      4|    }
  498|      2|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 1, False: 1]
  ------------------
  499|      1|      return false;
  500|      1|    }
  501|      1|    return true;
  502|      2|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|      1|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      1|    unsigned x;
  423|      1|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 1]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      1|    ans_.buf = buf;
  427|      1|    x = buf[offset - 1] >> 6;
  428|      1|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 0, False: 1]
  ------------------
  429|      0|      ans_.buf_offset = offset - 1;
  430|      0|      ans_.state = buf[offset - 1] & 0x3F;
  431|      1|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 1, False: 0]
  ------------------
  432|      1|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 1]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      1|      ans_.buf_offset = offset - 2;
  436|      1|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      1|    } 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|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|  11.6k|  inline int rans_read() {
  463|  11.6k|    unsigned rem;
  464|  11.6k|    unsigned quo;
  465|  11.6k|    struct rans_dec_sym sym;
  466|  12.1k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 482, False: 11.6k]
  |  Branch (466:40): [True: 482, False: 0]
  ------------------
  467|    482|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    482|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    482|    }
  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|  11.6k|    quo = ans_.state / rans_precision;
  472|  11.6k|    rem = ans_.state % rans_precision;
  473|  11.6k|    fetch_sym(&sym, rem);
  474|  11.6k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  11.6k|    return sym.val;
  476|  11.6k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|  11.6k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  11.6k|    uint32_t symbol = lut_table_[rem];
  507|  11.6k|    out->val = symbol;
  508|  11.6k|    out->prob = probability_table_[symbol].prob;
  509|  11.6k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  11.6k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|      1|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|     25|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|     13|                                       uint32_t num_symbols) {
  482|     13|    lut_table_.resize(rans_precision);
  483|     13|    probability_table_.resize(num_symbols);
  484|     13|    uint32_t cum_prob = 0;
  485|     13|    uint32_t act_prob = 0;
  486|  9.14k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 9.13k, False: 11]
  ------------------
  487|  9.13k|      probability_table_[i].prob = token_probs[i];
  488|  9.13k|      probability_table_[i].cum_prob = cum_prob;
  489|  9.13k|      cum_prob += token_probs[i];
  490|  9.13k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 2, False: 9.13k]
  ------------------
  491|      2|        return false;
  492|      2|      }
  493|  5.29M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 5.28M, False: 9.13k]
  ------------------
  494|  5.28M|        lut_table_[j] = i;
  495|  5.28M|      }
  496|  9.13k|      act_prob = cum_prob;
  497|  9.13k|    }
  498|     11|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 2, False: 9]
  ------------------
  499|      2|      return false;
  500|      2|    }
  501|      9|    return true;
  502|     11|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|      6|  inline int read_init(const uint8_t *const buf, int offset) {
  422|      6|    unsigned x;
  423|      6|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 6]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|      6|    ans_.buf = buf;
  427|      6|    x = buf[offset - 1] >> 6;
  428|      6|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 4, False: 2]
  ------------------
  429|      4|      ans_.buf_offset = offset - 1;
  430|      4|      ans_.state = buf[offset - 1] & 0x3F;
  431|      4|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 0, False: 2]
  ------------------
  432|      0|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 0]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      0|      ans_.buf_offset = offset - 2;
  436|      0|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      2|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 0, False: 2]
  ------------------
  438|      0|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 0]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      0|      ans_.buf_offset = offset - 3;
  442|      0|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      2|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 2, False: 0]
  ------------------
  444|      2|      ans_.buf_offset = offset - 4;
  445|      2|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      2|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|      6|    ans_.state += l_rans_base;
  450|      6|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|      6|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 6]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|      6|    return 0;
  454|      6|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|  81.1k|  inline int rans_read() {
  463|  81.1k|    unsigned rem;
  464|  81.1k|    unsigned quo;
  465|  81.1k|    struct rans_dec_sym sym;
  466|  82.8k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 14.2k, False: 68.6k]
  |  Branch (466:40): [True: 1.73k, False: 12.5k]
  ------------------
  467|  1.73k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.73k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.73k|    }
  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|  81.1k|    quo = ans_.state / rans_precision;
  472|  81.1k|    rem = ans_.state % rans_precision;
  473|  81.1k|    fetch_sym(&sym, rem);
  474|  81.1k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  81.1k|    return sym.val;
  476|  81.1k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|  81.1k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  81.1k|    uint32_t symbol = lut_table_[rem];
  507|  81.1k|    out->val = symbol;
  508|  81.1k|    out->prob = probability_table_[symbol].prob;
  509|  81.1k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  81.1k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|      6|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|     74|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|     43|                                       uint32_t num_symbols) {
  482|     43|    lut_table_.resize(rans_precision);
  483|     43|    probability_table_.resize(num_symbols);
  484|     43|    uint32_t cum_prob = 0;
  485|     43|    uint32_t act_prob = 0;
  486|    789|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 754, False: 35]
  ------------------
  487|    754|      probability_table_[i].prob = token_probs[i];
  488|    754|      probability_table_[i].cum_prob = cum_prob;
  489|    754|      cum_prob += token_probs[i];
  490|    754|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 8, False: 746]
  ------------------
  491|      8|        return false;
  492|      8|      }
  493|  36.5M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 36.5M, False: 746]
  ------------------
  494|  36.5M|        lut_table_[j] = i;
  495|  36.5M|      }
  496|    746|      act_prob = cum_prob;
  497|    746|    }
  498|     35|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 1, False: 34]
  ------------------
  499|      1|      return false;
  500|      1|    }
  501|     34|    return true;
  502|     35|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|     10|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     10|    unsigned x;
  423|     10|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 10]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     10|    ans_.buf = buf;
  427|     10|    x = buf[offset - 1] >> 6;
  428|     10|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 3, False: 7]
  ------------------
  429|      3|      ans_.buf_offset = offset - 1;
  430|      3|      ans_.state = buf[offset - 1] & 0x3F;
  431|      7|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 3, False: 4]
  ------------------
  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|      4|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 3, False: 1]
  ------------------
  438|      3|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 3]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      3|      ans_.buf_offset = offset - 3;
  442|      3|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      3|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 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|     10|    ans_.state += l_rans_base;
  450|     10|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     10|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 0, False: 10]
  ------------------
  451|      0|      return 1;
  452|      0|    }
  453|     10|    return 0;
  454|     10|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  3.17M|  inline int rans_read() {
  463|  3.17M|    unsigned rem;
  464|  3.17M|    unsigned quo;
  465|  3.17M|    struct rans_dec_sym sym;
  466|  3.17M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 24.1k, False: 3.15M]
  |  Branch (466:40): [True: 841, False: 23.2k]
  ------------------
  467|    841|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    841|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    841|    }
  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.17M|    quo = ans_.state / rans_precision;
  472|  3.17M|    rem = ans_.state % rans_precision;
  473|  3.17M|    fetch_sym(&sym, rem);
  474|  3.17M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  3.17M|    return sym.val;
  476|  3.17M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  3.17M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  3.17M|    uint32_t symbol = lut_table_[rem];
  507|  3.17M|    out->val = symbol;
  508|  3.17M|    out->prob = probability_table_[symbol].prob;
  509|  3.17M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  3.17M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|     10|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|    116|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|    116|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    116|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 116]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    116|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    116|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    116|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 9, False: 107]
  ------------------
   67|      9|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 9]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      9|  } else
   72|    107|#endif
   73|    107|  {
   74|    107|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 107]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    107|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    116|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 116]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|    116|  probability_table_.resize(num_symbols_);
   86|    116|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 60, False: 56]
  ------------------
   87|     60|    return true;
   88|     60|  }
   89|       |  // Decode the table.
   90|   180k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 180k, False: 35]
  ------------------
   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: 3, False: 180k]
  ------------------
   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|   180k|    const int token = prob_data & 3;
  102|   180k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 52.8k, False: 127k]
  ------------------
  103|  52.8k|      const uint32_t offset = prob_data >> 2;
  104|  52.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 17, False: 52.8k]
  ------------------
  105|     17|        return false;
  106|     17|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.74M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.69M, False: 52.8k]
  ------------------
  109|  1.69M|        probability_table_[i + j] = 0;
  110|  1.69M|      }
  111|  52.8k|      i += offset;
  112|   127k|    } else {
  113|   127k|      const int extra_bytes = token;
  114|   127k|      uint32_t prob = prob_data >> 2;
  115|   220k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 92.9k, False: 127k]
  ------------------
  116|  92.9k|        uint8_t eb;
  117|  92.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 1, False: 92.9k]
  ------------------
  118|      1|          return false;
  119|      1|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  92.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  92.9k|      }
  124|   127k|      probability_table_[i] = prob;
  125|   127k|    }
  126|   180k|  }
  127|     35|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 27, False: 8]
  ------------------
  128|     27|    return false;
  129|     27|  }
  130|      8|  return true;
  131|     35|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|     25|    DecoderBuffer *buffer) {
  136|     25|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     25|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     25|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     25|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 4, False: 21]
  ------------------
  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|     21|#endif
  146|     21|  {
  147|     21|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 21]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     21|  }
  151|     25|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 4, False: 21]
  ------------------
  152|      4|    return false;
  153|      4|  }
  154|     21|  const uint8_t *const data_head =
  155|     21|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     21|  buffer->Advance(bytes_encoded);
  158|     21|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 6, False: 15]
  ------------------
  159|      6|    return false;
  160|      6|  }
  161|     15|  return true;
  162|     21|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|     58|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  49.8k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|      8|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      8|  ans_.read_end();
  167|      8|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|     42|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|     42|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     42|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 42]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     42|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     42|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     42|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 12, False: 30]
  ------------------
   67|     12|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 12]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     12|  } else
   72|     30|#endif
   73|     30|  {
   74|     30|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 30]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     30|  }
   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|     42|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 5, False: 37]
  ------------------
   83|      5|    return false;
   84|      5|  }
   85|     37|  probability_table_.resize(num_symbols_);
   86|     37|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 35]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  2.93M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 2.93M, False: 23]
  ------------------
   91|  2.93M|    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.93M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 7, False: 2.93M]
  ------------------
   95|      7|      return false;
   96|      7|    }
   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.93M|    const int token = prob_data & 3;
  102|  2.93M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.09M, False: 1.83M]
  ------------------
  103|  1.09M|      const uint32_t offset = prob_data >> 2;
  104|  1.09M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 4, False: 1.09M]
  ------------------
  105|      4|        return false;
  106|      4|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  32.5M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 31.4M, False: 1.09M]
  ------------------
  109|  31.4M|        probability_table_[i + j] = 0;
  110|  31.4M|      }
  111|  1.09M|      i += offset;
  112|  1.83M|    } else {
  113|  1.83M|      const int extra_bytes = token;
  114|  1.83M|      uint32_t prob = prob_data >> 2;
  115|  1.90M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 67.4k, False: 1.83M]
  ------------------
  116|  67.4k|        uint8_t eb;
  117|  67.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 1, False: 67.4k]
  ------------------
  118|      1|          return false;
  119|      1|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  67.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  67.4k|      }
  124|  1.83M|      probability_table_[i] = prob;
  125|  1.83M|    }
  126|  2.93M|  }
  127|     23|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 21, False: 2]
  ------------------
  128|     21|    return false;
  129|     21|  }
  130|      2|  return true;
  131|     23|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|      4|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_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|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|    124|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|     39|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|     39|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     39|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 39]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     39|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     39|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     39|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 7, False: 32]
  ------------------
   67|      7|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 7]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      7|  } else
   72|     32|#endif
   73|     32|  {
   74|     32|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 32]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     32|  }
   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|     39|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 35]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|     35|  probability_table_.resize(num_symbols_);
   86|     35|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 35]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   453k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 453k, False: 21]
  ------------------
   91|   453k|    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|   453k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 8, False: 453k]
  ------------------
   95|      8|      return false;
   96|      8|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   453k|    const int token = prob_data & 3;
  102|   453k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 137k, False: 316k]
  ------------------
  103|   137k|      const uint32_t offset = prob_data >> 2;
  104|   137k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 2, False: 137k]
  ------------------
  105|      2|        return false;
  106|      2|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.37M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.23M, False: 137k]
  ------------------
  109|  4.23M|        probability_table_[i + j] = 0;
  110|  4.23M|      }
  111|   137k|      i += offset;
  112|   316k|    } else {
  113|   316k|      const int extra_bytes = token;
  114|   316k|      uint32_t prob = prob_data >> 2;
  115|   577k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 261k, False: 316k]
  ------------------
  116|   261k|        uint8_t eb;
  117|   261k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 4, False: 261k]
  ------------------
  118|      4|          return false;
  119|      4|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   261k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   261k|      }
  124|   316k|      probability_table_[i] = prob;
  125|   316k|    }
  126|   453k|  }
  127|     21|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 7, False: 14]
  ------------------
  128|      7|    return false;
  129|      7|  }
  130|     14|  return true;
  131|     21|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|     14|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|     14|    DecoderBuffer *buffer) {
  136|     14|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     14|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     14|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     14|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 3, False: 11]
  ------------------
  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|     11|#endif
  146|     11|  {
  147|     11|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 11]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     11|  }
  151|     14|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 4, False: 10]
  ------------------
  152|      4|    return false;
  153|      4|  }
  154|     10|  const uint8_t *const data_head =
  155|     10|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     10|  buffer->Advance(bytes_encoded);
  158|     10|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 10]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|     10|  return true;
  162|     10|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|   237k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|     10|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     10|  ans_.read_end();
  167|     10|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|     24|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|     24|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     24|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 24]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     24|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     24|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     24|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 16, False: 8]
  ------------------
   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|      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|     24|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 24]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     24|  probability_table_.resize(num_symbols_);
   86|     24|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 23]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|    125|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 105, False: 20]
  ------------------
   91|    105|    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|    105|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 105]
  ------------------
   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|    105|    const int token = prob_data & 3;
  102|    105|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 22, False: 83]
  ------------------
  103|     22|      const uint32_t offset = prob_data >> 2;
  104|     22|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 3, False: 19]
  ------------------
  105|      3|        return false;
  106|      3|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|    275|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 256, False: 19]
  ------------------
  109|    256|        probability_table_[i + j] = 0;
  110|    256|      }
  111|     19|      i += offset;
  112|     83|    } else {
  113|     83|      const int extra_bytes = token;
  114|     83|      uint32_t prob = prob_data >> 2;
  115|    123|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 40, False: 83]
  ------------------
  116|     40|        uint8_t eb;
  117|     40|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 40]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|     40|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|     40|      }
  124|     83|      probability_table_[i] = prob;
  125|     83|    }
  126|    105|  }
  127|     20|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 19]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|     19|  return true;
  131|     20|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|     20|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_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: 16, False: 3]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 16]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     16|  } 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|     19|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 15, False: 4]
  ------------------
  152|     15|    return false;
  153|     15|  }
  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: 2, False: 2]
  ------------------
  159|      2|    return false;
  160|      2|  }
  161|      2|  return true;
  162|      4|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|     12|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|      6|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|      6|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|      6|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 6]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|      6|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|      6|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      6|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 0, False: 6]
  ------------------
   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|      6|#endif
   73|      6|  {
   74|      6|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 6]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|      6|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|      6|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 6]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|      6|  probability_table_.resize(num_symbols_);
   86|      6|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 6]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  6.08k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 6.08k, False: 3]
  ------------------
   91|  6.08k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  6.08k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 6.08k]
  ------------------
   95|      0|      return false;
   96|      0|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  6.08k|    const int token = prob_data & 3;
  102|  6.08k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 651, False: 5.43k]
  ------------------
  103|    651|      const uint32_t offset = prob_data >> 2;
  104|    651|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 3, False: 648]
  ------------------
  105|      3|        return false;
  106|      3|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  21.8k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 21.2k, False: 648]
  ------------------
  109|  21.2k|        probability_table_[i + j] = 0;
  110|  21.2k|      }
  111|    648|      i += offset;
  112|  5.43k|    } else {
  113|  5.43k|      const int extra_bytes = token;
  114|  5.43k|      uint32_t prob = prob_data >> 2;
  115|  8.70k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.27k, False: 5.43k]
  ------------------
  116|  3.27k|        uint8_t eb;
  117|  3.27k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 3.27k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.27k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.27k|      }
  124|  5.43k|      probability_table_[i] = prob;
  125|  5.43k|    }
  126|  6.08k|  }
  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|      2|  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: 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|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  3.96k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|     20|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_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: 17, False: 3]
  ------------------
   67|     17|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 17]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     17|  } else
   72|      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|     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: 0, False: 19]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  24.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 24.5k, False: 14]
  ------------------
   91|  24.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|  24.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 24.5k]
  ------------------
   95|      0|      return false;
   96|      0|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  24.5k|    const int token = prob_data & 3;
  102|  24.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 7.16k, False: 17.3k]
  ------------------
  103|  7.16k|      const uint32_t offset = prob_data >> 2;
  104|  7.16k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 3, False: 7.16k]
  ------------------
  105|      3|        return false;
  106|      3|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   199k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 191k, False: 7.16k]
  ------------------
  109|   191k|        probability_table_[i + j] = 0;
  110|   191k|      }
  111|  7.16k|      i += offset;
  112|  17.3k|    } else {
  113|  17.3k|      const int extra_bytes = token;
  114|  17.3k|      uint32_t prob = prob_data >> 2;
  115|  30.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 12.6k, False: 17.3k]
  ------------------
  116|  12.6k|        uint8_t eb;
  117|  12.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 2, False: 12.6k]
  ------------------
  118|      2|          return false;
  119|      2|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  12.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  12.6k|      }
  124|  17.3k|      probability_table_[i] = prob;
  125|  17.3k|    }
  126|  24.5k|  }
  127|     14|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 3, False: 11]
  ------------------
  128|      3|    return false;
  129|      3|  }
  130|     11|  return true;
  131|     14|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|     11|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|     11|    DecoderBuffer *buffer) {
  136|     11|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     11|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     11|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     11|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 9, False: 2]
  ------------------
  140|      9|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 9]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      9|  } else
  145|      2|#endif
  146|      2|  {
  147|      2|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 2]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      2|  }
  151|     11|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 9, False: 2]
  ------------------
  152|      9|    return false;
  153|      9|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|   747k|  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|     37|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|     37|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     37|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 37]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     37|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     37|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     37|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 19, False: 18]
  ------------------
   67|     19|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 19]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     19|  } else
   72|     18|#endif
   73|     18|  {
   74|     18|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 18]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     18|  }
   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|     37|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 33]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|     33|  probability_table_.resize(num_symbols_);
   86|     33|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 33]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  1.31M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.31M, False: 7]
  ------------------
   91|  1.31M|    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.31M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 18, False: 1.31M]
  ------------------
   95|     18|      return false;
   96|     18|    }
   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.31M|    const int token = prob_data & 3;
  102|  1.31M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 349k, False: 963k]
  ------------------
  103|   349k|      const uint32_t offset = prob_data >> 2;
  104|   349k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 4, False: 349k]
  ------------------
  105|      4|        return false;
  106|      4|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  11.9M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 11.6M, False: 349k]
  ------------------
  109|  11.6M|        probability_table_[i + j] = 0;
  110|  11.6M|      }
  111|   349k|      i += offset;
  112|   963k|    } else {
  113|   963k|      const int extra_bytes = token;
  114|   963k|      uint32_t prob = prob_data >> 2;
  115|  1.58M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 617k, False: 963k]
  ------------------
  116|   617k|        uint8_t eb;
  117|   617k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 4, False: 617k]
  ------------------
  118|      4|          return false;
  119|      4|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   617k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   617k|      }
  124|   963k|      probability_table_[i] = prob;
  125|   963k|    }
  126|  1.31M|  }
  127|      7|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 3, False: 4]
  ------------------
  128|      3|    return false;
  129|      3|  }
  130|      4|  return true;
  131|      7|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|      4|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|      4|    DecoderBuffer *buffer) {
  136|      4|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      4|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      4|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      4|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 4]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|      4|#endif
  146|      4|  {
  147|      4|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 4]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      4|  }
  151|      4|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 1, False: 3]
  ------------------
  152|      1|    return false;
  153|      1|  }
  154|      3|  const uint8_t *const data_head =
  155|      3|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      3|  buffer->Advance(bytes_encoded);
  158|      3|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 2]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|      2|  return true;
  162|      3|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  26.7k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|     28|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|     28|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     28|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 28]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     28|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     28|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     28|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 16, False: 12]
  ------------------
   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|     12|#endif
   73|     12|  {
   74|     12|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 12]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     12|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     28|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 24]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|     24|  probability_table_.resize(num_symbols_);
   86|     24|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 24]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   496k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 496k, False: 8]
  ------------------
   91|   496k|    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|   496k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 6, False: 496k]
  ------------------
   95|      6|      return false;
   96|      6|    }
   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|   496k|    const int token = prob_data & 3;
  102|   496k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 140k, False: 356k]
  ------------------
  103|   140k|      const uint32_t offset = prob_data >> 2;
  104|   140k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 5, False: 140k]
  ------------------
  105|      5|        return false;
  106|      5|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  5.23M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 5.09M, False: 140k]
  ------------------
  109|  5.09M|        probability_table_[i + j] = 0;
  110|  5.09M|      }
  111|   140k|      i += offset;
  112|   356k|    } else {
  113|   356k|      const int extra_bytes = token;
  114|   356k|      uint32_t prob = prob_data >> 2;
  115|   570k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 213k, False: 356k]
  ------------------
  116|   213k|        uint8_t eb;
  117|   213k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 5, False: 213k]
  ------------------
  118|      5|          return false;
  119|      5|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   213k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   213k|      }
  124|   356k|      probability_table_[i] = prob;
  125|   356k|    }
  126|   496k|  }
  127|      8|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 2, False: 6]
  ------------------
  128|      2|    return false;
  129|      2|  }
  130|      6|  return true;
  131|      8|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|      6|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|      6|    DecoderBuffer *buffer) {
  136|      6|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      6|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      6|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      6|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 3, False: 3]
  ------------------
  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|      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|      6|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 2, False: 4]
  ------------------
  152|      2|    return false;
  153|      2|  }
  154|      4|  const uint8_t *const data_head =
  155|      4|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      4|  buffer->Advance(bytes_encoded);
  158|      4|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 4]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      4|  return true;
  162|      4|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  26.8k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|      4|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      4|  ans_.read_end();
  167|      4|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|     22|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_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: 7, False: 15]
  ------------------
   67|      7|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 7]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      7|  } else
   72|     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|     22|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 22]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     22|  probability_table_.resize(num_symbols_);
   86|     22|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 22]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  7.90k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 7.88k, False: 15]
  ------------------
   91|  7.88k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  7.88k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 7.88k]
  ------------------
   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|  7.88k|    const int token = prob_data & 3;
  102|  7.88k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.17k, False: 5.71k]
  ------------------
  103|  2.17k|      const uint32_t offset = prob_data >> 2;
  104|  2.17k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 6, False: 2.16k]
  ------------------
  105|      6|        return false;
  106|      6|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  77.7k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 75.5k, False: 2.16k]
  ------------------
  109|  75.5k|        probability_table_[i + j] = 0;
  110|  75.5k|      }
  111|  2.16k|      i += offset;
  112|  5.71k|    } else {
  113|  5.71k|      const int extra_bytes = token;
  114|  5.71k|      uint32_t prob = prob_data >> 2;
  115|  9.82k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.11k, False: 5.71k]
  ------------------
  116|  4.11k|        uint8_t eb;
  117|  4.11k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 4.11k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.11k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.11k|      }
  124|  5.71k|      probability_table_[i] = prob;
  125|  5.71k|    }
  126|  7.88k|  }
  127|     15|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 12, False: 3]
  ------------------
  128|     12|    return false;
  129|     12|  }
  130|      3|  return true;
  131|     15|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|      3|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_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|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|      6|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|      1|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      1|  ans_.read_end();
  167|      1|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|     23|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|     23|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     23|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 23]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     23|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     23|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     23|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 2, False: 21]
  ------------------
   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|     21|#endif
   73|     21|  {
   74|     21|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 21]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     21|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     23|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 23]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     23|  probability_table_.resize(num_symbols_);
   86|     23|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 23]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   213k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 213k, False: 15]
  ------------------
   91|   213k|    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|   213k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 213k]
  ------------------
   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|   213k|    const int token = prob_data & 3;
  102|   213k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 77.6k, False: 136k]
  ------------------
  103|  77.6k|      const uint32_t offset = prob_data >> 2;
  104|  77.6k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 2, False: 77.6k]
  ------------------
  105|      2|        return false;
  106|      2|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.77M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.69M, False: 77.6k]
  ------------------
  109|  2.69M|        probability_table_[i + j] = 0;
  110|  2.69M|      }
  111|  77.6k|      i += offset;
  112|   136k|    } else {
  113|   136k|      const int extra_bytes = token;
  114|   136k|      uint32_t prob = prob_data >> 2;
  115|   248k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 111k, False: 136k]
  ------------------
  116|   111k|        uint8_t eb;
  117|   111k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 5, False: 111k]
  ------------------
  118|      5|          return false;
  119|      5|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   111k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   111k|      }
  124|   136k|      probability_table_[i] = prob;
  125|   136k|    }
  126|   213k|  }
  127|     15|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 14]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|     14|  return true;
  131|     15|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|     14|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|     14|    DecoderBuffer *buffer) {
  136|     14|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     14|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     14|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     14|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 14]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|     14|#endif
  146|     14|  {
  147|     14|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 14]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     14|  }
  151|     14|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 9, False: 5]
  ------------------
  152|      9|    return false;
  153|      9|  }
  154|      5|  const uint8_t *const data_head =
  155|      5|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      5|  buffer->Advance(bytes_encoded);
  158|      5|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 4]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|      4|  return true;
  162|      5|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|  51.8k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|      4|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      4|  ans_.read_end();
  167|      4|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|     20|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_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: 16, False: 4]
  ------------------
   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|      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|     20|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 20]
  ------------------
   83|      0|    return false;
   84|      0|  }
   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|  45.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 45.5k, False: 13]
  ------------------
   91|  45.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|  45.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 45.5k]
  ------------------
   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|  45.5k|    const int token = prob_data & 3;
  102|  45.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 23.4k, False: 22.0k]
  ------------------
  103|  23.4k|      const uint32_t offset = prob_data >> 2;
  104|  23.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 6, False: 23.4k]
  ------------------
  105|      6|        return false;
  106|      6|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.11M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.09M, False: 23.4k]
  ------------------
  109|  1.09M|        probability_table_[i + j] = 0;
  110|  1.09M|      }
  111|  23.4k|      i += offset;
  112|  23.4k|    } else {
  113|  22.0k|      const int extra_bytes = token;
  114|  22.0k|      uint32_t prob = prob_data >> 2;
  115|  33.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 11.7k, False: 22.0k]
  ------------------
  116|  11.7k|        uint8_t eb;
  117|  11.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 11.7k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  11.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  11.7k|      }
  124|  22.0k|      probability_table_[i] = prob;
  125|  22.0k|    }
  126|  45.5k|  }
  127|     13|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 10, False: 3]
  ------------------
  128|     10|    return false;
  129|     10|  }
  130|      3|  return true;
  131|     13|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|      3|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_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: 3, False: 0]
  ------------------
  152|      3|    return false;
  153|      3|  }
  154|      0|  const uint8_t *const data_head =
  155|      0|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      0|  buffer->Advance(bytes_encoded);
  158|      0|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 0]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      0|  return true;
  162|      0|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|     12|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|     12|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     12|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 12]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     12|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     12|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     12|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 2, False: 10]
  ------------------
   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|     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|     12|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 12]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     12|  probability_table_.resize(num_symbols_);
   86|     12|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 12]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  63.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 63.0k, False: 3]
  ------------------
   91|  63.0k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  63.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 3, False: 63.0k]
  ------------------
   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|  63.0k|    const int token = prob_data & 3;
  102|  63.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 8.85k, False: 54.2k]
  ------------------
  103|  8.85k|      const uint32_t offset = prob_data >> 2;
  104|  8.85k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 3, False: 8.85k]
  ------------------
  105|      3|        return false;
  106|      3|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   308k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 299k, False: 8.85k]
  ------------------
  109|   299k|        probability_table_[i + j] = 0;
  110|   299k|      }
  111|  8.85k|      i += offset;
  112|  54.2k|    } else {
  113|  54.2k|      const int extra_bytes = token;
  114|  54.2k|      uint32_t prob = prob_data >> 2;
  115|  68.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 13.9k, False: 54.2k]
  ------------------
  116|  13.9k|        uint8_t eb;
  117|  13.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 3, False: 13.9k]
  ------------------
  118|      3|          return false;
  119|      3|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  13.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  13.9k|      }
  124|  54.2k|      probability_table_[i] = prob;
  125|  54.2k|    }
  126|  63.0k|  }
  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|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|      1|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_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|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|  11.6k|  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|     25|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|     25|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     25|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 25]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     25|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     25|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     25|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 2, False: 23]
  ------------------
   67|      2|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 2]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      2|  } else
   72|     23|#endif
   73|     23|  {
   74|     23|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 23]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     23|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     25|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 23]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|     23|  probability_table_.resize(num_symbols_);
   86|     23|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 22]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   261k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 261k, False: 13]
  ------------------
   91|   261k|    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|   261k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 7, False: 261k]
  ------------------
   95|      7|      return false;
   96|      7|    }
   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|   261k|    const int token = prob_data & 3;
  102|   261k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 64.8k, False: 196k]
  ------------------
  103|  64.8k|      const uint32_t offset = prob_data >> 2;
  104|  64.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 1, False: 64.8k]
  ------------------
  105|      1|        return false;
  106|      1|      }
  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.19M, False: 64.8k]
  ------------------
  109|  2.19M|        probability_table_[i + j] = 0;
  110|  2.19M|      }
  111|  64.8k|      i += offset;
  112|   196k|    } else {
  113|   196k|      const int extra_bytes = token;
  114|   196k|      uint32_t prob = prob_data >> 2;
  115|   349k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 153k, False: 196k]
  ------------------
  116|   153k|        uint8_t eb;
  117|   153k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 1, False: 153k]
  ------------------
  118|      1|          return false;
  119|      1|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   153k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   153k|      }
  124|   196k|      probability_table_[i] = prob;
  125|   196k|    }
  126|   261k|  }
  127|     13|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 4, False: 9]
  ------------------
  128|      4|    return false;
  129|      4|  }
  130|      9|  return true;
  131|     13|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|     10|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|      9|    DecoderBuffer *buffer) {
  136|      9|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      9|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      9|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      9|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 9]
  ------------------
  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|      9|#endif
  146|      9|  {
  147|      9|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 9]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      9|  }
  151|      9|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 3, False: 6]
  ------------------
  152|      3|    return false;
  153|      3|  }
  154|      6|  const uint8_t *const data_head =
  155|      6|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      6|  buffer->Advance(bytes_encoded);
  158|      6|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 6]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      6|  return true;
  162|      6|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|  81.1k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|      6|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      6|  ans_.read_end();
  167|      6|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|     21|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|     21|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     21|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 21]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     21|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     21|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     21|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 10, False: 11]
  ------------------
   67|     10|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 10]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     10|  } else
   72|     11|#endif
   73|     11|  {
   74|     11|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 11]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     11|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|     21|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 21]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     21|  probability_table_.resize(num_symbols_);
   86|     21|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 21]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   246k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 246k, False: 9]
  ------------------
   91|   246k|    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|   246k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 246k]
  ------------------
   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|   246k|    const int token = prob_data & 3;
  102|   246k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 74.5k, False: 171k]
  ------------------
  103|  74.5k|      const uint32_t offset = prob_data >> 2;
  104|  74.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 8, False: 74.5k]
  ------------------
  105|      8|        return false;
  106|      8|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.37M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.30M, False: 74.5k]
  ------------------
  109|  3.30M|        probability_table_[i + j] = 0;
  110|  3.30M|      }
  111|  74.5k|      i += offset;
  112|   171k|    } else {
  113|   171k|      const int extra_bytes = token;
  114|   171k|      uint32_t prob = prob_data >> 2;
  115|   294k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 122k, False: 171k]
  ------------------
  116|   122k|        uint8_t eb;
  117|   122k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 3, False: 122k]
  ------------------
  118|      3|          return false;
  119|      3|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   122k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   122k|      }
  124|   171k|      probability_table_[i] = prob;
  125|   171k|    }
  126|   246k|  }
  127|      9|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 4, False: 5]
  ------------------
  128|      4|    return false;
  129|      4|  }
  130|      5|  return true;
  131|      9|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|      5|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|      5|    DecoderBuffer *buffer) {
  136|      5|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      5|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      5|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      5|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 5]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|      5|#endif
  146|      5|  {
  147|      5|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 5]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      5|  }
  151|      5|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 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: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  12.8k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|     20|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_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: 6, False: 14]
  ------------------
   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|     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|     20|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 20]
  ------------------
   83|      0|    return false;
   84|      0|  }
   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|  68.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 68.4k, False: 9]
  ------------------
   91|  68.4k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  68.4k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 3, False: 68.4k]
  ------------------
   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|  68.4k|    const int token = prob_data & 3;
  102|  68.4k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 15.4k, False: 53.0k]
  ------------------
  103|  15.4k|      const uint32_t offset = prob_data >> 2;
  104|  15.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 4, False: 15.4k]
  ------------------
  105|      4|        return false;
  106|      4|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   702k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 687k, False: 15.4k]
  ------------------
  109|   687k|        probability_table_[i + j] = 0;
  110|   687k|      }
  111|  15.4k|      i += offset;
  112|  53.0k|    } else {
  113|  53.0k|      const int extra_bytes = token;
  114|  53.0k|      uint32_t prob = prob_data >> 2;
  115|   109k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 56.8k, False: 53.0k]
  ------------------
  116|  56.8k|        uint8_t eb;
  117|  56.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 4, False: 56.8k]
  ------------------
  118|      4|          return false;
  119|      4|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  56.8k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  56.8k|      }
  124|  53.0k|      probability_table_[i] = prob;
  125|  53.0k|    }
  126|  68.4k|  }
  127|      9|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 2, False: 7]
  ------------------
  128|      2|    return false;
  129|      2|  }
  130|      7|  return true;
  131|      9|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|      7|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_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: 5, False: 2]
  ------------------
  140|      5|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 5]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      5|  } else
  145|      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|      7|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 5, False: 2]
  ------------------
  152|      5|    return false;
  153|      5|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  12.2k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|      6|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|      6|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|      6|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 6]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|      6|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|      6|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      6|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 2, False: 4]
  ------------------
   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|      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|      6|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 6]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|      6|  probability_table_.resize(num_symbols_);
   86|      6|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 6]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  3.90k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 3.90k, False: 4]
  ------------------
   91|  3.90k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  3.90k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 0, False: 3.90k]
  ------------------
   95|      0|      return false;
   96|      0|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  3.90k|    const int token = prob_data & 3;
  102|  3.90k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.68k, False: 1.22k]
  ------------------
  103|  2.68k|      const uint32_t offset = prob_data >> 2;
  104|  2.68k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 2, False: 2.68k]
  ------------------
  105|      2|        return false;
  106|      2|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  84.8k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 82.1k, False: 2.68k]
  ------------------
  109|  82.1k|        probability_table_[i + j] = 0;
  110|  82.1k|      }
  111|  2.68k|      i += offset;
  112|  2.68k|    } else {
  113|  1.22k|      const int extra_bytes = token;
  114|  1.22k|      uint32_t prob = prob_data >> 2;
  115|  1.98k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 759, False: 1.22k]
  ------------------
  116|    759|        uint8_t eb;
  117|    759|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 759]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|    759|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|    759|      }
  124|  1.22k|      probability_table_[i] = prob;
  125|  1.22k|    }
  126|  3.90k|  }
  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|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|      2|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_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|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|     14|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_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: 4, False: 10]
  ------------------
   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|     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|     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|  6.37k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 6.36k, False: 10]
  ------------------
   91|  6.36k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  6.36k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 6.36k]
  ------------------
   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|  6.36k|    const int token = prob_data & 3;
  102|  6.36k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.26k, False: 4.10k]
  ------------------
  103|  2.26k|      const uint32_t offset = prob_data >> 2;
  104|  2.26k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 3, False: 2.26k]
  ------------------
  105|      3|        return false;
  106|      3|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  95.6k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 93.3k, False: 2.26k]
  ------------------
  109|  93.3k|        probability_table_[i + j] = 0;
  110|  93.3k|      }
  111|  2.26k|      i += offset;
  112|  4.10k|    } else {
  113|  4.10k|      const int extra_bytes = token;
  114|  4.10k|      uint32_t prob = prob_data >> 2;
  115|  6.21k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.11k, False: 4.10k]
  ------------------
  116|  2.11k|        uint8_t eb;
  117|  2.11k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 0, False: 2.11k]
  ------------------
  118|      0|          return false;
  119|      0|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.11k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.11k|      }
  124|  4.10k|      probability_table_[i] = prob;
  125|  4.10k|    }
  126|  6.36k|  }
  127|     10|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 1, False: 9]
  ------------------
  128|      1|    return false;
  129|      1|  }
  130|      9|  return true;
  131|     10|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|      9|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|      9|    DecoderBuffer *buffer) {
  136|      9|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|      9|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|      9|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|      9|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 7]
  ------------------
  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|      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|      9|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 5, False: 4]
  ------------------
  152|      5|    return false;
  153|      5|  }
  154|      4|  const uint8_t *const data_head =
  155|      4|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      4|  buffer->Advance(bytes_encoded);
  158|      4|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 4]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      4|  return true;
  162|      4|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  5.78k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|      4|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      4|  ans_.read_end();
  167|      4|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|     13|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|     13|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     13|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 13]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     13|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     13|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     13|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 11, False: 2]
  ------------------
   67|     11|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 11]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     11|  } else
   72|      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|     13|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 13]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     13|  probability_table_.resize(num_symbols_);
   86|     13|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 13]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  52.7k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 52.7k, False: 11]
  ------------------
   91|  52.7k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  52.7k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 1, False: 52.7k]
  ------------------
   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|  52.7k|    const int token = prob_data & 3;
  102|  52.7k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 41.7k, False: 10.9k]
  ------------------
  103|  41.7k|      const uint32_t offset = prob_data >> 2;
  104|  41.7k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 0, False: 41.7k]
  ------------------
  105|      0|        return false;
  106|      0|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   303k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 261k, False: 41.7k]
  ------------------
  109|   261k|        probability_table_[i + j] = 0;
  110|   261k|      }
  111|  41.7k|      i += offset;
  112|  41.7k|    } else {
  113|  10.9k|      const int extra_bytes = token;
  114|  10.9k|      uint32_t prob = prob_data >> 2;
  115|  25.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 14.8k, False: 10.9k]
  ------------------
  116|  14.8k|        uint8_t eb;
  117|  14.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 1, False: 14.8k]
  ------------------
  118|      1|          return false;
  119|      1|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  14.8k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  14.8k|      }
  124|  10.9k|      probability_table_[i] = prob;
  125|  10.9k|    }
  126|  52.7k|  }
  127|     11|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 0, False: 11]
  ------------------
  128|      0|    return false;
  129|      0|  }
  130|     11|  return true;
  131|     11|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|     11|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|     11|    DecoderBuffer *buffer) {
  136|     11|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     11|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     11|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     11|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 9, False: 2]
  ------------------
  140|      9|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 9]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      9|  } else
  145|      2|#endif
  146|      2|  {
  147|      2|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 2]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|      2|  }
  151|     11|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 9, False: 2]
  ------------------
  152|      9|    return false;
  153|      9|  }
  154|      2|  const uint8_t *const data_head =
  155|      2|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      2|  buffer->Advance(bytes_encoded);
  158|      2|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 2]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|      2|  return true;
  162|      2|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  3.14M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|      2|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      2|  ans_.read_end();
  167|      2|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|    685|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|    685|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 0, False: 685]
  ------------------
   35|      0|    return true;
   36|      0|  }
   37|       |  // Decode which scheme to use.
   38|    685|  uint8_t scheme;
   39|    685|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 685]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    685|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 67, False: 618]
  ------------------
   43|     67|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|     67|                                                  src_buffer, out_values);
   45|    618|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 436, False: 182]
  ------------------
   46|    436|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|    436|                                               out_values);
   48|    436|  }
   49|    182|  return false;
   50|    685|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|     67|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|     67|  SymbolDecoderT<5> tag_decoder;
   57|     67|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 48, False: 19]
  ------------------
   58|     48|    return false;
   59|     48|  }
   60|       |
   61|     19|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 10, False: 9]
  ------------------
   62|     10|    return false;
   63|     10|  }
   64|       |
   65|      9|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 9, False: 0]
  |  Branch (65:25): [True: 7, False: 2]
  ------------------
   66|      7|    return false;  // Wrong number of symbols.
   67|      7|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|      2|  src_buffer->StartBitDecoding(false, nullptr);
   72|      2|  int value_id = 0;
   73|  25.3k|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 25.3k, False: 2]
  ------------------
   74|       |    // Decode the tag.
   75|  25.3k|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  75.2k|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 49.8k, False: 25.3k]
  ------------------
   78|  49.8k|      uint32_t val;
   79|  49.8k|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 0, False: 49.8k]
  ------------------
   80|      0|        return false;
   81|      0|      }
   82|  49.8k|      out_values[value_id++] = val;
   83|  49.8k|    }
   84|  25.3k|  }
   85|      2|  tag_decoder.EndDecoding();
   86|      2|  src_buffer->EndBitDecoding();
   87|      2|  return true;
   88|      2|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|    436|                      uint32_t *out_values) {
  117|    436|  uint8_t max_bit_length;
  118|    436|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 0, False: 436]
  ------------------
  119|      0|    return false;
  120|      0|  }
  121|    436|  switch (max_bit_length) {
  122|     42|    case 1:
  ------------------
  |  Branch (122:5): [True: 42, False: 394]
  ------------------
  123|     42|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|     42|                                                         out_values);
  125|     39|    case 2:
  ------------------
  |  Branch (125:5): [True: 39, False: 397]
  ------------------
  126|     39|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|     39|                                                         out_values);
  128|     24|    case 3:
  ------------------
  |  Branch (128:5): [True: 24, False: 412]
  ------------------
  129|     24|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|     24|                                                         out_values);
  131|      6|    case 4:
  ------------------
  |  Branch (131:5): [True: 6, False: 430]
  ------------------
  132|      6|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|      6|                                                         out_values);
  134|     49|    case 5:
  ------------------
  |  Branch (134:5): [True: 49, False: 387]
  ------------------
  135|     49|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|     49|                                                         out_values);
  137|     20|    case 6:
  ------------------
  |  Branch (137:5): [True: 20, False: 416]
  ------------------
  138|     20|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|     20|                                                         out_values);
  140|     37|    case 7:
  ------------------
  |  Branch (140:5): [True: 37, False: 399]
  ------------------
  141|     37|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|     37|                                                         out_values);
  143|     28|    case 8:
  ------------------
  |  Branch (143:5): [True: 28, False: 408]
  ------------------
  144|     28|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|     28|                                                         out_values);
  146|     22|    case 9:
  ------------------
  |  Branch (146:5): [True: 22, False: 414]
  ------------------
  147|     22|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|     22|                                                         out_values);
  149|     23|    case 10:
  ------------------
  |  Branch (149:5): [True: 23, False: 413]
  ------------------
  150|     23|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|     23|          num_values, src_buffer, out_values);
  152|     20|    case 11:
  ------------------
  |  Branch (152:5): [True: 20, False: 416]
  ------------------
  153|     20|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|     20|          num_values, src_buffer, out_values);
  155|     12|    case 12:
  ------------------
  |  Branch (155:5): [True: 12, False: 424]
  ------------------
  156|     12|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|     12|          num_values, src_buffer, out_values);
  158|     25|    case 13:
  ------------------
  |  Branch (158:5): [True: 25, False: 411]
  ------------------
  159|     25|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|     25|          num_values, src_buffer, out_values);
  161|     21|    case 14:
  ------------------
  |  Branch (161:5): [True: 21, False: 415]
  ------------------
  162|     21|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|     21|          num_values, src_buffer, out_values);
  164|     20|    case 15:
  ------------------
  |  Branch (164:5): [True: 20, False: 416]
  ------------------
  165|     20|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|     20|          num_values, src_buffer, out_values);
  167|      6|    case 16:
  ------------------
  |  Branch (167:5): [True: 6, False: 430]
  ------------------
  168|      6|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|      6|          num_values, src_buffer, out_values);
  170|     14|    case 17:
  ------------------
  |  Branch (170:5): [True: 14, False: 422]
  ------------------
  171|     14|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|     14|          num_values, src_buffer, out_values);
  173|     13|    case 18:
  ------------------
  |  Branch (173:5): [True: 13, False: 423]
  ------------------
  174|     13|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|     13|          num_values, src_buffer, out_values);
  176|     15|    default:
  ------------------
  |  Branch (176:5): [True: 15, False: 421]
  ------------------
  177|     15|      return false;
  178|    436|  }
  179|    436|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|     42|                              uint32_t *out_values) {
   93|     42|  SymbolDecoderT decoder;
   94|     42|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 38, False: 4]
  ------------------
   95|     38|    return false;
   96|     38|  }
   97|       |
   98|      4|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 4, False: 0]
  |  Branch (98:25): [True: 2, False: 2]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|      2|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 2]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|    126|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 124, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|    124|    const uint32_t value = decoder.DecodeSymbol();
  108|    124|    out_values[i] = value;
  109|    124|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      2|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|     39|                              uint32_t *out_values) {
   93|     39|  SymbolDecoderT decoder;
   94|     39|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 25, False: 14]
  ------------------
   95|     25|    return false;
   96|     25|  }
   97|       |
   98|     14|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 14, False: 0]
  |  Branch (98:25): [True: 0, False: 14]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     14|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 4, False: 10]
  ------------------
  103|      4|    return false;
  104|      4|  }
  105|   237k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 237k, False: 10]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   237k|    const uint32_t value = decoder.DecodeSymbol();
  108|   237k|    out_values[i] = value;
  109|   237k|  }
  110|     10|  decoder.EndDecoding();
  111|     10|  return true;
  112|     14|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|     24|                              uint32_t *out_values) {
   93|     24|  SymbolDecoderT decoder;
   94|     24|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 4, False: 20]
  ------------------
   95|      4|    return false;
   96|      4|  }
   97|       |
   98|     20|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 20, False: 0]
  |  Branch (98:25): [True: 1, False: 19]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     19|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 17, False: 2]
  ------------------
  103|     17|    return false;
  104|     17|  }
  105|     14|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|     12|    const uint32_t value = decoder.DecodeSymbol();
  108|     12|    out_values[i] = value;
  109|     12|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|     19|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|      6|                              uint32_t *out_values) {
   93|      6|  SymbolDecoderT decoder;
   94|      6|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 4, False: 2]
  ------------------
   95|      4|    return false;
   96|      4|  }
   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|  3.96k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.96k, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.96k|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.96k|    out_values[i] = value;
  109|  3.96k|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      2|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|     49|                              uint32_t *out_values) {
   93|     49|  SymbolDecoderT decoder;
   94|     49|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 0, False: 49]
  ------------------
   95|      0|    return false;
   96|      0|  }
   97|       |
   98|     49|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 49, False: 0]
  |  Branch (98:25): [True: 43, False: 6]
  ------------------
   99|     43|    return false;  // Wrong number of symbols.
  100|     43|  }
  101|       |
  102|      6|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 6]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|  24.4k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 24.4k, False: 6]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  24.4k|    const uint32_t value = decoder.DecodeSymbol();
  108|  24.4k|    out_values[i] = value;
  109|  24.4k|  }
  110|      6|  decoder.EndDecoding();
  111|      6|  return true;
  112|      6|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|     20|                              uint32_t *out_values) {
   93|     20|  SymbolDecoderT decoder;
   94|     20|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 9, False: 11]
  ------------------
   95|      9|    return false;
   96|      9|  }
   97|       |
   98|     11|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 11, False: 0]
  |  Branch (98:25): [True: 0, False: 11]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     11|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 9, False: 2]
  ------------------
  103|      9|    return false;
  104|      9|  }
  105|   747k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 747k, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   747k|    const uint32_t value = decoder.DecodeSymbol();
  108|   747k|    out_values[i] = value;
  109|   747k|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|     11|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|     37|                              uint32_t *out_values) {
   93|     37|  SymbolDecoderT decoder;
   94|     37|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 33, False: 4]
  ------------------
   95|     33|    return false;
   96|     33|  }
   97|       |
   98|      4|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 4, False: 0]
  |  Branch (98:25): [True: 0, False: 4]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      4|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 2, False: 2]
  ------------------
  103|      2|    return false;
  104|      2|  }
  105|  26.7k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 26.7k, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  26.7k|    const uint32_t value = decoder.DecodeSymbol();
  108|  26.7k|    out_values[i] = value;
  109|  26.7k|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      4|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|     28|                              uint32_t *out_values) {
   93|     28|  SymbolDecoderT decoder;
   94|     28|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 22, False: 6]
  ------------------
   95|     22|    return false;
   96|     22|  }
   97|       |
   98|      6|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 6, False: 0]
  |  Branch (98:25): [True: 0, False: 6]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      6|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 2, False: 4]
  ------------------
  103|      2|    return false;
  104|      2|  }
  105|  26.8k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 26.8k, False: 4]
  ------------------
  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|      4|  decoder.EndDecoding();
  111|      4|  return true;
  112|      6|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_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: 2, False: 1]
  ------------------
  103|      2|    return false;
  104|      2|  }
  105|      7|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6, False: 1]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|      6|    const uint32_t value = decoder.DecodeSymbol();
  108|      6|    out_values[i] = value;
  109|      6|  }
  110|      1|  decoder.EndDecoding();
  111|      1|  return true;
  112|      3|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|     23|                              uint32_t *out_values) {
   93|     23|  SymbolDecoderT decoder;
   94|     23|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 9, False: 14]
  ------------------
   95|      9|    return false;
   96|      9|  }
   97|       |
   98|     14|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 14, False: 0]
  |  Branch (98:25): [True: 0, False: 14]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     14|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 10, False: 4]
  ------------------
  103|     10|    return false;
  104|     10|  }
  105|  51.8k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 51.8k, False: 4]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  51.8k|    const uint32_t value = decoder.DecodeSymbol();
  108|  51.8k|    out_values[i] = value;
  109|  51.8k|  }
  110|      4|  decoder.EndDecoding();
  111|      4|  return true;
  112|     14|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|     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: 0, False: 3]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      3|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 3, False: 0]
  ------------------
  103|      3|    return false;
  104|      3|  }
  105|      0|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 0, False: 0]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|      0|    const uint32_t value = decoder.DecodeSymbol();
  108|      0|    out_values[i] = value;
  109|      0|  }
  110|      0|  decoder.EndDecoding();
  111|      0|  return true;
  112|      3|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|     12|                              uint32_t *out_values) {
   93|     12|  SymbolDecoderT decoder;
   94|     12|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 11, False: 1]
  ------------------
   95|     11|    return false;
   96|     11|  }
   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|  11.6k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 11.6k, False: 1]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  11.6k|    const uint32_t value = decoder.DecodeSymbol();
  108|  11.6k|    out_values[i] = value;
  109|  11.6k|  }
  110|      1|  decoder.EndDecoding();
  111|      1|  return true;
  112|      1|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|     25|                              uint32_t *out_values) {
   93|     25|  SymbolDecoderT decoder;
   94|     25|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 15, False: 10]
  ------------------
   95|     15|    return false;
   96|     15|  }
   97|       |
   98|     10|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 10, False: 0]
  |  Branch (98:25): [True: 1, False: 9]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|      9|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 3, False: 6]
  ------------------
  103|      3|    return false;
  104|      3|  }
  105|  81.1k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 81.1k, False: 6]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  81.1k|    const uint32_t value = decoder.DecodeSymbol();
  108|  81.1k|    out_values[i] = value;
  109|  81.1k|  }
  110|      6|  decoder.EndDecoding();
  111|      6|  return true;
  112|      9|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|     21|                              uint32_t *out_values) {
   93|     21|  SymbolDecoderT decoder;
   94|     21|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 16, False: 5]
  ------------------
   95|     16|    return false;
   96|     16|  }
   97|       |
   98|      5|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 5, False: 0]
  |  Branch (98:25): [True: 0, False: 5]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      5|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 3, False: 2]
  ------------------
  103|      3|    return false;
  104|      3|  }
  105|  12.8k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.8k, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.8k|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.8k|    out_values[i] = value;
  109|  12.8k|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      5|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|     20|                              uint32_t *out_values) {
   93|     20|  SymbolDecoderT decoder;
   94|     20|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 13, False: 7]
  ------------------
   95|     13|    return false;
   96|     13|  }
   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: 5, False: 2]
  ------------------
  103|      5|    return false;
  104|      5|  }
  105|  12.2k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.2k, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.2k|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.2k|    out_values[i] = value;
  109|  12.2k|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|      7|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|      6|                              uint32_t *out_values) {
   93|      6|  SymbolDecoderT decoder;
   94|      6|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 4, False: 2]
  ------------------
   95|      4|    return false;
   96|      4|  }
   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_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|     14|                              uint32_t *out_values) {
   93|     14|  SymbolDecoderT decoder;
   94|     14|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 5, False: 9]
  ------------------
   95|      5|    return false;
   96|      5|  }
   97|       |
   98|      9|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 9, False: 0]
  |  Branch (98:25): [True: 0, False: 9]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|      9|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 5, False: 4]
  ------------------
  103|      5|    return false;
  104|      5|  }
  105|  5.78k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.78k, False: 4]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.78k|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.78k|    out_values[i] = value;
  109|  5.78k|  }
  110|      4|  decoder.EndDecoding();
  111|      4|  return true;
  112|      9|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|     13|                              uint32_t *out_values) {
   93|     13|  SymbolDecoderT decoder;
   94|     13|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 2, False: 11]
  ------------------
   95|      2|    return false;
   96|      2|  }
   97|       |
   98|     11|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 11, False: 0]
  |  Branch (98:25): [True: 0, False: 11]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     11|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 9, False: 2]
  ------------------
  103|      9|    return false;
  104|      9|  }
  105|  3.14M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.14M, False: 2]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.14M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.14M|    out_values[i] = value;
  109|  3.14M|  }
  110|      2|  decoder.EndDecoding();
  111|      2|  return true;
  112|     11|}

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|    122|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|   664k|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|   664k|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 664k, False: 531]
  ------------------
   61|   664k|      return true;  // Already traversed.
   62|   664k|    }
   63|       |
   64|    531|    corner_traversal_stack_.clear();
   65|    531|    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|    531|    const VertexIndex next_vert =
   69|    531|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|    531|    const VertexIndex prev_vert =
   71|    531|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|    531|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 531]
  |  Branch (72:45): [True: 0, False: 531]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|    531|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 519, False: 12]
  ------------------
   76|    519|      this->MarkVertexVisited(next_vert);
   77|    519|      this->traversal_observer().OnNewVertexVisited(
   78|    519|          next_vert, this->corner_table()->Next(corner_id));
   79|    519|    }
   80|    531|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 497, False: 34]
  ------------------
   81|    497|      this->MarkVertexVisited(prev_vert);
   82|    497|      this->traversal_observer().OnNewVertexVisited(
   83|    497|          prev_vert, this->corner_table()->Previous(corner_id));
   84|    497|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  3.36k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 2.83k, False: 531]
  ------------------
   88|       |      // Currently processed corner.
   89|  2.83k|      corner_id = corner_traversal_stack_.back();
   90|  2.83k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  2.83k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 2.83k]
  |  Branch (92:47): [True: 105, False: 2.72k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    105|        corner_traversal_stack_.pop_back();
   95|    105|        continue;
   96|    105|      }
   97|   664k|      while (true) {
  ------------------
  |  Branch (97:14): [True: 664k, Folded]
  ------------------
   98|   664k|        this->MarkFaceVisited(face_id);
   99|   664k|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|   664k|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|   664k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 664k]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|   664k|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 332k, False: 332k]
  ------------------
  105|   332k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|   332k|          this->MarkVertexVisited(vert_id);
  107|   332k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|   332k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 331k, False: 1.07k]
  ------------------
  109|   331k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   331k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   331k|            continue;
  112|   331k|          }
  113|   332k|        }
  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|   333k|        const CornerIndex right_corner_id =
  118|   333k|            this->corner_table()->GetRightCorner(corner_id);
  119|   333k|        const CornerIndex left_corner_id =
  120|   333k|            this->corner_table()->GetLeftCorner(corner_id);
  121|   333k|        const FaceIndex right_face_id(
  122|   333k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 891, False: 332k]
  ------------------
  123|   333k|                 ? kInvalidFaceIndex
  124|   333k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|   333k|        const FaceIndex left_face_id(
  126|   333k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 552, False: 332k]
  ------------------
  127|   333k|                 ? kInvalidFaceIndex
  128|   333k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|   333k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 331k, False: 2.02k]
  ------------------
  130|       |          // Right face has been already visited.
  131|   331k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 1.57k, False: 329k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  1.57k|            corner_traversal_stack_.pop_back();
  134|  1.57k|            break;  // Break from the while (true) loop.
  135|   329k|          } else {
  136|       |            // Go to the left face.
  137|   329k|            corner_id = left_corner_id;
  138|   329k|            face_id = left_face_id;
  139|   329k|          }
  140|   331k|        } else {
  141|       |          // Right face was not visited.
  142|  2.02k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 879, False: 1.15k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|    879|            corner_id = right_corner_id;
  145|    879|            face_id = right_face_id;
  146|  1.15k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  1.15k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  1.15k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  1.15k|            break;
  159|  1.15k|          }
  160|  2.02k|        }
  161|   333k|      }
  162|  2.72k|    }
  163|    531|    return true;
  164|    531|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|    122|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|    250|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|    127|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  60.3k|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  60.3k|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 42.0k, False: 18.2k]
  ------------------
   61|  42.0k|      return true;  // Already traversed.
   62|  42.0k|    }
   63|       |
   64|  18.2k|    corner_traversal_stack_.clear();
   65|  18.2k|    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|  18.2k|    const VertexIndex next_vert =
   69|  18.2k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  18.2k|    const VertexIndex prev_vert =
   71|  18.2k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  18.2k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 18.2k]
  |  Branch (72:45): [True: 0, False: 18.2k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  18.2k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 18.1k, False: 115]
  ------------------
   76|  18.1k|      this->MarkVertexVisited(next_vert);
   77|  18.1k|      this->traversal_observer().OnNewVertexVisited(
   78|  18.1k|          next_vert, this->corner_table()->Next(corner_id));
   79|  18.1k|    }
   80|  18.2k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 18.0k, False: 148]
  ------------------
   81|  18.0k|      this->MarkVertexVisited(prev_vert);
   82|  18.0k|      this->traversal_observer().OnNewVertexVisited(
   83|  18.0k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  18.0k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  39.1k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 20.9k, False: 18.2k]
  ------------------
   88|       |      // Currently processed corner.
   89|  20.9k|      corner_id = corner_traversal_stack_.back();
   90|  20.9k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  20.9k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 20.9k]
  |  Branch (92:47): [True: 234, False: 20.6k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    234|        corner_traversal_stack_.pop_back();
   95|    234|        continue;
   96|    234|      }
   97|  60.3k|      while (true) {
  ------------------
  |  Branch (97:14): [True: 60.3k, Folded]
  ------------------
   98|  60.3k|        this->MarkFaceVisited(face_id);
   99|  60.3k|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  60.3k|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  60.3k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 60.3k]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  60.3k|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 39.9k, False: 20.3k]
  ------------------
  105|  39.9k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  39.9k|          this->MarkVertexVisited(vert_id);
  107|  39.9k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  39.9k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 19.5k, False: 20.4k]
  ------------------
  109|  19.5k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  19.5k|            face_id = FaceIndex(corner_id.value() / 3);
  111|  19.5k|            continue;
  112|  19.5k|          }
  113|  39.9k|        }
  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|  40.7k|        const CornerIndex right_corner_id =
  118|  40.7k|            this->corner_table()->GetRightCorner(corner_id);
  119|  40.7k|        const CornerIndex left_corner_id =
  120|  40.7k|            this->corner_table()->GetLeftCorner(corner_id);
  121|  40.7k|        const FaceIndex right_face_id(
  122|  40.7k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 19.4k, False: 21.3k]
  ------------------
  123|  40.7k|                 ? kInvalidFaceIndex
  124|  40.7k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  40.7k|        const FaceIndex left_face_id(
  126|  40.7k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 19.2k, False: 21.5k]
  ------------------
  127|  40.7k|                 ? kInvalidFaceIndex
  128|  40.7k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  40.7k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 38.5k, False: 2.23k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  38.5k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 19.3k, False: 19.1k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  19.3k|            corner_traversal_stack_.pop_back();
  134|  19.3k|            break;  // Break from the while (true) loop.
  135|  19.3k|          } else {
  136|       |            // Go to the left face.
  137|  19.1k|            corner_id = left_corner_id;
  138|  19.1k|            face_id = left_face_id;
  139|  19.1k|          }
  140|  38.5k|        } else {
  141|       |          // Right face was not visited.
  142|  2.23k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 889, False: 1.34k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|    889|            corner_id = right_corner_id;
  145|    889|            face_id = right_face_id;
  146|  1.34k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  1.34k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  1.34k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  1.34k|            break;
  159|  1.34k|          }
  160|  2.23k|        }
  161|  40.7k|      }
  162|  20.6k|    }
  163|  18.2k|    return true;
  164|  18.2k|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|    127|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|    262|  DepthFirstTraverser() {}

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

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|     19|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|    613|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|    613|    const auto *corner_table = traverser_.corner_table();
   50|    613|    attribute->SetExplicitMapping(mesh_->num_points());
   51|    613|    const size_t num_faces = mesh_->num_faces();
   52|    613|    const size_t num_points = mesh_->num_points();
   53|   134k|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 133k, False: 613]
  ------------------
   54|   133k|      const auto &face = mesh_->face(f);
   55|   534k|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 400k, False: 133k]
  ------------------
   56|   400k|        const PointIndex point_id = face[p];
   57|   400k|        const VertexIndex vert_id =
   58|   400k|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|   400k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 400k]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|   400k|        const AttributeValueIndex att_entry_id(
   63|   400k|            encoding_data_
   64|   400k|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|   400k|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 400k]
  |  Branch (65:13): [True: 0, False: 400k]
  |  Branch (65:39): [True: 0, False: 400k]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|   400k|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|   400k|      }
   71|   133k|    }
   72|    613|    return true;
   73|    613|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|     19|  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|     19|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|     19|    traverser_.OnTraversalStart();
   82|     19|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 19]
  ------------------
   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|     19|    } else {
   89|     19|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  42.8k|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 42.8k, False: 19]
  ------------------
   91|  42.8k|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 42.8k]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  42.8k|      }
   95|     19|    }
   96|     19|    traverser_.OnTraversalEnd();
   97|     19|    return true;
   98|     19|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  42.8k|  bool ProcessCorner(CornerIndex corner_id) {
  102|  42.8k|    return traverser_.TraverseFromCorner(corner_id);
  103|  42.8k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|     19|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    125|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  1.19k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  1.19k|    const auto *corner_table = traverser_.corner_table();
   50|  1.19k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  1.19k|    const size_t num_faces = mesh_->num_faces();
   52|  1.19k|    const size_t num_points = mesh_->num_points();
   53|  1.42M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 1.42M, False: 1.19k]
  ------------------
   54|  1.42M|      const auto &face = mesh_->face(f);
   55|  5.68M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 4.26M, False: 1.42M]
  ------------------
   56|  4.26M|        const PointIndex point_id = face[p];
   57|  4.26M|        const VertexIndex vert_id =
   58|  4.26M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  4.26M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 4.26M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  4.26M|        const AttributeValueIndex att_entry_id(
   63|  4.26M|            encoding_data_
   64|  4.26M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  4.26M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 4.26M]
  |  Branch (65:13): [True: 0, False: 4.26M]
  |  Branch (65:39): [True: 0, False: 4.26M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  4.26M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  4.26M|      }
   71|  1.42M|    }
   72|  1.19k|    return true;
   73|  1.19k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    122|  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|    122|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    122|    traverser_.OnTraversalStart();
   82|    122|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 122]
  ------------------
   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|    122|    } else {
   89|    122|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|   665k|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 664k, False: 122]
  ------------------
   91|   664k|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 664k]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|   664k|      }
   95|    122|    }
   96|    122|    traverser_.OnTraversalEnd();
   97|    122|    return true;
   98|    122|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   664k|  bool ProcessCorner(CornerIndex corner_id) {
  102|   664k|    return traverser_.TraverseFromCorner(corner_id);
  103|   664k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    125|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    131|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  2.51k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  2.51k|    const auto *corner_table = traverser_.corner_table();
   50|  2.51k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  2.51k|    const size_t num_faces = mesh_->num_faces();
   52|  2.51k|    const size_t num_points = mesh_->num_points();
   53|   177k|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 175k, False: 2.51k]
  ------------------
   54|   175k|      const auto &face = mesh_->face(f);
   55|   700k|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 525k, False: 175k]
  ------------------
   56|   525k|        const PointIndex point_id = face[p];
   57|   525k|        const VertexIndex vert_id =
   58|   525k|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|   525k|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 525k]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|   525k|        const AttributeValueIndex att_entry_id(
   63|   525k|            encoding_data_
   64|   525k|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|   525k|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 525k]
  |  Branch (65:13): [True: 0, False: 525k]
  |  Branch (65:39): [True: 0, False: 525k]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|   525k|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|   525k|      }
   71|   175k|    }
   72|  2.51k|    return true;
   73|  2.51k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    127|  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|    127|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    127|    traverser_.OnTraversalStart();
   82|    127|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 127]
  ------------------
   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|    127|    } else {
   89|    127|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  60.4k|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 60.3k, False: 127]
  ------------------
   91|  60.3k|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 60.3k]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  60.3k|      }
   95|    127|    }
   96|    127|    traverser_.OnTraversalEnd();
   97|    127|    return true;
   98|    127|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  60.3k|  bool ProcessCorner(CornerIndex corner_id) {
  102|  60.3k|    return traverser_.TraverseFromCorner(corner_id);
  103|  60.3k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    131|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|    262|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  2.40M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|   900k|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|   900k|    return is_vertex_visited_[vert_id.value()];
   65|   900k|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|   356k|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|   356k|    is_vertex_visited_[vert_id.value()] = true;
   68|   356k|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  1.06M|  inline TraversalObserverT &traversal_observer() {
   75|  1.06M|    return traversal_observer_;
   76|  1.06M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|   831k|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|   831k|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 2.84k, False: 828k]
  ------------------
   47|  2.84k|      return true;  // Invalid faces are always considered as visited.
   48|  2.84k|    }
   49|   828k|    return is_face_visited_[face_id.value()];
   50|   831k|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|   707k|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|   707k|    is_face_visited_[face_id.value()] = true;
   62|   707k|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|    288|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|    288|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|    144|                    TraversalObserver traversal_observer) {
   37|    144|    corner_table_ = corner_table;
   38|    144|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|    144|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|    144|    traversal_observer_ = traversal_observer;
   41|    144|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|   664k|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|   664k|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 664k]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|   664k|    return is_face_visited_[corner_id.value() / 3];
   58|   664k|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|   313k|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  60.3k|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  60.3k|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 60.3k]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  60.3k|    return is_face_visited_[corner_id.value() / 3];
   58|  60.3k|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  96.7k|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  96.7k|    return is_vertex_visited_[vert_id.value()];
   65|  96.7k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  76.1k|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  76.1k|    is_vertex_visited_[vert_id.value()] = true;
   68|  76.1k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|   136k|  inline TraversalObserverT &traversal_observer() {
   75|   136k|    return traversal_observer_;
   76|   136k|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|   102k|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|   102k|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 38.6k, False: 63.8k]
  ------------------
   47|  38.6k|      return true;  // Invalid faces are always considered as visited.
   48|  38.6k|    }
   49|  63.8k|    return is_face_visited_[face_id.value()];
   50|   102k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  60.3k|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  60.3k|    is_face_visited_[face_id.value()] = true;
   62|  60.3k|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|    262|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|    131|                    TraversalObserver traversal_observer) {
   37|    131|    corner_table_ = corner_table;
   38|    131|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|    131|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|    131|    traversal_observer_ = traversal_observer;
   41|    131|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     14|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     14|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 14]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     14|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 11]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|     11|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 11]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     11|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 2, False: 9]
  ------------------
  196|      2|    return true;
  197|      2|  }
  198|      9|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 1, False: 8]
  ------------------
  199|      1|    return false;
  200|      1|  }
  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: 0, False: 8]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      8|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 7]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|      7|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 6]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|      6|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 6, False: 0]
  ------------------
  217|      6|    return false;
  218|      6|  }
  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|      6|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|      6|    uint32_t num_points, OutputIteratorT &oit) {
  254|      6|  typedef DecodingStatus Status;
  255|      6|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|      6|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|      6|  DecodingStatus init_status(num_points, 0, 0);
  258|      6|  std::stack<Status> status_stack;
  259|      6|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  3.11k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 3.11k, False: 0]
  ------------------
  263|  3.11k|    const DecodingStatus status = status_stack.top();
  264|  3.11k|    status_stack.pop();
  265|       |
  266|  3.11k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  3.11k|    const uint32_t last_axis = status.last_axis;
  268|  3.11k|    const uint32_t stack_pos = status.stack_pos;
  269|  3.11k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  3.11k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  3.11k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 3.11k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  3.11k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  3.11k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 3.11k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  3.11k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  3.11k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 580, False: 2.53k]
  ------------------
  285|  1.72k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 1.14k, False: 580]
  ------------------
  286|  1.14k|        *oit = old_base;
  287|  1.14k|        ++oit;
  288|  1.14k|        ++num_decoded_points_;
  289|  1.14k|      }
  290|    580|      continue;
  291|    580|    }
  292|       |
  293|  2.53k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  2.53k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 901, False: 1.63k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    901|      axes_[0] = axis;
  300|  8.45k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 7.54k, False: 901]
  ------------------
  301|  7.54k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  7.54k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 426, False: 7.12k]
  |  |  ------------------
  ------------------
  302|  7.54k|      }
  303|  2.44k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.54k, False: 900]
  ------------------
  304|  15.8k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 14.3k, False: 1.54k]
  ------------------
  305|  14.3k|          p_[axes_[j]] = 0;
  306|  14.3k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  14.3k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 4.95k, False: 9.37k]
  ------------------
  308|  4.95k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 1, False: 4.95k]
  ------------------
  309|  4.95k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      1|              return false;
  311|      1|            }
  312|  4.95k|          }
  313|  14.3k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  14.3k|        }
  315|  1.54k|        *oit = p_;
  316|  1.54k|        ++oit;
  317|  1.54k|        ++num_decoded_points_;
  318|  1.54k|      }
  319|    900|      continue;
  320|    901|    }
  321|       |
  322|  1.63k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.63k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.63k|    const int num_remaining_bits = bit_length_ - level;
  327|  1.63k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.63k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.63k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.63k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.63k|    uint32_t number = 0;
  334|  1.63k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.63k|    uint32_t first_half = num_remaining_points / 2;
  337|  1.63k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 5, False: 1.62k]
  ------------------
  338|       |      // Invalid |number|.
  339|      5|      return false;
  340|      5|    }
  341|  1.62k|    first_half -= number;
  342|  1.62k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.62k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.10k, False: 521]
  ------------------
  345|  1.10k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 753, False: 354]
  ------------------
  346|    753|        std::swap(first_half, second_half);
  347|    753|      }
  348|  1.10k|    }
  349|       |
  350|  1.62k|    levels_stack_[stack_pos][axis] += 1;
  351|  1.62k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.62k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.59k, False: 36]
  ------------------
  353|  1.59k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.59k|    }
  355|  1.62k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.57k, False: 55]
  ------------------
  356|  1.57k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.57k|    }
  358|  1.62k|  }
  359|      0|  return true;
  360|      6|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  134|  3.17k|        : num_remaining_points(num_remaining_points_),
  135|  3.17k|          last_axis(last_axis_),
  136|  3.17k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|  1.63k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.63k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.63k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|      2|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|     16|      : bit_length_(0),
   87|     16|        num_points_(0),
   88|     16|        num_decoded_points_(0),
   89|     16|        dimension_(dimension),
   90|     16|        p_(dimension, 0),
   91|     16|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     16|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     16|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     17|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     17|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 17]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     17|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 16]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     16|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 16]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     16|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 2, False: 14]
  ------------------
  196|      2|    return true;
  197|      2|  }
  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: 0, False: 14]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|     14|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 14]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     14|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 13]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     13|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 11]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     11|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 11, False: 0]
  ------------------
  217|     11|    return false;
  218|     11|  }
  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|     11|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     11|    uint32_t num_points, OutputIteratorT &oit) {
  254|     11|  typedef DecodingStatus Status;
  255|     11|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     11|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     11|  DecodingStatus init_status(num_points, 0, 0);
  258|     11|  std::stack<Status> status_stack;
  259|     11|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  8.79k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 8.79k, False: 0]
  ------------------
  263|  8.79k|    const DecodingStatus status = status_stack.top();
  264|  8.79k|    status_stack.pop();
  265|       |
  266|  8.79k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  8.79k|    const uint32_t last_axis = status.last_axis;
  268|  8.79k|    const uint32_t stack_pos = status.stack_pos;
  269|  8.79k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  8.79k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  8.79k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 8.79k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  8.79k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  8.79k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 8.79k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  8.79k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  8.79k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 3.42k, False: 5.36k]
  ------------------
  285|  20.6k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 17.2k, False: 3.42k]
  ------------------
  286|  17.2k|        *oit = old_base;
  287|  17.2k|        ++oit;
  288|  17.2k|        ++num_decoded_points_;
  289|  17.2k|      }
  290|  3.42k|      continue;
  291|  3.42k|    }
  292|       |
  293|  5.36k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  5.36k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 815, False: 4.55k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    815|      axes_[0] = axis;
  300|  6.52k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 5.70k, False: 815]
  ------------------
  301|  5.70k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  5.70k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 131, False: 5.57k]
  |  |  ------------------
  ------------------
  302|  5.70k|      }
  303|  2.24k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.43k, False: 815]
  ------------------
  304|  12.8k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 11.4k, False: 1.43k]
  ------------------
  305|  11.4k|          p_[axes_[j]] = 0;
  306|  11.4k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  11.4k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.66k, False: 9.78k]
  ------------------
  308|  1.66k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 0, False: 1.66k]
  ------------------
  309|  1.66k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      0|              return false;
  311|      0|            }
  312|  1.66k|          }
  313|  11.4k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  11.4k|        }
  315|  1.43k|        *oit = p_;
  316|  1.43k|        ++oit;
  317|  1.43k|        ++num_decoded_points_;
  318|  1.43k|      }
  319|    815|      continue;
  320|    815|    }
  321|       |
  322|  4.55k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 4.55k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  4.55k|    const int num_remaining_bits = bit_length_ - level;
  327|  4.55k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  4.55k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  4.55k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  4.55k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  4.55k|    uint32_t number = 0;
  334|  4.55k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  4.55k|    uint32_t first_half = num_remaining_points / 2;
  337|  4.55k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 11, False: 4.54k]
  ------------------
  338|       |      // Invalid |number|.
  339|     11|      return false;
  340|     11|    }
  341|  4.54k|    first_half -= number;
  342|  4.54k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  4.54k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 3.25k, False: 1.28k]
  ------------------
  345|  3.25k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 2.74k, False: 512]
  ------------------
  346|  2.74k|        std::swap(first_half, second_half);
  347|  2.74k|      }
  348|  3.25k|    }
  349|       |
  350|  4.54k|    levels_stack_[stack_pos][axis] += 1;
  351|  4.54k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  4.54k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 4.51k, False: 24]
  ------------------
  353|  4.51k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  4.51k|    }
  355|  4.54k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 4.37k, False: 168]
  ------------------
  356|  4.37k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  4.37k|    }
  358|  4.54k|  }
  359|      0|  return true;
  360|     11|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  134|  8.90k|        : num_remaining_points(num_remaining_points_),
  135|  8.90k|          last_axis(last_axis_),
  136|  8.90k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  8.79k|    uint32_t last_axis) {
  232|  8.79k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 8.79k, Folded]
  ------------------
  233|  8.79k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  8.79k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.46k, False: 6.33k]
  |  |  ------------------
  ------------------
  234|  8.79k|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  8.79k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  4.55k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  4.55k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  4.55k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|      2|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_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: 1, False: 12]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     12|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 12]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     12|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 11]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     11|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 11]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     11|  num_decoded_points_ = 0;
  202|       |
  203|     11|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 11]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|     11|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 10]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     10|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 8, False: 2]
  ------------------
  210|      8|    return false;
  211|      8|  }
  212|      2|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 2]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      2|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 2, False: 0]
  ------------------
  217|      2|    return false;
  218|      2|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_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|     10|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 10, False: 0]
  ------------------
  263|     10|    const DecodingStatus status = status_stack.top();
  264|     10|    status_stack.pop();
  265|       |
  266|     10|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|     10|    const uint32_t last_axis = status.last_axis;
  268|     10|    const uint32_t stack_pos = status.stack_pos;
  269|     10|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|     10|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|     10|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 10]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|     10|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|     10|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 10]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|     10|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|     10|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 0, False: 10]
  ------------------
  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|     10|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|     10|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 0, False: 10]
  ------------------
  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|     10|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 10]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|     10|    const int num_remaining_bits = bit_length_ - level;
  327|     10|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|     10|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|     10|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|     10|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|     10|    uint32_t number = 0;
  334|     10|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|     10|    uint32_t first_half = num_remaining_points / 2;
  337|     10|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 2, False: 8]
  ------------------
  338|       |      // Invalid |number|.
  339|      2|      return false;
  340|      2|    }
  341|      8|    first_half -= number;
  342|      8|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|      8|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 8, False: 0]
  ------------------
  345|      8|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 0, False: 8]
  ------------------
  346|      0|        std::swap(first_half, second_half);
  347|      0|      }
  348|      8|    }
  349|       |
  350|      8|    levels_stack_[stack_pos][axis] += 1;
  351|      8|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|      8|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 8, False: 0]
  ------------------
  353|      8|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|      8|    }
  355|      8|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 8, False: 0]
  ------------------
  356|      8|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|      8|    }
  358|      8|  }
  359|      0|  return true;
  360|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  134|     75|        : num_remaining_points(num_remaining_points_),
  135|     75|          last_axis(last_axis_),
  136|     75|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  127|     38|  void DecodeNumber(int nbits, uint32_t *value) {
  128|     38|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|     38|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  118|      1|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|     14|      : bit_length_(0),
   87|     14|        num_points_(0),
   88|     14|        num_decoded_points_(0),
   89|     14|        dimension_(dimension),
   90|     14|        p_(dimension, 0),
   91|     14|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     14|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     14|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|      4|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      4|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 4]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      4|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 2, False: 2]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|      2|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 2]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      2|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 2]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      2|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 2]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      2|  num_decoded_points_ = 0;
  202|       |
  203|      2|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 2]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|      2|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 1]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|      1|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 0]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     79|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     79|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 79]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     79|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 79]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     79|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 79]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     79|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 79]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     79|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 2, False: 77]
  ------------------
  199|      2|    return false;
  200|      2|  }
  201|     77|  num_decoded_points_ = 0;
  202|       |
  203|     77|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 5, False: 72]
  ------------------
  204|      5|    return false;
  205|      5|  }
  206|     72|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 71]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     71|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 71]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     71|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 70]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     70|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 31, False: 39]
  ------------------
  217|     31|    return false;
  218|     31|  }
  219|       |
  220|     39|  numbers_decoder_.EndDecoding();
  221|     39|  remaining_bits_decoder_.EndDecoding();
  222|     39|  axis_decoder_.EndDecoding();
  223|     39|  half_decoder_.EndDecoding();
  224|       |
  225|     39|  return true;
  226|     70|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     70|    uint32_t num_points, OutputIteratorT &oit) {
  254|     70|  typedef DecodingStatus Status;
  255|     70|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     70|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     70|  DecodingStatus init_status(num_points, 0, 0);
  258|     70|  std::stack<Status> status_stack;
  259|     70|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.25M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.25M, False: 39]
  ------------------
  263|  1.25M|    const DecodingStatus status = status_stack.top();
  264|  1.25M|    status_stack.pop();
  265|       |
  266|  1.25M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.25M|    const uint32_t last_axis = status.last_axis;
  268|  1.25M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.25M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.25M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.25M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.25M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.25M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.25M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.25M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.25M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.25M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 551k, False: 704k]
  ------------------
  285|  58.1M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 57.5M, False: 551k]
  ------------------
  286|  57.5M|        *oit = old_base;
  287|  57.5M|        ++oit;
  288|  57.5M|        ++num_decoded_points_;
  289|  57.5M|      }
  290|   551k|      continue;
  291|   551k|    }
  292|       |
  293|   704k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   704k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 53.0k, False: 651k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  53.0k|      axes_[0] = axis;
  300|  90.6k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 37.5k, False: 53.0k]
  ------------------
  301|  37.5k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  37.5k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 12.4k, False: 25.1k]
  |  |  ------------------
  ------------------
  302|  37.5k|      }
  303|   133k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 80.8k, False: 53.0k]
  ------------------
  304|   212k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 132k, False: 80.7k]
  ------------------
  305|   132k|          p_[axes_[j]] = 0;
  306|   132k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   132k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 112k, False: 19.4k]
  ------------------
  308|   112k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 27, False: 112k]
  ------------------
  309|   112k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     27|              return false;
  311|     27|            }
  312|   112k|          }
  313|   132k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   132k|        }
  315|  80.7k|        *oit = p_;
  316|  80.7k|        ++oit;
  317|  80.7k|        ++num_decoded_points_;
  318|  80.7k|      }
  319|  53.0k|      continue;
  320|  53.0k|    }
  321|       |
  322|   651k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 651k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   651k|    const int num_remaining_bits = bit_length_ - level;
  327|   651k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   651k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   651k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   651k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   651k|    uint32_t number = 0;
  334|   651k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   651k|    uint32_t first_half = num_remaining_points / 2;
  337|   651k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 4, False: 651k]
  ------------------
  338|       |      // Invalid |number|.
  339|      4|      return false;
  340|      4|    }
  341|   651k|    first_half -= number;
  342|   651k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   651k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 619k, False: 31.4k]
  ------------------
  345|   619k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 585k, False: 33.7k]
  ------------------
  346|   585k|        std::swap(first_half, second_half);
  347|   585k|      }
  348|   619k|    }
  349|       |
  350|   651k|    levels_stack_[stack_pos][axis] += 1;
  351|   651k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   651k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 638k, False: 12.1k]
  ------------------
  353|   638k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   638k|    }
  355|   651k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 616k, False: 34.4k]
  ------------------
  356|   616k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   616k|    }
  358|   651k|  }
  359|     39|  return true;
  360|     70|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  134|  1.25M|        : num_remaining_points(num_remaining_points_),
  135|  1.25M|          last_axis(last_axis_),
  136|  1.25M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|   651k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   651k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   651k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     39|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|     87|      : bit_length_(0),
   87|     87|        num_points_(0),
   88|     87|        num_decoded_points_(0),
   89|     87|        dimension_(dimension),
   90|     87|        p_(dimension, 0),
   91|     87|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     87|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     87|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     72|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     72|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 72]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     72|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 71]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     71|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 71]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     71|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 71]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     71|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 1, False: 70]
  ------------------
  199|      1|    return false;
  200|      1|  }
  201|     70|  num_decoded_points_ = 0;
  202|       |
  203|     70|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 4, False: 66]
  ------------------
  204|      4|    return false;
  205|      4|  }
  206|     66|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 62]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     62|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 5, False: 57]
  ------------------
  210|      5|    return false;
  211|      5|  }
  212|     57|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 56]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     56|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 21, False: 35]
  ------------------
  217|     21|    return false;
  218|     21|  }
  219|       |
  220|     35|  numbers_decoder_.EndDecoding();
  221|     35|  remaining_bits_decoder_.EndDecoding();
  222|     35|  axis_decoder_.EndDecoding();
  223|     35|  half_decoder_.EndDecoding();
  224|       |
  225|     35|  return true;
  226|     56|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     56|    uint32_t num_points, OutputIteratorT &oit) {
  254|     56|  typedef DecodingStatus Status;
  255|     56|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     56|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     56|  DecodingStatus init_status(num_points, 0, 0);
  258|     56|  std::stack<Status> status_stack;
  259|     56|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.95M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.95M, False: 35]
  ------------------
  263|  1.95M|    const DecodingStatus status = status_stack.top();
  264|  1.95M|    status_stack.pop();
  265|       |
  266|  1.95M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.95M|    const uint32_t last_axis = status.last_axis;
  268|  1.95M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.95M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.95M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.95M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.95M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.95M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.95M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.95M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.95M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.95M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 860k, False: 1.09M]
  ------------------
  285|  76.9M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 76.1M, False: 860k]
  ------------------
  286|  76.1M|        *oit = old_base;
  287|  76.1M|        ++oit;
  288|  76.1M|        ++num_decoded_points_;
  289|  76.1M|      }
  290|   860k|      continue;
  291|   860k|    }
  292|       |
  293|  1.09M|    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.09M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 28.0k, False: 1.06M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  28.0k|      axes_[0] = axis;
  300|   158k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 130k, False: 28.0k]
  ------------------
  301|   130k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   130k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 8.77k, False: 121k]
  |  |  ------------------
  ------------------
  302|   130k|      }
  303|  69.6k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 41.6k, False: 27.9k]
  ------------------
  304|   303k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 261k, False: 41.6k]
  ------------------
  305|   261k|          p_[axes_[j]] = 0;
  306|   261k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   261k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 64.7k, False: 197k]
  ------------------
  308|  64.7k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 19, False: 64.7k]
  ------------------
  309|  64.7k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     19|              return false;
  311|     19|            }
  312|  64.7k|          }
  313|   261k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   261k|        }
  315|  41.6k|        *oit = p_;
  316|  41.6k|        ++oit;
  317|  41.6k|        ++num_decoded_points_;
  318|  41.6k|      }
  319|  27.9k|      continue;
  320|  28.0k|    }
  321|       |
  322|  1.06M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.06M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.06M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.06M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.06M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.06M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.06M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.06M|    uint32_t number = 0;
  334|  1.06M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.06M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.06M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 2, False: 1.06M]
  ------------------
  338|       |      // Invalid |number|.
  339|      2|      return false;
  340|      2|    }
  341|  1.06M|    first_half -= number;
  342|  1.06M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.06M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.04M, False: 20.1k]
  ------------------
  345|  1.04M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 991k, False: 57.0k]
  ------------------
  346|   991k|        std::swap(first_half, second_half);
  347|   991k|      }
  348|  1.04M|    }
  349|       |
  350|  1.06M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.06M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.06M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.02M, False: 44.0k]
  ------------------
  353|  1.02M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.02M|    }
  355|  1.06M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 932k, False: 136k]
  ------------------
  356|   932k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   932k|    }
  358|  1.06M|  }
  359|     35|  return true;
  360|     56|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  134|  1.95M|        : num_remaining_points(num_remaining_points_),
  135|  1.95M|          last_axis(last_axis_),
  136|  1.95M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  1.95M|    uint32_t last_axis) {
  232|  1.95M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 1.95M, Folded]
  ------------------
  233|  1.95M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  1.95M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 464k, False: 1.49M]
  |  |  ------------------
  ------------------
  234|  1.95M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  1.95M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|  1.06M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.06M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.06M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     35|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     68|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     68|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 68]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     68|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 67]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     67|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 67]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     67|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 10, False: 57]
  ------------------
  196|     10|    return true;
  197|     10|  }
  198|     57|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 2, False: 55]
  ------------------
  199|      2|    return false;
  200|      2|  }
  201|     55|  num_decoded_points_ = 0;
  202|       |
  203|     55|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 2, False: 53]
  ------------------
  204|      2|    return false;
  205|      2|  }
  206|     53|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 53]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     53|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 51]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     51|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 49]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     49|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 26, False: 23]
  ------------------
  217|     26|    return false;
  218|     26|  }
  219|       |
  220|     23|  numbers_decoder_.EndDecoding();
  221|     23|  remaining_bits_decoder_.EndDecoding();
  222|     23|  axis_decoder_.EndDecoding();
  223|     23|  half_decoder_.EndDecoding();
  224|       |
  225|     23|  return true;
  226|     49|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     49|    uint32_t num_points, OutputIteratorT &oit) {
  254|     49|  typedef DecodingStatus Status;
  255|     49|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     49|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     49|  DecodingStatus init_status(num_points, 0, 0);
  258|     49|  std::stack<Status> status_stack;
  259|     49|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   175k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 175k, False: 23]
  ------------------
  263|   175k|    const DecodingStatus status = status_stack.top();
  264|   175k|    status_stack.pop();
  265|       |
  266|   175k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   175k|    const uint32_t last_axis = status.last_axis;
  268|   175k|    const uint32_t stack_pos = status.stack_pos;
  269|   175k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   175k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   175k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 175k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   175k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   175k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 7, False: 175k]
  ------------------
  278|      7|      return false;
  279|      7|    }
  280|       |
  281|   175k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   175k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 105, False: 175k]
  ------------------
  285|  1.07M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 1.07M, False: 105]
  ------------------
  286|  1.07M|        *oit = old_base;
  287|  1.07M|        ++oit;
  288|  1.07M|        ++num_decoded_points_;
  289|  1.07M|      }
  290|    105|      continue;
  291|    105|    }
  292|       |
  293|   175k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   175k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 143, False: 175k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    143|      axes_[0] = axis;
  300|  10.7k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 10.5k, False: 143]
  ------------------
  301|  10.5k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  10.5k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 132, False: 10.4k]
  |  |  ------------------
  ------------------
  302|  10.5k|      }
  303|    323|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 192, False: 131]
  ------------------
  304|  13.0k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 12.8k, False: 180]
  ------------------
  305|  12.8k|          p_[axes_[j]] = 0;
  306|  12.8k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  12.8k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 12.3k, False: 458]
  ------------------
  308|  12.3k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 12, False: 12.3k]
  ------------------
  309|  12.3k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     12|              return false;
  311|     12|            }
  312|  12.3k|          }
  313|  12.8k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  12.8k|        }
  315|    180|        *oit = p_;
  316|    180|        ++oit;
  317|    180|        ++num_decoded_points_;
  318|    180|      }
  319|    131|      continue;
  320|    143|    }
  321|       |
  322|   175k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 175k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   175k|    const int num_remaining_bits = bit_length_ - level;
  327|   175k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   175k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   175k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   175k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   175k|    uint32_t number = 0;
  334|   175k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   175k|    uint32_t first_half = num_remaining_points / 2;
  337|   175k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 7, False: 175k]
  ------------------
  338|       |      // Invalid |number|.
  339|      7|      return false;
  340|      7|    }
  341|   175k|    first_half -= number;
  342|   175k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   175k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 175k, False: 25]
  ------------------
  345|   175k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 150k, False: 24.6k]
  ------------------
  346|   150k|        std::swap(first_half, second_half);
  347|   150k|      }
  348|   175k|    }
  349|       |
  350|   175k|    levels_stack_[stack_pos][axis] += 1;
  351|   175k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   175k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 150k, False: 24.6k]
  ------------------
  353|   150k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   150k|    }
  355|   175k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 24.8k, False: 150k]
  ------------------
  356|  24.8k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  24.8k|    }
  358|   175k|  }
  359|     23|  return true;
  360|     49|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  134|   175k|        : num_remaining_points(num_remaining_points_),
  135|   175k|          last_axis(last_axis_),
  136|   175k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|   175k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   175k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   175k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     33|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|     68|      : bit_length_(0),
   87|     68|        num_points_(0),
   88|     68|        num_decoded_points_(0),
   89|     68|        dimension_(dimension),
   90|     68|        p_(dimension, 0),
   91|     68|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     68|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     68|        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:
   86|     17|      : bit_length_(0),
   87|     17|        num_points_(0),
   88|     17|        num_decoded_points_(0),
   89|     17|        dimension_(dimension),
   90|     17|        p_(dimension, 0),
   91|     17|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     17|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     17|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     15|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     15|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     11|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     11|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     11|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|      6|      : bit_length_(0),
   87|      6|        num_points_(0),
   88|      6|        num_decoded_points_(0),
   89|      6|        dimension_(dimension),
   90|      6|        p_(dimension, 0),
   91|      6|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|      6|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|      6|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      3|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      3|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      3|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|     72|      : bit_length_(0),
   87|     72|        num_points_(0),
   88|     72|        num_decoded_points_(0),
   89|     72|        dimension_(dimension),
   90|     72|        p_(dimension, 0),
   91|     72|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     72|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     72|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  3.11k|    uint32_t last_axis) {
  232|  3.11k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 3.11k, Folded]
  ------------------
  233|  3.11k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  3.11k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 786, False: 2.32k]
  |  |  ------------------
  ------------------
  234|  3.11k|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  3.11k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|     51|    uint32_t last_axis) {
  232|     51|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 51, Folded]
  ------------------
  233|     51|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|     51|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 26, False: 25]
  |  |  ------------------
  ------------------
  234|     51|  }
  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|     51|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  1.25M|    uint32_t last_axis) {
  232|  1.25M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 1.25M, Folded]
  ------------------
  233|  1.25M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  1.25M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.09M, False: 158k]
  |  |  ------------------
  ------------------
  234|  1.25M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  1.25M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   175k|    uint32_t last_axis) {
  232|   175k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded, False: 175k]
  ------------------
  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|   175k|  uint32_t best_axis = 0;
  237|   175k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 175k, False: 62]
  ------------------
  238|  26.7M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 26.6M, False: 175k]
  ------------------
  239|  26.6M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 173k, False: 26.4M]
  ------------------
  240|   173k|        best_axis = axis;
  241|   173k|      }
  242|  26.6M|    }
  243|   175k|  } else {
  244|     62|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|     62|  }
  246|       |
  247|   175k|  return best_axis;
  248|   175k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      2|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      2|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      2|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      2|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 2]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      2|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 2]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      2|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 2]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      2|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 2]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|      2|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 2]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      2|  num_decoded_points_ = 0;
  202|       |
  203|      2|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 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|}
_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: 0, False: 1]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|      1|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 1]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      1|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 1]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      1|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 1]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      1|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 1, False: 0]
  ------------------
  217|      1|    return false;
  218|      1|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_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|     41|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 41, False: 0]
  ------------------
  263|     41|    const DecodingStatus status = status_stack.top();
  264|     41|    status_stack.pop();
  265|       |
  266|     41|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|     41|    const uint32_t last_axis = status.last_axis;
  268|     41|    const uint32_t stack_pos = status.stack_pos;
  269|     41|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|     41|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|     41|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 41]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|     41|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|     41|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 41]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|     41|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|     41|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 0, False: 41]
  ------------------
  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|     41|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|     41|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 13, False: 28]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|     13|      axes_[0] = axis;
  300|     39|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 26, False: 13]
  ------------------
  301|     26|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|     26|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 6, False: 20]
  |  |  ------------------
  ------------------
  302|     26|      }
  303|     35|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 23, False: 12]
  ------------------
  304|     89|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 67, False: 22]
  ------------------
  305|     67|          p_[axes_[j]] = 0;
  306|     67|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|     67|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 67, False: 0]
  ------------------
  308|     67|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 1, False: 66]
  ------------------
  309|     67|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      1|              return false;
  311|      1|            }
  312|     67|          }
  313|     66|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|     66|        }
  315|     22|        *oit = p_;
  316|     22|        ++oit;
  317|     22|        ++num_decoded_points_;
  318|     22|      }
  319|     12|      continue;
  320|     13|    }
  321|       |
  322|     28|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 28]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|     28|    const int num_remaining_bits = bit_length_ - level;
  327|     28|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|     28|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|     28|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|     28|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|     28|    uint32_t number = 0;
  334|     28|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|     28|    uint32_t first_half = num_remaining_points / 2;
  337|     28|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 0, False: 28]
  ------------------
  338|       |      // Invalid |number|.
  339|      0|      return false;
  340|      0|    }
  341|     28|    first_half -= number;
  342|     28|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|     28|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 23, False: 5]
  ------------------
  345|     23|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 23, False: 0]
  ------------------
  346|     23|        std::swap(first_half, second_half);
  347|     23|      }
  348|     23|    }
  349|       |
  350|     28|    levels_stack_[stack_pos][axis] += 1;
  351|     28|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|     28|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 28, False: 0]
  ------------------
  353|     28|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|     28|    }
  355|     28|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 28, False: 0]
  ------------------
  356|     28|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|     28|    }
  358|     28|  }
  359|      0|  return true;
  360|      1|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      2|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      2|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      2|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      2|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 2]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      2|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 1]
  ------------------
  190|      1|    return false;
  191|      1|  }
  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: 0, False: 1]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|      1|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 1]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      1|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 0]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      8|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      8|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      8|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|      8|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|      8|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 8]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|      8|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 8]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|      8|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 8]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|      8|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 4, False: 4]
  ------------------
  196|      4|    return true;
  197|      4|  }
  198|      4|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 4]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|      4|  num_decoded_points_ = 0;
  202|       |
  203|      4|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 4, False: 0]
  ------------------
  204|      4|    return false;
  205|      4|  }
  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|     13|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|     13|  qinfo_.quantization_bits = 0;
   67|     13|  qinfo_.range = 0;
   68|     13|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|     13|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|     13|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 0, False: 13]
  ------------------
   73|      0|    return false;
   74|      0|  }
   75|     13|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 0, False: 13]
  ------------------
   76|      0|    return false;
   77|      0|  }
   78|     13|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 0, False: 13]
  ------------------
   79|      0|    return false;
   80|      0|  }
   81|     13|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 0, False: 13]
  ------------------
   82|      0|    return false;
   83|      0|  }
   84|     13|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 0, False: 13]
  |  Branch (84:38): [True: 0, False: 0]
  ------------------
   85|      0|    return false;
   86|      0|  }
   87|     13|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 0, False: 13]
  ------------------
   88|      0|    return false;
   89|      0|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|     13|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 0, False: 13]
  ------------------
   93|      0|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|      0|#define DRACO_LOGE printf
  ------------------
   94|      0|               compression_level_);
   95|      0|    return false;
   96|      0|  }
   97|       |
   98|     13|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|     13|      std::back_inserter(*qpoints);
  100|     13|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|     13|                           Converter>
  102|     13|      oit(oit_qpoints);
  103|     13|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 13, False: 0]
  ------------------
  104|     13|    qpoints->reserve(num_points_);
  105|     13|    switch (compression_level_) {
  106|      2|      case 0: {
  ------------------
  |  Branch (106:7): [True: 2, False: 11]
  ------------------
  107|      2|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|      2|        qpoints_decoder.DecodePoints(buffer, oit);
  109|      2|        break;
  110|      0|      }
  111|      0|      case 1: {
  ------------------
  |  Branch (111:7): [True: 0, False: 13]
  ------------------
  112|      0|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|      0|        qpoints_decoder.DecodePoints(buffer, oit);
  114|      0|        break;
  115|      0|      }
  116|      1|      case 2: {
  ------------------
  |  Branch (116:7): [True: 1, False: 12]
  ------------------
  117|      1|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|      1|        qpoints_decoder.DecodePoints(buffer, oit);
  119|      1|        break;
  120|      0|      }
  121|      2|      case 3: {
  ------------------
  |  Branch (121:7): [True: 2, False: 11]
  ------------------
  122|      2|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|      2|        qpoints_decoder.DecodePoints(buffer, oit);
  124|      2|        break;
  125|      0|      }
  126|      8|      case 4: {
  ------------------
  |  Branch (126:7): [True: 8, False: 5]
  ------------------
  127|      8|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|      8|        qpoints_decoder.DecodePoints(buffer, oit);
  129|      8|        break;
  130|      0|      }
  131|      0|      case 5: {
  ------------------
  |  Branch (131:7): [True: 0, False: 13]
  ------------------
  132|      0|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|      0|        qpoints_decoder.DecodePoints(buffer, oit);
  134|      0|        break;
  135|      0|      }
  136|      0|      case 6: {
  ------------------
  |  Branch (136:7): [True: 0, False: 13]
  ------------------
  137|      0|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|      0|        qpoints_decoder.DecodePoints(buffer, oit);
  139|      0|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 13]
  ------------------
  142|      0|        return false;
  143|     13|    }
  144|     13|  }
  145|       |
  146|     13|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 13, False: 0]
  ------------------
  147|     13|    return false;
  148|     13|  }
  149|      0|  return true;
  150|     13|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|     13|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|     22|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|     22|  const Self &operator=(const SourceType &source) {
   56|     22|    *oit_ = Converter()(source);
   57|     22|    return *this;
   58|     22|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|     22|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|     22|    return Point3ui(v[0], v[1], v[2]);
   31|     22|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|     22|  const Self &operator++() {
   46|     22|    ++oit_;
   47|     22|    return *this;
   48|     22|  }

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

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

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

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

_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|      6|    int32_t att_decoder_id) {
   33|       |  // Always create the basic attribute decoder.
   34|      6|  return SetAttributesDecoder(
   35|      6|      att_decoder_id,
   36|      6|      std::unique_ptr<AttributesDecoder>(
   37|      6|          new SequentialAttributeDecodersController(
   38|      6|              std::unique_ptr<PointsSequencer>(
   39|      6|                  new LinearSequencer(point_cloud()->num_points())))));
   40|      6|}

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

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

_ZN5draco10DataBufferC2Ev:
   21|  3.56k|DataBuffer::DataBuffer() {}
_ZN5draco10DataBuffer6UpdateEPKvl:
   23|  3.55k|bool DataBuffer::Update(const void *data, int64_t size) {
   24|  3.55k|  const int64_t offset = 0;
   25|  3.55k|  return this->Update(data, size, offset);
   26|  3.55k|}
_ZN5draco10DataBuffer6UpdateEPKvll:
   28|  3.55k|bool DataBuffer::Update(const void *data, int64_t size, int64_t offset) {
   29|  3.55k|  if (data == nullptr) {
  ------------------
  |  Branch (29:7): [True: 3.49k, False: 57]
  ------------------
   30|  3.49k|    if (size + offset < 0) {
  ------------------
  |  Branch (30:9): [True: 0, False: 3.49k]
  ------------------
   31|      0|      return false;
   32|      0|    }
   33|       |    // If no data is provided, just resize the buffer.
   34|  3.49k|    data_.resize(size + offset);
   35|  3.49k|  } else {
   36|     57|    if (size < 0) {
  ------------------
  |  Branch (36:9): [True: 0, False: 57]
  ------------------
   37|      0|      return false;
   38|      0|    }
   39|     57|    if (size + offset > static_cast<int64_t>(data_.size())) {
  ------------------
  |  Branch (39:9): [True: 44, False: 13]
  ------------------
   40|     44|      data_.resize(size + offset);
   41|     44|    }
   42|     57|    const uint8_t *const byte_data = static_cast<const uint8_t *>(data);
   43|     57|    std::copy(byte_data, byte_data + size, data_.data() + offset);
   44|     57|  }
   45|  3.55k|  descriptor_.buffer_update_count++;
   46|  3.55k|  return true;
   47|  3.55k|}
_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.5k|  DataBufferDescriptor() : buffer_id(0), buffer_update_count(0) {}
_ZNK5draco10DataBuffer4ReadElPvm:
   47|    204|  void Read(int64_t byte_pos, void *out_data, size_t data_size) const {
   48|    204|    memcpy(out_data, data() + byte_pos, data_size);
   49|    204|  }
_ZN5draco10DataBuffer5WriteElPKvm:
   53|   134M|  void Write(int64_t byte_pos, const void *in_data, size_t data_size) {
   54|   134M|    memcpy(const_cast<uint8_t *>(data()) + byte_pos, in_data, data_size);
   55|   134M|  }
_ZNK5draco10DataBuffer12update_countEv:
   67|  3.48k|  int64_t update_count() const { return descriptor_.buffer_update_count; }
_ZNK5draco10DataBuffer9data_sizeEv:
   68|  13.3M|  size_t data_size() const { return data_.size(); }
_ZNK5draco10DataBuffer4dataEv:
   69|    204|  const uint8_t *data() const { return data_.data(); }
_ZN5draco10DataBuffer4dataEv:
   70|   152M|  uint8_t *data() { return data_.data(); }
_ZNK5draco10DataBuffer9buffer_idEv:
   71|  3.48k|  int64_t buffer_id() const { return descriptor_.buffer_id; }

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  24.4M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  24.4M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 24.4M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  24.4M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  24.4M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|  3.47M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|  3.47M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 29, False: 3.47M]
  ------------------
   78|     29|      return false;  // Buffer overflow.
   79|     29|    }
   80|  3.47M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|  3.47M|    pos_ += size_to_decode;
   82|  3.47M|    return true;
   83|  3.47M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  9.27k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  1.22k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  10.3k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   113k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|    490|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  24.4M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  57.3k|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|    640|    inline void reset(const void *b, size_t s) {
  131|    640|      bit_offset_ = 0;
  132|    640|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|    640|      bit_buffer_end_ = bit_buffer_ + s;
  134|    640|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|    522|    inline uint64_t BitsDecoded() const {
  138|    522|      return static_cast<uint64_t>(bit_offset_);
  139|    522|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  24.4M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  24.4M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 0, False: 24.4M]
  ------------------
  162|      0|        return false;
  163|      0|      }
  164|  24.4M|      uint32_t value = 0;
  165|  57.2M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 32.8M, False: 24.4M]
  ------------------
  166|  32.8M|        value |= GetBit() << bit;
  167|  32.8M|      }
  168|  24.4M|      *x = value;
  169|  24.4M|      return true;
  170|  24.4M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  32.8M|    inline int GetBit() {
  176|  32.8M|      const size_t off = bit_offset_;
  177|  32.8M|      const size_t byte_offset = off >> 3;
  178|  32.8M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  32.8M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 31.6M, False: 1.20M]
  ------------------
  180|  31.6M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  31.6M|        bit_offset_ = off + 1;
  182|  31.6M|        return bit;
  183|  31.6M|      }
  184|  1.20M|      return 0;
  185|  32.8M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  8.95M|  bool Decode(T *out_val) {
   69|  8.95M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 185, False: 8.95M]
  ------------------
   70|    185|      return false;
   71|    185|    }
   72|  8.95M|    pos_ += sizeof(T);
   73|  8.95M|    return true;
   74|  8.95M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  8.95M|  bool Peek(T *out_val) {
   88|  8.95M|    const size_t size_to_decode = sizeof(T);
   89|  8.95M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 185, False: 8.95M]
  ------------------
   90|    185|      return false;  // Buffer overflow.
   91|    185|    }
   92|  8.95M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  8.95M|    return true;
   94|  8.95M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  1.54k|  bool Decode(T *out_val) {
   69|  1.54k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 1.54k]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|  1.54k|    pos_ += sizeof(T);
   73|  1.54k|    return true;
   74|  1.54k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  1.54k|  bool Peek(T *out_val) {
   88|  1.54k|    const size_t size_to_decode = sizeof(T);
   89|  1.54k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 1.54k]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|  1.54k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.54k|    return true;
   94|  1.54k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   417k|  bool Decode(T *out_val) {
   69|   417k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 24, False: 417k]
  ------------------
   70|     24|      return false;
   71|     24|    }
   72|   417k|    pos_ += sizeof(T);
   73|   417k|    return true;
   74|   417k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   417k|  bool Peek(T *out_val) {
   88|   417k|    const size_t size_to_decode = sizeof(T);
   89|   417k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 24, False: 417k]
  ------------------
   90|     24|      return false;  // Buffer overflow.
   91|     24|    }
   92|   417k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   417k|    return true;
   94|   417k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  2.69k|  bool Decode(T *out_val) {
   69|  2.69k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 2.69k]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|  2.69k|    pos_ += sizeof(T);
   73|  2.69k|    return true;
   74|  2.69k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  2.69k|  bool Peek(T *out_val) {
   88|  2.69k|    const size_t size_to_decode = sizeof(T);
   89|  2.69k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 2.69k]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|  2.69k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  2.69k|    return true;
   94|  2.69k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   338k|  bool Decode(T *out_val) {
   69|   338k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 30, False: 338k]
  ------------------
   70|     30|      return false;
   71|     30|    }
   72|   338k|    pos_ += sizeof(T);
   73|   338k|    return true;
   74|   338k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   338k|  bool Peek(T *out_val) {
   88|   338k|    const size_t size_to_decode = sizeof(T);
   89|   338k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 30, False: 338k]
  ------------------
   90|     30|      return false;  // Buffer overflow.
   91|     30|    }
   92|   338k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   338k|    return true;
   94|   338k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  67.1k|  bool Decode(T *out_val) {
   69|  67.1k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 1, False: 67.1k]
  ------------------
   70|      1|      return false;
   71|      1|    }
   72|  67.1k|    pos_ += sizeof(T);
   73|  67.1k|    return true;
   74|  67.1k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  67.1k|  bool Peek(T *out_val) {
   88|  67.1k|    const size_t size_to_decode = sizeof(T);
   89|  67.1k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 1, False: 67.1k]
  ------------------
   90|      1|      return false;  // Buffer overflow.
   91|      1|    }
   92|  67.1k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  67.1k|    return true;
   94|  67.1k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|    168|  bool Decode(T *out_val) {
   69|    168|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 168]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|    168|    pos_ += sizeof(T);
   73|    168|    return true;
   74|    168|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|    168|  bool Peek(T *out_val) {
   88|    168|    const size_t size_to_decode = sizeof(T);
   89|    168|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 168]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|    168|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    168|    return true;
   94|    168|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|     56|  bool Decode(T *out_val) {
   69|     56|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 0, False: 56]
  ------------------
   70|      0|      return false;
   71|      0|    }
   72|     56|    pos_ += sizeof(T);
   73|     56|    return true;
   74|     56|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|     56|  bool Peek(T *out_val) {
   88|     56|    const size_t size_to_decode = sizeof(T);
   89|     56|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 0, False: 56]
  ------------------
   90|      0|      return false;  // Buffer overflow.
   91|      0|    }
   92|     56|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|     56|    return true;
   94|     56|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   155M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   152M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  1.07M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  1.07M|    return value_ >= val;
  100|  1.07M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|  30.0M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|   448M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  2.81M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|  18.8M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  18.8M|    value_ = i.value_;
  153|  18.8M|    return *this;
  154|  18.8M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|  3.30M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  3.30M|    value_ = i.value_;
  153|  3.30M|    return *this;
  154|  3.30M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  2.80M|  inline ThisIndexType &operator++() {
  103|  2.80M|    ++value_;
  104|  2.80M|    return *this;
  105|  2.80M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|   334M|  constexpr bool operator==(const IndexType &i) const {
   76|   334M|    return value_ == i.value_;
   77|   334M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|  93.9M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|  21.6M|  constexpr bool operator==(const IndexType &i) const {
   76|  21.6M|    return value_ == i.value_;
   77|  21.6M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|  50.0M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|  50.0M|    return ThisIndexType(value_ - val);
  133|  50.0M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   103M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   103M|    return ThisIndexType(value_ + val);
  127|   103M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|   933k|  constexpr bool operator==(const IndexType &i) const {
   76|   933k|    return value_ == i.value_;
   77|   933k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|  32.4M|  constexpr bool operator!=(const IndexType &i) const {
   82|  32.4M|    return value_ != i.value_;
   83|  32.4M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|  72.3M|  constexpr bool operator!=(const IndexType &i) const {
   82|  72.3M|    return value_ != i.value_;
   83|  72.3M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|  80.8M|  inline ThisIndexType &operator++() {
  103|  80.8M|    ++value_;
  104|  80.8M|    return *this;
  105|  80.8M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|  70.6M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  70.6M|    value_ = i.value_;
  153|  70.6M|    return *this;
  154|  70.6M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|   139M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   139M|    value_ = i.value_;
  153|   139M|    return *this;
  154|   139M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  5.19M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  5.19M|    return value_ >= val;
  100|  5.19M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  1.09M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|   181M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  2.24G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|  22.8M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  1.59G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|  13.1M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  7.23M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  7.23M|    return ThisIndexType(value_ + val);
  127|  7.23M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|  33.2M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  3.23M|  constexpr bool operator<(const IndexType &i) const {
   88|  3.23M|    return value_ < i.value_;
   89|  3.23M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   168M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|  3.65M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  5.32M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|   150M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   203M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|   744k|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   744k|    value_ = i.value_;
  153|   744k|    return *this;
  154|   744k|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  1.09M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  1.09M|    value_ += val;
  141|  1.09M|    return *this;
  142|  1.09M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  3.59M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  3.59M|    value_ = val;
  157|  3.59M|    return *this;
  158|  3.59M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|  66.5k|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  2.06M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  2.06M|  inline ThisIndexType &operator++() {
  103|  2.06M|    ++value_;
  104|  2.06M|    return *this;
  105|  2.06M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  4.20M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|    220|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|   139M|  inline ThisIndexType &operator++() {
  103|   139M|    ++value_;
  104|   139M|    return *this;
  105|   139M|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|    204|  inline ThisIndexType &operator++() {
  103|    204|    ++value_;
  104|    204|    return *this;
  105|    204|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|   134M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|   134M|    return value_ >= val;
  100|   134M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  8.66M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  8.66M|    return vector_[index.value()];
   75|  8.66M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  4.20M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  1.63k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  4.66k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  9.40M|  inline reference operator[](const IndexTypeT &index) {
   71|  9.40M|    return vector_[index.value()];
   72|  9.40M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|   118k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  2.16M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|    306|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   70|  1.07M|  inline reference operator[](const IndexTypeT &index) {
   71|  1.07M|    return vector_[index.value()];
   72|  1.07M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  2.16M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  2.16M|    return vector_[index.value()];
   75|  2.16M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|  24.0M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  1.13M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|  62.8M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  62.8M|    return vector_[index.value()];
   75|  62.8M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|  76.4M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  76.4M|    return vector_[index.value()];
   75|  76.4M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|  59.5M|  inline reference operator[](const IndexTypeT &index) {
   71|  59.5M|    return vector_[index.value()];
   72|  59.5M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  12.6M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  12.6M|    return vector_[index.value()];
   75|  12.6M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|  45.6M|  inline reference operator[](const IndexTypeT &index) {
   71|  45.6M|    return vector_[index.value()];
   72|  45.6M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  14.3M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|  30.9M|  inline reference operator[](const IndexTypeT &index) {
   71|  30.9M|    return vector_[index.value()];
   72|  30.9M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|    128|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   154k|  inline reference operator[](const IndexTypeT &index) {
   71|   154k|    return vector_[index.value()];
   72|   154k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  4.61k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  42.8k|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  4.44k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|    562|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|    562|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|    562|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|    562|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  1.42k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  1.42k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  1.42k|    vector_.swap(arg.vector_);
   57|  1.42k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  1.42k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  1.42k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  1.42k|    vector_.swap(arg.vector_);
   57|  1.42k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|    562|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|    562|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|    562|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|    897|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  8.99k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  13.9k|int32_t DataTypeLength(DataType dt) {
   20|  13.9k|  switch (dt) {
   21|  6.92k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 6.92k, False: 7.00k]
  ------------------
   22|  7.33k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 414, False: 13.5k]
  ------------------
   23|  7.33k|      return 1;
   24|  2.03k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 2.03k, False: 11.8k]
  ------------------
   25|  2.11k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 80, False: 13.8k]
  ------------------
   26|  2.11k|      return 2;
   27|  3.73k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 3.73k, False: 10.1k]
  ------------------
   28|  3.97k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 238, False: 13.6k]
  ------------------
   29|  3.97k|      return 4;
   30|      3|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 3, False: 13.9k]
  ------------------
   31|     51|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 48, False: 13.8k]
  ------------------
   32|     51|      return 8;
   33|    434|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 434, False: 13.4k]
  ------------------
   34|    434|      return 4;
   35|      0|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 0, False: 13.9k]
  ------------------
   36|      0|      return 8;
   37|     15|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 15, False: 13.9k]
  ------------------
   38|     15|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 13.9k]
  ------------------
   40|      0|      return -1;
   41|  13.9k|  }
   42|  13.9k|}

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

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

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

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

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

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

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

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   233k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   233k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 233k, Folded]
  ------------------
   65|   233k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 73, False: 233k]
  ------------------
   66|     73|      return false;
   67|     73|    }
   68|   233k|  } 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|   233k|  return true;
   77|   233k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  75.3k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  75.3k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  75.3k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 20, False: 75.3k]
  ------------------
   33|     20|    return false;
   34|     20|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  75.3k|  uint8_t in;
   39|  75.3k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 31, False: 75.3k]
  ------------------
   40|     31|    return false;
   41|     31|  }
   42|  75.3k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 4.00k, False: 71.3k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  4.00k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 104, False: 3.90k]
  ------------------
   45|    104|      return false;
   46|    104|    }
   47|       |    // Append decoded info from this byte.
   48|  3.90k|    *out_val <<= 7;
   49|  3.90k|    *out_val |= in & ((1 << 7) - 1);
   50|  71.3k|  } else {
   51|       |    // Last byte reached
   52|  71.3k|    *out_val = in;
   53|  71.3k|  }
   54|  75.2k|  return true;
   55|  75.3k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  1.04k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  1.04k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  1.04k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 1.04k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  1.04k|  uint8_t in;
   39|  1.04k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 1.04k]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|  1.04k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 211, False: 832]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    211|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 5, False: 206]
  ------------------
   45|      5|      return false;
   46|      5|    }
   47|       |    // Append decoded info from this byte.
   48|    206|    *out_val <<= 7;
   49|    206|    *out_val |= in & ((1 << 7) - 1);
   50|    832|  } else {
   51|       |    // Last byte reached
   52|    832|    *out_val = in;
   53|    832|  }
   54|  1.03k|  return true;
   55|  1.04k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|    424|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|    424|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 424, Folded]
  ------------------
   65|    424|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 424]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|    424|  } 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|    424|  return true;
   77|    424|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|    355|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    355|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    355|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 355]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    355|  uint8_t in;
   39|    355|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 355]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    355|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 26, False: 329]
  ------------------
   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|    329|  } else {
   51|       |    // Last byte reached
   52|    329|    *out_val = in;
   53|    329|  }
   54|    355|  return true;
   55|    355|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   142k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   142k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   142k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 6, False: 142k]
  ------------------
   33|      6|    return false;
   34|      6|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   142k|  uint8_t in;
   39|   142k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 3, False: 142k]
  ------------------
   40|      3|    return false;
   41|      3|  }
   42|   142k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 246, False: 142k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    246|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 30, False: 216]
  ------------------
   45|     30|      return false;
   46|     30|    }
   47|       |    // Append decoded info from this byte.
   48|    216|    *out_val <<= 7;
   49|    216|    *out_val |= in & ((1 << 7) - 1);
   50|   142k|  } else {
   51|       |    // Last byte reached
   52|   142k|    *out_val = in;
   53|   142k|  }
   54|   142k|  return true;
   55|   142k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  2.37k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  2.37k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 2.37k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  2.37k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  2.37k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  2.37k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 30, False: 2.34k]
  ------------------
   72|     30|      return false;
   73|     30|    }
   74|  2.34k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  2.34k|  }
   76|  2.34k|  return true;
   77|  2.37k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  2.76k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.76k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.76k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 17, False: 2.74k]
  ------------------
   33|     17|    return false;
   34|     17|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.74k|  uint8_t in;
   39|  2.74k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 13, False: 2.73k]
  ------------------
   40|     13|    return false;
   41|     13|  }
   42|  2.73k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 391, False: 2.34k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    391|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 85, False: 306]
  ------------------
   45|     85|      return false;
   46|     85|    }
   47|       |    // Append decoded info from this byte.
   48|    306|    *out_val <<= 7;
   49|    306|    *out_val |= in & ((1 << 7) - 1);
   50|  2.34k|  } else {
   51|       |    // Last byte reached
   52|  2.34k|    *out_val = in;
   53|  2.34k|  }
   54|  2.64k|  return true;
   55|  2.73k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|    383|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    383|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    383|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 380]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    380|  uint8_t in;
   39|    380|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 380]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    380|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 51, False: 329]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     51|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 15, False: 36]
  ------------------
   45|     15|      return false;
   46|     15|    }
   47|       |    // Append decoded info from this byte.
   48|     36|    *out_val <<= 7;
   49|     36|    *out_val |= in & ((1 << 7) - 1);
   50|    329|  } else {
   51|       |    // Last byte reached
   52|    329|    *out_val = in;
   53|    329|  }
   54|    365|  return true;
   55|    380|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  8.96k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  8.96k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  8.96k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 8.96k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  8.96k|  uint8_t in;
   39|  8.96k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 1, False: 8.96k]
  ------------------
   40|      1|    return false;
   41|      1|  }
   42|  8.96k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 270, False: 8.69k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    270|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 15, False: 255]
  ------------------
   45|     15|      return false;
   46|     15|    }
   47|       |    // Append decoded info from this byte.
   48|    255|    *out_val <<= 7;
   49|    255|    *out_val |= in & ((1 << 7) - 1);
   50|  8.69k|  } else {
   51|       |    // Last byte reached
   52|  8.69k|    *out_val = in;
   53|  8.69k|  }
   54|  8.94k|  return true;
   55|  8.96k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|    499|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    499|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    499|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 499]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    499|  uint8_t in;
   39|    499|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 499]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    499|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 169, False: 330]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    169|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 169]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|    169|    *out_val <<= 7;
   49|    169|    *out_val |= in & ((1 << 7) - 1);
   50|    330|  } else {
   51|       |    // Last byte reached
   52|    330|    *out_val = in;
   53|    330|  }
   54|    499|  return true;
   55|    499|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|    325|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|    325|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|    325|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 325]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|    325|  uint8_t in;
   39|    325|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 325]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|    325|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 230, False: 95]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    230|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 230]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|    230|    *out_val <<= 7;
   49|    230|    *out_val |= in & ((1 << 7) - 1);
   50|    230|  } else {
   51|       |    // Last byte reached
   52|     95|    *out_val = in;
   53|     95|  }
   54|    325|  return true;
   55|    325|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  10.4k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  10.4k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  10.4k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 5, False: 10.4k]
  ------------------
   33|      5|    return false;
   34|      5|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  10.4k|  uint8_t in;
   39|  10.4k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 10.4k]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|  10.4k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 964, False: 9.50k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    964|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 25, False: 939]
  ------------------
   45|     25|      return false;
   46|     25|    }
   47|       |    // Append decoded info from this byte.
   48|    939|    *out_val <<= 7;
   49|    939|    *out_val |= in & ((1 << 7) - 1);
   50|  9.50k|  } else {
   51|       |    // Last byte reached
   52|  9.50k|    *out_val = in;
   53|  9.50k|  }
   54|  10.4k|  return true;
   55|  10.4k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|    762|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|    984|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|     82|  Self operator-(const Self &o) const {
  138|     82|    Self ret;
  139|    328|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 246, False: 82]
  ------------------
  140|    246|      ret[i] = (*this)[i] - o[i];
  141|    246|    }
  142|     82|    return ret;
  143|     82|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|    204|  VectorD() {
   41|    816|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 612, False: 204]
  ------------------
   42|    612|      (*this)[i] = Scalar(0);
   43|    612|    }
   44|    204|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|     66|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|  49.8M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  4.08M|  Self operator-(const Self &o) const {
  138|  4.08M|    Self ret;
  139|  16.3M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 12.2M, False: 4.08M]
  ------------------
  140|  12.2M|      ret[i] = (*this)[i] - o[i];
  141|  12.2M|    }
  142|  4.08M|    return ret;
  143|  4.08M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  2.04M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  2.04M|  static_assert(std::is_signed<ScalarT>::value,
  321|  2.04M|                "ScalarT must be a signed type. ");
  322|  2.04M|  VectorD<ScalarT, 3> r;
  323|  2.04M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  2.04M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  2.04M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  2.04M|  return r;
  327|  2.04M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  2.04M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  2.04M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|   370k|  Scalar AbsSum() const {
  238|   370k|    Scalar result(0);
  239|  1.46M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 1.10M, False: 354k]
  ------------------
  240|  1.10M|      Scalar next_value = std::abs(v_[i]);
  241|  1.10M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 16.2k, False: 1.09M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  16.2k|        return std::numeric_limits<Scalar>::max();
  244|  16.2k|      }
  245|  1.09M|      result += next_value;
  246|  1.09M|    }
  247|   354k|    return result;
  248|   370k|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   286k|  Self operator/(const Scalar &o) const {
  183|   286k|    Self ret;
  184|  1.14M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 858k, False: 286k]
  ------------------
  185|   858k|      ret[i] = (*this)[i] / o;
  186|   858k|    }
  187|   286k|    return ret;
  188|   286k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|  58.5M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  2.08M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  1.11M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|   347k|  Self operator-() const {
  121|   347k|    Self ret;
  122|  1.39M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 1.04M, False: 347k]
  ------------------
  123|  1.04M|      ret[i] = -(*this)[i];
  124|  1.04M|    }
  125|   347k|    return ret;
  126|   347k|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  1.04M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|   158k|  Self operator-(const Self &o) const {
  138|   158k|    Self ret;
  139|   476k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 317k, False: 158k]
  ------------------
  140|   317k|      ret[i] = (*this)[i] - o[i];
  141|   317k|    }
  142|   158k|    return ret;
  143|   158k|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  1.90M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  2.86M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  7.58M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|   317k|  Self operator+(const Self &o) const {
  130|   317k|    Self ret;
  131|   953k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 635k, False: 317k]
  ------------------
  132|   635k|      ret[i] = (*this)[i] + o[i];
  133|   635k|    }
  134|   317k|    return ret;
  135|   317k|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  6.78M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|   203k|  Self operator-(const Self &o) const {
  138|   203k|    Self ret;
  139|   609k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 406k, False: 203k]
  ------------------
  140|   406k|      ret[i] = (*this)[i] - o[i];
  141|   406k|    }
  142|   203k|    return ret;
  143|   203k|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|   203k|  Self operator+(const Self &o) const {
  130|   203k|    Self ret;
  131|   609k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 406k, False: 203k]
  ------------------
  132|   406k|      ret[i] = (*this)[i] + o[i];
  133|   406k|    }
  134|   203k|    return ret;
  135|   203k|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|    108|  bool operator==(const Self &o) const {
  207|    250|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 182, False: 68]
  ------------------
  208|    182|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 40, False: 142]
  ------------------
  209|     40|        return false;
  210|     40|      }
  211|    182|    }
  212|     68|    return true;
  213|    108|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  1.30k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|     42|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|     44|  Scalar Dot(const Self &o) const {
  251|     44|    Scalar ret(0);
  252|    176|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 132, False: 44]
  ------------------
  253|    132|      ret += (*this)[i] * o[i];
  254|    132|    }
  255|     44|    return ret;
  256|     44|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|      2|  Self operator*(const Scalar &o) const {
  175|      2|    Self ret;
  176|      8|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 6, False: 2]
  ------------------
  177|      6|      ret[i] = (*this)[i] * o;
  178|      6|    }
  179|      2|    return ret;
  180|      2|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|     40|  Self operator-(const Self &o) const {
  138|     40|    Self ret;
  139|    120|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 80, False: 40]
  ------------------
  140|     80|      ret[i] = (*this)[i] - o[i];
  141|     80|    }
  142|     40|    return ret;
  143|     40|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|     80|  VectorD() {
   41|    240|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 160, False: 80]
  ------------------
   42|    160|      (*this)[i] = Scalar(0);
   43|    160|    }
   44|     80|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|    253|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|    253|    DRACO_DCHECK_EQ(dimension, 2);
   54|    253|    v_[0] = c0;
   55|    253|    v_[1] = c1;
   56|    253|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|    314|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|    735|  bool operator==(const Self &o) const {
  207|  1.00k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 917, False: 84]
  ------------------
  208|    917|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 651, False: 266]
  ------------------
  209|    651|        return false;
  210|    651|      }
  211|    917|    }
  212|     84|    return true;
  213|    735|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  17.6k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  11.2M|  VectorD() {
   41|  44.9M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 33.7M, False: 11.2M]
  ------------------
   42|  33.7M|      (*this)[i] = Scalar(0);
   43|  33.7M|    }
   44|  11.2M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  1.25k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  1.86k|  Scalar Dot(const Self &o) const {
  251|  1.86k|    Scalar ret(0);
  252|  7.44k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 5.58k, False: 1.86k]
  ------------------
  253|  5.58k|      ret += (*this)[i] * o[i];
  254|  5.58k|    }
  255|  1.86k|    return ret;
  256|  1.86k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|    607|  Self operator-(const Self &o) const {
  138|    607|    Self ret;
  139|  1.82k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.21k, False: 607]
  ------------------
  140|  1.21k|      ret[i] = (*this)[i] - o[i];
  141|  1.21k|    }
  142|    607|    return ret;
  143|    607|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  1.80k|  Self operator*(const Scalar &o) const {
  175|  1.80k|    Self ret;
  176|  5.41k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 3.61k, False: 1.80k]
  ------------------
  177|  3.61k|      ret[i] = (*this)[i] * o;
  178|  3.61k|    }
  179|  1.80k|    return ret;
  180|  1.80k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|    602|  Self operator+(const Self &o) const {
  130|    602|    Self ret;
  131|  1.80k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.20k, False: 602]
  ------------------
  132|  1.20k|      ret[i] = (*this)[i] + o[i];
  133|  1.20k|    }
  134|    602|    return ret;
  135|    602|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|    602|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|    602|  return v * o;
  294|    602|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|    602|  Self operator+(const Self &o) const {
  130|    602|    Self ret;
  131|  2.40k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.80k, False: 602]
  ------------------
  132|  1.80k|      ret[i] = (*this)[i] + o[i];
  133|  1.80k|    }
  134|    602|    return ret;
  135|    602|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|    602|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|    602|  return v * o;
  294|    602|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|    602|  Self operator*(const Scalar &o) const {
  175|    602|    Self ret;
  176|  2.40k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 1.80k, False: 602]
  ------------------
  177|  1.80k|      ret[i] = (*this)[i] * o;
  178|  1.80k|    }
  179|    602|    return ret;
  180|    602|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|  2.07k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  2.07k|    DRACO_DCHECK_EQ(dimension, 2);
   54|  2.07k|    v_[0] = c0;
   55|  2.07k|    v_[1] = c1;
   56|  2.07k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  4.21k|  VectorD() {
   41|  12.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 8.43k, False: 4.21k]
  ------------------
   42|  8.43k|      (*this)[i] = Scalar(0);
   43|  8.43k|    }
   44|  4.21k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  1.20k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  3.61k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 2.40k, False: 1.20k]
  ------------------
  104|  2.40k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 2.40k, False: 0]
  ------------------
  105|  2.40k|        v_[i] = Scalar(src_vector[i]);
  106|  2.40k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  2.40k|    }
  110|  1.20k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|     61|  Self operator+(const Self &o) const {
  130|     61|    Self ret;
  131|    183|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 122, False: 61]
  ------------------
  132|    122|      ret[i] = (*this)[i] + o[i];
  133|    122|    }
  134|     61|    return ret;
  135|     61|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|    602|  VectorD() {
   41|  1.80k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 1.20k, False: 602]
  ------------------
   42|  1.20k|      (*this)[i] = Scalar(0);
   43|  1.20k|    }
   44|    602|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  3.61k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  2.40k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|    602|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  1.80k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 1.20k, False: 602]
  ------------------
  104|  1.20k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 1.20k, False: 0]
  ------------------
  105|  1.20k|        v_[i] = Scalar(src_vector[i]);
  106|  1.20k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  1.20k|    }
  110|    602|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|    602|  Self operator/(const Scalar &o) const {
  183|    602|    Self ret;
  184|  1.80k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 1.20k, False: 602]
  ------------------
  185|  1.20k|      ret[i] = (*this)[i] / o;
  186|  1.20k|    }
  187|    602|    return ret;
  188|    602|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|    541|  Self operator-(const Self &o) const {
  138|    541|    Self ret;
  139|  1.62k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.08k, False: 541]
  ------------------
  140|  1.08k|      ret[i] = (*this)[i] - o[i];
  141|  1.08k|    }
  142|    541|    return ret;
  143|    541|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  16.8k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|   348k|  VectorD() {
   41|  1.39M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 1.04M, False: 348k]
  ------------------
   42|  1.04M|      (*this)[i] = Scalar(0);
   43|  1.04M|    }
   44|   348k|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  1.54M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  1.54M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  1.54M|    v_[0] = c0;
   55|  1.54M|    v_[1] = c1;
   56|  1.54M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|   953k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  2.86M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 1.90M, False: 953k]
  ------------------
  104|  1.90M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 1.90M, False: 0]
  ------------------
  105|  1.90M|        v_[i] = Scalar(src_vector[i]);
  106|  1.90M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  1.90M|    }
  110|   953k|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|   476k|  VectorD() {
   41|  1.43M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 953k, False: 476k]
  ------------------
   42|   953k|      (*this)[i] = Scalar(0);
   43|   953k|    }
   44|   476k|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|   476k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  1.43M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 953k, False: 476k]
  ------------------
  104|   953k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 953k, False: 0]
  ------------------
  105|   953k|        v_[i] = Scalar(src_vector[i]);
  106|   953k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|   953k|    }
  110|   476k|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  1.01M|  VectorD(const Self &o) {
   89|  3.05M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 2.03M, False: 1.01M]
  ------------------
   90|  2.03M|      (*this)[i] = o[i];
   91|  2.03M|    }
   92|  1.01M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|   406k|  VectorD() {
   41|  1.21M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 812k, False: 406k]
  ------------------
   42|   812k|      (*this)[i] = Scalar(0);
   43|   812k|    }
   44|   406k|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|     22|  VectorD(const Self &o) {
   89|     88|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 66, False: 22]
  ------------------
   90|     66|      (*this)[i] = o[i];
   91|     66|    }
   92|     22|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|     66|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|     22|      : v_({{c0, c1, c2}}) {
   60|     22|    DRACO_DCHECK_EQ(dimension, 3);
   61|     22|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|  9.74M|  inline int num_vertices() const {
   74|  9.74M|    return static_cast<int>(vertex_corners_.size());
   75|  9.74M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  1.09M|  inline int num_corners() const {
   77|  1.09M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  1.09M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  41.4k|  inline int num_faces() const {
   80|  41.4k|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  41.4k|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|  62.8M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|  62.8M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 62.8M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|  62.8M|    return opposite_corners_[corner];
   88|  62.8M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|  84.5M|  inline CornerIndex Next(CornerIndex corner) const {
   90|  84.5M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 3.70M, False: 80.8M]
  ------------------
   91|  3.70M|      return corner;
   92|  3.70M|    }
   93|  80.8M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 61.6M, False: 19.1M]
  ------------------
   94|  84.5M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|  64.8M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|  64.8M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 378k, False: 64.5M]
  ------------------
   97|   378k|      return corner;
   98|   378k|    }
   99|  64.5M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 30.8M, False: 33.6M]
  ------------------
  100|  64.8M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  76.4M|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|  76.4M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 76.4M]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|  76.4M|    return ConfidentVertex(corner);
  106|  76.4M|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  76.4M|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|  76.4M|    DRACO_DCHECK_GE(corner.value(), 0);
  109|  76.4M|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|  76.4M|    return corner_to_vertex_map_[corner];
  111|  76.4M|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  4.32M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  4.32M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 4.32M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  4.32M|    return FaceIndex(corner.value() / 3);
  117|  4.32M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|   145M|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  12.6M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  12.6M|    return vertex_corners_[v];
  152|  12.6M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|   332k|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|   332k|    const CornerIndex corner = LeftMostCorner(vert);
  187|   332k|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 1.07k, False: 331k]
  ------------------
  188|  1.07k|      return true;
  189|  1.07k|    }
  190|   331k|    return false;
  191|   332k|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  16.8M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  16.8M|    return Previous(Opposite(Previous(corner)));
  202|  16.8M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  11.6M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  11.6M|    return Next(Opposite(Next(corner)));
  207|  11.6M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|   376k|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|   376k|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 376k]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|   376k|    return Opposite(Previous(corner_id));
  222|   376k|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|   707k|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|   707k|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 707k]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|   707k|    return Opposite(Next(corner_id));
  228|   707k|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|  45.6M|                                CornerIndex opp_corner_id) {
  249|  45.6M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|  45.6M|    opposite_corners_[corner_id] = opp_corner_id;
  251|  45.6M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|  59.5M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|  59.5M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|  59.5M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|  59.5M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|  14.3M|  VertexIndex AddNewVertex() {
  271|  14.3M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|  14.3M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|  14.3M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|  14.3M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|  29.1M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|  29.1M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|  29.1M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 29.1M, False: 0]
  ------------------
  295|  29.1M|      vertex_corners_[vert] = corner;
  296|  29.1M|    }
  297|  29.1M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|  1.76M|  void MakeVertexIsolated(VertexIndex vert) {
  329|  1.76M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|  1.76M|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|  1.76M|  }

_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  2.31M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  1.98M|  void Next() {
  248|  1.98M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 1.97M, False: 4.61k]
  ------------------
  249|  1.97M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  1.97M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 6.05k, False: 1.96M]
  ------------------
  251|       |        // Open boundary reached.
  252|  6.05k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  6.05k|        left_traversal_ = false;
  254|  1.96M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 329k, False: 1.64M]
  ------------------
  255|       |        // End reached.
  256|   329k|        corner_ = kInvalidCornerIndex;
  257|   329k|      }
  258|  1.97M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  4.61k|      corner_ = corner_table_->SwingRight(corner_);
  262|  4.61k|    }
  263|  1.98M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  3.96M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  96.0k|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|   122k|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  61.1k|  void Next() {
  248|  61.1k|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 58.3k, False: 2.78k]
  ------------------
  249|  58.3k|      corner_ = corner_table_->SwingLeft(corner_);
  250|  58.3k|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 30.6k, False: 27.7k]
  ------------------
  251|       |        // Open boundary reached.
  252|  30.6k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  30.6k|        left_traversal_ = false;
  254|  30.6k|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 4.36k, False: 23.3k]
  ------------------
  255|       |        // End reached.
  256|  4.36k|        corner_ = kInvalidCornerIndex;
  257|  4.36k|      }
  258|  58.3k|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  2.78k|      corner_ = corner_table_->SwingRight(corner_);
  262|  2.78k|    }
  263|  61.1k|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  34.9k|      : corner_table_(table),
  236|  34.9k|        start_corner_(corner_id),
  237|  34.9k|        corner_(start_corner_),
  238|  34.9k|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   335k|      : corner_table_(table),
  236|   335k|        start_corner_(corner_id),
  237|   335k|        corner_(start_corner_),
  238|   335k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  11.4M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  11.4M|    return is_edge_on_seam_[corner.value()];
   47|  11.4M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  2.27M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  2.27M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 2.27M]
  |  Branch (50:42): [True: 2.05M, False: 223k]
  ------------------
   51|  2.05M|      return kInvalidCornerIndex;
   52|  2.05M|    }
   53|   223k|    return corner_table_->Opposite(corner);
   54|  2.27M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  4.27M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  4.27M|    return corner_table_->Next(corner);
   58|  4.27M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|   318k|  inline CornerIndex Previous(CornerIndex corner) const {
   61|   318k|    return corner_table_->Previous(corner);
   62|   318k|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|   534k|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|   534k|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|   534k|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  40.7k|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  40.7k|    return Opposite(Previous(corner));
   73|  40.7k|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  60.3k|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  60.3k|    return Opposite(Next(corner));
   76|  60.3k|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  78.2k|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  78.2k|    return Previous(Opposite(Previous(corner)));
   81|  78.2k|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  2.04M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  2.04M|    return Next(Opposite(Next(corner)));
   86|  2.04M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  1.12k|  int num_vertices() const {
   89|  1.12k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  1.12k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|    258|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|    118|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|  7.37M|  VertexIndex Vertex(CornerIndex corner) const {
   95|  7.37M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|  7.37M|    return ConfidentVertex(corner);
   97|  7.37M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|  7.37M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|  7.37M|    return corner_to_vertex_map_[corner.value()];
  100|  7.37M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  39.9k|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  39.9k|    return vertex_to_left_most_corner_map_[v.value()];
  108|  39.9k|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  39.9k|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  39.9k|    const CornerIndex corner = LeftMostCorner(vert);
  124|  39.9k|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 39.9k]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  39.9k|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 20.4k, False: 19.5k]
  ------------------
  128|  20.4k|      return true;
  129|  20.4k|    }
  130|  19.5k|    return false;
  131|  39.9k|  }

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

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

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

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

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

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

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

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

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

