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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  1.87k|      : quantization_bits_(-1),
   54|  1.87k|        max_quantized_value_(-1),
   55|  1.87k|        max_value_(-1),
   56|  1.87k|        dequantization_scale_(1.f),
   57|  1.87k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  1.70k|  bool SetQuantizationBits(int32_t q) {
   60|  1.70k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 646, False: 1.05k]
  |  Branch (60:18): [True: 94, False: 960]
  ------------------
   61|    740|      return false;
   62|    740|    }
   63|    960|    quantization_bits_ = q;
   64|    960|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|    960|    max_value_ = max_quantized_value_ - 1;
   66|    960|    dequantization_scale_ = 2.f / max_value_;
   67|    960|    center_value_ = max_value_ / 2;
   68|    960|    return true;
   69|  1.70k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  1.83M|                                           int32_t *out_t) const {
   77|  1.83M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 5.75k, False: 1.82M]
  |  Branch (77:20): [True: 0, False: 5.75k]
  |  Branch (77:32): [True: 5.75k, False: 1.82M]
  |  Branch (77:42): [True: 0, False: 5.75k]
  ------------------
   78|  1.83M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 1.05M, False: 777k]
  |  Branch (78:29): [True: 5.81k, False: 1.05M]
  ------------------
   79|  5.81k|      s = max_value_;
   80|  5.81k|      t = max_value_;
   81|  1.82M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 5.75k, False: 1.82M]
  |  Branch (81:26): [True: 2.20k, False: 3.54k]
  ------------------
   82|  2.20k|      t = center_value_ - (t - center_value_);
   83|  1.82M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 1.05M, False: 774k]
  |  Branch (83:35): [True: 6.10k, False: 1.04M]
  ------------------
   84|  6.10k|      t = center_value_ + (center_value_ - t);
   85|  1.81M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 1.04M, False: 772k]
  |  Branch (85:35): [True: 938, False: 1.04M]
  ------------------
   86|    938|      s = center_value_ + (center_value_ - s);
   87|  1.81M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 6.29k, False: 1.81M]
  |  Branch (87:26): [True: 2.12k, False: 4.16k]
  ------------------
   88|  2.12k|      s = center_value_ - (s - center_value_);
   89|  2.12k|    }
   90|       |
   91|  1.83M|    *out_s = s;
   92|  1.83M|    *out_t = t;
   93|  1.83M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  1.83M|                                                       int32_t *out_t) const {
  100|  1.83M|    DRACO_DCHECK_EQ(
  101|  1.83M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  1.83M|        center_value_);
  103|  1.83M|    int32_t s, t;
  104|  1.83M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 979k, False: 853k]
  ------------------
  105|       |      // Right hemisphere.
  106|   979k|      s = (int_vec[1] + center_value_);
  107|   979k|      t = (int_vec[2] + center_value_);
  108|   979k|    } else {
  109|       |      // Left hemisphere.
  110|   853k|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 68.8k, False: 785k]
  ------------------
  111|  68.8k|        s = std::abs(int_vec[2]);
  112|   785k|      } else {
  113|   785k|        s = (max_value_ - std::abs(int_vec[2]));
  114|   785k|      }
  115|   853k|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 72.9k, False: 781k]
  ------------------
  116|  72.9k|        t = std::abs(int_vec[1]);
  117|   781k|      } else {
  118|   781k|        t = (max_value_ - std::abs(int_vec[1]));
  119|   781k|      }
  120|   853k|    }
  121|  1.83M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  1.83M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|   129k|                                                    float *out_vector) const {
  199|   129k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|   129k|                                 in_t * dequantization_scale_ - 1.f,
  201|   129k|                                 out_vector);
  202|   129k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  1.71M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  1.71M|    DRACO_DCHECK_LE(s, center_value_);
  208|  1.71M|    DRACO_DCHECK_LE(t, center_value_);
  209|  1.71M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  1.71M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  1.71M|    const uint32_t st =
  212|  1.71M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  1.71M|    return st <= center_value_;
  214|  1.71M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  2.18M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  2.18M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  2.18M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  2.18M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  2.18M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  2.18M|    int32_t sign_s = 0;
  223|  2.18M|    int32_t sign_t = 0;
  224|  2.18M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 1.92M, False: 256k]
  |  Branch (224:20): [True: 1.77M, False: 152k]
  ------------------
  225|  1.77M|      sign_s = 1;
  226|  1.77M|      sign_t = 1;
  227|  1.77M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 280k, False: 127k]
  |  Branch (227:27): [True: 159k, False: 121k]
  ------------------
  228|   159k|      sign_s = -1;
  229|   159k|      sign_t = -1;
  230|   249k|    } else {
  231|   249k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 127k, False: 121k]
  ------------------
  232|   249k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 121k, False: 127k]
  ------------------
  233|   249k|    }
  234|       |
  235|       |    // Perform the addition and subtraction using unsigned integers to avoid
  236|       |    // signed integer overflows for bad data. Note that the result will be
  237|       |    // unchanged for non-overflowing cases.
  238|  2.18M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  2.18M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  2.18M|    uint32_t us = *s;
  241|  2.18M|    uint32_t ut = *t;
  242|  2.18M|    us = us + us - corner_point_s;
  243|  2.18M|    ut = ut + ut - corner_point_t;
  244|  2.18M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 1.93M, False: 249k]
  ------------------
  245|  1.93M|      uint32_t temp = us;
  246|  1.93M|      us = -ut;
  247|  1.93M|      ut = -temp;
  248|  1.93M|    } else {
  249|   249k|      std::swap(us, ut);
  250|   249k|    }
  251|  2.18M|    us = us + corner_point_s;
  252|  2.18M|    ut = ut + corner_point_t;
  253|       |
  254|  2.18M|    *s = us;
  255|  2.18M|    *t = ut;
  256|  2.18M|    *s /= 2;
  257|  2.18M|    *t /= 2;
  258|  2.18M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  3.43M|  int32_t ModMax(int32_t x) const {
  273|  3.43M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 6.02k, False: 3.43M]
  ------------------
  274|  6.02k|      return x - this->max_quantized_value();
  275|  6.02k|    }
  276|  3.43M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 3.42k, False: 3.42M]
  ------------------
  277|  3.42k|      return x + this->max_quantized_value();
  278|  3.42k|    }
  279|  3.42M|    return x;
  280|  3.43M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|    957|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  9.45k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  10.3M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|   129k|                                           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|   129k|    float y = in_s_scaled;
  329|   129k|    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|   129k|    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|   129k|    float x_offset = -x;
  342|   129k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 23.7k, False: 106k]
  ------------------
  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|   129k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 31.6k, False: 98.1k]
  ------------------
  348|   129k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 31.5k, False: 98.2k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|   129k|    const float norm_squared = x * x + y * y + z * z;
  352|   129k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 129k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|   129k|    } else {
  357|   129k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|   129k|      out_vector[0] = x * d;
  359|   129k|      out_vector[1] = y * d;
  360|   129k|      out_vector[2] = z * d;
  361|   129k|    }
  362|   129k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  1.83M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  1.83M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  1.83M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  1.83M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  1.83M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  1.83M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  1.83M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 1.48M, False: 350k]
  ------------------
  181|  1.48M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  1.48M|    } else {
  183|   350k|      vec[0] =
  184|   350k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   350k|          abs_sum;
  186|   350k|      vec[1] =
  187|   350k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   350k|          abs_sum;
  189|   350k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 187k, False: 162k]
  ------------------
  190|   187k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   187k|      } else {
  192|   162k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   162k|      }
  194|   350k|    }
  195|  1.83M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    253|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    253|            attribute, transform, mesh_data),
   52|    253|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    242|                                                                *buffer) {
  194|    242|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    242|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    242|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 13, False: 229]
  ------------------
  196|       |    // Decode prediction mode.
  197|     13|    uint8_t mode;
  198|     13|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 13]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|     13|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 10, False: 3]
  ------------------
  203|       |      // Unsupported mode.
  204|     10|      return false;
  205|     10|    }
  206|     13|  }
  207|    232|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.08k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 885, False: 197]
  ------------------
  211|    885|    uint32_t num_flags;
  212|    885|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 2, False: 883]
  ------------------
  213|      2|      return false;
  214|      2|    }
  215|    883|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 21, False: 862]
  ------------------
  216|     21|      return false;
  217|     21|    }
  218|    862|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 433, False: 429]
  ------------------
  219|    433|      is_crease_edge_[i].resize(num_flags);
  220|    433|      RAnsBitDecoder decoder;
  221|    433|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 12, False: 421]
  ------------------
  222|     12|        return false;
  223|     12|      }
  224|  3.00M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 3.00M, False: 421]
  ------------------
  225|  3.00M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  3.00M|      }
  227|    421|      decoder.EndDecoding();
  228|    421|    }
  229|    862|  }
  230|    197|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    197|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    232|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    182|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    182|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    182|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    910|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 728, False: 182]
  ------------------
   93|    728|    pred_vals[i].resize(num_components, 0);
   94|    728|  }
   95|    182|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    182|                                         out_data);
   97|       |
   98|    182|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    182|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    182|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    182|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    182|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    182|  const int corner_map_size =
  109|    182|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  1.21M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 1.21M, False: 125]
  ------------------
  111|  1.21M|    const CornerIndex start_corner_id =
  112|  1.21M|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  1.21M|    CornerIndex corner_id(start_corner_id);
  115|  1.21M|    int num_parallelograms = 0;
  116|  1.21M|    bool first_pass = true;
  117|  2.70M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 1.55M, False: 1.14M]
  ------------------
  118|  1.55M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 131k, False: 1.42M]
  ------------------
  119|  1.55M|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  1.55M|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   131k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   131k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 1.13k, False: 130k]
  ------------------
  127|  1.13k|          break;
  128|  1.13k|        }
  129|   131k|      }
  130|       |
  131|       |      // Proceed to the next corner attached to the vertex. First swing left
  132|       |      // and if we reach a boundary, swing right from the start corner.
  133|  1.55M|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 1.53M, False: 13.3k]
  ------------------
  134|  1.53M|        corner_id = table->SwingLeft(corner_id);
  135|  1.53M|      } else {
  136|  13.3k|        corner_id = table->SwingRight(corner_id);
  137|  13.3k|      }
  138|  1.55M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 62.4k, False: 1.48M]
  ------------------
  139|  62.4k|        break;
  140|  62.4k|      }
  141|  1.48M|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 1.15M, False: 332k]
  |  Branch (141:47): [True: 1.14M, False: 5.81k]
  ------------------
  142|  1.14M|        first_pass = false;
  143|  1.14M|        corner_id = table->SwingRight(start_corner_id);
  144|  1.14M|      }
  145|  1.48M|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  1.21M|    int num_used_parallelograms = 0;
  150|  1.21M|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 72.1k, False: 1.14M]
  ------------------
  151|  9.81M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 9.74M, False: 72.1k]
  ------------------
  152|  9.74M|        multi_pred_vals[i] = 0;
  153|  9.74M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   203k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 131k, False: 72.1k]
  ------------------
  156|   131k|        const int context = num_parallelograms - 1;
  157|   131k|        const int pos = is_crease_edge_pos[context]++;
  158|   131k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 57, False: 131k]
  ------------------
  159|     57|          return false;
  160|     57|        }
  161|   131k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   131k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 34.8k, False: 96.3k]
  ------------------
  163|  34.8k|          ++num_used_parallelograms;
  164|  4.69M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 4.65M, False: 34.8k]
  ------------------
  165|  4.65M|            multi_pred_vals[j] =
  166|  4.65M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  4.65M|          }
  168|  34.8k|        }
  169|   131k|      }
  170|  72.1k|    }
  171|  1.21M|    const int dst_offset = p * num_components;
  172|  1.21M|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 1.19M, False: 13.5k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  1.19M|      const int src_offset = (p - 1) * num_components;
  176|  1.19M|      this->transform().ComputeOriginalValue(
  177|  1.19M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  1.19M|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|  1.77M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 1.76M, False: 13.5k]
  ------------------
  181|  1.76M|        multi_pred_vals[c] /= num_used_parallelograms;
  182|  1.76M|      }
  183|  13.5k|      this->transform().ComputeOriginalValue(
  184|  13.5k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  13.5k|    }
  186|  1.21M|  }
  187|    125|  return true;
  188|    182|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    212|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    212|            attribute, transform, mesh_data),
   52|    212|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    199|                                                                *buffer) {
  194|    199|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    199|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    199|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 2, False: 197]
  ------------------
  196|       |    // Decode prediction mode.
  197|      2|    uint8_t mode;
  198|      2|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 2]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      2|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 1, False: 1]
  ------------------
  203|       |      // Unsupported mode.
  204|      1|      return false;
  205|      1|    }
  206|      2|  }
  207|    198|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|    900|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 738, False: 162]
  ------------------
  211|    738|    uint32_t num_flags;
  212|    738|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 3, False: 735]
  ------------------
  213|      3|      return false;
  214|      3|    }
  215|    735|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 21, False: 714]
  ------------------
  216|     21|      return false;
  217|     21|    }
  218|    714|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 389, False: 325]
  ------------------
  219|    389|      is_crease_edge_[i].resize(num_flags);
  220|    389|      RAnsBitDecoder decoder;
  221|    389|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 12, False: 377]
  ------------------
  222|     12|        return false;
  223|     12|      }
  224|   833k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 832k, False: 377]
  ------------------
  225|   832k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|   832k|      }
  227|    377|      decoder.EndDecoding();
  228|    377|    }
  229|    714|  }
  230|    162|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    162|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    198|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    149|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    149|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    149|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    745|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 596, False: 149]
  ------------------
   93|    596|    pred_vals[i].resize(num_components, 0);
   94|    596|  }
   95|    149|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    149|                                         out_data);
   97|       |
   98|    149|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    149|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    149|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    149|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    149|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    149|  const int corner_map_size =
  109|    149|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  70.3k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 70.3k, False: 74]
  ------------------
  111|  70.3k|    const CornerIndex start_corner_id =
  112|  70.3k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  70.3k|    CornerIndex corner_id(start_corner_id);
  115|  70.3k|    int num_parallelograms = 0;
  116|  70.3k|    bool first_pass = true;
  117|   410k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 406k, False: 3.48k]
  ------------------
  118|   406k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 131k, False: 274k]
  ------------------
  119|   406k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   406k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   131k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   131k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 353, False: 131k]
  ------------------
  127|    353|          break;
  128|    353|        }
  129|   131k|      }
  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|   406k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 403k, False: 3.26k]
  ------------------
  134|   403k|        corner_id = table->SwingLeft(corner_id);
  135|   403k|      } else {
  136|  3.26k|        corner_id = table->SwingRight(corner_id);
  137|  3.26k|      }
  138|   406k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 66.4k, False: 339k]
  ------------------
  139|  66.4k|        break;
  140|  66.4k|      }
  141|   339k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 5.06k, False: 334k]
  |  Branch (141:47): [True: 3.48k, False: 1.58k]
  ------------------
  142|  3.48k|        first_pass = false;
  143|  3.48k|        corner_id = table->SwingRight(start_corner_id);
  144|  3.48k|      }
  145|   339k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  70.3k|    int num_used_parallelograms = 0;
  150|  70.3k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 67.8k, False: 2.42k]
  ------------------
  151|  6.26M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 6.20M, False: 67.8k]
  ------------------
  152|  6.20M|        multi_pred_vals[i] = 0;
  153|  6.20M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   199k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 131k, False: 67.8k]
  ------------------
  156|   131k|        const int context = num_parallelograms - 1;
  157|   131k|        const int pos = is_crease_edge_pos[context]++;
  158|   131k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 75, False: 131k]
  ------------------
  159|     75|          return false;
  160|     75|        }
  161|   131k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   131k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 11.6k, False: 120k]
  ------------------
  163|  11.6k|          ++num_used_parallelograms;
  164|   833k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 821k, False: 11.6k]
  ------------------
  165|   821k|            multi_pred_vals[j] =
  166|   821k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|   821k|          }
  168|  11.6k|        }
  169|   131k|      }
  170|  67.8k|    }
  171|  70.2k|    const int dst_offset = p * num_components;
  172|  70.2k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 64.2k, False: 5.95k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  64.2k|      const int src_offset = (p - 1) * num_components;
  176|  64.2k|      this->transform().ComputeOriginalValue(
  177|  64.2k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  64.2k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   435k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 429k, False: 5.95k]
  ------------------
  181|   429k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   429k|      }
  183|  5.95k|      this->transform().ComputeOriginalValue(
  184|  5.95k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  5.95k|    }
  186|  70.2k|  }
  187|     74|  return true;
  188|    149|}

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

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   571k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   237k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   367k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   298k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.34k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.34k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  10.1M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.55k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.55k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  3.21M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    117|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    117|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|     99|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|     99|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    114|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    114|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    129|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    129|        mesh_data_(mesh_data) {}

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

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    151|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    151|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 33, False: 118]
  ------------------
  105|     33|      this->normal_prediction_mode_ = mode;
  106|     33|      return true;
  107|    118|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 118, False: 0]
  ------------------
  108|    118|      this->normal_prediction_mode_ = mode;
  109|    118|      return true;
  110|    118|    }
  111|      0|    return false;
  112|    151|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   571k|                             DataTypeT *prediction) override {
   42|   571k|    DRACO_DCHECK(this->IsInitialized());
   43|   571k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   571k|    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|   571k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   571k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   571k|    VectorD<int64_t, 3> normal;
   53|   571k|    CornerIndex c_next, c_prev;
   54|  1.28M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 715k, False: 571k]
  ------------------
   55|       |      // Getting corners.
   56|   715k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 180, False: 714k]
  ------------------
   57|    180|        c_next = corner_table->Next(corner_id);
   58|    180|        c_prev = corner_table->Previous(corner_id);
   59|   714k|      } else {
   60|   714k|        c_next = corner_table->Next(cit.Corner());
   61|   714k|        c_prev = corner_table->Previous(cit.Corner());
   62|   714k|      }
   63|   715k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   715k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   715k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   715k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   715k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   715k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   715k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   715k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   715k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   715k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   715k|      cit.Next();
   81|   715k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   571k|    constexpr int64_t upper_bound = 1 << 29;
   85|   571k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 120, False: 571k]
  ------------------
   86|    120|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    120|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 60, False: 60]
  ------------------
   88|     60|        const int64_t quotient = abs_sum / upper_bound;
   89|     60|        normal = normal / quotient;
   90|     60|      }
   91|   571k|    } else {
   92|   571k|      const int64_t abs_sum = normal.AbsSum();
   93|   571k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.98k, False: 569k]
  ------------------
   94|  1.98k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.98k|        normal = normal / quotient;
   96|  1.98k|      }
   97|   571k|    }
   98|   571k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   571k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   571k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   571k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   571k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    110|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    110|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 10, False: 100]
  ------------------
  105|     10|      this->normal_prediction_mode_ = mode;
  106|     10|      return true;
  107|    100|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 100, False: 0]
  ------------------
  108|    100|      this->normal_prediction_mode_ = mode;
  109|    100|      return true;
  110|    100|    }
  111|      0|    return false;
  112|    110|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   237k|                             DataTypeT *prediction) override {
   42|   237k|    DRACO_DCHECK(this->IsInitialized());
   43|   237k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   237k|    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|   237k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   237k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   237k|    VectorD<int64_t, 3> normal;
   53|   237k|    CornerIndex c_next, c_prev;
   54|  1.64M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.41M, False: 237k]
  ------------------
   55|       |      // Getting corners.
   56|  1.41M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 54, False: 1.41M]
  ------------------
   57|     54|        c_next = corner_table->Next(corner_id);
   58|     54|        c_prev = corner_table->Previous(corner_id);
   59|  1.41M|      } else {
   60|  1.41M|        c_next = corner_table->Next(cit.Corner());
   61|  1.41M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.41M|      }
   63|  1.41M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.41M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.41M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.41M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.41M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.41M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.41M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.41M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.41M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.41M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.41M|      cit.Next();
   81|  1.41M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   237k|    constexpr int64_t upper_bound = 1 << 29;
   85|   237k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 36, False: 237k]
  ------------------
   86|     36|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     36|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 12, False: 24]
  ------------------
   88|     12|        const int64_t quotient = abs_sum / upper_bound;
   89|     12|        normal = normal / quotient;
   90|     12|      }
   91|   237k|    } else {
   92|   237k|      const int64_t abs_sum = normal.AbsSum();
   93|   237k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 111k, False: 125k]
  ------------------
   94|   111k|        const int64_t quotient = abs_sum / upper_bound;
   95|   111k|        normal = normal / quotient;
   96|   111k|      }
   97|   237k|    }
   98|   237k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   237k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   237k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   237k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   237k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    149|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    149|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 33, False: 116]
  ------------------
  105|     33|      this->normal_prediction_mode_ = mode;
  106|     33|      return true;
  107|    116|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 116, False: 0]
  ------------------
  108|    116|      this->normal_prediction_mode_ = mode;
  109|    116|      return true;
  110|    116|    }
  111|      0|    return false;
  112|    149|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   367k|                             DataTypeT *prediction) override {
   42|   367k|    DRACO_DCHECK(this->IsInitialized());
   43|   367k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   367k|    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|   367k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   367k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   367k|    VectorD<int64_t, 3> normal;
   53|   367k|    CornerIndex c_next, c_prev;
   54|  1.11M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 751k, False: 367k]
  ------------------
   55|       |      // Getting corners.
   56|   751k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 180, False: 751k]
  ------------------
   57|    180|        c_next = corner_table->Next(corner_id);
   58|    180|        c_prev = corner_table->Previous(corner_id);
   59|   751k|      } else {
   60|   751k|        c_next = corner_table->Next(cit.Corner());
   61|   751k|        c_prev = corner_table->Previous(cit.Corner());
   62|   751k|      }
   63|   751k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   751k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   751k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   751k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   751k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   751k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   751k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   751k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   751k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   751k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   751k|      cit.Next();
   81|   751k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   367k|    constexpr int64_t upper_bound = 1 << 29;
   85|   367k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 120, False: 367k]
  ------------------
   86|    120|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    120|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 47, False: 73]
  ------------------
   88|     47|        const int64_t quotient = abs_sum / upper_bound;
   89|     47|        normal = normal / quotient;
   90|     47|      }
   91|   367k|    } else {
   92|   367k|      const int64_t abs_sum = normal.AbsSum();
   93|   367k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.73k, False: 365k]
  ------------------
   94|  1.73k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.73k|        normal = normal / quotient;
   96|  1.73k|      }
   97|   367k|    }
   98|   367k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   367k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   367k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   367k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   367k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    151|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    151|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 20, False: 131]
  ------------------
  105|     20|      this->normal_prediction_mode_ = mode;
  106|     20|      return true;
  107|    131|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 131, False: 0]
  ------------------
  108|    131|      this->normal_prediction_mode_ = mode;
  109|    131|      return true;
  110|    131|    }
  111|      0|    return false;
  112|    151|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   298k|                             DataTypeT *prediction) override {
   42|   298k|    DRACO_DCHECK(this->IsInitialized());
   43|   298k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   298k|    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|   298k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   298k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   298k|    VectorD<int64_t, 3> normal;
   53|   298k|    CornerIndex c_next, c_prev;
   54|  2.08M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.78M, False: 298k]
  ------------------
   55|       |      // Getting corners.
   56|  1.78M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 114, False: 1.78M]
  ------------------
   57|    114|        c_next = corner_table->Next(corner_id);
   58|    114|        c_prev = corner_table->Previous(corner_id);
   59|  1.78M|      } else {
   60|  1.78M|        c_next = corner_table->Next(cit.Corner());
   61|  1.78M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.78M|      }
   63|  1.78M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.78M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.78M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.78M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.78M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.78M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.78M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.78M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.78M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.78M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.78M|      cit.Next();
   81|  1.78M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   298k|    constexpr int64_t upper_bound = 1 << 29;
   85|   298k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 76, False: 298k]
  ------------------
   86|     76|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     76|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 20, False: 56]
  ------------------
   88|     20|        const int64_t quotient = abs_sum / upper_bound;
   89|     20|        normal = normal / quotient;
   90|     20|      }
   91|   298k|    } else {
   92|   298k|      const int64_t abs_sum = normal.AbsSum();
   93|   298k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 203k, False: 94.5k]
  ------------------
   94|   203k|        const int64_t quotient = abs_sum / upper_bound;
   95|   203k|        normal = normal / quotient;
   96|   203k|      }
   97|   298k|    }
   98|   298k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   298k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   298k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   298k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   298k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    246|      : Base(md) {
   35|    246|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    246|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    318|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    318|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 71, False: 247]
  ------------------
  105|     71|      this->normal_prediction_mode_ = mode;
  106|     71|      return true;
  107|    247|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 247, False: 0]
  ------------------
  108|    247|      this->normal_prediction_mode_ = mode;
  109|    247|      return true;
  110|    247|    }
  111|      0|    return false;
  112|    318|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   142k|                             DataTypeT *prediction) override {
   42|   142k|    DRACO_DCHECK(this->IsInitialized());
   43|   142k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   142k|    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|   142k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   142k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   142k|    VectorD<int64_t, 3> normal;
   53|   142k|    CornerIndex c_next, c_prev;
   54|   306k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 164k, False: 142k]
  ------------------
   55|       |      // Getting corners.
   56|   164k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 390, False: 164k]
  ------------------
   57|    390|        c_next = corner_table->Next(corner_id);
   58|    390|        c_prev = corner_table->Previous(corner_id);
   59|   164k|      } else {
   60|   164k|        c_next = corner_table->Next(cit.Corner());
   61|   164k|        c_prev = corner_table->Previous(cit.Corner());
   62|   164k|      }
   63|   164k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   164k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   164k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   164k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   164k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   164k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   164k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   164k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   164k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   164k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   164k|      cit.Next();
   81|   164k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   142k|    constexpr int64_t upper_bound = 1 << 29;
   85|   142k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 342, False: 141k]
  ------------------
   86|    342|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    342|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 117, False: 225]
  ------------------
   88|    117|        const int64_t quotient = abs_sum / upper_bound;
   89|    117|        normal = normal / quotient;
   90|    117|      }
   91|   141k|    } else {
   92|   141k|      const int64_t abs_sum = normal.AbsSum();
   93|   141k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.30k, False: 139k]
  ------------------
   94|  2.30k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.30k|        normal = normal / quotient;
   96|  2.30k|      }
   97|   141k|    }
   98|   142k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   142k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   142k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   142k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   142k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    424|      : Base(md) {
   35|    424|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    424|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    525|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    525|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 99, False: 426]
  ------------------
  105|     99|      this->normal_prediction_mode_ = mode;
  106|     99|      return true;
  107|    426|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 426, False: 0]
  ------------------
  108|    426|      this->normal_prediction_mode_ = mode;
  109|    426|      return true;
  110|    426|    }
  111|      0|    return false;
  112|    525|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   217k|                             DataTypeT *prediction) override {
   42|   217k|    DRACO_DCHECK(this->IsInitialized());
   43|   217k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   217k|    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|   217k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   217k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   217k|    VectorD<int64_t, 3> normal;
   53|   217k|    CornerIndex c_next, c_prev;
   54|  1.44M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.22M, False: 217k]
  ------------------
   55|       |      // Getting corners.
   56|  1.22M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 546, False: 1.22M]
  ------------------
   57|    546|        c_next = corner_table->Next(corner_id);
   58|    546|        c_prev = corner_table->Previous(corner_id);
   59|  1.22M|      } else {
   60|  1.22M|        c_next = corner_table->Next(cit.Corner());
   61|  1.22M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.22M|      }
   63|  1.22M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.22M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.22M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.22M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.22M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.22M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.22M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.22M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.22M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.22M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.22M|      cit.Next();
   81|  1.22M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   217k|    constexpr int64_t upper_bound = 1 << 29;
   85|   217k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 528, False: 216k]
  ------------------
   86|    528|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    528|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 173, False: 355]
  ------------------
   88|    173|        const int64_t quotient = abs_sum / upper_bound;
   89|    173|        normal = normal / quotient;
   90|    173|      }
   91|   216k|    } else {
   92|   216k|      const int64_t abs_sum = normal.AbsSum();
   93|   216k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.91k, False: 213k]
  ------------------
   94|  2.91k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.91k|        normal = normal / quotient;
   96|  2.91k|      }
   97|   216k|    }
   98|   217k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   217k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   217k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   217k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   217k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    117|      : Base(md) {
   35|    117|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    117|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|     99|      : Base(md) {
   35|     99|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     99|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    114|      : Base(md) {
   35|    114|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    114|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    129|      : Base(md) {
   35|    129|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    129|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.00M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.00M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.00M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.00M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.00M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.00M|    return GetPositionForDataId(data_id);
   77|  2.00M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.00M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.00M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.00M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.00M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.00M|    VectorD<int64_t, 3> pos;
   68|  2.00M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.00M|    return pos;
   70|  2.00M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    117|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    117|    pos_attribute_ = &position_attribute;
   43|    117|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    102|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    102|    entry_to_point_id_map_ = map;
   46|    102|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.06M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.06M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.06M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.06M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.06M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.06M|    return GetPositionForDataId(data_id);
   77|  3.06M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  3.06M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.06M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.06M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.06M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.06M|    VectorD<int64_t, 3> pos;
   68|  3.06M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.06M|    return pos;
   70|  3.06M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     96|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     96|    pos_attribute_ = &position_attribute;
   43|     96|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     92|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     92|    entry_to_point_id_map_ = map;
   46|     92|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.87M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.87M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.87M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.87M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.87M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.87M|    return GetPositionForDataId(data_id);
   77|  1.87M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.87M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.87M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.87M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.87M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.87M|    VectorD<int64_t, 3> pos;
   68|  1.87M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.87M|    return pos;
   70|  1.87M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    112|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    112|    pos_attribute_ = &position_attribute;
   43|    112|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     91|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     91|    entry_to_point_id_map_ = map;
   46|     91|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.86M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.86M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.86M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.86M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.86M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.86M|    return GetPositionForDataId(data_id);
   77|  3.86M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  3.86M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.86M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.86M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.86M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.86M|    VectorD<int64_t, 3> pos;
   68|  3.86M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.86M|    return pos;
   70|  3.86M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    128|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    128|    pos_attribute_ = &position_attribute;
   43|    128|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    116|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    116|    entry_to_point_id_map_ = map;
   46|    116|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    246|      : pos_attribute_(nullptr),
   36|    246|        entry_to_point_id_map_(nullptr),
   37|    246|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    246|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|   471k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|   471k|    DRACO_DCHECK(this->IsInitialized());
   73|   471k|    const auto corner_table = mesh_data_.corner_table();
   74|   471k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|   471k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|   471k|    return GetPositionForDataId(data_id);
   77|   471k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|   471k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|   471k|    DRACO_DCHECK(this->IsInitialized());
   65|   471k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|   471k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|   471k|    VectorD<int64_t, 3> pos;
   68|   471k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|   471k|    return pos;
   70|   471k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    245|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    245|    pos_attribute_ = &position_attribute;
   43|    245|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    225|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    225|    entry_to_point_id_map_ = map;
   46|    225|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    424|      : pos_attribute_(nullptr),
   36|    424|        entry_to_point_id_map_(nullptr),
   37|    424|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    424|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.67M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.67M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.67M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.67M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.67M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.67M|    return GetPositionForDataId(data_id);
   77|  2.67M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.67M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.67M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.67M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.67M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.67M|    VectorD<int64_t, 3> pos;
   68|  2.67M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.67M|    return pos;
   70|  2.67M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    422|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    422|    pos_attribute_ = &position_attribute;
   43|    422|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    371|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    371|    entry_to_point_id_map_ = map;
   46|    371|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    117|      : pos_attribute_(nullptr),
   36|    117|        entry_to_point_id_map_(nullptr),
   37|    117|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    117|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|     99|      : pos_attribute_(nullptr),
   36|     99|        entry_to_point_id_map_(nullptr),
   37|     99|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|     99|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    114|      : pos_attribute_(nullptr),
   36|    114|        entry_to_point_id_map_(nullptr),
   37|    114|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    114|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    129|      : pos_attribute_(nullptr),
   36|    129|        entry_to_point_id_map_(nullptr),
   37|    129|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    129|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    142|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    142|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    139|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    139|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    139|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    139|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    139|      new DataTypeT[num_components]());
   70|       |
   71|    139|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    139|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    139|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    139|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    139|  const int corner_map_size =
   78|    139|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   719k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 719k, False: 139]
  ------------------
   80|   719k|    const CornerIndex start_corner_id =
   81|   719k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   719k|    CornerIndex corner_id(start_corner_id);
   84|   719k|    int num_parallelograms = 0;
   85|  73.3M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 72.5M, False: 719k]
  ------------------
   86|  72.5M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  72.5M|    }
   88|  1.79M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 1.07M, False: 719k]
  ------------------
   89|  1.07M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 143k, False: 927k]
  ------------------
   90|  1.07M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  1.07M|              num_components, parallelogram_pred_vals.get())) {
   92|  13.7M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 13.5M, False: 143k]
  ------------------
   93|  13.5M|          pred_vals[c] =
   94|  13.5M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  13.5M|        }
   96|   143k|        ++num_parallelograms;
   97|   143k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  1.07M|      corner_id = table->SwingRight(corner_id);
  101|  1.07M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 67.3k, False: 1.00M]
  ------------------
  102|  67.3k|        corner_id = kInvalidCornerIndex;
  103|  67.3k|      }
  104|  1.07M|    }
  105|       |
  106|   719k|    const int dst_offset = p * num_components;
  107|   719k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 642k, False: 77.3k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|   642k|      const int src_offset = (p - 1) * num_components;
  111|   642k|      this->transform().ComputeOriginalValue(
  112|   642k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   642k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  7.36M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 7.28M, False: 77.3k]
  ------------------
  116|  7.28M|        pred_vals[c] /= num_parallelograms;
  117|  7.28M|      }
  118|  77.3k|      this->transform().ComputeOriginalValue(
  119|  77.3k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|  77.3k|    }
  121|   719k|  }
  122|    139|  return true;
  123|    139|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    273|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    273|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    249|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    249|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    249|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    249|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    249|      new DataTypeT[num_components]());
   70|       |
   71|    249|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    249|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    249|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    249|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    249|  const int corner_map_size =
   78|    249|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   736k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 736k, False: 249]
  ------------------
   80|   736k|    const CornerIndex start_corner_id =
   81|   736k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   736k|    CornerIndex corner_id(start_corner_id);
   84|   736k|    int num_parallelograms = 0;
   85|  9.38M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 8.64M, False: 736k]
  ------------------
   86|  8.64M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  8.64M|    }
   88|  5.11M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 4.37M, False: 736k]
  ------------------
   89|  4.37M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 1.43M, False: 2.94M]
  ------------------
   90|  4.37M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  4.37M|              num_components, parallelogram_pred_vals.get())) {
   92|  18.2M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 16.8M, False: 1.43M]
  ------------------
   93|  16.8M|          pred_vals[c] =
   94|  16.8M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  16.8M|        }
   96|  1.43M|        ++num_parallelograms;
   97|  1.43M|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  4.37M|      corner_id = table->SwingRight(corner_id);
  101|  4.37M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 726k, False: 3.65M]
  ------------------
  102|   726k|        corner_id = kInvalidCornerIndex;
  103|   726k|      }
  104|  4.37M|    }
  105|       |
  106|   736k|    const int dst_offset = p * num_components;
  107|   736k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 902, False: 735k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|    902|      const int src_offset = (p - 1) * num_components;
  111|    902|      this->transform().ComputeOriginalValue(
  112|    902|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   735k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  9.36M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 8.62M, False: 735k]
  ------------------
  116|  8.62M|        pred_vals[c] /= num_parallelograms;
  117|  8.62M|      }
  118|   735k|      this->transform().ComputeOriginalValue(
  119|   735k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   735k|    }
  121|   736k|  }
  122|    249|  return true;
  123|    249|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  2.92M|    int num_components, DataTypeT *out_prediction) {
   49|  2.92M|  const CornerIndex oci = table->Opposite(ci);
   50|  2.92M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 2.07M, False: 850k]
  ------------------
   51|  2.07M|    return false;
   52|  2.07M|  }
   53|   850k|  int vert_opp, vert_next, vert_prev;
   54|   850k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   850k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   850k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 435k, False: 414k]
  |  Branch (56:35): [True: 326k, False: 109k]
  ------------------
   57|   326k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 299k, False: 26.5k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   299k|    const int v_opp_off = vert_opp * num_components;
   60|   299k|    const int v_next_off = vert_next * num_components;
   61|   299k|    const int v_prev_off = vert_prev * num_components;
   62|  34.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 34.4M, False: 299k]
  ------------------
   63|  34.4M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  34.4M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  34.4M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  34.4M|      const int64_t result =
   67|  34.4M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  34.4M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  34.4M|    }
   71|   299k|    return true;
   72|   299k|  }
   73|   550k|  return false;  // Not all data is available for prediction
   74|   850k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   850k|    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|   850k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   850k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   850k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   850k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  5.17M|    int num_components, DataTypeT *out_prediction) {
   49|  5.17M|  const CornerIndex oci = table->Opposite(ci);
   50|  5.17M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 13.9k, False: 5.16M]
  ------------------
   51|  13.9k|    return false;
   52|  13.9k|  }
   53|  5.16M|  int vert_opp, vert_next, vert_prev;
   54|  5.16M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  5.16M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  5.16M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 2.76M, False: 2.39M]
  |  Branch (56:35): [True: 2.11M, False: 650k]
  ------------------
   57|  2.11M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 1.95M, False: 161k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  1.95M|    const int v_opp_off = vert_opp * num_components;
   60|  1.95M|    const int v_next_off = vert_next * num_components;
   61|  1.95M|    const int v_prev_off = vert_prev * num_components;
   62|  45.6M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 43.7M, False: 1.95M]
  ------------------
   63|  43.7M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  43.7M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  43.7M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  43.7M|      const int64_t result =
   67|  43.7M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  43.7M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  43.7M|    }
   71|  1.95M|    return true;
   72|  1.95M|  }
   73|  3.20M|  return false;  // Not all data is available for prediction
   74|  5.16M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  5.16M|    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|  5.16M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  5.16M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  5.16M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  5.16M|}

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

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

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

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     46|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    255|  bool AreCorrectionsPositive() override {
   71|    255|    return transform_.AreCorrectionsPositive();
   72|    255|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     43|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     43|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 11, False: 32]
  ------------------
   50|     11|      return false;
   51|     11|    }
   52|     32|    return true;
   53|     43|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|   833k|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     67|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    302|  bool AreCorrectionsPositive() override {
   71|    302|    return transform_.AreCorrectionsPositive();
   72|    302|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     62|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     62|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 16, False: 46]
  ------------------
   50|     16|      return false;
   51|     16|    }
   52|     46|    return true;
   53|     62|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|   886k|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  3.02k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  1.78k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  2.92k|  bool AreCorrectionsPositive() override {
   71|  2.92k|    return transform_.AreCorrectionsPositive();
   72|  2.92k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  2.14k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  2.14k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 109, False: 2.03k]
  ------------------
   50|    109|      return false;
   51|    109|    }
   52|  2.03k|    return true;
   53|  2.14k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  7.26M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    262|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    310|      : attribute_(attribute), transform_(transform) {}

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

_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|     32|    const PointIndex *) {
   50|     32|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|     32|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|     32|  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|  25.2k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 25.1k, False: 32]
  ------------------
   57|  25.1k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  25.1k|                                           in_corr + i, out_data + i);
   59|  25.1k|  }
   60|     32|  return true;
   61|     32|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|     46|    const PointIndex *) {
   50|     46|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|     46|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|     46|  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|   220k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 220k, False: 46]
  ------------------
   57|   220k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|   220k|                                           in_corr + i, out_data + i);
   59|   220k|  }
   60|     46|  return true;
   61|     46|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    121|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    108|    const PointIndex *) {
   50|    108|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    108|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    108|  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|  1.47M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 1.47M, False: 108]
  ------------------
   57|  1.47M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  1.47M|                                           in_corr + i, out_data + i);
   59|  1.47M|  }
   60|    108|  return true;
   61|    108|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|     46|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|     67|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    255|    uint16_t bitstream_version) {
   38|    255|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    255|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 255, False: 0]
  ------------------
   40|    255|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 0, False: 255]
  ------------------
   41|    255|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 3, False: 252]
  ------------------
   42|    252|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 1, False: 251]
  ------------------
   43|    251|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 9, False: 242]
  ------------------
   44|    242|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 216, False: 26]
  ------------------
   45|    250|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 21, False: 5]
  ------------------
   46|    250|    const CornerTable *const ct = source->GetCornerTable();
   47|    250|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    250|        source->GetAttributeEncodingData(att_id);
   49|    250|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 30, False: 220]
  |  Branch (49:26): [True: 0, False: 220]
  ------------------
   50|       |      // No connectivity data found.
   51|     30|      return nullptr;
   52|     30|    }
   53|       |    // Connectivity data exists.
   54|    220|    const MeshAttributeCornerTable *const att_ct =
   55|    220|        source->GetAttributeCornerTable(att_id);
   56|    220|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 118, False: 102]
  ------------------
   57|    118|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    118|      MeshData md;
   59|    118|      md.Set(source->mesh(), att_ct,
   60|    118|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    118|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    118|      MeshPredictionSchemeFactoryT factory;
   63|    118|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    118|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 117, False: 1]
  ------------------
   65|    117|        return ret;
   66|    117|      }
   67|    118|    } else {
   68|    102|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    102|      MeshData md;
   70|    102|      md.Set(source->mesh(), ct,
   71|    102|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    102|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    102|      MeshPredictionSchemeFactoryT factory;
   74|    102|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    102|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 99, False: 3]
  ------------------
   76|     99|        return ret;
   77|     99|      }
   78|    102|    }
   79|    220|  }
   80|      9|  return nullptr;
   81|    255|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    310|    uint16_t bitstream_version) {
   38|    310|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    310|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 310, False: 0]
  ------------------
   40|    310|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 37, False: 273]
  ------------------
   41|    273|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 5, False: 268]
  ------------------
   42|    268|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 268]
  ------------------
   43|    268|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 3, False: 265]
  ------------------
   44|    265|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 246, False: 19]
  ------------------
   45|    304|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 13, False: 6]
  ------------------
   46|    304|    const CornerTable *const ct = source->GetCornerTable();
   47|    304|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    304|        source->GetAttributeEncodingData(att_id);
   49|    304|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 42, False: 262]
  |  Branch (49:26): [True: 0, False: 262]
  ------------------
   50|       |      // No connectivity data found.
   51|     42|      return nullptr;
   52|     42|    }
   53|       |    // Connectivity data exists.
   54|    262|    const MeshAttributeCornerTable *const att_ct =
   55|    262|        source->GetAttributeCornerTable(att_id);
   56|    262|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 133, False: 129]
  ------------------
   57|    133|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    133|      MeshData md;
   59|    133|      md.Set(source->mesh(), att_ct,
   60|    133|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    133|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    133|      MeshPredictionSchemeFactoryT factory;
   63|    133|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    133|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 114, False: 19]
  ------------------
   65|    114|        return ret;
   66|    114|      }
   67|    133|    } else {
   68|    129|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    129|      MeshData md;
   70|    129|      md.Set(source->mesh(), ct,
   71|    129|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    129|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    129|      MeshPredictionSchemeFactoryT factory;
   74|    129|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    129|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 129, False: 0]
  ------------------
   76|    129|        return ret;
   77|    129|      }
   78|    129|    }
   79|    262|  }
   80|     25|  return nullptr;
   81|    310|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  3.01k|    uint16_t bitstream_version) {
   38|  3.01k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  3.01k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 3.01k, False: 0]
  ------------------
   40|  3.01k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 803, False: 2.21k]
  ------------------
   41|  2.21k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 418, False: 1.79k]
  ------------------
   42|  1.79k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 475, False: 1.31k]
  ------------------
   43|  1.31k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 339, False: 979]
  ------------------
   44|    979|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 671, False: 308]
  ------------------
   45|  2.94k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 234, False: 74]
  ------------------
   46|  2.94k|    const CornerTable *const ct = source->GetCornerTable();
   47|  2.94k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  2.94k|        source->GetAttributeEncodingData(att_id);
   49|  2.94k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 39, False: 2.90k]
  |  Branch (49:26): [True: 0, False: 2.90k]
  ------------------
   50|       |      // No connectivity data found.
   51|     39|      return nullptr;
   52|     39|    }
   53|       |    // Connectivity data exists.
   54|  2.90k|    const MeshAttributeCornerTable *const att_ct =
   55|  2.90k|        source->GetAttributeCornerTable(att_id);
   56|  2.90k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 1.34k, False: 1.55k]
  ------------------
   57|  1.34k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  1.34k|      MeshData md;
   59|  1.34k|      md.Set(source->mesh(), att_ct,
   60|  1.34k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  1.34k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  1.34k|      MeshPredictionSchemeFactoryT factory;
   63|  1.34k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  1.34k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 1.34k, False: 0]
  ------------------
   65|  1.34k|        return ret;
   66|  1.34k|      }
   67|  1.55k|    } else {
   68|  1.55k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  1.55k|      MeshData md;
   70|  1.55k|      md.Set(source->mesh(), ct,
   71|  1.55k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  1.55k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  1.55k|      MeshPredictionSchemeFactoryT factory;
   74|  1.55k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  1.55k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 1.55k, False: 0]
  ------------------
   76|  1.55k|        return ret;
   77|  1.55k|      }
   78|  1.55k|    }
   79|  2.90k|  }
   80|     74|  return nullptr;
   81|  3.01k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|   885k|  bool IsInBottomLeft(const Point2 &p) const {
   93|   885k|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 539k, False: 346k]
  |  Branch (93:22): [True: 483k, False: 55.6k]
  ------------------
   94|   483k|      return true;
   95|   483k|    }
   96|   402k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 146k, False: 255k]
  |  Branch (96:25): [True: 72.5k, False: 73.7k]
  ------------------
   97|   885k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|   885k|  int32_t GetRotationCount(Point2 pred) const {
   51|   885k|    const DataType sign_x = pred[0];
   52|   885k|    const DataType sign_y = pred[1];
   53|       |
   54|   885k|    int32_t rotation_count = 0;
   55|   885k|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 539k, False: 346k]
  ------------------
   56|   539k|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 483k, False: 55.6k]
  ------------------
   57|   483k|        rotation_count = 0;
   58|   483k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 28.2k, False: 27.4k]
  ------------------
   59|  28.2k|        rotation_count = 3;
   60|  28.2k|      } else {
   61|  27.4k|        rotation_count = 1;
   62|  27.4k|      }
   63|   539k|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 200k, False: 146k]
  ------------------
   64|   200k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 124k, False: 76.1k]
  ------------------
   65|   124k|        rotation_count = 2;
   66|   124k|      } else {
   67|  76.1k|        rotation_count = 1;
   68|  76.1k|      }
   69|   200k|    } else {
   70|   146k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 72.5k, False: 73.7k]
  ------------------
   71|  72.5k|        rotation_count = 0;
   72|  73.7k|      } else {
   73|  73.7k|        rotation_count = 3;
   74|  73.7k|      }
   75|   146k|    }
   76|   885k|    return rotation_count;
   77|   885k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   659k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   659k|    switch (rotation_count) {
   81|   205k|      case 1:
  ------------------
  |  Branch (81:7): [True: 205k, False: 453k]
  ------------------
   82|   205k|        return Point2(p[1], -p[0]);
   83|   248k|      case 2:
  ------------------
  |  Branch (83:7): [True: 248k, False: 411k]
  ------------------
   84|   248k|        return Point2(-p[0], -p[1]);
   85|   205k|      case 3:
  ------------------
  |  Branch (85:7): [True: 205k, False: 453k]
  ------------------
   86|   205k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 659k]
  ------------------
   88|      0|        return p;
   89|   659k|    }
   90|   659k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    310|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|  2.92k|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|  2.68k|  inline void set_min_value(const DataTypeT &v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|  2.68k|  inline void set_max_value(const DataTypeT &v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|  2.68k|  bool InitCorrectionBounds() {
   84|  2.68k|    const int64_t dif =
   85|  2.68k|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|  2.68k|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 2.68k]
  |  Branch (86:20): [True: 6, False: 2.67k]
  ------------------
   87|      6|      return false;
   88|      6|    }
   89|  2.67k|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|  2.67k|    max_correction_ = max_dif_ / 2;
   91|  2.67k|    min_correction_ = -max_correction_;
   92|  2.67k|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 1.23k, False: 1.44k]
  ------------------
   93|  1.23k|      max_correction_ -= 1;
   94|  1.23k|    }
   95|  2.67k|    return true;
   96|  2.68k|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|  2.03k|  void Init(int num_components) {
   56|  2.03k|    num_components_ = num_components;
   57|  2.03k|    clamped_value_.resize(num_components);
   58|  2.03k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|  7.26M|      const DataTypeT *predicted_val) const {
   64|   301M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 294M, False: 7.26M]
  ------------------
   65|   294M|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 314k, False: 293M]
  ------------------
   66|   314k|        clamped_value_[i] = max_value_;
   67|   293M|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 5.32M, False: 288M]
  ------------------
   68|  5.32M|        clamped_value_[i] = min_value_;
   69|   288M|      } else {
   70|   288M|        clamped_value_[i] = predicted_val[i];
   71|   288M|      }
   72|   294M|    }
   73|  7.26M|    return clamped_value_.data();
   74|  7.26M|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|   602M|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|   294M|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|  1.30M|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|   294M|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|    596|  int quantization_bits() const {
   78|    596|    DRACO_DCHECK(false);
   79|    596|    return -1;
   80|    596|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   44|  3.02k|      : num_components_(0),
   45|  3.02k|        min_value_(0),
   46|  3.02k|        max_value_(0),
   47|  3.02k|        max_dif_(0),
   48|  3.02k|        max_correction_(0),
   49|  3.02k|        min_correction_(0) {}

_ZN5draco26SequentialAttributeDecoderC2Ev:
   20|  13.9k|    : decoder_(nullptr), attribute_(nullptr), attribute_id_(-1) {}
_ZN5draco26SequentialAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   23|  13.9k|                                      int attribute_id) {
   24|  13.9k|  decoder_ = decoder;
   25|  13.9k|  attribute_ = decoder->point_cloud()->attribute(attribute_id);
   26|  13.9k|  attribute_id_ = attribute_id;
   27|  13.9k|  return true;
   28|  13.9k|}
_ZN5draco26SequentialAttributeDecoder23DecodePortableAttributeERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   38|  7.32k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   39|  7.32k|  if (attribute_->num_components() <= 0 ||
  ------------------
  |  Branch (39:7): [True: 0, False: 7.32k]
  ------------------
   40|  7.32k|      !attribute_->Reset(point_ids.size())) {
  ------------------
  |  Branch (40:7): [True: 0, False: 7.32k]
  ------------------
   41|      0|    return false;
   42|      0|  }
   43|  7.32k|  if (!DecodeValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (43:7): [True: 1.08k, False: 6.24k]
  ------------------
   44|  1.08k|    return false;
   45|  1.08k|  }
   46|  6.24k|  return true;
   47|  7.32k|}
_ZN5draco26SequentialAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   50|  2.65k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   51|       |  // Default implementation does not apply any transform.
   52|  2.65k|  return true;
   53|  2.65k|}
_ZN5draco26SequentialAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   56|    586|    const std::vector<PointIndex> &point_ids) {
   57|       |  // Default implementation does not apply any transform.
   58|    586|  return true;
   59|    586|}
_ZN5draco26SequentialAttributeDecoder20GetPortableAttributeEv:
   61|  5.04k|const PointAttribute *SequentialAttributeDecoder::GetPortableAttribute() {
   62|       |  // If needed, copy point to attribute value index mapping from the final
   63|       |  // attribute to the portable attribute.
   64|  5.04k|  if (!attribute_->is_mapping_identity() && portable_attribute_ &&
  ------------------
  |  Branch (64:7): [True: 4.48k, False: 553]
  |  Branch (64:45): [True: 3.94k, False: 544]
  ------------------
   65|  3.94k|      portable_attribute_->is_mapping_identity()) {
  ------------------
  |  Branch (65:7): [True: 2.78k, False: 1.15k]
  ------------------
   66|  2.78k|    portable_attribute_->SetExplicitMapping(attribute_->indices_map_size());
   67|  2.78k|    for (PointIndex i(0);
   68|  25.8M|         i < static_cast<uint32_t>(attribute_->indices_map_size()); ++i) {
  ------------------
  |  Branch (68:10): [True: 25.8M, False: 2.78k]
  ------------------
   69|  25.8M|      portable_attribute_->SetPointMapEntry(i, attribute_->mapped_index(i));
   70|  25.8M|    }
   71|  2.78k|  }
   72|  5.04k|  return portable_attribute_.get();
   73|  5.04k|}
_ZN5draco26SequentialAttributeDecoder20InitPredictionSchemeEPNS_25PredictionSchemeInterfaceE:
   76|  3.59k|    PredictionSchemeInterface *ps) {
   77|  5.28k|  for (int i = 0; i < ps->GetNumParentAttributes(); ++i) {
  ------------------
  |  Branch (77:19): [True: 1.70k, False: 3.58k]
  ------------------
   78|  1.70k|    const int att_id = decoder_->point_cloud()->GetNamedAttributeId(
   79|  1.70k|        ps->GetParentAttributeType(i));
   80|  1.70k|    if (att_id == -1) {
  ------------------
  |  Branch (80:9): [True: 2, False: 1.69k]
  ------------------
   81|      2|      return false;  // Requested attribute does not exist.
   82|      2|    }
   83|  1.69k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   84|  1.69k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.69k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:9): [True: 0, False: 1.69k]
  ------------------
   85|      0|      if (!ps->SetParentAttribute(decoder_->point_cloud()->attribute(att_id))) {
  ------------------
  |  Branch (85:11): [True: 0, False: 0]
  ------------------
   86|      0|        return false;
   87|      0|      }
   88|      0|    } else
   89|  1.69k|#endif
   90|  1.69k|    {
   91|  1.69k|      const PointAttribute *const pa = decoder_->GetPortableAttribute(att_id);
   92|  1.69k|      if (pa == nullptr || !ps->SetParentAttribute(pa)) {
  ------------------
  |  Branch (92:11): [True: 2, False: 1.69k]
  |  Branch (92:28): [True: 9, False: 1.68k]
  ------------------
   93|     11|        return false;
   94|     11|      }
   95|  1.69k|    }
   96|  1.69k|  }
   97|  3.58k|  return true;
   98|  3.59k|}
_ZN5draco26SequentialAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  101|    958|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  102|    958|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
  103|    958|  const int entry_size = static_cast<int>(attribute_->byte_stride());
  104|    958|  std::unique_ptr<uint8_t[]> value_data_ptr(new uint8_t[entry_size]);
  105|    958|  uint8_t *const value_data = value_data_ptr.get();
  106|    958|  int out_byte_pos = 0;
  107|       |  // Decode raw attribute values in their original format.
  108|   216k|  for (int i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (108:19): [True: 215k, False: 942]
  ------------------
  109|   215k|    if (!in_buffer->Decode(value_data, entry_size)) {
  ------------------
  |  Branch (109:9): [True: 16, False: 215k]
  ------------------
  110|     16|      return false;
  111|     16|    }
  112|   215k|    attribute_->buffer()->Write(out_byte_pos, value_data, entry_size);
  113|   215k|    out_byte_pos += entry_size;
  114|   215k|  }
  115|    942|  return true;
  116|    958|}

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  5.53k|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|  2.71M|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  3.59k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  17.8k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  6.11k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  6.11k|    portable_attribute_ = std::move(att);
   71|  6.11k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  20.0k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  13.9k|  virtual ~SequentialAttributeDecoder() = default;

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

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

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

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

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

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

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

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

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|  4.72M|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|  4.72M|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|  4.72M|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|  4.72M|    const int remaining = 32 - num_used_bits_;
   54|  4.72M|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 3.32M, False: 1.39M]
  ------------------
   55|  3.32M|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 2.96M, False: 365k]
  ------------------
   56|  2.96M|        return false;
   57|  2.96M|      }
   58|   365k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   365k|      num_used_bits_ += nbits;
   60|   365k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 11.9k, False: 353k]
  ------------------
   61|  11.9k|        ++pos_;
   62|  11.9k|        num_used_bits_ = 0;
   63|  11.9k|      }
   64|  1.39M|    } else {
   65|  1.39M|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 1.38M, False: 14.0k]
  ------------------
   66|  1.38M|        return false;
   67|  1.38M|      }
   68|  14.0k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  14.0k|      num_used_bits_ = nbits - remaining;
   70|  14.0k|      ++pos_;
   71|  14.0k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  14.0k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  14.0k|    }
   74|   379k|    return true;
   75|  4.72M|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  5.29M|  bool DecodeNextBit() {
   35|  5.29M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  5.29M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 4.74M, False: 546k]
  ------------------
   37|  4.74M|      return false;
   38|  4.74M|    }
   39|   546k|    const bool bit = *pos_ & selector;
   40|   546k|    ++num_used_bits_;
   41|   546k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 17.0k, False: 529k]
  ------------------
   42|  17.0k|      ++pos_;
   43|  17.0k|      num_used_bits_ = 0;
   44|  17.0k|    }
   45|   546k|    return bit;
   46|  5.29M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    464|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    418|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    326|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  9.72k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 9.44k, False: 282]
  ------------------
   35|  9.44k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 44, False: 9.40k]
  ------------------
   36|     44|        return false;
   37|     44|      }
   38|  9.44k|    }
   39|    282|    return bit_decoder_.StartDecoding(source_buffer);
   40|    326|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  2.99M|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|  2.99M|    uint32_t result = 0;
   49|  18.7M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 15.7M, False: 2.99M]
  ------------------
   50|  15.7M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  15.7M|      result = (result << 1) + bit;
   52|  15.7M|    }
   53|  2.99M|    *value = result;
   54|  2.99M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|    133|  void EndDecoding() {
   57|  4.38k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 4.25k, False: 133]
  ------------------
   58|  4.25k|      folded_number_decoders_[i].EndDecoding();
   59|  4.25k|    }
   60|    133|    bit_decoder_.EndDecoding();
   61|    133|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    418|  FoldedBit32Decoder() {}

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  29.4k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  20.9k|                                const uint8_t *const buf, int offset) {
  301|  20.9k|  unsigned x;
  302|  20.9k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 24, False: 20.8k]
  ------------------
  303|     24|    return 1;
  304|     24|  }
  305|  20.8k|  ans->buf = buf;
  306|  20.8k|  x = buf[offset - 1] >> 6;
  307|  20.8k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 18.3k, False: 2.50k]
  ------------------
  308|  18.3k|    ans->buf_offset = offset - 1;
  309|  18.3k|    ans->state = buf[offset - 1] & 0x3F;
  310|  18.3k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 2.32k, False: 176]
  ------------------
  311|  2.32k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 0, False: 2.32k]
  ------------------
  312|      0|      return 1;
  313|      0|    }
  314|  2.32k|    ans->buf_offset = offset - 2;
  315|  2.32k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  2.32k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 166, False: 10]
  ------------------
  317|    166|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 0, False: 166]
  ------------------
  318|      0|      return 1;
  319|      0|    }
  320|    166|    ans->buf_offset = offset - 3;
  321|    166|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    166|  } else {
  323|     10|    return 1;
  324|     10|  }
  325|  20.8k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  20.8k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  20.8k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  20.8k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  20.8k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 2, False: 20.8k]
  ------------------
  327|      2|    return 1;
  328|      2|  }
  329|  20.8k|  return 0;
  330|  20.8k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  2.32k|static uint32_t mem_get_le16(const void *vmem) {
   68|  2.32k|  uint32_t val;
   69|  2.32k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  2.32k|  val = mem[1] << 8;
   72|  2.32k|  val |= mem[0];
   73|  2.32k|  return val;
   74|  2.32k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    166|static uint32_t mem_get_le24(const void *vmem) {
   77|    166|  uint32_t val;
   78|    166|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    166|  val = mem[2] << 16;
   81|    166|  val |= mem[1] << 8;
   82|    166|  val |= mem[0];
   83|    166|  return val;
   84|    166|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  5.16G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  5.16G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  5.16G|  unsigned quot, rem, x, xn;
  172|  5.16G|#endif
  173|  5.16G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  5.16G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  5.16G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  10.3G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 4.29G, False: 870M]
  |  Branch (174:40): [True: 162k, False: 4.29G]
  ------------------
  175|   162k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   162k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   162k|  }
  177|       |#if DRACO_ANS_IMPL1
  178|       |  val = ans->state % DRACO_ANS_P8_PRECISION < p;
  179|       |  l_s = val ? p : p0;
  180|       |  ans->state = (ans->state / DRACO_ANS_P8_PRECISION) * l_s +
  181|       |               ans->state % DRACO_ANS_P8_PRECISION - (!val * p);
  182|       |#else
  183|  5.16G|  x = ans->state;
  184|  5.16G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  5.16G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  5.16G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  5.16G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  5.16G|  xn = quot * p;
  187|  5.16G|  val = rem < p;
  188|  5.16G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  10.3G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 4.29G, False: 864M]
  |  |  ------------------
  ------------------
  189|  4.29G|    ans->state = xn + rem;
  190|  4.29G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   864M|    ans->state = x - xn - p;
  193|   864M|  }
  194|  5.16G|#endif
  195|  5.16G|  return val;
  196|  5.16G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  47.5k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  47.5k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  47.5k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  47.5k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  1.89k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|  1.15k|                                       uint32_t num_symbols) {
  482|  1.15k|    lut_table_.resize(rans_precision);
  483|  1.15k|    probability_table_.resize(num_symbols);
  484|  1.15k|    uint32_t cum_prob = 0;
  485|  1.15k|    uint32_t act_prob = 0;
  486|  12.3k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 11.3k, False: 1.02k]
  ------------------
  487|  11.3k|      probability_table_[i].prob = token_probs[i];
  488|  11.3k|      probability_table_[i].cum_prob = cum_prob;
  489|  11.3k|      cum_prob += token_probs[i];
  490|  11.3k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 130, False: 11.2k]
  ------------------
  491|    130|        return false;
  492|    130|      }
  493|  3.76M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 3.75M, False: 11.2k]
  ------------------
  494|  3.75M|        lut_table_[j] = i;
  495|  3.75M|      }
  496|  11.2k|      act_prob = cum_prob;
  497|  11.2k|    }
  498|  1.02k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 123, False: 900]
  ------------------
  499|    123|      return false;
  500|    123|    }
  501|    900|    return true;
  502|  1.02k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|    829|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    829|    unsigned x;
  423|    829|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 45, False: 784]
  ------------------
  424|     45|      return 1;
  425|     45|    }
  426|    784|    ans_.buf = buf;
  427|    784|    x = buf[offset - 1] >> 6;
  428|    784|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 475, False: 309]
  ------------------
  429|    475|      ans_.buf_offset = offset - 1;
  430|    475|      ans_.state = buf[offset - 1] & 0x3F;
  431|    475|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 138, False: 171]
  ------------------
  432|    138|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 9, False: 129]
  ------------------
  433|      9|        return 1;
  434|      9|      }
  435|    129|      ans_.buf_offset = offset - 2;
  436|    129|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    171|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 105, False: 66]
  ------------------
  438|    105|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 5, False: 100]
  ------------------
  439|      5|        return 1;
  440|      5|      }
  441|    100|      ans_.buf_offset = offset - 3;
  442|    100|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    100|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 66, False: 0]
  ------------------
  444|     66|      ans_.buf_offset = offset - 4;
  445|     66|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     66|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    770|    ans_.state += l_rans_base;
  450|    770|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    770|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 65, False: 705]
  ------------------
  451|     65|      return 1;
  452|     65|    }
  453|    705|    return 0;
  454|    770|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    168|static uint32_t mem_get_le16(const void *vmem) {
   68|    168|  uint32_t val;
   69|    168|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    168|  val = mem[1] << 8;
   72|    168|  val |= mem[0];
   73|    168|  return val;
   74|    168|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    146|static uint32_t mem_get_le24(const void *vmem) {
   77|    146|  uint32_t val;
   78|    146|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    146|  val = mem[2] << 16;
   81|    146|  val |= mem[1] << 8;
   82|    146|  val |= mem[0];
   83|    146|  return val;
   84|    146|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    194|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    194|  uint32_t val;
   88|    194|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    194|  val = mem[3] << 24;
   91|    194|  val |= mem[2] << 16;
   92|    194|  val |= mem[1] << 8;
   93|    194|  val |= mem[0];
   94|    194|  return val;
   95|    194|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|  36.4M|  inline int rans_read() {
  463|  36.4M|    unsigned rem;
  464|  36.4M|    unsigned quo;
  465|  36.4M|    struct rans_dec_sym sym;
  466|  36.5M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 25.5M, False: 10.9M]
  |  Branch (466:40): [True: 23.0k, False: 25.5M]
  ------------------
  467|  23.0k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  23.0k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  23.0k|    }
  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|  36.4M|    quo = ans_.state / rans_precision;
  472|  36.4M|    rem = ans_.state % rans_precision;
  473|  36.4M|    fetch_sym(&sym, rem);
  474|  36.4M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  36.4M|    return sym.val;
  476|  36.4M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|  36.4M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  36.4M|    uint32_t symbol = lut_table_[rem];
  507|  36.4M|    out->val = symbol;
  508|  36.4M|    out->prob = probability_table_[symbol].prob;
  509|  36.4M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  36.4M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|    675|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    115|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|     70|                                       uint32_t num_symbols) {
  482|     70|    lut_table_.resize(rans_precision);
  483|     70|    probability_table_.resize(num_symbols);
  484|     70|    uint32_t cum_prob = 0;
  485|     70|    uint32_t act_prob = 0;
  486|  1.68k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 1.63k, False: 50]
  ------------------
  487|  1.63k|      probability_table_[i].prob = token_probs[i];
  488|  1.63k|      probability_table_[i].cum_prob = cum_prob;
  489|  1.63k|      cum_prob += token_probs[i];
  490|  1.63k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 20, False: 1.61k]
  ------------------
  491|     20|        return false;
  492|     20|      }
  493|   405k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 403k, False: 1.61k]
  ------------------
  494|   403k|        lut_table_[j] = i;
  495|   403k|      }
  496|  1.61k|      act_prob = cum_prob;
  497|  1.61k|    }
  498|     50|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 8, False: 42]
  ------------------
  499|      8|      return false;
  500|      8|    }
  501|     42|    return true;
  502|     50|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|     27|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     27|    unsigned x;
  423|     27|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 2, False: 25]
  ------------------
  424|      2|      return 1;
  425|      2|    }
  426|     25|    ans_.buf = buf;
  427|     25|    x = buf[offset - 1] >> 6;
  428|     25|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 14, False: 11]
  ------------------
  429|     14|      ans_.buf_offset = offset - 1;
  430|     14|      ans_.state = buf[offset - 1] & 0x3F;
  431|     14|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 4, False: 7]
  ------------------
  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|      7|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 1, False: 6]
  ------------------
  438|      1|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 1]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      1|      ans_.buf_offset = offset - 3;
  442|      1|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      6|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 6, False: 0]
  ------------------
  444|      6|      ans_.buf_offset = offset - 4;
  445|      6|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      6|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     25|    ans_.state += l_rans_base;
  450|     25|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     25|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 6, False: 19]
  ------------------
  451|      6|      return 1;
  452|      6|    }
  453|     19|    return 0;
  454|     25|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|  92.6k|  inline int rans_read() {
  463|  92.6k|    unsigned rem;
  464|  92.6k|    unsigned quo;
  465|  92.6k|    struct rans_dec_sym sym;
  466|  93.5k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 18.8k, False: 74.6k]
  |  Branch (466:40): [True: 908, False: 17.9k]
  ------------------
  467|    908|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    908|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    908|    }
  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|  92.6k|    quo = ans_.state / rans_precision;
  472|  92.6k|    rem = ans_.state % rans_precision;
  473|  92.6k|    fetch_sym(&sym, rem);
  474|  92.6k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  92.6k|    return sym.val;
  476|  92.6k|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|  92.6k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  92.6k|    uint32_t symbol = lut_table_[rem];
  507|  92.6k|    out->val = symbol;
  508|  92.6k|    out->prob = probability_table_[symbol].prob;
  509|  92.6k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  92.6k|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|     19|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|     99|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|     56|                                       uint32_t num_symbols) {
  482|     56|    lut_table_.resize(rans_precision);
  483|     56|    probability_table_.resize(num_symbols);
  484|     56|    uint32_t cum_prob = 0;
  485|     56|    uint32_t act_prob = 0;
  486|  3.45k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 3.40k, False: 48]
  ------------------
  487|  3.40k|      probability_table_[i].prob = token_probs[i];
  488|  3.40k|      probability_table_[i].cum_prob = cum_prob;
  489|  3.40k|      cum_prob += token_probs[i];
  490|  3.40k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 8, False: 3.40k]
  ------------------
  491|      8|        return false;
  492|      8|      }
  493|  1.55M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.54M, False: 3.40k]
  ------------------
  494|  1.54M|        lut_table_[j] = i;
  495|  1.54M|      }
  496|  3.40k|      act_prob = cum_prob;
  497|  3.40k|    }
  498|     48|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 5, False: 43]
  ------------------
  499|      5|      return false;
  500|      5|    }
  501|     43|    return true;
  502|     48|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|     30|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     30|    unsigned x;
  423|     30|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 30]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     30|    ans_.buf = buf;
  427|     30|    x = buf[offset - 1] >> 6;
  428|     30|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 10, False: 20]
  ------------------
  429|     10|      ans_.buf_offset = offset - 1;
  430|     10|      ans_.state = buf[offset - 1] & 0x3F;
  431|     20|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 8, False: 12]
  ------------------
  432|      8|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 5, False: 3]
  ------------------
  433|      5|        return 1;
  434|      5|      }
  435|      3|      ans_.buf_offset = offset - 2;
  436|      3|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     12|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 0, False: 12]
  ------------------
  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|     12|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 12, False: 0]
  ------------------
  444|     12|      ans_.buf_offset = offset - 4;
  445|     12|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     12|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     25|    ans_.state += l_rans_base;
  450|     25|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     25|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 8, False: 17]
  ------------------
  451|      8|      return 1;
  452|      8|    }
  453|     17|    return 0;
  454|     25|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|   169k|  inline int rans_read() {
  463|   169k|    unsigned rem;
  464|   169k|    unsigned quo;
  465|   169k|    struct rans_dec_sym sym;
  466|   171k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 157k, False: 13.4k]
  |  Branch (466:40): [True: 1.92k, False: 155k]
  ------------------
  467|  1.92k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.92k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.92k|    }
  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|   169k|    quo = ans_.state / rans_precision;
  472|   169k|    rem = ans_.state % rans_precision;
  473|   169k|    fetch_sym(&sym, rem);
  474|   169k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   169k|    return sym.val;
  476|   169k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|   169k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   169k|    uint32_t symbol = lut_table_[rem];
  507|   169k|    out->val = symbol;
  508|   169k|    out->prob = probability_table_[symbol].prob;
  509|   169k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   169k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     17|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    102|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|     42|                                       uint32_t num_symbols) {
  482|     42|    lut_table_.resize(rans_precision);
  483|     42|    probability_table_.resize(num_symbols);
  484|     42|    uint32_t cum_prob = 0;
  485|     42|    uint32_t act_prob = 0;
  486|  9.41k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 9.38k, False: 31]
  ------------------
  487|  9.38k|      probability_table_[i].prob = token_probs[i];
  488|  9.38k|      probability_table_[i].cum_prob = cum_prob;
  489|  9.38k|      cum_prob += token_probs[i];
  490|  9.38k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 11, False: 9.37k]
  ------------------
  491|     11|        return false;
  492|     11|      }
  493|  2.20M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 2.19M, False: 9.37k]
  ------------------
  494|  2.19M|        lut_table_[j] = i;
  495|  2.19M|      }
  496|  9.37k|      act_prob = cum_prob;
  497|  9.37k|    }
  498|     31|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 1, False: 30]
  ------------------
  499|      1|      return false;
  500|      1|    }
  501|     30|    return true;
  502|     31|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     13|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     13|    unsigned x;
  423|     13|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 13]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     13|    ans_.buf = buf;
  427|     13|    x = buf[offset - 1] >> 6;
  428|     13|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 11, False: 2]
  ------------------
  429|     11|      ans_.buf_offset = offset - 1;
  430|     11|      ans_.state = buf[offset - 1] & 0x3F;
  431|     11|    } 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|     13|    ans_.state += l_rans_base;
  450|     13|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     13|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 1, False: 12]
  ------------------
  451|      1|      return 1;
  452|      1|    }
  453|     12|    return 0;
  454|     13|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|  9.86k|  inline int rans_read() {
  463|  9.86k|    unsigned rem;
  464|  9.86k|    unsigned quo;
  465|  9.86k|    struct rans_dec_sym sym;
  466|  10.3k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 8.40k, False: 1.94k]
  |  Branch (466:40): [True: 490, False: 7.91k]
  ------------------
  467|    490|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    490|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    490|    }
  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|  9.86k|    quo = ans_.state / rans_precision;
  472|  9.86k|    rem = ans_.state % rans_precision;
  473|  9.86k|    fetch_sym(&sym, rem);
  474|  9.86k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  9.86k|    return sym.val;
  476|  9.86k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|  9.86k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  9.86k|    uint32_t symbol = lut_table_[rem];
  507|  9.86k|    out->val = symbol;
  508|  9.86k|    out->prob = probability_table_[symbol].prob;
  509|  9.86k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  9.86k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|     12|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|     96|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|     55|                                       uint32_t num_symbols) {
  482|     55|    lut_table_.resize(rans_precision);
  483|     55|    probability_table_.resize(num_symbols);
  484|     55|    uint32_t cum_prob = 0;
  485|     55|    uint32_t act_prob = 0;
  486|  3.62k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 3.57k, False: 50]
  ------------------
  487|  3.57k|      probability_table_[i].prob = token_probs[i];
  488|  3.57k|      probability_table_[i].cum_prob = cum_prob;
  489|  3.57k|      cum_prob += token_probs[i];
  490|  3.57k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 5, False: 3.56k]
  ------------------
  491|      5|        return false;
  492|      5|      }
  493|  12.8M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 12.8M, False: 3.56k]
  ------------------
  494|  12.8M|        lut_table_[j] = i;
  495|  12.8M|      }
  496|  3.56k|      act_prob = cum_prob;
  497|  3.56k|    }
  498|     50|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 7, False: 43]
  ------------------
  499|      7|      return false;
  500|      7|    }
  501|     43|    return true;
  502|     50|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     26|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     26|    unsigned x;
  423|     26|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 26]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     26|    ans_.buf = buf;
  427|     26|    x = buf[offset - 1] >> 6;
  428|     26|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 7, False: 19]
  ------------------
  429|      7|      ans_.buf_offset = offset - 1;
  430|      7|      ans_.state = buf[offset - 1] & 0x3F;
  431|     19|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 2, False: 17]
  ------------------
  432|      2|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 2]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      2|      ans_.buf_offset = offset - 2;
  436|      2|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     17|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 12, False: 5]
  ------------------
  438|     12|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 2, False: 10]
  ------------------
  439|      2|        return 1;
  440|      2|      }
  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: 5, False: 0]
  ------------------
  444|      5|      ans_.buf_offset = offset - 4;
  445|      5|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      5|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     24|    ans_.state += l_rans_base;
  450|     24|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     24|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 5, False: 19]
  ------------------
  451|      5|      return 1;
  452|      5|    }
  453|     19|    return 0;
  454|     24|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|  44.3k|  inline int rans_read() {
  463|  44.3k|    unsigned rem;
  464|  44.3k|    unsigned quo;
  465|  44.3k|    struct rans_dec_sym sym;
  466|  44.4k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 8.09k, False: 36.3k]
  |  Branch (466:40): [True: 139, False: 7.95k]
  ------------------
  467|    139|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    139|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    139|    }
  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|  44.3k|    quo = ans_.state / rans_precision;
  472|  44.3k|    rem = ans_.state % rans_precision;
  473|  44.3k|    fetch_sym(&sym, rem);
  474|  44.3k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  44.3k|    return sym.val;
  476|  44.3k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|  44.3k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  44.3k|    uint32_t symbol = lut_table_[rem];
  507|  44.3k|    out->val = symbol;
  508|  44.3k|    out->prob = probability_table_[symbol].prob;
  509|  44.3k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  44.3k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|     19|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    126|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|     81|                                       uint32_t num_symbols) {
  482|     81|    lut_table_.resize(rans_precision);
  483|     81|    probability_table_.resize(num_symbols);
  484|     81|    uint32_t cum_prob = 0;
  485|     81|    uint32_t act_prob = 0;
  486|  2.53k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 2.46k, False: 73]
  ------------------
  487|  2.46k|      probability_table_[i].prob = token_probs[i];
  488|  2.46k|      probability_table_[i].cum_prob = cum_prob;
  489|  2.46k|      cum_prob += token_probs[i];
  490|  2.46k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 8, False: 2.45k]
  ------------------
  491|      8|        return false;
  492|      8|      }
  493|  37.7M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 37.7M, False: 2.45k]
  ------------------
  494|  37.7M|        lut_table_[j] = i;
  495|  37.7M|      }
  496|  2.45k|      act_prob = cum_prob;
  497|  2.45k|    }
  498|     73|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 6, False: 67]
  ------------------
  499|      6|      return false;
  500|      6|    }
  501|     67|    return true;
  502|     73|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     49|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     49|    unsigned x;
  423|     49|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 49]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     49|    ans_.buf = buf;
  427|     49|    x = buf[offset - 1] >> 6;
  428|     49|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 13, False: 36]
  ------------------
  429|     13|      ans_.buf_offset = offset - 1;
  430|     13|      ans_.state = buf[offset - 1] & 0x3F;
  431|     36|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 0, False: 36]
  ------------------
  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|     36|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 9, False: 27]
  ------------------
  438|      9|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 9]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      9|      ans_.buf_offset = offset - 3;
  442|      9|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     27|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 27, False: 0]
  ------------------
  444|     27|      ans_.buf_offset = offset - 4;
  445|     27|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     27|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     49|    ans_.state += l_rans_base;
  450|     49|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     49|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 10, False: 39]
  ------------------
  451|     10|      return 1;
  452|     10|    }
  453|     39|    return 0;
  454|     49|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|   313k|  inline int rans_read() {
  463|   313k|    unsigned rem;
  464|   313k|    unsigned quo;
  465|   313k|    struct rans_dec_sym sym;
  466|   314k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 224k, False: 89.7k]
  |  Branch (466:40): [True: 1.30k, False: 223k]
  ------------------
  467|  1.30k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.30k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.30k|    }
  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|   313k|    quo = ans_.state / rans_precision;
  472|   313k|    rem = ans_.state % rans_precision;
  473|   313k|    fetch_sym(&sym, rem);
  474|   313k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   313k|    return sym.val;
  476|   313k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|   313k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   313k|    uint32_t symbol = lut_table_[rem];
  507|   313k|    out->val = symbol;
  508|   313k|    out->prob = probability_table_[symbol].prob;
  509|   313k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   313k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     39|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|    486|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|    315|                                       uint32_t num_symbols) {
  482|    315|    lut_table_.resize(rans_precision);
  483|    315|    probability_table_.resize(num_symbols);
  484|    315|    uint32_t cum_prob = 0;
  485|    315|    uint32_t act_prob = 0;
  486|  6.15k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 5.86k, False: 283]
  ------------------
  487|  5.86k|      probability_table_[i].prob = token_probs[i];
  488|  5.86k|      probability_table_[i].cum_prob = cum_prob;
  489|  5.86k|      cum_prob += token_probs[i];
  490|  5.86k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 32, False: 5.83k]
  ------------------
  491|     32|        return false;
  492|     32|      }
  493|   289M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 289M, False: 5.83k]
  ------------------
  494|   289M|        lut_table_[j] = i;
  495|   289M|      }
  496|  5.83k|      act_prob = cum_prob;
  497|  5.83k|    }
  498|    283|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 20, False: 263]
  ------------------
  499|     20|      return false;
  500|     20|    }
  501|    263|    return true;
  502|    283|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    178|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    178|    unsigned x;
  423|    178|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 13, False: 165]
  ------------------
  424|     13|      return 1;
  425|     13|    }
  426|    165|    ans_.buf = buf;
  427|    165|    x = buf[offset - 1] >> 6;
  428|    165|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 32, False: 133]
  ------------------
  429|     32|      ans_.buf_offset = offset - 1;
  430|     32|      ans_.state = buf[offset - 1] & 0x3F;
  431|    133|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 31, False: 102]
  ------------------
  432|     31|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 30]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|     30|      ans_.buf_offset = offset - 2;
  436|     30|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    102|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 26, False: 76]
  ------------------
  438|     26|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 26]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|     26|      ans_.buf_offset = offset - 3;
  442|     26|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     76|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 76, False: 0]
  ------------------
  444|     76|      ans_.buf_offset = offset - 4;
  445|     76|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     76|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    164|    ans_.state += l_rans_base;
  450|    164|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    164|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 26, False: 138]
  ------------------
  451|     26|      return 1;
  452|     26|    }
  453|    138|    return 0;
  454|    164|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  60.2M|  inline int rans_read() {
  463|  60.2M|    unsigned rem;
  464|  60.2M|    unsigned quo;
  465|  60.2M|    struct rans_dec_sym sym;
  466|  60.2M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 45.2M, False: 15.0M]
  |  Branch (466:40): [True: 5.24k, False: 45.2M]
  ------------------
  467|  5.24k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  5.24k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  5.24k|    }
  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|  60.2M|    quo = ans_.state / rans_precision;
  472|  60.2M|    rem = ans_.state % rans_precision;
  473|  60.2M|    fetch_sym(&sym, rem);
  474|  60.2M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  60.2M|    return sym.val;
  476|  60.2M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  60.2M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  60.2M|    uint32_t symbol = lut_table_[rem];
  507|  60.2M|    out->val = symbol;
  508|  60.2M|    out->prob = probability_table_[symbol].prob;
  509|  60.2M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  60.2M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    138|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|    557|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|    557|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    557|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 557]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    557|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    557|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    557|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 34, False: 523]
  ------------------
   67|     34|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 34]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     34|  } else
   72|    523|#endif
   73|    523|  {
   74|    523|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 514]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    523|  }
   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|    548|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 22, False: 526]
  ------------------
   83|     22|    return false;
   84|     22|  }
   85|    526|  probability_table_.resize(num_symbols_);
   86|    526|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 217, False: 309]
  ------------------
   87|    217|    return true;
   88|    217|  }
   89|       |  // Decode the table.
   90|  60.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 59.8k, False: 223]
  ------------------
   91|  59.8k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  59.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 31, False: 59.8k]
  ------------------
   95|     31|      return false;
   96|     31|    }
   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|  59.8k|    const int token = prob_data & 3;
  102|  59.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 28.0k, False: 31.8k]
  ------------------
  103|  28.0k|      const uint32_t offset = prob_data >> 2;
  104|  28.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 42, False: 27.9k]
  ------------------
  105|     42|        return false;
  106|     42|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   939k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 911k, False: 27.9k]
  ------------------
  109|   911k|        probability_table_[i + j] = 0;
  110|   911k|      }
  111|  27.9k|      i += offset;
  112|  31.8k|    } else {
  113|  31.8k|      const int extra_bytes = token;
  114|  31.8k|      uint32_t prob = prob_data >> 2;
  115|  58.9k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 27.0k, False: 31.8k]
  ------------------
  116|  27.0k|        uint8_t eb;
  117|  27.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 27.0k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  27.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  27.0k|      }
  124|  31.8k|      probability_table_[i] = prob;
  125|  31.8k|    }
  126|  59.8k|  }
  127|    223|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 92, False: 131]
  ------------------
  128|     92|    return false;
  129|     92|  }
  130|    131|  return true;
  131|    223|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    240|    DecoderBuffer *buffer) {
  136|    240|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    240|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    240|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    240|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 25, False: 215]
  ------------------
  140|     25|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 25]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     25|  } else
  145|    215|#endif
  146|    215|  {
  147|    215|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 215]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    215|  }
  151|    240|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 36, False: 204]
  ------------------
  152|     36|    return false;
  153|     36|  }
  154|    204|  const uint8_t *const data_head =
  155|    204|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    204|  buffer->Advance(bytes_encoded);
  158|    204|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 66, False: 138]
  ------------------
  159|     66|    return false;
  160|     66|  }
  161|    138|  return true;
  162|    204|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    261|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|   762k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    108|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    108|  ans_.read_end();
  167|    108|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    308|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    308|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    308|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 308]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    308|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    308|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    308|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 26, False: 282]
  ------------------
   67|     26|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 26]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     26|  } else
   72|    282|#endif
   73|    282|  {
   74|    282|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 280]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    282|  }
   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|    306|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 19, False: 287]
  ------------------
   83|     19|    return false;
   84|     19|  }
   85|    287|  probability_table_.resize(num_symbols_);
   86|    287|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 275]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|  1.39M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.39M, False: 216]
  ------------------
   91|  1.39M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  1.39M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 19, False: 1.39M]
  ------------------
   95|     19|      return false;
   96|     19|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.39M|    const int token = prob_data & 3;
  102|  1.39M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 419k, False: 975k]
  ------------------
  103|   419k|      const uint32_t offset = prob_data >> 2;
  104|   419k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 419k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  13.0M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 12.6M, False: 419k]
  ------------------
  109|  12.6M|        probability_table_[i + j] = 0;
  110|  12.6M|      }
  111|   419k|      i += offset;
  112|   975k|    } else {
  113|   975k|      const int extra_bytes = token;
  114|   975k|      uint32_t prob = prob_data >> 2;
  115|  1.00M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 29.9k, False: 975k]
  ------------------
  116|  29.9k|        uint8_t eb;
  117|  29.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 29.8k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  29.8k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  29.8k|      }
  124|   975k|      probability_table_[i] = prob;
  125|   975k|    }
  126|  1.39M|  }
  127|    216|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 77, False: 139]
  ------------------
  128|     77|    return false;
  129|     77|  }
  130|    139|  return true;
  131|    216|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    151|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    139|    DecoderBuffer *buffer) {
  136|    139|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    139|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    139|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    139|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 139]
  ------------------
  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|    139|#endif
  146|    139|  {
  147|    139|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 139]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    139|  }
  151|    139|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 14, False: 125]
  ------------------
  152|     14|    return false;
  153|     14|  }
  154|    125|  const uint8_t *const data_head =
  155|    125|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    125|  buffer->Advance(bytes_encoded);
  158|    125|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 15, False: 110]
  ------------------
  159|     15|    return false;
  160|     15|  }
  161|    110|  return true;
  162|    125|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  10.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    110|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    110|  ans_.read_end();
  167|    110|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    286|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    286|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    286|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 286]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    286|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    286|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    286|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 17, False: 269]
  ------------------
   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|    269|#endif
   73|    269|  {
   74|    269|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 269]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    269|  }
   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|    286|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 11, False: 275]
  ------------------
   83|     11|    return false;
   84|     11|  }
   85|    275|  probability_table_.resize(num_symbols_);
   86|    275|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 272]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|   470k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 470k, False: 213]
  ------------------
   91|   470k|    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|   470k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 27, False: 470k]
  ------------------
   95|     27|      return false;
   96|     27|    }
   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|   470k|    const int token = prob_data & 3;
  102|   470k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 251k, False: 218k]
  ------------------
  103|   251k|      const uint32_t offset = prob_data >> 2;
  104|   251k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 18, False: 251k]
  ------------------
  105|     18|        return false;
  106|     18|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  8.34M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 8.09M, False: 251k]
  ------------------
  109|  8.09M|        probability_table_[i + j] = 0;
  110|  8.09M|      }
  111|   251k|      i += offset;
  112|   251k|    } else {
  113|   218k|      const int extra_bytes = token;
  114|   218k|      uint32_t prob = prob_data >> 2;
  115|   338k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 120k, False: 218k]
  ------------------
  116|   120k|        uint8_t eb;
  117|   120k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 14, False: 120k]
  ------------------
  118|     14|          return false;
  119|     14|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   120k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   120k|      }
  124|   218k|      probability_table_[i] = prob;
  125|   218k|    }
  126|   470k|  }
  127|    213|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 12, False: 201]
  ------------------
  128|     12|    return false;
  129|     12|  }
  130|    201|  return true;
  131|    213|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    204|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    201|    DecoderBuffer *buffer) {
  136|    201|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    201|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    201|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    201|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 3, False: 198]
  ------------------
  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|    198|#endif
  146|    198|  {
  147|    198|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 195]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    198|  }
  151|    198|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 20, False: 178]
  ------------------
  152|     20|    return false;
  153|     20|  }
  154|    178|  const uint8_t *const data_head =
  155|    178|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    178|  buffer->Advance(bytes_encoded);
  158|    178|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 8, False: 170]
  ------------------
  159|      8|    return false;
  160|      8|  }
  161|    170|  return true;
  162|    178|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  7.34M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    170|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    170|  ans_.read_end();
  167|    170|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    168|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    168|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    168|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 168]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    168|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    168|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    168|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 31, False: 137]
  ------------------
   67|     31|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 31]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     31|  } else
   72|    137|#endif
   73|    137|  {
   74|    137|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 137]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    137|  }
   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|    168|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 168]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|    168|  probability_table_.resize(num_symbols_);
   86|    168|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 163]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|  12.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 12.0k, False: 120]
  ------------------
   91|  12.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|  12.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 21, False: 12.0k]
  ------------------
   95|     21|      return false;
   96|     21|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  12.0k|    const int token = prob_data & 3;
  102|  12.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.91k, False: 8.12k]
  ------------------
  103|  3.91k|      const uint32_t offset = prob_data >> 2;
  104|  3.91k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 17, False: 3.89k]
  ------------------
  105|     17|        return false;
  106|     17|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   141k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 138k, False: 3.89k]
  ------------------
  109|   138k|        probability_table_[i + j] = 0;
  110|   138k|      }
  111|  3.89k|      i += offset;
  112|  8.12k|    } else {
  113|  8.12k|      const int extra_bytes = token;
  114|  8.12k|      uint32_t prob = prob_data >> 2;
  115|  14.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 6.18k, False: 8.11k]
  ------------------
  116|  6.18k|        uint8_t eb;
  117|  6.18k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 5, False: 6.18k]
  ------------------
  118|      5|          return false;
  119|      5|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  6.18k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  6.18k|      }
  124|  8.11k|      probability_table_[i] = prob;
  125|  8.11k|    }
  126|  12.0k|  }
  127|    120|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 14, False: 106]
  ------------------
  128|     14|    return false;
  129|     14|  }
  130|    106|  return true;
  131|    120|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    111|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    106|    DecoderBuffer *buffer) {
  136|    106|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    106|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    106|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    106|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 28, False: 78]
  ------------------
  140|     28|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 27]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     28|  } else
  145|     78|#endif
  146|     78|  {
  147|     78|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 78]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     78|  }
  151|    105|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 29, False: 76]
  ------------------
  152|     29|    return false;
  153|     29|  }
  154|     76|  const uint8_t *const data_head =
  155|     76|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     76|  buffer->Advance(bytes_encoded);
  158|     76|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 4, False: 72]
  ------------------
  159|      4|    return false;
  160|      4|  }
  161|     72|  return true;
  162|     76|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  8.79M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|     72|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     72|  ans_.read_end();
  167|     72|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|     85|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|     85|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     85|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 85]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     85|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     85|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     85|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 10, False: 75]
  ------------------
   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|     75|#endif
   73|     75|  {
   74|     75|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 74]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|     75|  }
   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|     84|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 82]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|     82|  probability_table_.resize(num_symbols_);
   86|     82|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 82]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  4.79k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 4.73k, False: 56]
  ------------------
   91|  4.73k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  4.73k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 11, False: 4.72k]
  ------------------
   95|     11|      return false;
   96|     11|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  4.72k|    const int token = prob_data & 3;
  102|  4.72k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.43k, False: 2.29k]
  ------------------
  103|  2.43k|      const uint32_t offset = prob_data >> 2;
  104|  2.43k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 9, False: 2.42k]
  ------------------
  105|      9|        return false;
  106|      9|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  85.5k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 83.1k, False: 2.42k]
  ------------------
  109|  83.1k|        probability_table_[i + j] = 0;
  110|  83.1k|      }
  111|  2.42k|      i += offset;
  112|  2.42k|    } else {
  113|  2.29k|      const int extra_bytes = token;
  114|  2.29k|      uint32_t prob = prob_data >> 2;
  115|  3.71k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.42k, False: 2.28k]
  ------------------
  116|  1.42k|        uint8_t eb;
  117|  1.42k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 6, False: 1.41k]
  ------------------
  118|      6|          return false;
  119|      6|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.41k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.41k|      }
  124|  2.28k|      probability_table_[i] = prob;
  125|  2.28k|    }
  126|  4.72k|  }
  127|     56|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 8, False: 48]
  ------------------
  128|      8|    return false;
  129|      8|  }
  130|     48|  return true;
  131|     56|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|     48|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|     48|    DecoderBuffer *buffer) {
  136|     48|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     48|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     48|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     48|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 8, False: 40]
  ------------------
  140|      8|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 7]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      8|  } else
  145|     40|#endif
  146|     40|  {
  147|     40|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 40]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     40|  }
  151|     47|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 8, False: 39]
  ------------------
  152|      8|    return false;
  153|      8|  }
  154|     39|  const uint8_t *const data_head =
  155|     39|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     39|  buffer->Advance(bytes_encoded);
  158|     39|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 38]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|     38|  return true;
  162|     39|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|   436k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|     38|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     38|  ans_.read_end();
  167|     38|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    198|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    198|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    198|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 198]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    198|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    198|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    198|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 42, False: 156]
  ------------------
   67|     42|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 42]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     42|  } else
   72|    156|#endif
   73|    156|  {
   74|    156|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 152]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    156|  }
   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|    194|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 3, False: 191]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|    191|  probability_table_.resize(num_symbols_);
   86|    191|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 191]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  17.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 17.0k, False: 155]
  ------------------
   91|  17.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|  17.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 9, False: 17.0k]
  ------------------
   95|      9|      return false;
   96|      9|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  17.0k|    const int token = prob_data & 3;
  102|  17.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.26k, False: 10.7k]
  ------------------
  103|  6.26k|      const uint32_t offset = prob_data >> 2;
  104|  6.26k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 15, False: 6.24k]
  ------------------
  105|     15|        return false;
  106|     15|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   228k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 222k, False: 6.24k]
  ------------------
  109|   222k|        probability_table_[i + j] = 0;
  110|   222k|      }
  111|  6.24k|      i += offset;
  112|  10.7k|    } else {
  113|  10.7k|      const int extra_bytes = token;
  114|  10.7k|      uint32_t prob = prob_data >> 2;
  115|  20.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 9.49k, False: 10.7k]
  ------------------
  116|  9.49k|        uint8_t eb;
  117|  9.49k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 9.48k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  9.48k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  9.48k|      }
  124|  10.7k|      probability_table_[i] = prob;
  125|  10.7k|    }
  126|  17.0k|  }
  127|    155|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 13, False: 142]
  ------------------
  128|     13|    return false;
  129|     13|  }
  130|    142|  return true;
  131|    155|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    142|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    142|    DecoderBuffer *buffer) {
  136|    142|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    142|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    142|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    142|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 29, False: 113]
  ------------------
  140|     29|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 28]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     29|  } else
  145|    113|#endif
  146|    113|  {
  147|    113|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 113]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    113|  }
  151|    141|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 31, False: 110]
  ------------------
  152|     31|    return false;
  153|     31|  }
  154|    110|  const uint8_t *const data_head =
  155|    110|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    110|  buffer->Advance(bytes_encoded);
  158|    110|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 9, False: 101]
  ------------------
  159|      9|    return false;
  160|      9|  }
  161|    101|  return true;
  162|    110|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  4.93M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|    101|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    101|  ans_.read_end();
  167|    101|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    145|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    145|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    145|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 145]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    145|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    145|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    145|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 32, False: 113]
  ------------------
   67|     32|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 32]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     32|  } else
   72|    113|#endif
   73|    113|  {
   74|    113|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 112]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    113|  }
   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|    144|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 142]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|    142|  probability_table_.resize(num_symbols_);
   86|    142|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 142]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  1.11M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.11M, False: 78]
  ------------------
   91|  1.11M|    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.11M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 33, False: 1.11M]
  ------------------
   95|     33|      return false;
   96|     33|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.11M|    const int token = prob_data & 3;
  102|  1.11M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 369k, False: 744k]
  ------------------
  103|   369k|      const uint32_t offset = prob_data >> 2;
  104|   369k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 16, False: 369k]
  ------------------
  105|     16|        return false;
  106|     16|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  14.1M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 13.7M, False: 369k]
  ------------------
  109|  13.7M|        probability_table_[i + j] = 0;
  110|  13.7M|      }
  111|   369k|      i += offset;
  112|   744k|    } else {
  113|   744k|      const int extra_bytes = token;
  114|   744k|      uint32_t prob = prob_data >> 2;
  115|  1.21M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 470k, False: 744k]
  ------------------
  116|   470k|        uint8_t eb;
  117|   470k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 15, False: 470k]
  ------------------
  118|     15|          return false;
  119|     15|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   470k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   470k|      }
  124|   744k|      probability_table_[i] = prob;
  125|   744k|    }
  126|  1.11M|  }
  127|     78|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 29, False: 49]
  ------------------
  128|     29|    return false;
  129|     29|  }
  130|     49|  return true;
  131|     78|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|     49|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|     49|    DecoderBuffer *buffer) {
  136|     49|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     49|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     49|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     49|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 10, False: 39]
  ------------------
  140|     10|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 9]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     10|  } else
  145|     39|#endif
  146|     39|  {
  147|     39|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 39]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     39|  }
  151|     48|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 13, False: 35]
  ------------------
  152|     13|    return false;
  153|     13|  }
  154|     35|  const uint8_t *const data_head =
  155|     35|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     35|  buffer->Advance(bytes_encoded);
  158|     35|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 7, False: 28]
  ------------------
  159|      7|    return false;
  160|      7|  }
  161|     28|  return true;
  162|     35|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  1.14M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|     28|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     28|  ans_.read_end();
  167|     28|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    146|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    146|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    146|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 146]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    146|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    146|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    146|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 37, False: 109]
  ------------------
   67|     37|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 37]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     37|  } else
   72|    109|#endif
   73|    109|  {
   74|    109|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 109]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    109|  }
   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|    146|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 11, False: 135]
  ------------------
   83|     11|    return false;
   84|     11|  }
   85|    135|  probability_table_.resize(num_symbols_);
   86|    135|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 134]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   434k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 434k, False: 92]
  ------------------
   91|   434k|    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|   434k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 21, False: 434k]
  ------------------
   95|     21|      return false;
   96|     21|    }
   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|   434k|    const int token = prob_data & 3;
  102|   434k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 123k, False: 310k]
  ------------------
  103|   123k|      const uint32_t offset = prob_data >> 2;
  104|   123k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 15, False: 123k]
  ------------------
  105|     15|        return false;
  106|     15|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.50M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.38M, False: 123k]
  ------------------
  109|  4.38M|        probability_table_[i + j] = 0;
  110|  4.38M|      }
  111|   123k|      i += offset;
  112|   310k|    } else {
  113|   310k|      const int extra_bytes = token;
  114|   310k|      uint32_t prob = prob_data >> 2;
  115|   547k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 237k, False: 310k]
  ------------------
  116|   237k|        uint8_t eb;
  117|   237k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 6, False: 237k]
  ------------------
  118|      6|          return false;
  119|      6|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   237k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   237k|      }
  124|   310k|      probability_table_[i] = prob;
  125|   310k|    }
  126|   434k|  }
  127|     92|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 8, False: 84]
  ------------------
  128|      8|    return false;
  129|      8|  }
  130|     84|  return true;
  131|     92|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|     85|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|     84|    DecoderBuffer *buffer) {
  136|     84|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     84|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     84|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     84|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 68]
  ------------------
  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|     68|#endif
  146|     68|  {
  147|     68|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 68]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     68|  }
  151|     84|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 22, False: 62]
  ------------------
  152|     22|    return false;
  153|     22|  }
  154|     62|  const uint8_t *const data_head =
  155|     62|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     62|  buffer->Advance(bytes_encoded);
  158|     62|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 14, False: 48]
  ------------------
  159|     14|    return false;
  160|     14|  }
  161|     48|  return true;
  162|     62|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  2.51M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     48|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     48|  ans_.read_end();
  167|     48|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    115|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    115|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    115|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 115]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    115|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    115|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    115|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 10, False: 105]
  ------------------
   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|    105|#endif
   73|    105|  {
   74|    105|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 105]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    105|  }
   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|    115|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 8, False: 107]
  ------------------
   83|      8|    return false;
   84|      8|  }
   85|    107|  probability_table_.resize(num_symbols_);
   86|    107|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 106]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  13.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 13.5k, False: 70]
  ------------------
   91|  13.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|  13.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 7, False: 13.5k]
  ------------------
   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|  13.5k|    const int token = prob_data & 3;
  102|  13.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.53k, False: 9.03k]
  ------------------
  103|  4.53k|      const uint32_t offset = prob_data >> 2;
  104|  4.53k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 17, False: 4.51k]
  ------------------
  105|     17|        return false;
  106|     17|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   176k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 172k, False: 4.51k]
  ------------------
  109|   172k|        probability_table_[i + j] = 0;
  110|   172k|      }
  111|  4.51k|      i += offset;
  112|  9.03k|    } else {
  113|  9.03k|      const int extra_bytes = token;
  114|  9.03k|      uint32_t prob = prob_data >> 2;
  115|  13.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.15k, False: 9.02k]
  ------------------
  116|  4.15k|        uint8_t eb;
  117|  4.15k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 4.14k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.14k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.14k|      }
  124|  9.02k|      probability_table_[i] = prob;
  125|  9.02k|    }
  126|  13.5k|  }
  127|     70|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 28, False: 42]
  ------------------
  128|     28|    return false;
  129|     28|  }
  130|     42|  return true;
  131|     70|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|     43|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|     42|    DecoderBuffer *buffer) {
  136|     42|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     42|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     42|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     42|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 42]
  ------------------
  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|     42|#endif
  146|     42|  {
  147|     42|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 42]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     42|  }
  151|     42|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 15, False: 27]
  ------------------
  152|     15|    return false;
  153|     15|  }
  154|     27|  const uint8_t *const data_head =
  155|     27|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     27|  buffer->Advance(bytes_encoded);
  158|     27|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 8, False: 19]
  ------------------
  159|      8|    return false;
  160|      8|  }
  161|     19|  return true;
  162|     27|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|  92.6k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     19|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     19|  ans_.read_end();
  167|     19|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|     99|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|     99|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     99|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 99]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     99|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     99|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     99|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 9, False: 90]
  ------------------
   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|     90|#endif
   73|     90|  {
   74|     90|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 90]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     90|  }
   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|     99|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 99]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     99|  probability_table_.resize(num_symbols_);
   86|     99|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 99]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   194k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 194k, False: 56]
  ------------------
   91|   194k|    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|   194k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 15, False: 194k]
  ------------------
   95|     15|      return false;
   96|     15|    }
   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|   194k|    const int token = prob_data & 3;
  102|   194k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 62.2k, False: 132k]
  ------------------
  103|  62.2k|      const uint32_t offset = prob_data >> 2;
  104|  62.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 62.1k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.17M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.11M, False: 62.1k]
  ------------------
  109|  2.11M|        probability_table_[i + j] = 0;
  110|  2.11M|      }
  111|  62.1k|      i += offset;
  112|   132k|    } else {
  113|   132k|      const int extra_bytes = token;
  114|   132k|      uint32_t prob = prob_data >> 2;
  115|   226k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 94.5k, False: 132k]
  ------------------
  116|  94.5k|        uint8_t eb;
  117|  94.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 6, False: 94.5k]
  ------------------
  118|      6|          return false;
  119|      6|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  94.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  94.5k|      }
  124|   132k|      probability_table_[i] = prob;
  125|   132k|    }
  126|   194k|  }
  127|     56|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 13, False: 43]
  ------------------
  128|     13|    return false;
  129|     13|  }
  130|     43|  return true;
  131|     56|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|     43|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|     43|    DecoderBuffer *buffer) {
  136|     43|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     43|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     43|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     43|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 43]
  ------------------
  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|     43|#endif
  146|     43|  {
  147|     43|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 43]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     43|  }
  151|     43|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 13, False: 30]
  ------------------
  152|     13|    return false;
  153|     13|  }
  154|     30|  const uint8_t *const data_head =
  155|     30|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     30|  buffer->Advance(bytes_encoded);
  158|     30|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 13, False: 17]
  ------------------
  159|     13|    return false;
  160|     13|  }
  161|     17|  return true;
  162|     30|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   169k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     17|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     17|  ans_.read_end();
  167|     17|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    102|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    102|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    102|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 102]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    102|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    102|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    102|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 22, False: 80]
  ------------------
   67|     22|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 22]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     22|  } else
   72|     80|#endif
   73|     80|  {
   74|     80|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 80]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     80|  }
   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|    102|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 98]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|     98|  probability_table_.resize(num_symbols_);
   86|     98|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 95]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|  87.6k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 87.5k, False: 42]
  ------------------
   91|  87.5k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  87.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 14, False: 87.5k]
  ------------------
   95|     14|      return false;
   96|     14|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  87.5k|    const int token = prob_data & 3;
  102|  87.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 29.2k, False: 58.3k]
  ------------------
  103|  29.2k|      const uint32_t offset = prob_data >> 2;
  104|  29.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 29.2k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.17M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.14M, False: 29.2k]
  ------------------
  109|  1.14M|        probability_table_[i + j] = 0;
  110|  1.14M|      }
  111|  29.2k|      i += offset;
  112|  58.3k|    } else {
  113|  58.3k|      const int extra_bytes = token;
  114|  58.3k|      uint32_t prob = prob_data >> 2;
  115|  91.5k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 33.2k, False: 58.3k]
  ------------------
  116|  33.2k|        uint8_t eb;
  117|  33.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 33.2k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  33.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  33.2k|      }
  124|  58.3k|      probability_table_[i] = prob;
  125|  58.3k|    }
  126|  87.5k|  }
  127|     42|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 12, False: 30]
  ------------------
  128|     12|    return false;
  129|     12|  }
  130|     30|  return true;
  131|     42|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|     33|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|     30|    DecoderBuffer *buffer) {
  136|     30|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     30|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     30|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     30|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 30]
  ------------------
  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|     30|#endif
  146|     30|  {
  147|     30|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 30]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     30|  }
  151|     30|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 17, False: 13]
  ------------------
  152|     17|    return false;
  153|     17|  }
  154|     13|  const uint8_t *const data_head =
  155|     13|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     13|  buffer->Advance(bytes_encoded);
  158|     13|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 12]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|     12|  return true;
  162|     13|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|  9.86k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     12|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     12|  ans_.read_end();
  167|     12|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|     96|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|     96|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     96|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 96]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     96|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     96|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     96|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 0, False: 96]
  ------------------
   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|     96|#endif
   73|     96|  {
   74|     96|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 96]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     96|  }
   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|     96|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 96]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     96|  probability_table_.resize(num_symbols_);
   86|     96|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 96]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  62.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 61.9k, False: 55]
  ------------------
   91|  61.9k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  61.9k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 16, False: 61.9k]
  ------------------
   95|     16|      return false;
   96|     16|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  61.9k|    const int token = prob_data & 3;
  102|  61.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 9.25k, False: 52.7k]
  ------------------
  103|  9.25k|      const uint32_t offset = prob_data >> 2;
  104|  9.25k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 18, False: 9.23k]
  ------------------
  105|     18|        return false;
  106|     18|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   316k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 307k, False: 9.23k]
  ------------------
  109|   307k|        probability_table_[i + j] = 0;
  110|   307k|      }
  111|  9.23k|      i += offset;
  112|  52.7k|    } else {
  113|  52.7k|      const int extra_bytes = token;
  114|  52.7k|      uint32_t prob = prob_data >> 2;
  115|  62.4k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 9.77k, False: 52.7k]
  ------------------
  116|  9.77k|        uint8_t eb;
  117|  9.77k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 9.76k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  9.76k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  9.76k|      }
  124|  52.7k|      probability_table_[i] = prob;
  125|  52.7k|    }
  126|  61.9k|  }
  127|     55|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 12, False: 43]
  ------------------
  128|     12|    return false;
  129|     12|  }
  130|     43|  return true;
  131|     55|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|     43|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|     43|    DecoderBuffer *buffer) {
  136|     43|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     43|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     43|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     43|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 43]
  ------------------
  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|     43|#endif
  146|     43|  {
  147|     43|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 43]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     43|  }
  151|     43|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 17, False: 26]
  ------------------
  152|     17|    return false;
  153|     17|  }
  154|     26|  const uint8_t *const data_head =
  155|     26|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     26|  buffer->Advance(bytes_encoded);
  158|     26|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 7, False: 19]
  ------------------
  159|      7|    return false;
  160|      7|  }
  161|     19|  return true;
  162|     26|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|  44.3k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     19|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     19|  ans_.read_end();
  167|     19|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    126|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    126|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    126|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 126]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    126|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    126|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    126|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 7, False: 119]
  ------------------
   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|    119|#endif
   73|    119|  {
   74|    119|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 119]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    119|  }
   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|    126|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 124]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|    124|  probability_table_.resize(num_symbols_);
   86|    124|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 124]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   238k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 238k, False: 81]
  ------------------
   91|   238k|    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|   238k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 22, False: 238k]
  ------------------
   95|     22|      return false;
   96|     22|    }
   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|   238k|    const int token = prob_data & 3;
  102|   238k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 64.5k, False: 174k]
  ------------------
  103|  64.5k|      const uint32_t offset = prob_data >> 2;
  104|  64.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 16, False: 64.5k]
  ------------------
  105|     16|        return false;
  106|     16|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.32M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.26M, False: 64.5k]
  ------------------
  109|  2.26M|        probability_table_[i + j] = 0;
  110|  2.26M|      }
  111|  64.5k|      i += offset;
  112|   174k|    } else {
  113|   174k|      const int extra_bytes = token;
  114|   174k|      uint32_t prob = prob_data >> 2;
  115|   298k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 124k, False: 174k]
  ------------------
  116|   124k|        uint8_t eb;
  117|   124k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 5, False: 124k]
  ------------------
  118|      5|          return false;
  119|      5|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   124k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   124k|      }
  124|   174k|      probability_table_[i] = prob;
  125|   174k|    }
  126|   238k|  }
  127|     81|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 14, False: 67]
  ------------------
  128|     14|    return false;
  129|     14|  }
  130|     67|  return true;
  131|     81|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|     67|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|     67|    DecoderBuffer *buffer) {
  136|     67|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     67|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     67|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     67|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 67]
  ------------------
  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|     67|#endif
  146|     67|  {
  147|     67|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 67]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     67|  }
  151|     67|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 18, False: 49]
  ------------------
  152|     18|    return false;
  153|     18|  }
  154|     49|  const uint8_t *const data_head =
  155|     49|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     49|  buffer->Advance(bytes_encoded);
  158|     49|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 10, False: 39]
  ------------------
  159|     10|    return false;
  160|     10|  }
  161|     39|  return true;
  162|     49|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   313k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     39|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     39|  ans_.read_end();
  167|     39|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|     98|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|     98|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     98|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 98]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     98|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     98|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     98|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 12, False: 86]
  ------------------
   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|     86|#endif
   73|     86|  {
   74|     86|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 86]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     86|  }
   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|     98|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 6, False: 92]
  ------------------
   83|      6|    return false;
   84|      6|  }
   85|     92|  probability_table_.resize(num_symbols_);
   86|     92|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 92]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  74.9k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 74.8k, False: 60]
  ------------------
   91|  74.8k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  74.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 13, False: 74.8k]
  ------------------
   95|     13|      return false;
   96|     13|    }
   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|  74.8k|    const int token = prob_data & 3;
  102|  74.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 36.5k, False: 38.2k]
  ------------------
  103|  36.5k|      const uint32_t offset = prob_data >> 2;
  104|  36.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 8, False: 36.5k]
  ------------------
  105|      8|        return false;
  106|      8|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.86M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.82M, False: 36.5k]
  ------------------
  109|  1.82M|        probability_table_[i + j] = 0;
  110|  1.82M|      }
  111|  36.5k|      i += offset;
  112|  38.2k|    } else {
  113|  38.2k|      const int extra_bytes = token;
  114|  38.2k|      uint32_t prob = prob_data >> 2;
  115|  58.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 20.4k, False: 38.2k]
  ------------------
  116|  20.4k|        uint8_t eb;
  117|  20.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 20.4k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  20.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  20.4k|      }
  124|  38.2k|      probability_table_[i] = prob;
  125|  38.2k|    }
  126|  74.8k|  }
  127|     60|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 7, False: 53]
  ------------------
  128|      7|    return false;
  129|      7|  }
  130|     53|  return true;
  131|     60|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|     53|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|     53|    DecoderBuffer *buffer) {
  136|     53|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     53|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     53|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     53|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 53]
  ------------------
  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|     53|#endif
  146|     53|  {
  147|     53|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 53]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     53|  }
  151|     53|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 20, False: 33]
  ------------------
  152|     20|    return false;
  153|     20|  }
  154|     33|  const uint8_t *const data_head =
  155|     33|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     33|  buffer->Advance(bytes_encoded);
  158|     33|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 13, False: 20]
  ------------------
  159|     13|    return false;
  160|     13|  }
  161|     20|  return true;
  162|     33|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  4.78M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     20|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     20|  ans_.read_end();
  167|     20|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    110|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    110|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    110|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 110]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    110|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    110|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    110|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 13, False: 97]
  ------------------
   67|     13|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 13]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     13|  } else
   72|     97|#endif
   73|     97|  {
   74|     97|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 97]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     97|  }
   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|    110|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 108]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|    108|  probability_table_.resize(num_symbols_);
   86|    108|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 108]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   249k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 249k, False: 64]
  ------------------
   91|   249k|    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|   249k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 19, False: 249k]
  ------------------
   95|     19|      return false;
   96|     19|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   249k|    const int token = prob_data & 3;
  102|   249k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 26.0k, False: 223k]
  ------------------
  103|  26.0k|      const uint32_t offset = prob_data >> 2;
  104|  26.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 14, False: 25.9k]
  ------------------
  105|     14|        return false;
  106|     14|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.03M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.00M, False: 25.9k]
  ------------------
  109|  1.00M|        probability_table_[i + j] = 0;
  110|  1.00M|      }
  111|  25.9k|      i += offset;
  112|   223k|    } else {
  113|   223k|      const int extra_bytes = token;
  114|   223k|      uint32_t prob = prob_data >> 2;
  115|   296k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 72.7k, False: 223k]
  ------------------
  116|  72.7k|        uint8_t eb;
  117|  72.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 72.7k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  72.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  72.7k|      }
  124|   223k|      probability_table_[i] = prob;
  125|   223k|    }
  126|   249k|  }
  127|     64|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 17, False: 47]
  ------------------
  128|     17|    return false;
  129|     17|  }
  130|     47|  return true;
  131|     64|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|     47|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|     47|    DecoderBuffer *buffer) {
  136|     47|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     47|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     47|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     47|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 11, False: 36]
  ------------------
  140|     11|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 11]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     11|  } else
  145|     36|#endif
  146|     36|  {
  147|     36|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 36]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     36|  }
  151|     47|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 12, False: 35]
  ------------------
  152|     12|    return false;
  153|     12|  }
  154|     35|  const uint8_t *const data_head =
  155|     35|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     35|  buffer->Advance(bytes_encoded);
  158|     35|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 13, False: 22]
  ------------------
  159|     13|    return false;
  160|     13|  }
  161|     22|  return true;
  162|     35|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|   131k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     22|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     22|  ans_.read_end();
  167|     22|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|     72|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|     72|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     72|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 72]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     72|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     72|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     72|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 5, False: 67]
  ------------------
   67|      5|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 5]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      5|  } else
   72|     67|#endif
   73|     67|  {
   74|     67|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 67]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     67|  }
   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|     72|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 72]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     72|  probability_table_.resize(num_symbols_);
   86|     72|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 72]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  9.20k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 9.15k, False: 49]
  ------------------
   91|  9.15k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  9.15k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 13, False: 9.13k]
  ------------------
   95|     13|      return false;
   96|     13|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  9.13k|    const int token = prob_data & 3;
  102|  9.13k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.70k, False: 3.42k]
  ------------------
  103|  5.70k|      const uint32_t offset = prob_data >> 2;
  104|  5.70k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 8, False: 5.70k]
  ------------------
  105|      8|        return false;
  106|      8|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   206k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 201k, False: 5.70k]
  ------------------
  109|   201k|        probability_table_[i + j] = 0;
  110|   201k|      }
  111|  5.70k|      i += offset;
  112|  5.70k|    } else {
  113|  3.42k|      const int extra_bytes = token;
  114|  3.42k|      uint32_t prob = prob_data >> 2;
  115|  5.93k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.50k, False: 3.42k]
  ------------------
  116|  2.50k|        uint8_t eb;
  117|  2.50k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 2, False: 2.50k]
  ------------------
  118|      2|          return false;
  119|      2|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.50k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.50k|      }
  124|  3.42k|      probability_table_[i] = prob;
  125|  3.42k|    }
  126|  9.13k|  }
  127|     49|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 6, False: 43]
  ------------------
  128|      6|    return false;
  129|      6|  }
  130|     43|  return true;
  131|     49|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|     43|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|     43|    DecoderBuffer *buffer) {
  136|     43|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     43|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     43|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     43|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 41]
  ------------------
  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|     41|#endif
  146|     41|  {
  147|     41|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 41]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     41|  }
  151|     43|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 9, False: 34]
  ------------------
  152|      9|    return false;
  153|      9|  }
  154|     34|  const uint8_t *const data_head =
  155|     34|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     34|  buffer->Advance(bytes_encoded);
  158|     34|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 7, False: 27]
  ------------------
  159|      7|    return false;
  160|      7|  }
  161|     27|  return true;
  162|     34|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  9.55M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     27|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     27|  ans_.read_end();
  167|     27|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    104|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    104|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    104|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 104]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    104|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    104|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    104|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 13, False: 91]
  ------------------
   67|     13|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 13]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     13|  } else
   72|     91|#endif
   73|     91|  {
   74|     91|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 91]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     91|  }
   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|    104|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 4, False: 100]
  ------------------
   83|      4|    return false;
   84|      4|  }
   85|    100|  probability_table_.resize(num_symbols_);
   86|    100|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 99]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  11.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 11.1k, False: 67]
  ------------------
   91|  11.1k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  11.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 13, False: 11.1k]
  ------------------
   95|     13|      return false;
   96|     13|    }
   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|  11.1k|    const int token = prob_data & 3;
  102|  11.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.03k, False: 7.07k]
  ------------------
  103|  4.03k|      const uint32_t offset = prob_data >> 2;
  104|  4.03k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 10, False: 4.02k]
  ------------------
  105|     10|        return false;
  106|     10|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   144k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 140k, False: 4.02k]
  ------------------
  109|   140k|        probability_table_[i + j] = 0;
  110|   140k|      }
  111|  4.02k|      i += offset;
  112|  7.07k|    } else {
  113|  7.07k|      const int extra_bytes = token;
  114|  7.07k|      uint32_t prob = prob_data >> 2;
  115|  11.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.71k, False: 7.06k]
  ------------------
  116|  4.71k|        uint8_t eb;
  117|  4.71k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 9, False: 4.70k]
  ------------------
  118|      9|          return false;
  119|      9|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.70k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.70k|      }
  124|  7.06k|      probability_table_[i] = prob;
  125|  7.06k|    }
  126|  11.1k|  }
  127|     67|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 18, False: 49]
  ------------------
  128|     18|    return false;
  129|     18|  }
  130|     49|  return true;
  131|     67|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|     50|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|     49|    DecoderBuffer *buffer) {
  136|     49|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     49|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     49|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     49|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 9, False: 40]
  ------------------
  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|     40|#endif
  146|     40|  {
  147|     40|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 39]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|     40|  }
  151|     48|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 14, False: 34]
  ------------------
  152|     14|    return false;
  153|     14|  }
  154|     34|  const uint8_t *const data_head =
  155|     34|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     34|  buffer->Advance(bytes_encoded);
  158|     34|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 6, False: 28]
  ------------------
  159|      6|    return false;
  160|      6|  }
  161|     28|  return true;
  162|     34|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  15.7M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     28|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     28|  ans_.read_end();
  167|     28|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    102|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    102|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    102|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 102]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    102|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    102|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    102|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 34, False: 68]
  ------------------
   67|     34|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 34]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     34|  } else
   72|     68|#endif
   73|     68|  {
   74|     68|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 68]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     68|  }
   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|    102|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 102]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|    102|  probability_table_.resize(num_symbols_);
   86|    102|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 101]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  65.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 65.3k, False: 75]
  ------------------
   91|  65.3k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  65.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 11, False: 65.3k]
  ------------------
   95|     11|      return false;
   96|     11|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  65.3k|    const int token = prob_data & 3;
  102|  65.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 46.1k, False: 19.2k]
  ------------------
  103|  46.1k|      const uint32_t offset = prob_data >> 2;
  104|  46.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 8, False: 46.1k]
  ------------------
  105|      8|        return false;
  106|      8|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   463k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 417k, False: 46.1k]
  ------------------
  109|   417k|        probability_table_[i + j] = 0;
  110|   417k|      }
  111|  46.1k|      i += offset;
  112|  46.1k|    } else {
  113|  19.2k|      const int extra_bytes = token;
  114|  19.2k|      uint32_t prob = prob_data >> 2;
  115|  41.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 22.1k, False: 19.2k]
  ------------------
  116|  22.1k|        uint8_t eb;
  117|  22.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 22.0k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  22.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  22.0k|      }
  124|  19.2k|      probability_table_[i] = prob;
  125|  19.2k|    }
  126|  65.3k|  }
  127|     75|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 4, False: 71]
  ------------------
  128|      4|    return false;
  129|      4|  }
  130|     71|  return true;
  131|     75|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|     72|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|     71|    DecoderBuffer *buffer) {
  136|     71|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     71|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     71|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     71|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 26, False: 45]
  ------------------
  140|     26|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 26]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     26|  } else
  145|     45|#endif
  146|     45|  {
  147|     45|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 45]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     45|  }
  151|     71|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 29, False: 42]
  ------------------
  152|     29|    return false;
  153|     29|  }
  154|     42|  const uint8_t *const data_head =
  155|     42|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     42|  buffer->Advance(bytes_encoded);
  158|     42|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 41]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|     41|  return true;
  162|     42|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  30.0M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     41|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     41|  ans_.read_end();
  167|     41|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  4.25k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  4.25k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 2, False: 4.25k]
  ------------------
   35|      2|    return true;
   36|      2|  }
   37|       |  // Decode which scheme to use.
   38|  4.25k|  uint8_t scheme;
   39|  4.25k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 38, False: 4.21k]
  ------------------
   40|     38|    return false;
   41|     38|  }
   42|  4.21k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 392, False: 3.82k]
  ------------------
   43|    392|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|    392|                                                  src_buffer, out_values);
   45|  3.82k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 2.64k, False: 1.17k]
  ------------------
   46|  2.64k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  2.64k|                                               out_values);
   48|  2.64k|  }
   49|  1.17k|  return false;
   50|  4.21k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|    392|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|    392|  SymbolDecoderT<5> tag_decoder;
   57|    392|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 203, False: 189]
  ------------------
   58|    203|    return false;
   59|    203|  }
   60|       |
   61|    189|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 87, False: 102]
  ------------------
   62|     87|    return false;
   63|     87|  }
   64|       |
   65|    102|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 102, False: 0]
  |  Branch (65:25): [True: 30, False: 72]
  ------------------
   66|     30|    return false;  // Wrong number of symbols.
   67|     30|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|     72|  src_buffer->StartBitDecoding(false, nullptr);
   72|     72|  int value_id = 0;
   73|   589k|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 589k, False: 72]
  ------------------
   74|       |    // Decode the tag.
   75|   589k|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  1.66M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 1.07M, False: 589k]
  ------------------
   78|  1.07M|      uint32_t val;
   79|  1.07M|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 0, False: 1.07M]
  ------------------
   80|      0|        return false;
   81|      0|      }
   82|  1.07M|      out_values[value_id++] = val;
   83|  1.07M|    }
   84|   589k|  }
   85|     72|  tag_decoder.EndDecoding();
   86|     72|  src_buffer->EndBitDecoding();
   87|     72|  return true;
   88|     72|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  2.64k|                      uint32_t *out_values) {
  117|  2.64k|  uint8_t max_bit_length;
  118|  2.64k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 4, False: 2.64k]
  ------------------
  119|      4|    return false;
  120|      4|  }
  121|  2.64k|  switch (max_bit_length) {
  122|    308|    case 1:
  ------------------
  |  Branch (122:5): [True: 308, False: 2.33k]
  ------------------
  123|    308|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    308|                                                         out_values);
  125|    286|    case 2:
  ------------------
  |  Branch (125:5): [True: 286, False: 2.35k]
  ------------------
  126|    286|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    286|                                                         out_values);
  128|    168|    case 3:
  ------------------
  |  Branch (128:5): [True: 168, False: 2.47k]
  ------------------
  129|    168|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    168|                                                         out_values);
  131|     85|    case 4:
  ------------------
  |  Branch (131:5): [True: 85, False: 2.55k]
  ------------------
  132|     85|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|     85|                                                         out_values);
  134|    165|    case 5:
  ------------------
  |  Branch (134:5): [True: 165, False: 2.47k]
  ------------------
  135|    165|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    165|                                                         out_values);
  137|    198|    case 6:
  ------------------
  |  Branch (137:5): [True: 198, False: 2.44k]
  ------------------
  138|    198|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    198|                                                         out_values);
  140|    145|    case 7:
  ------------------
  |  Branch (140:5): [True: 145, False: 2.49k]
  ------------------
  141|    145|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    145|                                                         out_values);
  143|    146|    case 8:
  ------------------
  |  Branch (143:5): [True: 146, False: 2.49k]
  ------------------
  144|    146|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    146|                                                         out_values);
  146|    115|    case 9:
  ------------------
  |  Branch (146:5): [True: 115, False: 2.52k]
  ------------------
  147|    115|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    115|                                                         out_values);
  149|     99|    case 10:
  ------------------
  |  Branch (149:5): [True: 99, False: 2.54k]
  ------------------
  150|     99|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|     99|          num_values, src_buffer, out_values);
  152|    102|    case 11:
  ------------------
  |  Branch (152:5): [True: 102, False: 2.53k]
  ------------------
  153|    102|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    102|          num_values, src_buffer, out_values);
  155|     96|    case 12:
  ------------------
  |  Branch (155:5): [True: 96, False: 2.54k]
  ------------------
  156|     96|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|     96|          num_values, src_buffer, out_values);
  158|    126|    case 13:
  ------------------
  |  Branch (158:5): [True: 126, False: 2.51k]
  ------------------
  159|    126|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    126|          num_values, src_buffer, out_values);
  161|     98|    case 14:
  ------------------
  |  Branch (161:5): [True: 98, False: 2.54k]
  ------------------
  162|     98|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|     98|          num_values, src_buffer, out_values);
  164|    110|    case 15:
  ------------------
  |  Branch (164:5): [True: 110, False: 2.53k]
  ------------------
  165|    110|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    110|          num_values, src_buffer, out_values);
  167|     72|    case 16:
  ------------------
  |  Branch (167:5): [True: 72, False: 2.56k]
  ------------------
  168|     72|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|     72|          num_values, src_buffer, out_values);
  170|    104|    case 17:
  ------------------
  |  Branch (170:5): [True: 104, False: 2.53k]
  ------------------
  171|    104|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    104|          num_values, src_buffer, out_values);
  173|    102|    case 18:
  ------------------
  |  Branch (173:5): [True: 102, False: 2.53k]
  ------------------
  174|    102|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    102|          num_values, src_buffer, out_values);
  176|    115|    default:
  ------------------
  |  Branch (176:5): [True: 115, False: 2.52k]
  ------------------
  177|    115|      return false;
  178|  2.64k|  }
  179|  2.64k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    308|                              uint32_t *out_values) {
   93|    308|  SymbolDecoderT decoder;
   94|    308|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 157, False: 151]
  ------------------
   95|    157|    return false;
   96|    157|  }
   97|       |
   98|    151|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 151, False: 0]
  |  Branch (98:25): [True: 12, False: 139]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|    139|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 29, False: 110]
  ------------------
  103|     29|    return false;
  104|     29|  }
  105|  10.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 10.5M, False: 110]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  10.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  10.5M|    out_values[i] = value;
  109|  10.5M|  }
  110|    110|  decoder.EndDecoding();
  111|    110|  return true;
  112|    139|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    286|                              uint32_t *out_values) {
   93|    286|  SymbolDecoderT decoder;
   94|    286|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 82, False: 204]
  ------------------
   95|     82|    return false;
   96|     82|  }
   97|       |
   98|    204|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 204, False: 0]
  |  Branch (98:25): [True: 3, False: 201]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|    201|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 31, False: 170]
  ------------------
  103|     31|    return false;
  104|     31|  }
  105|  7.34M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 7.34M, False: 170]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  7.34M|    const uint32_t value = decoder.DecodeSymbol();
  108|  7.34M|    out_values[i] = value;
  109|  7.34M|  }
  110|    170|  decoder.EndDecoding();
  111|    170|  return true;
  112|    201|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    168|                              uint32_t *out_values) {
   93|    168|  SymbolDecoderT decoder;
   94|    168|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 57, False: 111]
  ------------------
   95|     57|    return false;
   96|     57|  }
   97|       |
   98|    111|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 111, False: 0]
  |  Branch (98:25): [True: 5, False: 106]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    106|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 34, False: 72]
  ------------------
  103|     34|    return false;
  104|     34|  }
  105|  8.79M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.79M, False: 72]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.79M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.79M|    out_values[i] = value;
  109|  8.79M|  }
  110|     72|  decoder.EndDecoding();
  111|     72|  return true;
  112|    106|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|     85|                              uint32_t *out_values) {
   93|     85|  SymbolDecoderT decoder;
   94|     85|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 37, False: 48]
  ------------------
   95|     37|    return false;
   96|     37|  }
   97|       |
   98|     48|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 48, False: 0]
  |  Branch (98:25): [True: 0, False: 48]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     48|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 10, False: 38]
  ------------------
  103|     10|    return false;
  104|     10|  }
  105|   436k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 436k, False: 38]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   436k|    const uint32_t value = decoder.DecodeSymbol();
  108|   436k|    out_values[i] = value;
  109|   436k|  }
  110|     38|  decoder.EndDecoding();
  111|     38|  return true;
  112|     48|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    165|                              uint32_t *out_values) {
   93|    165|  SymbolDecoderT decoder;
   94|    165|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 6, False: 159]
  ------------------
   95|      6|    return false;
   96|      6|  }
   97|       |
   98|    159|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 159, False: 0]
  |  Branch (98:25): [True: 108, False: 51]
  ------------------
   99|    108|    return false;  // Wrong number of symbols.
  100|    108|  }
  101|       |
  102|     51|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 15, False: 36]
  ------------------
  103|     15|    return false;
  104|     15|  }
  105|   173k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 173k, False: 36]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   173k|    const uint32_t value = decoder.DecodeSymbol();
  108|   173k|    out_values[i] = value;
  109|   173k|  }
  110|     36|  decoder.EndDecoding();
  111|     36|  return true;
  112|     51|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    198|                              uint32_t *out_values) {
   93|    198|  SymbolDecoderT decoder;
   94|    198|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 56, False: 142]
  ------------------
   95|     56|    return false;
   96|     56|  }
   97|       |
   98|    142|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 142, False: 0]
  |  Branch (98:25): [True: 0, False: 142]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    142|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 41, False: 101]
  ------------------
  103|     41|    return false;
  104|     41|  }
  105|  4.93M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.93M, False: 101]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.93M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.93M|    out_values[i] = value;
  109|  4.93M|  }
  110|    101|  decoder.EndDecoding();
  111|    101|  return true;
  112|    142|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    145|                              uint32_t *out_values) {
   93|    145|  SymbolDecoderT decoder;
   94|    145|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 96, False: 49]
  ------------------
   95|     96|    return false;
   96|     96|  }
   97|       |
   98|     49|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 49, False: 0]
  |  Branch (98:25): [True: 0, False: 49]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     49|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 21, False: 28]
  ------------------
  103|     21|    return false;
  104|     21|  }
  105|  1.14M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.14M, False: 28]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.14M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.14M|    out_values[i] = value;
  109|  1.14M|  }
  110|     28|  decoder.EndDecoding();
  111|     28|  return true;
  112|     49|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    146|                              uint32_t *out_values) {
   93|    146|  SymbolDecoderT decoder;
   94|    146|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 61, False: 85]
  ------------------
   95|     61|    return false;
   96|     61|  }
   97|       |
   98|     85|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 85, False: 0]
  |  Branch (98:25): [True: 1, False: 84]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     84|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 36, False: 48]
  ------------------
  103|     36|    return false;
  104|     36|  }
  105|  2.51M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.51M, False: 48]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.51M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.51M|    out_values[i] = value;
  109|  2.51M|  }
  110|     48|  decoder.EndDecoding();
  111|     48|  return true;
  112|     84|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    115|                              uint32_t *out_values) {
   93|    115|  SymbolDecoderT decoder;
   94|    115|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 72, False: 43]
  ------------------
   95|     72|    return false;
   96|     72|  }
   97|       |
   98|     43|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 43, False: 0]
  |  Branch (98:25): [True: 1, False: 42]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     42|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 23, False: 19]
  ------------------
  103|     23|    return false;
  104|     23|  }
  105|  92.6k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 92.6k, False: 19]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  92.6k|    const uint32_t value = decoder.DecodeSymbol();
  108|  92.6k|    out_values[i] = value;
  109|  92.6k|  }
  110|     19|  decoder.EndDecoding();
  111|     19|  return true;
  112|     42|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|     99|                              uint32_t *out_values) {
   93|     99|  SymbolDecoderT decoder;
   94|     99|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 56, False: 43]
  ------------------
   95|     56|    return false;
   96|     56|  }
   97|       |
   98|     43|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 43, False: 0]
  |  Branch (98:25): [True: 0, False: 43]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     43|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 26, False: 17]
  ------------------
  103|     26|    return false;
  104|     26|  }
  105|   169k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 169k, False: 17]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   169k|    const uint32_t value = decoder.DecodeSymbol();
  108|   169k|    out_values[i] = value;
  109|   169k|  }
  110|     17|  decoder.EndDecoding();
  111|     17|  return true;
  112|     43|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    102|                              uint32_t *out_values) {
   93|    102|  SymbolDecoderT decoder;
   94|    102|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 69, False: 33]
  ------------------
   95|     69|    return false;
   96|     69|  }
   97|       |
   98|     33|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 33, False: 0]
  |  Branch (98:25): [True: 3, False: 30]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|     30|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 18, False: 12]
  ------------------
  103|     18|    return false;
  104|     18|  }
  105|  9.87k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 9.86k, False: 12]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  9.86k|    const uint32_t value = decoder.DecodeSymbol();
  108|  9.86k|    out_values[i] = value;
  109|  9.86k|  }
  110|     12|  decoder.EndDecoding();
  111|     12|  return true;
  112|     30|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|     96|                              uint32_t *out_values) {
   93|     96|  SymbolDecoderT decoder;
   94|     96|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 53, False: 43]
  ------------------
   95|     53|    return false;
   96|     53|  }
   97|       |
   98|     43|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 43, False: 0]
  |  Branch (98:25): [True: 0, False: 43]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     43|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 24, False: 19]
  ------------------
  103|     24|    return false;
  104|     24|  }
  105|  44.3k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 44.3k, False: 19]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  44.3k|    const uint32_t value = decoder.DecodeSymbol();
  108|  44.3k|    out_values[i] = value;
  109|  44.3k|  }
  110|     19|  decoder.EndDecoding();
  111|     19|  return true;
  112|     43|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    126|                              uint32_t *out_values) {
   93|    126|  SymbolDecoderT decoder;
   94|    126|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 59, False: 67]
  ------------------
   95|     59|    return false;
   96|     59|  }
   97|       |
   98|     67|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 67, False: 0]
  |  Branch (98:25): [True: 0, False: 67]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     67|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 28, False: 39]
  ------------------
  103|     28|    return false;
  104|     28|  }
  105|   313k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 313k, False: 39]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   313k|    const uint32_t value = decoder.DecodeSymbol();
  108|   313k|    out_values[i] = value;
  109|   313k|  }
  110|     39|  decoder.EndDecoding();
  111|     39|  return true;
  112|     67|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|     98|                              uint32_t *out_values) {
   93|     98|  SymbolDecoderT decoder;
   94|     98|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 45, False: 53]
  ------------------
   95|     45|    return false;
   96|     45|  }
   97|       |
   98|     53|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 53, False: 0]
  |  Branch (98:25): [True: 0, False: 53]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     53|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 33, False: 20]
  ------------------
  103|     33|    return false;
  104|     33|  }
  105|  4.78M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.78M, False: 20]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.78M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.78M|    out_values[i] = value;
  109|  4.78M|  }
  110|     20|  decoder.EndDecoding();
  111|     20|  return true;
  112|     53|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    110|                              uint32_t *out_values) {
   93|    110|  SymbolDecoderT decoder;
   94|    110|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 63, False: 47]
  ------------------
   95|     63|    return false;
   96|     63|  }
   97|       |
   98|     47|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 47, False: 0]
  |  Branch (98:25): [True: 0, False: 47]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     47|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 25, False: 22]
  ------------------
  103|     25|    return false;
  104|     25|  }
  105|   131k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 131k, False: 22]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   131k|    const uint32_t value = decoder.DecodeSymbol();
  108|   131k|    out_values[i] = value;
  109|   131k|  }
  110|     22|  decoder.EndDecoding();
  111|     22|  return true;
  112|     47|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|     72|                              uint32_t *out_values) {
   93|     72|  SymbolDecoderT decoder;
   94|     72|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 29, False: 43]
  ------------------
   95|     29|    return false;
   96|     29|  }
   97|       |
   98|     43|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 43, False: 0]
  |  Branch (98:25): [True: 0, False: 43]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     43|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 16, False: 27]
  ------------------
  103|     16|    return false;
  104|     16|  }
  105|  9.55M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 9.55M, False: 27]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  9.55M|    const uint32_t value = decoder.DecodeSymbol();
  108|  9.55M|    out_values[i] = value;
  109|  9.55M|  }
  110|     27|  decoder.EndDecoding();
  111|     27|  return true;
  112|     43|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    104|                              uint32_t *out_values) {
   93|    104|  SymbolDecoderT decoder;
   94|    104|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 54, False: 50]
  ------------------
   95|     54|    return false;
   96|     54|  }
   97|       |
   98|     50|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 50, False: 0]
  |  Branch (98:25): [True: 1, False: 49]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     49|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 21, False: 28]
  ------------------
  103|     21|    return false;
  104|     21|  }
  105|  15.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 15.7M, False: 28]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  15.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  15.7M|    out_values[i] = value;
  109|  15.7M|  }
  110|     28|  decoder.EndDecoding();
  111|     28|  return true;
  112|     49|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    102|                              uint32_t *out_values) {
   93|    102|  SymbolDecoderT decoder;
   94|    102|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 30, False: 72]
  ------------------
   95|     30|    return false;
   96|     30|  }
   97|       |
   98|     72|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 72, False: 0]
  |  Branch (98:25): [True: 1, False: 71]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     71|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 30, False: 41]
  ------------------
  103|     30|    return false;
  104|     30|  }
  105|  30.0M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 30.0M, False: 41]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  30.0M|    const uint32_t value = decoder.DecodeSymbol();
  108|  30.0M|    out_values[i] = value;
  109|  30.0M|  }
  110|     41|  decoder.EndDecoding();
  111|     41|  return true;
  112|     71|}

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

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

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

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

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

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  3.24k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  1.47k|  const CornerTable *GetCornerTable() const override {
   67|  1.47k|    return corner_table_.get();
   68|  1.47k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  3.23M|                       int *out_encoder_split_symbol_id) {
   87|  3.23M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 20.1k, False: 3.21M]
  ------------------
   88|  20.1k|      return false;
   89|  20.1k|    }
   90|  3.21M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 6, False: 3.21M]
  ------------------
   91|  3.21M|        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|      6|      *out_encoder_split_symbol_id = -1;
   98|      6|      return true;
   99|      6|    }
  100|  3.21M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 3.21M, False: 743]
  ------------------
  101|  3.21M|      return false;
  102|  3.21M|    }
  103|    743|    *out_face_edge =
  104|    743|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|    743|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|    743|    topology_split_data_.pop_back();
  108|    743|    return true;
  109|  3.21M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  9.80M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  9.80M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  9.80M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  9.80M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  4.44k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  4.01k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  3.13k|  const CornerTable *GetCornerTable() const override {
   67|  3.13k|    return corner_table_.get();
   68|  3.13k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  21.3M|                       int *out_encoder_split_symbol_id) {
   87|  21.3M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 21.2M, False: 55.1k]
  ------------------
   88|  21.2M|      return false;
   89|  21.2M|    }
   90|  55.1k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 17, False: 55.1k]
  ------------------
   91|  55.1k|        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|     17|      *out_encoder_split_symbol_id = -1;
   98|     17|      return true;
   99|     17|    }
  100|  55.1k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 53.8k, False: 1.35k]
  ------------------
  101|  53.8k|      return false;
  102|  53.8k|    }
  103|  1.35k|    *out_face_edge =
  104|  1.35k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.35k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.35k|    topology_split_data_.pop_back();
  108|  1.35k|    return true;
  109|  55.1k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  63.5M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  63.5M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  63.5M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  63.5M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  2.08k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  4.79k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|    981|  const CornerTable *GetCornerTable() const override {
   67|    981|    return corner_table_.get();
   68|    981|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  16.0M|                       int *out_encoder_split_symbol_id) {
   87|  16.0M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 15.6M, False: 450k]
  ------------------
   88|  15.6M|      return false;
   89|  15.6M|    }
   90|   450k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 7, False: 450k]
  ------------------
   91|   450k|        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|      7|      *out_encoder_split_symbol_id = -1;
   98|      7|      return true;
   99|      7|    }
  100|   450k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 449k, False: 1.09k]
  ------------------
  101|   449k|      return false;
  102|   449k|    }
  103|  1.09k|    *out_face_edge =
  104|  1.09k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.09k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.09k|    topology_split_data_.pop_back();
  108|  1.09k|    return true;
  109|   450k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  20.8M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  20.8M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  20.8M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  20.8M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  10.4k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

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

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

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

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

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|    835|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.41M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.41M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 2.40M, False: 2.34k]
  ------------------
   61|  2.40M|      return true;  // Already traversed.
   62|  2.40M|    }
   63|       |
   64|  2.34k|    corner_traversal_stack_.clear();
   65|  2.34k|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  2.34k|    const VertexIndex next_vert =
   69|  2.34k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  2.34k|    const VertexIndex prev_vert =
   71|  2.34k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  2.34k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.34k]
  |  Branch (72:45): [True: 0, False: 2.34k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  2.34k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.05k, False: 281]
  ------------------
   76|  2.05k|      this->MarkVertexVisited(next_vert);
   77|  2.05k|      this->traversal_observer().OnNewVertexVisited(
   78|  2.05k|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.05k|    }
   80|  2.34k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.10k, False: 232]
  ------------------
   81|  2.10k|      this->MarkVertexVisited(prev_vert);
   82|  2.10k|      this->traversal_observer().OnNewVertexVisited(
   83|  2.10k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.10k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  17.4k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 15.0k, False: 2.34k]
  ------------------
   88|       |      // Currently processed corner.
   89|  15.0k|      corner_id = corner_traversal_stack_.back();
   90|  15.0k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  15.0k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 15.0k]
  |  Branch (92:47): [True: 683, False: 14.3k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    683|        corner_traversal_stack_.pop_back();
   95|    683|        continue;
   96|    683|      }
   97|  2.41M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 2.41M, Folded]
  ------------------
   98|  2.41M|        this->MarkFaceVisited(face_id);
   99|  2.41M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.41M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.41M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.41M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.41M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.21M, False: 1.19M]
  ------------------
  105|  1.21M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.21M|          this->MarkVertexVisited(vert_id);
  107|  1.21M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.21M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 1.19M, False: 25.3k]
  ------------------
  109|  1.19M|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  1.19M|            face_id = FaceIndex(corner_id.value() / 3);
  111|  1.19M|            continue;
  112|  1.19M|          }
  113|  1.21M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  1.21M|        const CornerIndex right_corner_id =
  118|  1.21M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.21M|        const CornerIndex left_corner_id =
  120|  1.21M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.21M|        const FaceIndex right_face_id(
  122|  1.21M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 18.5k, False: 1.20M]
  ------------------
  123|  1.21M|                 ? kInvalidFaceIndex
  124|  1.21M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.21M|        const FaceIndex left_face_id(
  126|  1.21M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 8.24k, False: 1.21M]
  ------------------
  127|  1.21M|                 ? kInvalidFaceIndex
  128|  1.21M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.21M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.19M, False: 26.9k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.19M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 8.02k, False: 1.18M]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  8.02k|            corner_traversal_stack_.pop_back();
  134|  8.02k|            break;  // Break from the while (true) loop.
  135|  1.18M|          } else {
  136|       |            // Go to the left face.
  137|  1.18M|            corner_id = left_corner_id;
  138|  1.18M|            face_id = left_face_id;
  139|  1.18M|          }
  140|  1.19M|        } else {
  141|       |          // Right face was not visited.
  142|  26.9k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 20.6k, False: 6.36k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  20.6k|            corner_id = right_corner_id;
  145|  20.6k|            face_id = right_face_id;
  146|  20.6k|          } 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|  6.36k|            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|  6.36k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  6.36k|            break;
  159|  6.36k|          }
  160|  26.9k|        }
  161|  1.21M|      }
  162|  14.3k|    }
  163|  2.34k|    return true;
  164|  2.34k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|    835|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  1.68k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.03k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.95M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.95M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 898k, False: 2.05M]
  ------------------
   61|   898k|      return true;  // Already traversed.
   62|   898k|    }
   63|       |
   64|  2.05M|    corner_traversal_stack_.clear();
   65|  2.05M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  2.05M|    const VertexIndex next_vert =
   69|  2.05M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  2.05M|    const VertexIndex prev_vert =
   71|  2.05M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  2.05M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.05M]
  |  Branch (72:45): [True: 0, False: 2.05M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  2.05M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.05M, False: 1.14k]
  ------------------
   76|  2.05M|      this->MarkVertexVisited(next_vert);
   77|  2.05M|      this->traversal_observer().OnNewVertexVisited(
   78|  2.05M|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.05M|    }
   80|  2.05M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.05M, False: 923]
  ------------------
   81|  2.05M|      this->MarkVertexVisited(prev_vert);
   82|  2.05M|      this->traversal_observer().OnNewVertexVisited(
   83|  2.05M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.05M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  4.18M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 2.12M, False: 2.05M]
  ------------------
   88|       |      // Currently processed corner.
   89|  2.12M|      corner_id = corner_traversal_stack_.back();
   90|  2.12M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  2.12M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 2.12M]
  |  Branch (92:47): [True: 5.35k, False: 2.12M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  5.35k|        corner_traversal_stack_.pop_back();
   95|  5.35k|        continue;
   96|  5.35k|      }
   97|  2.95M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 2.95M, Folded]
  ------------------
   98|  2.95M|        this->MarkFaceVisited(face_id);
   99|  2.95M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.95M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.95M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.95M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.95M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 2.53M, False: 428k]
  ------------------
  105|  2.53M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  2.53M|          this->MarkVertexVisited(vert_id);
  107|  2.53M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  2.53M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 415k, False: 2.11M]
  ------------------
  109|   415k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   415k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   415k|            continue;
  112|   415k|          }
  113|  2.53M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  2.54M|        const CornerIndex right_corner_id =
  118|  2.54M|            this->corner_table()->GetRightCorner(corner_id);
  119|  2.54M|        const CornerIndex left_corner_id =
  120|  2.54M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  2.54M|        const FaceIndex right_face_id(
  122|  2.54M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 2.08M, False: 453k]
  ------------------
  123|  2.54M|                 ? kInvalidFaceIndex
  124|  2.54M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  2.54M|        const FaceIndex left_face_id(
  126|  2.54M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 2.08M, False: 458k]
  ------------------
  127|  2.54M|                 ? kInvalidFaceIndex
  128|  2.54M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  2.54M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 2.49M, False: 52.9k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  2.49M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 2.08M, False: 402k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  2.08M|            corner_traversal_stack_.pop_back();
  134|  2.08M|            break;  // Break from the while (true) loop.
  135|  2.08M|          } else {
  136|       |            // Go to the left face.
  137|   402k|            corner_id = left_corner_id;
  138|   402k|            face_id = left_face_id;
  139|   402k|          }
  140|  2.49M|        } else {
  141|       |          // Right face was not visited.
  142|  52.9k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 19.1k, False: 33.7k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  19.1k|            corner_id = right_corner_id;
  145|  19.1k|            face_id = right_face_id;
  146|  33.7k|          } 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|  33.7k|            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|  33.7k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  33.7k|            break;
  159|  33.7k|          }
  160|  52.9k|        }
  161|  2.54M|      }
  162|  2.12M|    }
  163|  2.05M|    return true;
  164|  2.05M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.03k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.10k|  DepthFirstTraverser() {}

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

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    202|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  1.32k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  1.32k|    const auto *corner_table = traverser_.corner_table();
   50|  1.32k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  1.32k|    const size_t num_faces = mesh_->num_faces();
   52|  1.32k|    const size_t num_points = mesh_->num_points();
   53|  4.17M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 4.17M, False: 1.32k]
  ------------------
   54|  4.17M|      const auto &face = mesh_->face(f);
   55|  16.6M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 12.5M, False: 4.17M]
  ------------------
   56|  12.5M|        const PointIndex point_id = face[p];
   57|  12.5M|        const VertexIndex vert_id =
   58|  12.5M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  12.5M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 12.5M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  12.5M|        const AttributeValueIndex att_entry_id(
   63|  12.5M|            encoding_data_
   64|  12.5M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  12.5M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 12.5M]
  |  Branch (65:13): [True: 0, False: 12.5M]
  |  Branch (65:39): [True: 0, False: 12.5M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  12.5M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  12.5M|      }
   71|  4.17M|    }
   72|  1.32k|    return true;
   73|  1.32k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    201|  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|    201|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    201|    traverser_.OnTraversalStart();
   82|    201|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 201]
  ------------------
   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|    201|    } else {
   89|    201|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  1.67M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 1.67M, False: 201]
  ------------------
   91|  1.67M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 1.67M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  1.67M|      }
   95|    201|    }
   96|    201|    traverser_.OnTraversalEnd();
   97|    201|    return true;
   98|    201|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.67M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  1.67M|    return traverser_.TraverseFromCorner(corner_id);
  103|  1.67M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    202|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    843|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  5.33k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  5.33k|    const auto *corner_table = traverser_.corner_table();
   50|  5.33k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  5.33k|    const size_t num_faces = mesh_->num_faces();
   52|  5.33k|    const size_t num_points = mesh_->num_points();
   53|  4.73M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 4.73M, False: 5.33k]
  ------------------
   54|  4.73M|      const auto &face = mesh_->face(f);
   55|  18.9M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 14.2M, False: 4.73M]
  ------------------
   56|  14.2M|        const PointIndex point_id = face[p];
   57|  14.2M|        const VertexIndex vert_id =
   58|  14.2M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  14.2M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 14.2M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  14.2M|        const AttributeValueIndex att_entry_id(
   63|  14.2M|            encoding_data_
   64|  14.2M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  14.2M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 14.2M]
  |  Branch (65:13): [True: 0, False: 14.2M]
  |  Branch (65:39): [True: 0, False: 14.2M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  14.2M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  14.2M|      }
   71|  4.73M|    }
   72|  5.33k|    return true;
   73|  5.33k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    835|  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|    835|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    835|    traverser_.OnTraversalStart();
   82|    835|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 835]
  ------------------
   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|    835|    } else {
   89|    835|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.41M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.41M, False: 835]
  ------------------
   91|  2.41M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.41M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.41M|      }
   95|    835|    }
   96|    835|    traverser_.OnTraversalEnd();
   97|    835|    return true;
   98|    835|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.41M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.41M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.41M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    843|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.05k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  6.34k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  6.34k|    const auto *corner_table = traverser_.corner_table();
   50|  6.34k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  6.34k|    const size_t num_faces = mesh_->num_faces();
   52|  6.34k|    const size_t num_points = mesh_->num_points();
   53|  4.88M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 4.88M, False: 6.34k]
  ------------------
   54|  4.88M|      const auto &face = mesh_->face(f);
   55|  19.5M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 14.6M, False: 4.88M]
  ------------------
   56|  14.6M|        const PointIndex point_id = face[p];
   57|  14.6M|        const VertexIndex vert_id =
   58|  14.6M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  14.6M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 14.6M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  14.6M|        const AttributeValueIndex att_entry_id(
   63|  14.6M|            encoding_data_
   64|  14.6M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  14.6M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 14.6M]
  |  Branch (65:13): [True: 0, False: 14.6M]
  |  Branch (65:39): [True: 0, False: 14.6M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  14.6M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  14.6M|      }
   71|  4.88M|    }
   72|  6.34k|    return true;
   73|  6.34k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.03k|  bool GenerateSequenceInternal() override {
   77|       |    // Preallocate memory for storing point indices. We expect the number of
   78|       |    // points to be the same as the number of corner table vertices.
   79|  1.03k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.03k|    traverser_.OnTraversalStart();
   82|  1.03k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.03k]
  ------------------
   83|      0|      for (uint32_t i = 0; i < corner_order_->size(); ++i) {
  ------------------
  |  Branch (83:28): [True: 0, False: 0]
  ------------------
   84|      0|        if (!ProcessCorner(corner_order_->at(i))) {
  ------------------
  |  Branch (84:13): [True: 0, False: 0]
  ------------------
   85|      0|          return false;
   86|      0|        }
   87|      0|      }
   88|  1.03k|    } else {
   89|  1.03k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.95M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.95M, False: 1.03k]
  ------------------
   91|  2.95M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.95M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.95M|      }
   95|  1.03k|    }
   96|  1.03k|    traverser_.OnTraversalEnd();
   97|  1.03k|    return true;
   98|  1.03k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.95M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.95M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.95M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.05k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  2.10k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  23.2M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  11.6M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  11.6M|    return is_vertex_visited_[vert_id.value()];
   65|  11.6M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  2.07M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  2.07M|    is_vertex_visited_[vert_id.value()] = true;
   68|  2.07M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  6.16M|  inline TraversalObserverT &traversal_observer() {
   75|  6.16M|    return traversal_observer_;
   76|  6.16M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  9.13M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  9.13M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 53.8k, False: 9.08M]
  ------------------
   47|  53.8k|      return true;  // Invalid faces are always considered as visited.
   48|  53.8k|    }
   49|  9.08M|    return is_face_visited_[face_id.value()];
   50|  9.13M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  4.08M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  4.08M|    is_face_visited_[face_id.value()] = true;
   62|  4.08M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  2.09k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  2.09k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.04k|                    TraversalObserver traversal_observer) {
   37|  1.04k|    corner_table_ = corner_table;
   38|  1.04k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.04k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.04k|    traversal_observer_ = traversal_observer;
   41|  1.04k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.41M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.41M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.41M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.41M|    return is_face_visited_[corner_id.value() / 3];
   58|  2.41M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  23.3M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.95M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.95M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.95M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.95M|    return is_face_visited_[corner_id.value() / 3];
   58|  2.95M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  7.07M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  7.07M|    return is_vertex_visited_[vert_id.value()];
   65|  7.07M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  6.64M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  6.64M|    is_vertex_visited_[vert_id.value()] = true;
   68|  6.64M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  9.60M|  inline TraversalObserverT &traversal_observer() {
   75|  9.60M|    return traversal_observer_;
   76|  9.60M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  7.21M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  7.21M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 4.17M, False: 3.03M]
  ------------------
   47|  4.17M|      return true;  // Invalid faces are always considered as visited.
   48|  4.17M|    }
   49|  3.03M|    return is_face_visited_[face_id.value()];
   50|  7.21M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  2.95M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  2.95M|    is_face_visited_[face_id.value()] = true;
   62|  2.95M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  2.10k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.05k|                    TraversalObserver traversal_observer) {
   37|  1.05k|    corner_table_ = corner_table;
   38|  1.05k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.05k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.05k|    traversal_observer_ = traversal_observer;
   41|  1.05k|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    105|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    105|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 5, False: 100]
  ------------------
  187|      5|    return false;
  188|      5|  }
  189|    100|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 7, False: 93]
  ------------------
  190|      7|    return false;
  191|      7|  }
  192|     93|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 4, False: 89]
  ------------------
  193|      4|    return false;
  194|      4|  }
  195|     89|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 48, False: 41]
  ------------------
  196|     48|    return true;
  197|     48|  }
  198|     41|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 5, False: 36]
  ------------------
  199|      5|    return false;
  200|      5|  }
  201|     36|  num_decoded_points_ = 0;
  202|       |
  203|     36|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 2, False: 34]
  ------------------
  204|      2|    return false;
  205|      2|  }
  206|     34|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 30]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     30|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 27]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     27|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 25]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     25|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 22, False: 3]
  ------------------
  217|     22|    return false;
  218|     22|  }
  219|       |
  220|      3|  numbers_decoder_.EndDecoding();
  221|      3|  remaining_bits_decoder_.EndDecoding();
  222|      3|  axis_decoder_.EndDecoding();
  223|      3|  half_decoder_.EndDecoding();
  224|       |
  225|      3|  return true;
  226|     25|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     25|    uint32_t num_points, OutputIteratorT &oit) {
  254|     25|  typedef DecodingStatus Status;
  255|     25|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     25|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     25|  DecodingStatus init_status(num_points, 0, 0);
  258|     25|  std::stack<Status> status_stack;
  259|     25|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.37M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.37M, False: 3]
  ------------------
  263|  2.37M|    const DecodingStatus status = status_stack.top();
  264|  2.37M|    status_stack.pop();
  265|       |
  266|  2.37M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.37M|    const uint32_t last_axis = status.last_axis;
  268|  2.37M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.37M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.37M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.37M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.37M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.37M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.37M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.37M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.37M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.37M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.18M, False: 1.18M]
  ------------------
  285|  17.9M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 16.7M, False: 1.18M]
  ------------------
  286|  16.7M|        *oit = old_base;
  287|  16.7M|        ++oit;
  288|  16.7M|        ++num_decoded_points_;
  289|  16.7M|      }
  290|  1.18M|      continue;
  291|  1.18M|    }
  292|       |
  293|  1.18M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  1.18M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.54k, False: 1.18M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.54k|      axes_[0] = axis;
  300|  11.1k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 9.63k, False: 1.54k]
  ------------------
  301|  9.63k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  9.63k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 565, False: 9.06k]
  |  |  ------------------
  ------------------
  302|  9.63k|      }
  303|  4.18k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.65k, False: 1.53k]
  ------------------
  304|  21.6k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 18.9k, False: 2.63k]
  ------------------
  305|  18.9k|          p_[axes_[j]] = 0;
  306|  18.9k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  18.9k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 6.47k, False: 12.5k]
  ------------------
  308|  6.47k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 14, False: 6.46k]
  ------------------
  309|  6.47k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     14|              return false;
  311|     14|            }
  312|  6.47k|          }
  313|  18.9k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  18.9k|        }
  315|  2.63k|        *oit = p_;
  316|  2.63k|        ++oit;
  317|  2.63k|        ++num_decoded_points_;
  318|  2.63k|      }
  319|  1.53k|      continue;
  320|  1.54k|    }
  321|       |
  322|  1.18M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.18M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.18M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.18M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.18M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.18M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.18M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.18M|    uint32_t number = 0;
  334|  1.18M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.18M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.18M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 8, False: 1.18M]
  ------------------
  338|       |      // Invalid |number|.
  339|      8|      return false;
  340|      8|    }
  341|  1.18M|    first_half -= number;
  342|  1.18M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.18M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 600k, False: 587k]
  ------------------
  345|   600k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 598k, False: 1.77k]
  ------------------
  346|   598k|        std::swap(first_half, second_half);
  347|   598k|      }
  348|   600k|    }
  349|       |
  350|  1.18M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.18M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.18M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.18M, False: 46]
  ------------------
  353|  1.18M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.18M|    }
  355|  1.18M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.18M, False: 76]
  ------------------
  356|  1.18M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.18M|    }
  358|  1.18M|  }
  359|      3|  return true;
  360|     25|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  134|  2.64M|        : num_remaining_points(num_remaining_points_),
  135|  2.64M|          last_axis(last_axis_),
  136|  2.64M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|  1.32M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.32M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.32M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|     48|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|    138|      : bit_length_(0),
   87|    138|        num_points_(0),
   88|    138|        num_decoded_points_(0),
   89|    138|        dimension_(dimension),
   90|    138|        p_(dimension, 0),
   91|    138|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    138|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    138|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     84|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     84|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 2, False: 82]
  ------------------
  187|      2|    return false;
  188|      2|  }
  189|     82|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 7, False: 75]
  ------------------
  190|      7|    return false;
  191|      7|  }
  192|     75|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 75]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     75|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 23, False: 52]
  ------------------
  196|     23|    return true;
  197|     23|  }
  198|     52|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 1, False: 51]
  ------------------
  199|      1|    return false;
  200|      1|  }
  201|     51|  num_decoded_points_ = 0;
  202|       |
  203|     51|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 2, False: 49]
  ------------------
  204|      2|    return false;
  205|      2|  }
  206|     49|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 47]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     47|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 44]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     44|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 43]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     43|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 34, False: 9]
  ------------------
  217|     34|    return false;
  218|     34|  }
  219|       |
  220|      9|  numbers_decoder_.EndDecoding();
  221|      9|  remaining_bits_decoder_.EndDecoding();
  222|      9|  axis_decoder_.EndDecoding();
  223|      9|  half_decoder_.EndDecoding();
  224|       |
  225|      9|  return true;
  226|     43|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     43|    uint32_t num_points, OutputIteratorT &oit) {
  254|     43|  typedef DecodingStatus Status;
  255|     43|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     43|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     43|  DecodingStatus init_status(num_points, 0, 0);
  258|     43|  std::stack<Status> status_stack;
  259|     43|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  5.78M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 5.78M, False: 9]
  ------------------
  263|  5.78M|    const DecodingStatus status = status_stack.top();
  264|  5.78M|    status_stack.pop();
  265|       |
  266|  5.78M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  5.78M|    const uint32_t last_axis = status.last_axis;
  268|  5.78M|    const uint32_t stack_pos = status.stack_pos;
  269|  5.78M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  5.78M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  5.78M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 5.78M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  5.78M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  5.78M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 5.78M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  5.78M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  5.78M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.89M, False: 2.89M]
  ------------------
  285|   298M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 295M, False: 2.89M]
  ------------------
  286|   295M|        *oit = old_base;
  287|   295M|        ++oit;
  288|   295M|        ++num_decoded_points_;
  289|   295M|      }
  290|  2.89M|      continue;
  291|  2.89M|    }
  292|       |
  293|  2.89M|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  2.89M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 2.24k, False: 2.89M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  2.24k|      axes_[0] = axis;
  300|  16.7k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 14.4k, False: 2.24k]
  ------------------
  301|  14.4k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  14.4k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 413, False: 14.0k]
  |  |  ------------------
  ------------------
  302|  14.4k|      }
  303|  6.16k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.93k, False: 2.23k]
  ------------------
  304|  32.9k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 29.0k, False: 3.91k]
  ------------------
  305|  29.0k|          p_[axes_[j]] = 0;
  306|  29.0k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  29.0k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 4.96k, False: 24.0k]
  ------------------
  308|  4.96k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 18, False: 4.94k]
  ------------------
  309|  4.96k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     18|              return false;
  311|     18|            }
  312|  4.96k|          }
  313|  29.0k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  29.0k|        }
  315|  3.91k|        *oit = p_;
  316|  3.91k|        ++oit;
  317|  3.91k|        ++num_decoded_points_;
  318|  3.91k|      }
  319|  2.23k|      continue;
  320|  2.24k|    }
  321|       |
  322|  2.89M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 2.89M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  2.89M|    const int num_remaining_bits = bit_length_ - level;
  327|  2.89M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  2.89M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  2.89M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  2.89M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  2.89M|    uint32_t number = 0;
  334|  2.89M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  2.89M|    uint32_t first_half = num_remaining_points / 2;
  337|  2.89M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 16, False: 2.89M]
  ------------------
  338|       |      // Invalid |number|.
  339|     16|      return false;
  340|     16|    }
  341|  2.89M|    first_half -= number;
  342|  2.89M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  2.89M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.55M, False: 1.33M]
  ------------------
  345|  1.55M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.55M, False: 4.83k]
  ------------------
  346|  1.55M|        std::swap(first_half, second_half);
  347|  1.55M|      }
  348|  1.55M|    }
  349|       |
  350|  2.89M|    levels_stack_[stack_pos][axis] += 1;
  351|  2.89M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  2.89M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 2.89M, False: 74]
  ------------------
  353|  2.89M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  2.89M|    }
  355|  2.89M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.89M, False: 427]
  ------------------
  356|  2.89M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.89M|    }
  358|  2.89M|  }
  359|      9|  return true;
  360|     43|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  134|  6.06M|        : num_remaining_points(num_remaining_points_),
  135|  6.06M|          last_axis(last_axis_),
  136|  6.06M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  6.06M|    uint32_t last_axis) {
  232|  6.06M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 6.06M, Folded]
  ------------------
  233|  6.06M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  6.06M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 5.46M, False: 606k]
  |  |  ------------------
  ------------------
  234|  6.06M|  }
  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|  6.06M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  3.03M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  3.03M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  3.03M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|     23|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     54|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     54|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 54]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     54|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 53]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     53|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 53]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     53|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 10, False: 43]
  ------------------
  196|     10|    return true;
  197|     10|  }
  198|     43|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 1, False: 42]
  ------------------
  199|      1|    return false;
  200|      1|  }
  201|     42|  num_decoded_points_ = 0;
  202|       |
  203|     42|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 6, False: 36]
  ------------------
  204|      6|    return false;
  205|      6|  }
  206|     36|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 9, False: 27]
  ------------------
  207|      9|    return false;
  208|      9|  }
  209|     27|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 27]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     27|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 26]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     26|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 25, False: 1]
  ------------------
  217|     25|    return false;
  218|     25|  }
  219|       |
  220|      1|  numbers_decoder_.EndDecoding();
  221|      1|  remaining_bits_decoder_.EndDecoding();
  222|      1|  axis_decoder_.EndDecoding();
  223|      1|  half_decoder_.EndDecoding();
  224|       |
  225|      1|  return true;
  226|     26|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     26|    uint32_t num_points, OutputIteratorT &oit) {
  254|     26|  typedef DecodingStatus Status;
  255|     26|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     26|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     26|  DecodingStatus init_status(num_points, 0, 0);
  258|     26|  std::stack<Status> status_stack;
  259|     26|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  13.7k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 13.7k, False: 1]
  ------------------
  263|  13.7k|    const DecodingStatus status = status_stack.top();
  264|  13.7k|    status_stack.pop();
  265|       |
  266|  13.7k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  13.7k|    const uint32_t last_axis = status.last_axis;
  268|  13.7k|    const uint32_t stack_pos = status.stack_pos;
  269|  13.7k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  13.7k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  13.7k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 13.7k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  13.7k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  13.7k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 13.7k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  13.7k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  13.7k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 803, False: 12.9k]
  ------------------
  285|  3.38k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 2.58k, False: 803]
  ------------------
  286|  2.58k|        *oit = old_base;
  287|  2.58k|        ++oit;
  288|  2.58k|        ++num_decoded_points_;
  289|  2.58k|      }
  290|    803|      continue;
  291|    803|    }
  292|       |
  293|  12.9k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  12.9k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.83k, False: 11.1k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.83k|      axes_[0] = axis;
  300|  3.99k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.16k, False: 1.83k]
  ------------------
  301|  2.16k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.16k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 489, False: 1.67k]
  |  |  ------------------
  ------------------
  302|  2.16k|      }
  303|  4.85k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.02k, False: 1.82k]
  ------------------
  304|  9.63k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 6.61k, False: 3.01k]
  ------------------
  305|  6.61k|          p_[axes_[j]] = 0;
  306|  6.61k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  6.61k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 5.69k, False: 917]
  ------------------
  308|  5.69k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 6, False: 5.69k]
  ------------------
  309|  5.69k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      6|              return false;
  311|      6|            }
  312|  5.69k|          }
  313|  6.60k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  6.60k|        }
  315|  3.01k|        *oit = p_;
  316|  3.01k|        ++oit;
  317|  3.01k|        ++num_decoded_points_;
  318|  3.01k|      }
  319|  1.82k|      continue;
  320|  1.83k|    }
  321|       |
  322|  11.1k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 11.1k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  11.1k|    const int num_remaining_bits = bit_length_ - level;
  327|  11.1k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  11.1k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  11.1k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  11.1k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  11.1k|    uint32_t number = 0;
  334|  11.1k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  11.1k|    uint32_t first_half = num_remaining_points / 2;
  337|  11.1k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 19, False: 11.1k]
  ------------------
  338|       |      // Invalid |number|.
  339|     19|      return false;
  340|     19|    }
  341|  11.1k|    first_half -= number;
  342|  11.1k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  11.1k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 10.0k, False: 1.12k]
  ------------------
  345|  10.0k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 7.94k, False: 2.05k]
  ------------------
  346|  7.94k|        std::swap(first_half, second_half);
  347|  7.94k|      }
  348|  10.0k|    }
  349|       |
  350|  11.1k|    levels_stack_[stack_pos][axis] += 1;
  351|  11.1k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  11.1k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 9.45k, False: 1.66k]
  ------------------
  353|  9.45k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  9.45k|    }
  355|  11.1k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 4.79k, False: 6.33k]
  ------------------
  356|  4.79k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  4.79k|    }
  358|  11.1k|  }
  359|      1|  return true;
  360|     26|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  134|  87.4k|        : num_remaining_points(num_remaining_points_),
  135|  87.4k|          last_axis(last_axis_),
  136|  87.4k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  127|  47.7k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  47.7k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  47.7k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  118|      9|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|     82|      : bit_length_(0),
   87|     82|        num_points_(0),
   88|     82|        num_decoded_points_(0),
   89|     82|        dimension_(dimension),
   90|     82|        p_(dimension, 0),
   91|     82|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     82|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     82|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|     57|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     57|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 57]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     57|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 7, False: 50]
  ------------------
  190|      7|    return false;
  191|      7|  }
  192|     50|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 50]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     50|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 12, False: 38]
  ------------------
  196|     12|    return true;
  197|     12|  }
  198|     38|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 38]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     38|  num_decoded_points_ = 0;
  202|       |
  203|     38|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 0, False: 38]
  ------------------
  204|      0|    return false;
  205|      0|  }
  206|     38|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 37]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     37|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 5, False: 32]
  ------------------
  210|      5|    return false;
  211|      5|  }
  212|     32|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 31]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     31|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 31, False: 0]
  ------------------
  217|     31|    return false;
  218|     31|  }
  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|     31|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     31|    uint32_t num_points, OutputIteratorT &oit) {
  254|     31|  typedef DecodingStatus Status;
  255|     31|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     31|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     31|  DecodingStatus init_status(num_points, 0, 0);
  258|     31|  std::stack<Status> status_stack;
  259|     31|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  23.4k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 23.4k, False: 0]
  ------------------
  263|  23.4k|    const DecodingStatus status = status_stack.top();
  264|  23.4k|    status_stack.pop();
  265|       |
  266|  23.4k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  23.4k|    const uint32_t last_axis = status.last_axis;
  268|  23.4k|    const uint32_t stack_pos = status.stack_pos;
  269|  23.4k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  23.4k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  23.4k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 23.4k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  23.4k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  23.4k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 23.4k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  23.4k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  23.4k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 3.83k, False: 19.6k]
  ------------------
  285|  11.4k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 7.62k, False: 3.83k]
  ------------------
  286|  7.62k|        *oit = old_base;
  287|  7.62k|        ++oit;
  288|  7.62k|        ++num_decoded_points_;
  289|  7.62k|      }
  290|  3.83k|      continue;
  291|  3.83k|    }
  292|       |
  293|  19.6k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  19.6k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 812, False: 18.7k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    812|      axes_[0] = axis;
  300|  1.82k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.00k, False: 812]
  ------------------
  301|  1.00k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.00k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 264, False: 744]
  |  |  ------------------
  ------------------
  302|  1.00k|      }
  303|  2.18k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.37k, False: 809]
  ------------------
  304|  4.47k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 3.10k, False: 1.37k]
  ------------------
  305|  3.10k|          p_[axes_[j]] = 0;
  306|  3.10k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  3.10k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.58k, False: 515]
  ------------------
  308|  2.58k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 3, False: 2.58k]
  ------------------
  309|  2.58k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      3|              return false;
  311|      3|            }
  312|  2.58k|          }
  313|  3.10k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  3.10k|        }
  315|  1.37k|        *oit = p_;
  316|  1.37k|        ++oit;
  317|  1.37k|        ++num_decoded_points_;
  318|  1.37k|      }
  319|    809|      continue;
  320|    812|    }
  321|       |
  322|  18.7k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 18.7k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  18.7k|    const int num_remaining_bits = bit_length_ - level;
  327|  18.7k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  18.7k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  18.7k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  18.7k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  18.7k|    uint32_t number = 0;
  334|  18.7k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  18.7k|    uint32_t first_half = num_remaining_points / 2;
  337|  18.7k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 28, False: 18.7k]
  ------------------
  338|       |      // Invalid |number|.
  339|     28|      return false;
  340|     28|    }
  341|  18.7k|    first_half -= number;
  342|  18.7k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  18.7k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 16.6k, False: 2.16k]
  ------------------
  345|  16.6k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 12.4k, False: 4.13k]
  ------------------
  346|  12.4k|        std::swap(first_half, second_half);
  347|  12.4k|      }
  348|  16.6k|    }
  349|       |
  350|  18.7k|    levels_stack_[stack_pos][axis] += 1;
  351|  18.7k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  18.7k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 15.1k, False: 3.65k]
  ------------------
  353|  15.1k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  15.1k|    }
  355|  18.7k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 8.75k, False: 10.0k]
  ------------------
  356|  8.75k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  8.75k|    }
  358|  18.7k|  }
  359|      0|  return true;
  360|     31|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  134|  35.0k|        : num_remaining_points(num_remaining_points_),
  135|  35.0k|          last_axis(last_axis_),
  136|  35.0k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  34.2k|    uint32_t last_axis) {
  232|  34.2k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 34.2k, Folded]
  ------------------
  233|  34.2k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  34.2k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 6.45k, False: 27.7k]
  |  |  ------------------
  ------------------
  234|  34.2k|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  34.2k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  127|  24.4k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  24.4k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  24.4k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  118|     12|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    129|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    129|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 128]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    128|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 125]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|    125|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 125]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    125|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 14, False: 111]
  ------------------
  196|     14|    return true;
  197|     14|  }
  198|    111|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 5, False: 106]
  ------------------
  199|      5|    return false;
  200|      5|  }
  201|    106|  num_decoded_points_ = 0;
  202|       |
  203|    106|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 4, False: 102]
  ------------------
  204|      4|    return false;
  205|      4|  }
  206|    102|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 101]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|    101|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 100]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|    100|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 99]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     99|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 43, False: 56]
  ------------------
  217|     43|    return false;
  218|     43|  }
  219|       |
  220|     56|  numbers_decoder_.EndDecoding();
  221|     56|  remaining_bits_decoder_.EndDecoding();
  222|     56|  axis_decoder_.EndDecoding();
  223|     56|  half_decoder_.EndDecoding();
  224|       |
  225|     56|  return true;
  226|     99|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     99|    uint32_t num_points, OutputIteratorT &oit) {
  254|     99|  typedef DecodingStatus Status;
  255|     99|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     99|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     99|  DecodingStatus init_status(num_points, 0, 0);
  258|     99|  std::stack<Status> status_stack;
  259|     99|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.02M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.02M, False: 56]
  ------------------
  263|  2.02M|    const DecodingStatus status = status_stack.top();
  264|  2.02M|    status_stack.pop();
  265|       |
  266|  2.02M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.02M|    const uint32_t last_axis = status.last_axis;
  268|  2.02M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.02M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.02M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.02M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.02M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.02M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.02M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.02M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.02M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.02M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 897k, False: 1.12M]
  ------------------
  285|  93.1M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 92.3M, False: 897k]
  ------------------
  286|  92.3M|        *oit = old_base;
  287|  92.3M|        ++oit;
  288|  92.3M|        ++num_decoded_points_;
  289|  92.3M|      }
  290|   897k|      continue;
  291|   897k|    }
  292|       |
  293|  1.12M|    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.12M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 79.7k, False: 1.04M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  79.7k|      axes_[0] = axis;
  300|   131k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 51.4k, False: 79.7k]
  ------------------
  301|  51.4k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  51.4k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 17.0k, False: 34.4k]
  |  |  ------------------
  ------------------
  302|  51.4k|      }
  303|   201k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 122k, False: 79.7k]
  ------------------
  304|   314k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 192k, False: 122k]
  ------------------
  305|   192k|          p_[axes_[j]] = 0;
  306|   192k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   192k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 164k, False: 27.9k]
  ------------------
  308|   164k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 37, False: 164k]
  ------------------
  309|   164k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     37|              return false;
  311|     37|            }
  312|   164k|          }
  313|   192k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   192k|        }
  315|   122k|        *oit = p_;
  316|   122k|        ++oit;
  317|   122k|        ++num_decoded_points_;
  318|   122k|      }
  319|  79.7k|      continue;
  320|  79.7k|    }
  321|       |
  322|  1.04M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.04M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.04M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.04M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.04M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.04M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.04M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.04M|    uint32_t number = 0;
  334|  1.04M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.04M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.04M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 6, False: 1.04M]
  ------------------
  338|       |      // Invalid |number|.
  339|      6|      return false;
  340|      6|    }
  341|  1.04M|    first_half -= number;
  342|  1.04M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.04M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 992k, False: 51.5k]
  ------------------
  345|   992k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 948k, False: 43.5k]
  ------------------
  346|   948k|        std::swap(first_half, second_half);
  347|   948k|      }
  348|   992k|    }
  349|       |
  350|  1.04M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.04M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.04M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.03M, False: 12.8k]
  ------------------
  353|  1.03M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.03M|    }
  355|  1.04M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 990k, False: 53.3k]
  ------------------
  356|   990k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   990k|    }
  358|  1.04M|  }
  359|     56|  return true;
  360|     99|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  134|  2.02M|        : num_remaining_points(num_remaining_points_),
  135|  2.02M|          last_axis(last_axis_),
  136|  2.02M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|  1.04M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.04M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.04M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     70|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|    148|      : bit_length_(0),
   87|    148|        num_points_(0),
   88|    148|        num_decoded_points_(0),
   89|    148|        dimension_(dimension),
   90|    148|        p_(dimension, 0),
   91|    148|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    148|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    148|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    156|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    156|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 156]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|    156|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 2, False: 154]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|    154|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 154]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    154|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 153]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|    153|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 12, False: 141]
  ------------------
  199|     12|    return false;
  200|     12|  }
  201|    141|  num_decoded_points_ = 0;
  202|       |
  203|    141|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 18, False: 123]
  ------------------
  204|     18|    return false;
  205|     18|  }
  206|    123|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 119]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|    119|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 6, False: 113]
  ------------------
  210|      6|    return false;
  211|      6|  }
  212|    113|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 112]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|    112|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 61, False: 51]
  ------------------
  217|     61|    return false;
  218|     61|  }
  219|       |
  220|     51|  numbers_decoder_.EndDecoding();
  221|     51|  remaining_bits_decoder_.EndDecoding();
  222|     51|  axis_decoder_.EndDecoding();
  223|     51|  half_decoder_.EndDecoding();
  224|       |
  225|     51|  return true;
  226|    112|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|    112|    uint32_t num_points, OutputIteratorT &oit) {
  254|    112|  typedef DecodingStatus Status;
  255|    112|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|    112|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|    112|  DecodingStatus init_status(num_points, 0, 0);
  258|    112|  std::stack<Status> status_stack;
  259|    112|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  3.24M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 3.24M, False: 51]
  ------------------
  263|  3.24M|    const DecodingStatus status = status_stack.top();
  264|  3.24M|    status_stack.pop();
  265|       |
  266|  3.24M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  3.24M|    const uint32_t last_axis = status.last_axis;
  268|  3.24M|    const uint32_t stack_pos = status.stack_pos;
  269|  3.24M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  3.24M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  3.24M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 3.24M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  3.24M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  3.24M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 3.24M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  3.24M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  3.24M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.39M, False: 1.84M]
  ------------------
  285|   151M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 150M, False: 1.39M]
  ------------------
  286|   150M|        *oit = old_base;
  287|   150M|        ++oit;
  288|   150M|        ++num_decoded_points_;
  289|   150M|      }
  290|  1.39M|      continue;
  291|  1.39M|    }
  292|       |
  293|  1.84M|    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.84M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 89.0k, False: 1.75M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  89.0k|      axes_[0] = axis;
  300|   273k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 184k, False: 89.0k]
  ------------------
  301|   184k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   184k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 14.1k, False: 170k]
  |  |  ------------------
  ------------------
  302|   184k|      }
  303|   215k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 126k, False: 89.0k]
  ------------------
  304|   563k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 436k, False: 126k]
  ------------------
  305|   436k|          p_[axes_[j]] = 0;
  306|   436k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   436k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 162k, False: 273k]
  ------------------
  308|   162k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 60, False: 162k]
  ------------------
  309|   162k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     60|              return false;
  311|     60|            }
  312|   162k|          }
  313|   436k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   436k|        }
  315|   126k|        *oit = p_;
  316|   126k|        ++oit;
  317|   126k|        ++num_decoded_points_;
  318|   126k|      }
  319|  89.0k|      continue;
  320|  89.0k|    }
  321|       |
  322|  1.75M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.75M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.75M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.75M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.75M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.75M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.75M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.75M|    uint32_t number = 0;
  334|  1.75M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.75M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.75M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 1.75M]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|  1.75M|    first_half -= number;
  342|  1.75M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.75M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.73M, False: 29.0k]
  ------------------
  345|  1.73M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.63M, False: 95.2k]
  ------------------
  346|  1.63M|        std::swap(first_half, second_half);
  347|  1.63M|      }
  348|  1.73M|    }
  349|       |
  350|  1.75M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.75M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.75M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.69M, False: 61.3k]
  ------------------
  353|  1.69M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.69M|    }
  355|  1.75M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.54M, False: 215k]
  ------------------
  356|  1.54M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.54M|    }
  358|  1.75M|  }
  359|     51|  return true;
  360|    112|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  134|  3.24M|        : num_remaining_points(num_remaining_points_),
  135|  3.24M|          last_axis(last_axis_),
  136|  3.24M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  3.24M|    uint32_t last_axis) {
  232|  3.24M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 3.24M, Folded]
  ------------------
  233|  3.24M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  3.24M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.13M, False: 2.10M]
  |  |  ------------------
  ------------------
  234|  3.24M|  }
  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.24M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|  1.75M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.75M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.75M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     52|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    110|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    110|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 110]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|    110|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 109]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|    109|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 109]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    109|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 46, False: 63]
  ------------------
  196|     46|    return true;
  197|     46|  }
  198|     63|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 1, False: 62]
  ------------------
  199|      1|    return false;
  200|      1|  }
  201|     62|  num_decoded_points_ = 0;
  202|       |
  203|     62|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 5, False: 57]
  ------------------
  204|      5|    return false;
  205|      5|  }
  206|     57|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 55]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     55|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 52]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     52|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 49]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|       |
  216|     49|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 23, False: 26]
  ------------------
  217|     23|    return false;
  218|     23|  }
  219|       |
  220|     26|  numbers_decoder_.EndDecoding();
  221|     26|  remaining_bits_decoder_.EndDecoding();
  222|     26|  axis_decoder_.EndDecoding();
  223|     26|  half_decoder_.EndDecoding();
  224|       |
  225|     26|  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|   193k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 193k, False: 26]
  ------------------
  263|   193k|    const DecodingStatus status = status_stack.top();
  264|   193k|    status_stack.pop();
  265|       |
  266|   193k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   193k|    const uint32_t last_axis = status.last_axis;
  268|   193k|    const uint32_t stack_pos = status.stack_pos;
  269|   193k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   193k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   193k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 193k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   193k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   193k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 7, False: 193k]
  ------------------
  278|      7|      return false;
  279|      7|    }
  280|       |
  281|   193k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   193k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 105, False: 193k]
  ------------------
  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|   193k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   193k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 134, False: 193k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    134|      axes_[0] = axis;
  300|  9.05k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 8.92k, False: 134]
  ------------------
  301|  8.92k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  8.92k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 111, False: 8.81k]
  |  |  ------------------
  ------------------
  302|  8.92k|      }
  303|    305|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 178, False: 127]
  ------------------
  304|  10.9k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 10.7k, False: 171]
  ------------------
  305|  10.7k|          p_[axes_[j]] = 0;
  306|  10.7k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  10.7k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 10.4k, False: 312]
  ------------------
  308|  10.4k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 7, False: 10.4k]
  ------------------
  309|  10.4k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      7|              return false;
  311|      7|            }
  312|  10.4k|          }
  313|  10.7k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  10.7k|        }
  315|    171|        *oit = p_;
  316|    171|        ++oit;
  317|    171|        ++num_decoded_points_;
  318|    171|      }
  319|    127|      continue;
  320|    134|    }
  321|       |
  322|   193k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 193k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   193k|    const int num_remaining_bits = bit_length_ - level;
  327|   193k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   193k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   193k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   193k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   193k|    uint32_t number = 0;
  334|   193k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   193k|    uint32_t first_half = num_remaining_points / 2;
  337|   193k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 9, False: 193k]
  ------------------
  338|       |      // Invalid |number|.
  339|      9|      return false;
  340|      9|    }
  341|   193k|    first_half -= number;
  342|   193k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   193k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 193k, False: 15]
  ------------------
  345|   193k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 159k, False: 33.9k]
  ------------------
  346|   159k|        std::swap(first_half, second_half);
  347|   159k|      }
  348|   193k|    }
  349|       |
  350|   193k|    levels_stack_[stack_pos][axis] += 1;
  351|   193k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   193k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 159k, False: 33.9k]
  ------------------
  353|   159k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   159k|    }
  355|   193k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 34.1k, False: 159k]
  ------------------
  356|  34.1k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  34.1k|    }
  358|   193k|  }
  359|     26|  return true;
  360|     49|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  134|   193k|        : num_remaining_points(num_remaining_points_),
  135|   193k|          last_axis(last_axis_),
  136|   193k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|   193k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   193k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   193k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     71|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|    112|      : bit_length_(0),
   87|    112|        num_points_(0),
   88|    112|        num_decoded_points_(0),
   89|    112|        dimension_(dimension),
   90|    112|        p_(dimension, 0),
   91|    112|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    112|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    112|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     36|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     36|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     36|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|     99|      : bit_length_(0),
   87|     99|        num_points_(0),
   88|     99|        num_decoded_points_(0),
   89|     99|        dimension_(dimension),
   90|     99|        p_(dimension, 0),
   91|     99|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     99|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     99|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     53|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     53|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     53|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     37|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     37|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     37|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|     91|      : bit_length_(0),
   87|     91|        num_points_(0),
   88|     91|        num_decoded_points_(0),
   89|     91|        dimension_(dimension),
   90|     91|        p_(dimension, 0),
   91|     91|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|     91|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|     91|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     27|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     27|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     27|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|    158|      : bit_length_(0),
   87|    158|        num_points_(0),
   88|    158|        num_decoded_points_(0),
   89|    158|        dimension_(dimension),
   90|    158|        p_(dimension, 0),
   91|    158|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    158|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    158|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      2|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      2|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.64M|    uint32_t last_axis) {
  232|  2.64M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.64M, Folded]
  ------------------
  233|  2.64M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.64M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.44M, False: 205k]
  |  |  ------------------
  ------------------
  234|  2.64M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  2.64M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  86.6k|    uint32_t last_axis) {
  232|  86.6k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 86.6k, Folded]
  ------------------
  233|  86.6k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  86.6k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 23.7k, False: 62.9k]
  |  |  ------------------
  ------------------
  234|  86.6k|  }
  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|  86.6k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.02M|    uint32_t last_axis) {
  232|  2.02M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.02M, Folded]
  ------------------
  233|  2.02M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.02M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.79M, False: 226k]
  |  |  ------------------
  ------------------
  234|  2.02M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  2.02M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   193k|    uint32_t last_axis) {
  232|   193k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded, False: 193k]
  ------------------
  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|   193k|  uint32_t best_axis = 0;
  237|   193k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 193k, False: 64]
  ------------------
  238|  29.9M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 29.7M, False: 193k]
  ------------------
  239|  29.7M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 191k, False: 29.6M]
  ------------------
  240|   191k|        best_axis = axis;
  241|   191k|      }
  242|  29.7M|    }
  243|   193k|  } else {
  244|     64|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|     64|  }
  246|       |
  247|   193k|  return best_axis;
  248|   193k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     33|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     33|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     33|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     33|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     33|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 33]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     33|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 2, False: 31]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|     31|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 31]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     31|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 31]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     31|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 31]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     31|  num_decoded_points_ = 0;
  202|       |
  203|     31|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 7, False: 24]
  ------------------
  204|      7|    return false;
  205|      7|  }
  206|     24|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 5, False: 19]
  ------------------
  207|      5|    return false;
  208|      5|  }
  209|     19|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 19]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     19|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 18]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     18|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 17, False: 1]
  ------------------
  217|     17|    return false;
  218|     17|  }
  219|       |
  220|      1|  numbers_decoder_.EndDecoding();
  221|      1|  remaining_bits_decoder_.EndDecoding();
  222|      1|  axis_decoder_.EndDecoding();
  223|      1|  half_decoder_.EndDecoding();
  224|       |
  225|      1|  return true;
  226|     18|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     18|    uint32_t num_points, OutputIteratorT &oit) {
  254|     18|  typedef DecodingStatus Status;
  255|     18|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     18|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     18|  DecodingStatus init_status(num_points, 0, 0);
  258|     18|  std::stack<Status> status_stack;
  259|     18|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   272k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 272k, False: 1]
  ------------------
  263|   272k|    const DecodingStatus status = status_stack.top();
  264|   272k|    status_stack.pop();
  265|       |
  266|   272k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   272k|    const uint32_t last_axis = status.last_axis;
  268|   272k|    const uint32_t stack_pos = status.stack_pos;
  269|   272k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   272k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   272k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 272k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   272k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   272k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 272k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   272k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   272k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 135k, False: 136k]
  ------------------
  285|  14.2M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 14.1M, False: 135k]
  ------------------
  286|  14.1M|        *oit = old_base;
  287|  14.1M|        ++oit;
  288|  14.1M|        ++num_decoded_points_;
  289|  14.1M|      }
  290|   135k|      continue;
  291|   135k|    }
  292|       |
  293|   136k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   136k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 558, False: 136k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    558|      axes_[0] = axis;
  300|  1.67k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.11k, False: 558]
  ------------------
  301|  1.11k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.11k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 159, False: 957]
  |  |  ------------------
  ------------------
  302|  1.11k|      }
  303|  1.47k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 925, False: 548]
  ------------------
  304|  3.67k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 2.76k, False: 915]
  ------------------
  305|  2.76k|          p_[axes_[j]] = 0;
  306|  2.76k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  2.76k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.31k, False: 1.44k]
  ------------------
  308|  1.31k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 10, False: 1.30k]
  ------------------
  309|  1.31k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     10|              return false;
  311|     10|            }
  312|  1.31k|          }
  313|  2.75k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  2.75k|        }
  315|    915|        *oit = p_;
  316|    915|        ++oit;
  317|    915|        ++num_decoded_points_;
  318|    915|      }
  319|    548|      continue;
  320|    558|    }
  321|       |
  322|   136k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 136k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   136k|    const int num_remaining_bits = bit_length_ - level;
  327|   136k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   136k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   136k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   136k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   136k|    uint32_t number = 0;
  334|   136k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   136k|    uint32_t first_half = num_remaining_points / 2;
  337|   136k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 7, False: 136k]
  ------------------
  338|       |      // Invalid |number|.
  339|      7|      return false;
  340|      7|    }
  341|   136k|    first_half -= number;
  342|   136k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   136k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 78.8k, False: 57.3k]
  ------------------
  345|  78.8k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 78.3k, False: 466]
  ------------------
  346|  78.3k|        std::swap(first_half, second_half);
  347|  78.3k|      }
  348|  78.8k|    }
  349|       |
  350|   136k|    levels_stack_[stack_pos][axis] += 1;
  351|   136k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   136k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 136k, False: 9]
  ------------------
  353|   136k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   136k|    }
  355|   136k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 136k, False: 9]
  ------------------
  356|   136k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   136k|    }
  358|   136k|  }
  359|      1|  return true;
  360|     18|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     15|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     15|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     15|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     15|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 15]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     15|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 4, False: 11]
  ------------------
  190|      4|    return false;
  191|      4|  }
  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: 0, False: 11]
  ------------------
  196|      0|    return true;
  197|      0|  }
  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: 0, False: 11]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     11|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 11]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     11|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 11]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     11|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 10, False: 1]
  ------------------
  217|     10|    return false;
  218|     10|  }
  219|       |
  220|      1|  numbers_decoder_.EndDecoding();
  221|      1|  remaining_bits_decoder_.EndDecoding();
  222|      1|  axis_decoder_.EndDecoding();
  223|      1|  half_decoder_.EndDecoding();
  224|       |
  225|      1|  return true;
  226|     11|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  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|   278k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 278k, False: 1]
  ------------------
  263|   278k|    const DecodingStatus status = status_stack.top();
  264|   278k|    status_stack.pop();
  265|       |
  266|   278k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   278k|    const uint32_t last_axis = status.last_axis;
  268|   278k|    const uint32_t stack_pos = status.stack_pos;
  269|   278k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   278k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   278k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 278k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   278k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   278k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 278k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   278k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   278k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 138k, False: 139k]
  ------------------
  285|   352k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 213k, False: 138k]
  ------------------
  286|   213k|        *oit = old_base;
  287|   213k|        ++oit;
  288|   213k|        ++num_decoded_points_;
  289|   213k|      }
  290|   138k|      continue;
  291|   138k|    }
  292|       |
  293|   139k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   139k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 589, False: 139k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    589|      axes_[0] = axis;
  300|  1.76k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.17k, False: 589]
  ------------------
  301|  1.17k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.17k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 78, False: 1.10k]
  |  |  ------------------
  ------------------
  302|  1.17k|      }
  303|  1.60k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.02k, False: 582]
  ------------------
  304|  4.08k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 3.06k, False: 1.01k]
  ------------------
  305|  3.06k|          p_[axes_[j]] = 0;
  306|  3.06k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  3.06k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.35k, False: 1.71k]
  ------------------
  308|  1.35k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 7, False: 1.34k]
  ------------------
  309|  1.35k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      7|              return false;
  311|      7|            }
  312|  1.35k|          }
  313|  3.05k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  3.05k|        }
  315|  1.01k|        *oit = p_;
  316|  1.01k|        ++oit;
  317|  1.01k|        ++num_decoded_points_;
  318|  1.01k|      }
  319|    582|      continue;
  320|    589|    }
  321|       |
  322|   139k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 139k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   139k|    const int num_remaining_bits = bit_length_ - level;
  327|   139k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   139k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   139k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   139k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   139k|    uint32_t number = 0;
  334|   139k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   139k|    uint32_t first_half = num_remaining_points / 2;
  337|   139k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 3, False: 139k]
  ------------------
  338|       |      // Invalid |number|.
  339|      3|      return false;
  340|      3|    }
  341|   139k|    first_half -= number;
  342|   139k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   139k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 81.6k, False: 57.6k]
  ------------------
  345|  81.6k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 81.3k, False: 336]
  ------------------
  346|  81.3k|        std::swap(first_half, second_half);
  347|  81.3k|      }
  348|  81.6k|    }
  349|       |
  350|   139k|    levels_stack_[stack_pos][axis] += 1;
  351|   139k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   139k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 139k, False: 0]
  ------------------
  353|   139k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   139k|    }
  355|   139k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 139k, False: 7]
  ------------------
  356|   139k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   139k|    }
  358|   139k|  }
  359|      1|  return true;
  360|     11|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     28|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     28|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     28|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     28|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     28|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 28]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     28|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 28]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|     28|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 28]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     28|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 28]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     28|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 28]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     28|  num_decoded_points_ = 0;
  202|       |
  203|     28|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 3, False: 25]
  ------------------
  204|      3|    return false;
  205|      3|  }
  206|     25|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 25]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|     25|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 25]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|     25|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 25]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     25|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 24, False: 1]
  ------------------
  217|     24|    return false;
  218|     24|  }
  219|       |
  220|      1|  numbers_decoder_.EndDecoding();
  221|      1|  remaining_bits_decoder_.EndDecoding();
  222|      1|  axis_decoder_.EndDecoding();
  223|      1|  half_decoder_.EndDecoding();
  224|       |
  225|      1|  return true;
  226|     25|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     25|    uint32_t num_points, OutputIteratorT &oit) {
  254|     25|  typedef DecodingStatus Status;
  255|     25|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     25|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     25|  DecodingStatus init_status(num_points, 0, 0);
  258|     25|  std::stack<Status> status_stack;
  259|     25|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  72.8k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 72.8k, False: 1]
  ------------------
  263|  72.8k|    const DecodingStatus status = status_stack.top();
  264|  72.8k|    status_stack.pop();
  265|       |
  266|  72.8k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  72.8k|    const uint32_t last_axis = status.last_axis;
  268|  72.8k|    const uint32_t stack_pos = status.stack_pos;
  269|  72.8k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  72.8k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  72.8k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 72.8k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  72.8k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  72.8k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 72.8k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  72.8k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  72.8k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 35.9k, False: 36.9k]
  ------------------
  285|  2.93M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 2.90M, False: 35.9k]
  ------------------
  286|  2.90M|        *oit = old_base;
  287|  2.90M|        ++oit;
  288|  2.90M|        ++num_decoded_points_;
  289|  2.90M|      }
  290|  35.9k|      continue;
  291|  35.9k|    }
  292|       |
  293|  36.9k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  36.9k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 271, False: 36.6k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    271|      axes_[0] = axis;
  300|    813|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 542, False: 271]
  ------------------
  301|    542|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    542|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 154, False: 388]
  |  |  ------------------
  ------------------
  302|    542|      }
  303|    714|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 447, False: 267]
  ------------------
  304|  1.78k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 1.33k, False: 443]
  ------------------
  305|  1.33k|          p_[axes_[j]] = 0;
  306|  1.33k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  1.33k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.02k, False: 308]
  ------------------
  308|  1.02k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 4, False: 1.02k]
  ------------------
  309|  1.02k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      4|              return false;
  311|      4|            }
  312|  1.02k|          }
  313|  1.33k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  1.33k|        }
  315|    443|        *oit = p_;
  316|    443|        ++oit;
  317|    443|        ++num_decoded_points_;
  318|    443|      }
  319|    267|      continue;
  320|    271|    }
  321|       |
  322|  36.6k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 36.6k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  36.6k|    const int num_remaining_bits = bit_length_ - level;
  327|  36.6k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  36.6k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  36.6k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  36.6k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  36.6k|    uint32_t number = 0;
  334|  36.6k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  36.6k|    uint32_t first_half = num_remaining_points / 2;
  337|  36.6k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 20, False: 36.6k]
  ------------------
  338|       |      // Invalid |number|.
  339|     20|      return false;
  340|     20|    }
  341|  36.6k|    first_half -= number;
  342|  36.6k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  36.6k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 23.1k, False: 13.4k]
  ------------------
  345|  23.1k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 19.3k, False: 3.80k]
  ------------------
  346|  19.3k|        std::swap(first_half, second_half);
  347|  19.3k|      }
  348|  23.1k|    }
  349|       |
  350|  36.6k|    levels_stack_[stack_pos][axis] += 1;
  351|  36.6k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  36.6k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 36.5k, False: 54]
  ------------------
  353|  36.5k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  36.5k|    }
  355|  36.6k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 36.5k, False: 34]
  ------------------
  356|  36.5k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  36.5k|    }
  358|  36.6k|  }
  359|      1|  return true;
  360|     25|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     34|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     34|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     34|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     34|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     34|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 34]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     34|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 33]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     33|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 33]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     33|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 33]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     33|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 33]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     33|  num_decoded_points_ = 0;
  202|       |
  203|     33|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 5, False: 28]
  ------------------
  204|      5|    return false;
  205|      5|  }
  206|     28|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 25]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     25|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 24]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     24|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 24]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|     24|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 23, False: 1]
  ------------------
  217|     23|    return false;
  218|     23|  }
  219|       |
  220|      1|  numbers_decoder_.EndDecoding();
  221|      1|  remaining_bits_decoder_.EndDecoding();
  222|      1|  axis_decoder_.EndDecoding();
  223|      1|  half_decoder_.EndDecoding();
  224|       |
  225|      1|  return true;
  226|     24|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     24|    uint32_t num_points, OutputIteratorT &oit) {
  254|     24|  typedef DecodingStatus Status;
  255|     24|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     24|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     24|  DecodingStatus init_status(num_points, 0, 0);
  258|     24|  std::stack<Status> status_stack;
  259|     24|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  10.7k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 10.7k, False: 1]
  ------------------
  263|  10.7k|    const DecodingStatus status = status_stack.top();
  264|  10.7k|    status_stack.pop();
  265|       |
  266|  10.7k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  10.7k|    const uint32_t last_axis = status.last_axis;
  268|  10.7k|    const uint32_t stack_pos = status.stack_pos;
  269|  10.7k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  10.7k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  10.7k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 10.7k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  10.7k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  10.7k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 10.7k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  10.7k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  10.7k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 4.25k, False: 6.53k]
  ------------------
  285|  22.6k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 18.3k, False: 4.25k]
  ------------------
  286|  18.3k|        *oit = old_base;
  287|  18.3k|        ++oit;
  288|  18.3k|        ++num_decoded_points_;
  289|  18.3k|      }
  290|  4.25k|      continue;
  291|  4.25k|    }
  292|       |
  293|  6.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|  6.53k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 925, False: 5.60k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    925|      axes_[0] = axis;
  300|  2.77k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.85k, False: 925]
  ------------------
  301|  1.85k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.85k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 550, False: 1.30k]
  |  |  ------------------
  ------------------
  302|  1.85k|      }
  303|  2.51k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.59k, False: 920]
  ------------------
  304|  6.35k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 4.76k, False: 1.58k]
  ------------------
  305|  4.76k|          p_[axes_[j]] = 0;
  306|  4.76k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  4.76k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 4.34k, False: 424]
  ------------------
  308|  4.34k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 5, False: 4.34k]
  ------------------
  309|  4.34k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|      5|              return false;
  311|      5|            }
  312|  4.34k|          }
  313|  4.76k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  4.76k|        }
  315|  1.58k|        *oit = p_;
  316|  1.58k|        ++oit;
  317|  1.58k|        ++num_decoded_points_;
  318|  1.58k|      }
  319|    920|      continue;
  320|    925|    }
  321|       |
  322|  5.60k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 5.60k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  5.60k|    const int num_remaining_bits = bit_length_ - level;
  327|  5.60k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  5.60k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  5.60k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  5.60k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  5.60k|    uint32_t number = 0;
  334|  5.60k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  5.60k|    uint32_t first_half = num_remaining_points / 2;
  337|  5.60k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 18, False: 5.58k]
  ------------------
  338|       |      // Invalid |number|.
  339|     18|      return false;
  340|     18|    }
  341|  5.58k|    first_half -= number;
  342|  5.58k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  5.58k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 3.30k, False: 2.28k]
  ------------------
  345|  3.30k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 2.31k, False: 989]
  ------------------
  346|  2.31k|        std::swap(first_half, second_half);
  347|  2.31k|      }
  348|  3.30k|    }
  349|       |
  350|  5.58k|    levels_stack_[stack_pos][axis] += 1;
  351|  5.58k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  5.58k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 5.56k, False: 25]
  ------------------
  353|  5.56k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  5.56k|    }
  355|  5.58k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 5.53k, False: 57]
  ------------------
  356|  5.53k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  5.53k|    }
  358|  5.58k|  }
  359|      1|  return true;
  360|     24|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     19|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     19|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     19|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     19|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     19|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 19]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     19|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 18]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     18|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 18]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     18|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 5, False: 13]
  ------------------
  196|      5|    return true;
  197|      5|  }
  198|     13|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 13]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     13|  num_decoded_points_ = 0;
  202|       |
  203|     13|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 13, False: 0]
  ------------------
  204|     13|    return false;
  205|     13|  }
  206|      0|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 0, False: 0]
  ------------------
  207|      0|    return false;
  208|      0|  }
  209|      0|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 0, False: 0]
  ------------------
  210|      0|    return false;
  211|      0|  }
  212|      0|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 0, False: 0]
  ------------------
  213|      0|    return false;
  214|      0|  }
  215|       |
  216|      0|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 0, False: 0]
  ------------------
  217|      0|    return false;
  218|      0|  }
  219|       |
  220|      0|  numbers_decoder_.EndDecoding();
  221|      0|  remaining_bits_decoder_.EndDecoding();
  222|      0|  axis_decoder_.EndDecoding();
  223|      0|  half_decoder_.EndDecoding();
  224|       |
  225|      0|  return true;
  226|      0|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|      2|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      2|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      2|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_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|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_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|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_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|}

_ZN5draco22FloatPointsTreeDecoderC2Ev:
   65|    140|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|    140|  qinfo_.quantization_bits = 0;
   67|    140|  qinfo_.range = 0;
   68|    140|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|    139|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|    139|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 0, False: 139]
  ------------------
   73|      0|    return false;
   74|      0|  }
   75|    139|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 0, False: 139]
  ------------------
   76|      0|    return false;
   77|      0|  }
   78|    139|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 0, False: 139]
  ------------------
   79|      0|    return false;
   80|      0|  }
   81|    139|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 0, False: 139]
  ------------------
   82|      0|    return false;
   83|      0|  }
   84|    139|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 5, False: 134]
  |  Branch (84:38): [True: 3, False: 2]
  ------------------
   85|      3|    return false;
   86|      3|  }
   87|    136|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 0, False: 136]
  ------------------
   88|      0|    return false;
   89|      0|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|    136|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 3, False: 133]
  ------------------
   93|      3|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|      3|#define DRACO_LOGE printf
  ------------------
   94|      3|               compression_level_);
   95|      3|    return false;
   96|      3|  }
   97|       |
   98|    133|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|    133|      std::back_inserter(*qpoints);
  100|    133|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|    133|                           Converter>
  102|    133|      oit(oit_qpoints);
  103|    133|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 133, False: 0]
  ------------------
  104|    133|    qpoints->reserve(num_points_);
  105|    133|    switch (compression_level_) {
  106|     33|      case 0: {
  ------------------
  |  Branch (106:7): [True: 33, False: 100]
  ------------------
  107|     33|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|     33|        qpoints_decoder.DecodePoints(buffer, oit);
  109|     33|        break;
  110|      0|      }
  111|     15|      case 1: {
  ------------------
  |  Branch (111:7): [True: 15, False: 118]
  ------------------
  112|     15|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|     15|        qpoints_decoder.DecodePoints(buffer, oit);
  114|     15|        break;
  115|      0|      }
  116|     28|      case 2: {
  ------------------
  |  Branch (116:7): [True: 28, False: 105]
  ------------------
  117|     28|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|     28|        qpoints_decoder.DecodePoints(buffer, oit);
  119|     28|        break;
  120|      0|      }
  121|     34|      case 3: {
  ------------------
  |  Branch (121:7): [True: 34, False: 99]
  ------------------
  122|     34|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|     34|        qpoints_decoder.DecodePoints(buffer, oit);
  124|     34|        break;
  125|      0|      }
  126|     19|      case 4: {
  ------------------
  |  Branch (126:7): [True: 19, False: 114]
  ------------------
  127|     19|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     19|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     19|        break;
  130|      0|      }
  131|      2|      case 5: {
  ------------------
  |  Branch (131:7): [True: 2, False: 131]
  ------------------
  132|      2|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|      2|        qpoints_decoder.DecodePoints(buffer, oit);
  134|      2|        break;
  135|      0|      }
  136|      2|      case 6: {
  ------------------
  |  Branch (136:7): [True: 2, False: 131]
  ------------------
  137|      2|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|      2|        qpoints_decoder.DecodePoints(buffer, oit);
  139|      2|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 133]
  ------------------
  142|      0|        return false;
  143|    133|    }
  144|    133|  }
  145|       |
  146|    133|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 130, False: 3]
  ------------------
  147|    130|    return false;
  148|    130|  }
  149|      3|  return true;
  150|    133|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|    133|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|  17.2M|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|  17.2M|  const Self &operator=(const SourceType &source) {
   56|  17.2M|    *oit_ = Converter()(source);
   57|  17.2M|    return *this;
   58|  17.2M|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|  17.2M|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|  17.2M|    return Point3ui(v[0], v[1], v[2]);
   31|  17.2M|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|  17.2M|  const Self &operator++() {
   46|  17.2M|    ++oit_;
   47|  17.2M|    return *this;
   48|  17.2M|  }

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  12.5M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  12.5M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 12.5M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  12.5M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  12.5M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|   504M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|   504M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 180, False: 504M]
  ------------------
   78|    180|      return false;  // Buffer overflow.
   79|    180|    }
   80|   504M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|   504M|    pos_ += size_to_decode;
   82|   504M|    return true;
   83|   504M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  25.0k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  5.64k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  32.5k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   175k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  3.28k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  12.5M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  3.48M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  4.33k|    inline void reset(const void *b, size_t s) {
  131|  4.33k|      bit_offset_ = 0;
  132|  4.33k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  4.33k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  4.33k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  3.86k|    inline uint64_t BitsDecoded() const {
  138|  3.86k|      return static_cast<uint64_t>(bit_offset_);
  139|  3.86k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  12.5M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  12.5M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 0, False: 12.5M]
  ------------------
  162|      0|        return false;
  163|      0|      }
  164|  12.5M|      uint32_t value = 0;
  165|  28.7M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 16.1M, False: 12.5M]
  ------------------
  166|  16.1M|        value |= GetBit() << bit;
  167|  16.1M|      }
  168|  12.5M|      *x = value;
  169|  12.5M|      return true;
  170|  12.5M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  16.1M|    inline int GetBit() {
  176|  16.1M|      const size_t off = bit_offset_;
  177|  16.1M|      const size_t byte_offset = off >> 3;
  178|  16.1M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  16.1M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 15.2M, False: 841k]
  ------------------
  180|  15.2M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  15.2M|        bit_offset_ = off + 1;
  182|  15.2M|        return bit;
  183|  15.2M|      }
  184|   841k|      return 0;
  185|  16.1M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  7.15M|  bool Decode(T *out_val) {
   69|  7.15M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 1.25k, False: 7.15M]
  ------------------
   70|  1.25k|      return false;
   71|  1.25k|    }
   72|  7.15M|    pos_ += sizeof(T);
   73|  7.15M|    return true;
   74|  7.15M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  7.15M|  bool Peek(T *out_val) {
   88|  7.15M|    const size_t size_to_decode = sizeof(T);
   89|  7.15M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 1.25k, False: 7.15M]
  ------------------
   90|  1.25k|      return false;  // Buffer overflow.
   91|  1.25k|    }
   92|  7.15M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  7.15M|    return true;
   94|  7.15M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  8.97k|  bool Decode(T *out_val) {
   69|  8.97k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 35, False: 8.94k]
  ------------------
   70|     35|      return false;
   71|     35|    }
   72|  8.94k|    pos_ += sizeof(T);
   73|  8.94k|    return true;
   74|  8.97k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  8.97k|  bool Peek(T *out_val) {
   88|  8.97k|    const size_t size_to_decode = sizeof(T);
   89|  8.97k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 35, False: 8.94k]
  ------------------
   90|     35|      return false;  // Buffer overflow.
   91|     35|    }
   92|  8.94k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  8.94k|    return true;
   94|  8.97k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   686k|  bool Decode(T *out_val) {
   69|   686k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 95, False: 685k]
  ------------------
   70|     95|      return false;
   71|     95|    }
   72|   685k|    pos_ += sizeof(T);
   73|   685k|    return true;
   74|   686k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   686k|  bool Peek(T *out_val) {
   88|   686k|    const size_t size_to_decode = sizeof(T);
   89|   686k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 95, False: 685k]
  ------------------
   90|     95|      return false;  // Buffer overflow.
   91|     95|    }
   92|   685k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   685k|    return true;
   94|   686k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  14.8k|  bool Decode(T *out_val) {
   69|  14.8k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 31, False: 14.7k]
  ------------------
   70|     31|      return false;
   71|     31|    }
   72|  14.7k|    pos_ += sizeof(T);
   73|  14.7k|    return true;
   74|  14.8k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  14.8k|  bool Peek(T *out_val) {
   88|  14.8k|    const size_t size_to_decode = sizeof(T);
   89|  14.8k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 31, False: 14.7k]
  ------------------
   90|     31|      return false;  // Buffer overflow.
   91|     31|    }
   92|  14.7k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  14.7k|    return true;
   94|  14.8k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   935k|  bool Decode(T *out_val) {
   69|   935k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 79, False: 935k]
  ------------------
   70|     79|      return false;
   71|     79|    }
   72|   935k|    pos_ += sizeof(T);
   73|   935k|    return true;
   74|   935k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   935k|  bool Peek(T *out_val) {
   88|   935k|    const size_t size_to_decode = sizeof(T);
   89|   935k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 79, False: 935k]
  ------------------
   90|     79|      return false;  // Buffer overflow.
   91|     79|    }
   92|   935k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   935k|    return true;
   94|   935k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  34.6k|  bool Decode(T *out_val) {
   69|  34.6k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 6, False: 34.6k]
  ------------------
   70|      6|      return false;
   71|      6|    }
   72|  34.6k|    pos_ += sizeof(T);
   73|  34.6k|    return true;
   74|  34.6k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  34.6k|  bool Peek(T *out_val) {
   88|  34.6k|    const size_t size_to_decode = sizeof(T);
   89|  34.6k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 6, False: 34.6k]
  ------------------
   90|      6|      return false;  // Buffer overflow.
   91|      6|    }
   92|  34.6k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  34.6k|    return true;
   94|  34.6k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|    982|  bool Decode(T *out_val) {
   69|    982|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 4, False: 978]
  ------------------
   70|      4|      return false;
   71|      4|    }
   72|    978|    pos_ += sizeof(T);
   73|    978|    return true;
   74|    982|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|    982|  bool Peek(T *out_val) {
   88|    982|    const size_t size_to_decode = sizeof(T);
   89|    982|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 4, False: 978]
  ------------------
   90|      4|      return false;  // Buffer overflow.
   91|      4|    }
   92|    978|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    978|    return true;
   94|    982|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    326|  bool Decode(T *out_val) {
   69|    326|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 1, False: 325]
  ------------------
   70|      1|      return false;
   71|      1|    }
   72|    325|    pos_ += sizeof(T);
   73|    325|    return true;
   74|    326|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    326|  bool Peek(T *out_val) {
   88|    326|    const size_t size_to_decode = sizeof(T);
   89|    326|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 1, False: 325]
  ------------------
   90|      1|      return false;  // Buffer overflow.
   91|      1|    }
   92|    325|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    325|    return true;
   94|    326|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   395M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   664M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  7.80M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  7.80M|    return value_ >= val;
  100|  7.80M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   183M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  2.16G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  21.6M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|   101M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   101M|    value_ = i.value_;
  153|   101M|    return *this;
  154|   101M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   355M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   355M|    value_ = i.value_;
  153|   355M|    return *this;
  154|   355M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  21.5M|  inline ThisIndexType &operator++() {
  103|  21.5M|    ++value_;
  104|  21.5M|    return *this;
  105|  21.5M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  1.65G|  constexpr bool operator==(const IndexType &i) const {
   76|  1.65G|    return value_ == i.value_;
   77|  1.65G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   596M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  2.53k|  constexpr bool operator<(const IndexType &i) const {
   88|  2.53k|    return value_ < i.value_;
   89|  2.53k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   100M|  constexpr bool operator==(const IndexType &i) const {
   76|   100M|    return value_ == i.value_;
   77|   100M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   166M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   166M|    return ThisIndexType(value_ - val);
  133|   166M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   449M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   449M|    return ThisIndexType(value_ + val);
  127|   449M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  16.3M|  constexpr bool operator==(const IndexType &i) const {
   76|  16.3M|    return value_ == i.value_;
   77|  16.3M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   139M|  constexpr bool operator!=(const IndexType &i) const {
   82|   139M|    return value_ != i.value_;
   83|   139M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   263M|  constexpr bool operator!=(const IndexType &i) const {
   82|   263M|    return value_ != i.value_;
   83|   263M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   372M|  inline ThisIndexType &operator++() {
  103|   372M|    ++value_;
  104|   372M|    return *this;
  105|   372M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   258M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   258M|    value_ = i.value_;
  153|   258M|    return *this;
  154|   258M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|   608M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   608M|    value_ = i.value_;
  153|   608M|    return *this;
  154|   608M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  41.3M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  41.3M|    return value_ >= val;
  100|  41.3M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  8.01M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|   749M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  8.96G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   125M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  5.69G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   107M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  16.4M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  16.4M|    return ThisIndexType(value_ + val);
  127|  16.4M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   111M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  23.6M|  constexpr bool operator<(const IndexType &i) const {
   88|  23.6M|    return value_ < i.value_;
   89|  23.6M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   770M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   355M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  56.2M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|   628M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   587M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  4.91M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  4.91M|    value_ = i.value_;
  153|  4.91M|    return *this;
  154|  4.91M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  8.01M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  8.01M|    value_ += val;
  141|  8.01M|    return *this;
  142|  8.01M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  23.6M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  23.6M|    value_ = val;
  157|  23.6M|    return *this;
  158|  23.6M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|   331M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  6.31M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  6.31M|  inline ThisIndexType &operator++() {
  103|  6.31M|    ++value_;
  104|  6.31M|    return *this;
  105|  6.31M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  25.8M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|  20.3M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|   582M|  inline ThisIndexType &operator++() {
  103|   582M|    ++value_;
  104|   582M|    return *this;
  105|   582M|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|  20.3M|  inline ThisIndexType &operator++() {
  103|  20.3M|    ++value_;
  104|  20.3M|    return *this;
  105|  20.3M|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|   557M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|   557M|    return value_ >= val;
  100|   557M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  39.9M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  39.9M|    return vector_[index.value()];
   75|  39.9M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  25.8M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  8.75k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  15.7k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  67.2M|  inline reference operator[](const IndexTypeT &index) {
   71|  67.2M|    return vector_[index.value()];
   72|  67.2M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  85.1k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  15.6M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  2.24k|  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|  7.80M|  inline reference operator[](const IndexTypeT &index) {
   71|  7.80M|    return vector_[index.value()];
   72|  7.80M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  22.5M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  22.5M|    return vector_[index.value()];
   75|  22.5M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   108M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  11.4M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   236M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   236M|    return vector_[index.value()];
   75|   236M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   503M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   503M|    return vector_[index.value()];
   75|   503M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   224M|  inline reference operator[](const IndexTypeT &index) {
   71|   224M|    return vector_[index.value()];
   72|   224M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  44.4M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  44.4M|    return vector_[index.value()];
   75|  44.4M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   188M|  inline reference operator[](const IndexTypeT &index) {
   71|   188M|    return vector_[index.value()];
   72|   188M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  57.1M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   117M|  inline reference operator[](const IndexTypeT &index) {
   71|   117M|    return vector_[index.value()];
   72|   117M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  1.00k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|  67.7M|  inline reference operator[](const IndexTypeT &index) {
   71|  67.7M|    return vector_[index.value()];
   72|  67.7M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  29.4k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  1.67M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  28.1k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  3.49k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  3.49k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  3.49k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  3.49k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  7.65k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  7.65k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  7.65k|    vector_.swap(arg.vector_);
   57|  7.65k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  7.65k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  7.65k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  7.65k|    vector_.swap(arg.vector_);
   57|  7.65k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  3.49k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  3.49k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  3.49k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  4.74k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  26.7k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  49.3k|int32_t DataTypeLength(DataType dt) {
   20|  49.3k|  switch (dt) {
   21|  19.1k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 19.1k, False: 30.2k]
  ------------------
   22|  22.3k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 3.28k, False: 46.1k]
  ------------------
   23|  22.3k|      return 1;
   24|  3.00k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 3.00k, False: 46.3k]
  ------------------
   25|  3.86k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 855, False: 48.5k]
  ------------------
   26|  3.86k|      return 2;
   27|  18.9k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 18.9k, False: 30.4k]
  ------------------
   28|  20.1k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 1.16k, False: 48.2k]
  ------------------
   29|  20.1k|      return 4;
   30|    111|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 111, False: 49.2k]
  ------------------
   31|    290|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 179, False: 49.2k]
  ------------------
   32|    290|      return 8;
   33|  2.46k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 2.46k, False: 46.9k]
  ------------------
   34|  2.46k|      return 4;
   35|    138|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 138, False: 49.2k]
  ------------------
   36|    138|      return 8;
   37|    136|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 136, False: 49.2k]
  ------------------
   38|    136|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 49.3k]
  ------------------
   40|      0|      return -1;
   41|  49.3k|  }
   42|  49.3k|}

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

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    905|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  4.74k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2ERKNS_6StatusE:
   37|      3|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|  5.64k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|  5.65k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE6statusEv:
   43|      3|  const Status &status() const { return status_; }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  4.95k|  StatusOr(const Status &status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|  5.64k|  T &&value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    698|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|    905|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|    905|  T &&value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  4.74k|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  4.74k|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   424k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   424k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 424k, Folded]
  ------------------
   65|   424k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 412, False: 424k]
  ------------------
   66|    412|      return false;
   67|    412|    }
   68|   424k|  } 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|   424k|  return true;
   77|   424k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   217k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   217k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   217k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 74, False: 217k]
  ------------------
   33|     74|    return false;
   34|     74|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   217k|  uint8_t in;
   39|   217k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 233, False: 217k]
  ------------------
   40|    233|    return false;
   41|    233|  }
   42|   217k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 13.2k, False: 204k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  13.2k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 384, False: 12.8k]
  ------------------
   45|    384|      return false;
   46|    384|    }
   47|       |    // Append decoded info from this byte.
   48|  12.8k|    *out_val <<= 7;
   49|  12.8k|    *out_val |= in & ((1 << 7) - 1);
   50|   204k|  } else {
   51|       |    // Last byte reached
   52|   204k|    *out_val = in;
   53|   204k|  }
   54|   216k|  return true;
   55|   217k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  2.09k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.09k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.09k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 2.09k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.09k|  uint8_t in;
   39|  2.09k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 2, False: 2.09k]
  ------------------
   40|      2|    return false;
   41|      2|  }
   42|  2.09k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 205, False: 1.88k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    205|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 3, False: 202]
  ------------------
   45|      3|      return false;
   46|      3|    }
   47|       |    // Append decoded info from this byte.
   48|    202|    *out_val <<= 7;
   49|    202|    *out_val |= in & ((1 << 7) - 1);
   50|  1.88k|  } else {
   51|       |    // Last byte reached
   52|  1.88k|    *out_val = in;
   53|  1.88k|  }
   54|  2.08k|  return true;
   55|  2.09k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  3.41k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  3.41k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 3.41k, Folded]
  ------------------
   65|  3.41k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 8, False: 3.40k]
  ------------------
   66|      8|      return false;
   67|      8|    }
   68|  3.41k|  } 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|  3.40k|  return true;
   77|  3.41k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  2.15k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.15k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.15k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 2.15k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.15k|  uint8_t in;
   39|  2.15k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 4, False: 2.14k]
  ------------------
   40|      4|    return false;
   41|      4|  }
   42|  2.14k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 66, False: 2.08k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     66|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 66]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|     66|    *out_val <<= 7;
   49|     66|    *out_val |= in & ((1 << 7) - 1);
   50|  2.08k|  } else {
   51|       |    // Last byte reached
   52|  2.08k|    *out_val = in;
   53|  2.08k|  }
   54|  2.14k|  return true;
   55|  2.14k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   170k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   170k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   170k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 16, False: 170k]
  ------------------
   33|     16|    return false;
   34|     16|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   170k|  uint8_t in;
   39|   170k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 32, False: 170k]
  ------------------
   40|     32|    return false;
   41|     32|  }
   42|   170k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 3.45k, False: 167k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  3.45k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 82, False: 3.36k]
  ------------------
   45|     82|      return false;
   46|     82|    }
   47|       |    // Append decoded info from this byte.
   48|  3.36k|    *out_val <<= 7;
   49|  3.36k|    *out_val |= in & ((1 << 7) - 1);
   50|   167k|  } else {
   51|       |    // Last byte reached
   52|   167k|    *out_val = in;
   53|   167k|  }
   54|   170k|  return true;
   55|   170k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  5.63k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  5.63k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 5.63k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  5.63k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  5.63k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  5.63k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 61, False: 5.56k]
  ------------------
   72|     61|      return false;
   73|     61|    }
   74|  5.56k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  5.56k|  }
   76|  5.56k|  return true;
   77|  5.63k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  6.31k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  6.31k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  6.31k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 30, False: 6.28k]
  ------------------
   33|     30|    return false;
   34|     30|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  6.28k|  uint8_t in;
   39|  6.28k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 31, False: 6.25k]
  ------------------
   40|     31|    return false;
   41|     31|  }
   42|  6.25k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 681, False: 5.56k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    681|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 150, False: 531]
  ------------------
   45|    150|      return false;
   46|    150|    }
   47|       |    // Append decoded info from this byte.
   48|    531|    *out_val <<= 7;
   49|    531|    *out_val |= in & ((1 << 7) - 1);
   50|  5.56k|  } else {
   51|       |    // Last byte reached
   52|  5.56k|    *out_val = in;
   53|  5.56k|  }
   54|  6.10k|  return true;
   55|  6.25k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  2.46k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.46k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.46k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 4, False: 2.46k]
  ------------------
   33|      4|    return false;
   34|      4|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.46k|  uint8_t in;
   39|  2.46k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 4, False: 2.46k]
  ------------------
   40|      4|    return false;
   41|      4|  }
   42|  2.46k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 621, False: 1.84k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    621|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 23, False: 598]
  ------------------
   45|     23|      return false;
   46|     23|    }
   47|       |    // Append decoded info from this byte.
   48|    598|    *out_val <<= 7;
   49|    598|    *out_val |= in & ((1 << 7) - 1);
   50|  1.84k|  } else {
   51|       |    // Last byte reached
   52|  1.84k|    *out_val = in;
   53|  1.84k|  }
   54|  2.43k|  return true;
   55|  2.46k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  20.7k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  20.7k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  20.7k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 7, False: 20.7k]
  ------------------
   33|      7|    return false;
   34|      7|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  20.7k|  uint8_t in;
   39|  20.7k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 4, False: 20.7k]
  ------------------
   40|      4|    return false;
   41|      4|  }
   42|  20.7k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 465, False: 20.2k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    465|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 35, False: 430]
  ------------------
   45|     35|      return false;
   46|     35|    }
   47|       |    // Append decoded info from this byte.
   48|    430|    *out_val <<= 7;
   49|    430|    *out_val |= in & ((1 << 7) - 1);
   50|  20.2k|  } else {
   51|       |    // Last byte reached
   52|  20.2k|    *out_val = in;
   53|  20.2k|  }
   54|  20.6k|  return true;
   55|  20.7k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.41k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.41k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.41k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 9, False: 3.40k]
  ------------------
   33|      9|    return false;
   34|      9|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.40k|  uint8_t in;
   39|  3.40k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 8, False: 3.39k]
  ------------------
   40|      8|    return false;
   41|      8|  }
   42|  3.39k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 853, False: 2.54k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    853|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 52, False: 801]
  ------------------
   45|     52|      return false;
   46|     52|    }
   47|       |    // Append decoded info from this byte.
   48|    801|    *out_val <<= 7;
   49|    801|    *out_val |= in & ((1 << 7) - 1);
   50|  2.54k|  } else {
   51|       |    // Last byte reached
   52|  2.54k|    *out_val = in;
   53|  2.54k|  }
   54|  3.34k|  return true;
   55|  3.39k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  2.48k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.48k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.48k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 4, False: 2.48k]
  ------------------
   33|      4|    return false;
   34|      4|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.48k|  uint8_t in;
   39|  2.48k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 0, False: 2.48k]
  ------------------
   40|      0|    return false;
   41|      0|  }
   42|  2.48k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.15k, False: 1.32k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.15k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 40, False: 1.11k]
  ------------------
   45|     40|      return false;
   46|     40|    }
   47|       |    // Append decoded info from this byte.
   48|  1.11k|    *out_val <<= 7;
   49|  1.11k|    *out_val |= in & ((1 << 7) - 1);
   50|  1.32k|  } else {
   51|       |    // Last byte reached
   52|  1.32k|    *out_val = in;
   53|  1.32k|  }
   54|  2.44k|  return true;
   55|  2.48k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  28.4k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  28.4k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  28.4k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 12, False: 28.4k]
  ------------------
   33|     12|    return false;
   34|     12|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  28.4k|  uint8_t in;
   39|  28.4k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 7, False: 28.4k]
  ------------------
   40|      7|    return false;
   41|      7|  }
   42|  28.4k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.31k, False: 26.1k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.31k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 60, False: 2.25k]
  ------------------
   45|     60|      return false;
   46|     60|    }
   47|       |    // Append decoded info from this byte.
   48|  2.25k|    *out_val <<= 7;
   49|  2.25k|    *out_val |= in & ((1 << 7) - 1);
   50|  26.1k|  } else {
   51|       |    // Last byte reached
   52|  26.1k|    *out_val = in;
   53|  26.1k|  }
   54|  28.3k|  return true;
   55|  28.4k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|   137k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|   177k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  14.7k|  Self operator-(const Self &o) const {
  138|  14.7k|    Self ret;
  139|  59.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 44.2k, False: 14.7k]
  ------------------
  140|  44.2k|      ret[i] = (*this)[i] - o[i];
  141|  44.2k|    }
  142|  14.7k|    return ret;
  143|  14.7k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  36.6k|  VectorD() {
   41|   146k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 110k, False: 36.6k]
  ------------------
   42|   110k|      (*this)[i] = Scalar(0);
   43|   110k|    }
   44|  36.6k|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|   124M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIfLi3EEC2ERKfS3_S3_:
   59|     12|      : v_({{c0, c1, c2}}) {
   60|     12|    DRACO_DCHECK_EQ(dimension, 3);
   61|     12|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|   146M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  12.1M|  Self operator-(const Self &o) const {
  138|  12.1M|    Self ret;
  139|  48.5M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 36.4M, False: 12.1M]
  ------------------
  140|  36.4M|      ret[i] = (*this)[i] - o[i];
  141|  36.4M|    }
  142|  12.1M|    return ret;
  143|  12.1M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  6.05M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  6.05M|  static_assert(std::is_signed<ScalarT>::value,
  321|  6.05M|                "ScalarT must be a signed type. ");
  322|  6.05M|  VectorD<ScalarT, 3> r;
  323|  6.05M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  6.05M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  6.05M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  6.05M|  return r;
  327|  6.05M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  6.05M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  6.05M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  1.83M|  Scalar AbsSum() const {
  238|  1.83M|    Scalar result(0);
  239|  7.31M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 5.49M, False: 1.81M]
  ------------------
  240|  5.49M|      Scalar next_value = std::abs(v_[i]);
  241|  5.49M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 15.8k, False: 5.48M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  15.8k|        return std::numeric_limits<Scalar>::max();
  244|  15.8k|      }
  245|  5.48M|      result += next_value;
  246|  5.48M|    }
  247|  1.81M|    return result;
  248|  1.83M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   327k|  Self operator/(const Scalar &o) const {
  183|   327k|    Self ret;
  184|  1.31M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 983k, False: 327k]
  ------------------
  185|   983k|      ret[i] = (*this)[i] / o;
  186|   983k|    }
  187|   327k|    return ret;
  188|   327k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   178M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  8.18M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  5.50M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  1.36M|  Self operator-() const {
  121|  1.36M|    Self ret;
  122|  5.45M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 4.09M, False: 1.36M]
  ------------------
  123|  4.09M|      ret[i] = -(*this)[i];
  124|  4.09M|    }
  125|  1.36M|    return ret;
  126|  1.36M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  4.09M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|   833k|  Self operator-(const Self &o) const {
  138|   833k|    Self ret;
  139|  2.50M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.66M, False: 833k]
  ------------------
  140|  1.66M|      ret[i] = (*this)[i] - o[i];
  141|  1.66M|    }
  142|   833k|    return ret;
  143|   833k|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  10.0M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  15.0M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  33.1M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  1.66M|  Self operator+(const Self &o) const {
  130|  1.66M|    Self ret;
  131|  5.00M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 3.33M, False: 1.66M]
  ------------------
  132|  3.33M|      ret[i] = (*this)[i] + o[i];
  133|  3.33M|    }
  134|  1.66M|    return ret;
  135|  1.66M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  30.8M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|   885k|  Self operator-(const Self &o) const {
  138|   885k|    Self ret;
  139|  2.65M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.77M, False: 885k]
  ------------------
  140|  1.77M|      ret[i] = (*this)[i] - o[i];
  141|  1.77M|    }
  142|   885k|    return ret;
  143|   885k|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|   885k|  Self operator+(const Self &o) const {
  130|   885k|    Self ret;
  131|  2.65M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.77M, False: 885k]
  ------------------
  132|  1.77M|      ret[i] = (*this)[i] + o[i];
  133|  1.77M|    }
  134|   885k|    return ret;
  135|   885k|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   604k|  bool operator==(const Self &o) const {
  207|  1.80M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 1.20M, False: 597k]
  ------------------
  208|  1.20M|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 7.17k, False: 1.19M]
  ------------------
  209|  7.17k|        return false;
  210|  7.17k|      }
  211|  1.20M|    }
  212|   597k|    return true;
  213|   604k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  7.25M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  7.59k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  8.01k|  Scalar Dot(const Self &o) const {
  251|  8.01k|    Scalar ret(0);
  252|  32.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 24.0k, False: 8.01k]
  ------------------
  253|  24.0k|      ret += (*this)[i] * o[i];
  254|  24.0k|    }
  255|  8.01k|    return ret;
  256|  8.01k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    422|  Self operator*(const Scalar &o) const {
  175|    422|    Self ret;
  176|  1.68k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 1.26k, False: 422]
  ------------------
  177|  1.26k|      ret[i] = (*this)[i] * o;
  178|  1.26k|    }
  179|    422|    return ret;
  180|    422|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  7.17k|  Self operator-(const Self &o) const {
  138|  7.17k|    Self ret;
  139|  21.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 14.3k, False: 7.17k]
  ------------------
  140|  14.3k|      ret[i] = (*this)[i] - o[i];
  141|  14.3k|    }
  142|  7.17k|    return ret;
  143|  7.17k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  14.3k|  VectorD() {
   41|  43.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 28.6k, False: 14.3k]
  ------------------
   42|  28.6k|      (*this)[i] = Scalar(0);
   43|  28.6k|    }
   44|  14.3k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|  1.21M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  1.21M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  1.21M|    v_[0] = c0;
   55|  1.21M|    v_[1] = c1;
   56|  1.21M|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  57.2k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   437k|  bool operator==(const Self &o) const {
  207|  1.25M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 848k, False: 409k]
  ------------------
  208|   848k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 28.2k, False: 820k]
  ------------------
  209|  28.2k|        return false;
  210|  28.2k|      }
  211|   848k|    }
  212|   409k|    return true;
  213|   437k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  2.60M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  34.3M|  VectorD() {
   41|   137M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 103M, False: 34.3M]
  ------------------
   42|   103M|      (*this)[i] = Scalar(0);
   43|   103M|    }
   44|  34.3M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  31.6k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  35.0k|  Scalar Dot(const Self &o) const {
  251|  35.0k|    Scalar ret(0);
  252|   140k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 105k, False: 35.0k]
  ------------------
  253|   105k|      ret += (*this)[i] * o[i];
  254|   105k|    }
  255|  35.0k|    return ret;
  256|  35.0k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  3.42k|  Self operator-(const Self &o) const {
  138|  3.42k|    Self ret;
  139|  10.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 6.84k, False: 3.42k]
  ------------------
  140|  6.84k|      ret[i] = (*this)[i] - o[i];
  141|  6.84k|    }
  142|  3.42k|    return ret;
  143|  3.42k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  10.0k|  Self operator*(const Scalar &o) const {
  175|  10.0k|    Self ret;
  176|  30.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 20.0k, False: 10.0k]
  ------------------
  177|  20.0k|      ret[i] = (*this)[i] * o;
  178|  20.0k|    }
  179|  10.0k|    return ret;
  180|  10.0k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  3.34k|  Self operator+(const Self &o) const {
  130|  3.34k|    Self ret;
  131|  10.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 6.69k, False: 3.34k]
  ------------------
  132|  6.69k|      ret[i] = (*this)[i] + o[i];
  133|  6.69k|    }
  134|  3.34k|    return ret;
  135|  3.34k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  3.34k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  3.34k|  return v * o;
  294|  3.34k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  3.33k|  Self operator+(const Self &o) const {
  130|  3.33k|    Self ret;
  131|  13.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 10.0k, False: 3.33k]
  ------------------
  132|  10.0k|      ret[i] = (*this)[i] + o[i];
  133|  10.0k|    }
  134|  3.33k|    return ret;
  135|  3.33k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  3.33k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  3.33k|  return v * o;
  294|  3.33k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  3.33k|  Self operator*(const Scalar &o) const {
  175|  3.33k|    Self ret;
  176|  13.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 10.0k, False: 3.33k]
  ------------------
  177|  10.0k|      ret[i] = (*this)[i] * o;
  178|  10.0k|    }
  179|  3.33k|    return ret;
  180|  3.33k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   879k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   879k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   879k|    v_[0] = c0;
   55|   879k|    v_[1] = c1;
   56|   879k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  23.4k|  VectorD() {
   41|  70.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 46.9k, False: 23.4k]
  ------------------
   42|  46.9k|      (*this)[i] = Scalar(0);
   43|  46.9k|    }
   44|  23.4k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  6.65k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  19.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 13.3k, False: 6.65k]
  ------------------
  104|  13.3k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 13.3k, False: 0]
  ------------------
  105|  13.3k|        v_[i] = Scalar(src_vector[i]);
  106|  13.3k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  13.3k|    }
  110|  6.65k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|    914|  Self operator+(const Self &o) const {
  130|    914|    Self ret;
  131|  2.74k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.82k, False: 914]
  ------------------
  132|  1.82k|      ret[i] = (*this)[i] + o[i];
  133|  1.82k|    }
  134|    914|    return ret;
  135|    914|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  3.32k|  VectorD() {
   41|  9.98k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 6.65k, False: 3.32k]
  ------------------
   42|  6.65k|      (*this)[i] = Scalar(0);
   43|  6.65k|    }
   44|  3.32k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  19.9k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  13.3k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  3.32k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  9.98k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 6.65k, False: 3.32k]
  ------------------
  104|  6.65k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 6.65k, False: 0]
  ------------------
  105|  6.65k|        v_[i] = Scalar(src_vector[i]);
  106|  6.65k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  6.65k|    }
  110|  3.32k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  3.32k|  Self operator/(const Scalar &o) const {
  183|  3.32k|    Self ret;
  184|  9.98k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 6.65k, False: 3.32k]
  ------------------
  185|  6.65k|      ret[i] = (*this)[i] / o;
  186|  6.65k|    }
  187|  3.32k|    return ret;
  188|  3.32k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  2.41k|  Self operator-(const Self &o) const {
  138|  2.41k|    Self ret;
  139|  7.23k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 4.82k, False: 2.41k]
  ------------------
  140|  4.82k|      ret[i] = (*this)[i] - o[i];
  141|  4.82k|    }
  142|  2.41k|    return ret;
  143|  2.41k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  93.8k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  1.36M|  VectorD() {
   41|  5.45M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 4.09M, False: 1.36M]
  ------------------
   42|  4.09M|      (*this)[i] = Scalar(0);
   43|  4.09M|    }
   44|  1.36M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  6.70M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  6.70M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  6.70M|    v_[0] = c0;
   55|  6.70M|    v_[1] = c1;
   56|  6.70M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  5.00M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  15.0M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 10.0M, False: 5.00M]
  ------------------
  104|  10.0M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 10.0M, False: 0]
  ------------------
  105|  10.0M|        v_[i] = Scalar(src_vector[i]);
  106|  10.0M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  10.0M|    }
  110|  5.00M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  2.50M|  VectorD() {
   41|  7.50M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 5.00M, False: 2.50M]
  ------------------
   42|  5.00M|      (*this)[i] = Scalar(0);
   43|  5.00M|    }
   44|  2.50M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  2.50M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  7.50M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 5.00M, False: 2.50M]
  ------------------
  104|  5.00M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 5.00M, False: 0]
  ------------------
  105|  5.00M|        v_[i] = Scalar(src_vector[i]);
  106|  5.00M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  5.00M|    }
  110|  2.50M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  4.15M|  VectorD(const Self &o) {
   89|  12.4M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 8.30M, False: 4.15M]
  ------------------
   90|  8.30M|      (*this)[i] = o[i];
   91|  8.30M|    }
   92|  4.15M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  1.77M|  VectorD() {
   41|  5.31M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.54M, False: 1.77M]
  ------------------
   42|  3.54M|      (*this)[i] = Scalar(0);
   43|  3.54M|    }
   44|  1.77M|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|  41.5M|  VectorD(const Self &o) {
   89|   166M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 124M, False: 41.5M]
  ------------------
   90|   124M|      (*this)[i] = o[i];
   91|   124M|    }
   92|  41.5M|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|   124M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|  17.2M|      : v_({{c0, c1, c2}}) {
   60|  17.2M|    DRACO_DCHECK_EQ(dimension, 3);
   61|  17.2M|  }

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

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

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  2.09k|      : corner_table_(table),
  229|  2.09k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  2.09k|        corner_(start_corner_),
  231|  2.09k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  5.18M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  6.32k|  VertexCornersIterator &operator++() {
  268|  6.32k|    Next();
  269|  6.32k|    return *this;
  270|  6.32k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  4.43M|  void Next() {
  248|  4.43M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 4.40M, False: 24.7k]
  ------------------
  249|  4.40M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  4.40M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 24.9k, False: 4.38M]
  ------------------
  251|       |        // Open boundary reached.
  252|  24.9k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  24.9k|        left_traversal_ = false;
  254|  4.38M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 729k, False: 3.65M]
  ------------------
  255|       |        // End reached.
  256|   729k|        corner_ = kInvalidCornerIndex;
  257|   729k|      }
  258|  4.40M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  24.7k|      corner_ = corner_table_->SwingRight(corner_);
  262|  24.7k|    }
  263|  4.43M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  8.85M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  2.71M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  3.26M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  1.63M|  void Next() {
  248|  1.63M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 1.60M, False: 23.6k]
  ------------------
  249|  1.60M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  1.60M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 978k, False: 628k]
  ------------------
  251|       |        // Open boundary reached.
  252|   978k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|   978k|        left_traversal_ = false;
  254|   978k|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 102k, False: 526k]
  ------------------
  255|       |        // End reached.
  256|   102k|        corner_ = kInvalidCornerIndex;
  257|   102k|      }
  258|  1.60M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  23.6k|      corner_ = corner_table_->SwingRight(corner_);
  262|  23.6k|    }
  263|  1.63M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  1.08M|      : corner_table_(table),
  236|  1.08M|        start_corner_(corner_id),
  237|  1.08M|        corner_(start_corner_),
  238|  1.08M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   752k|      : corner_table_(table),
  236|   752k|        start_corner_(corner_id),
  237|   752k|        corner_(start_corner_),
  238|   752k|        left_traversal_(true) {}

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

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

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

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

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

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

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

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

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

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

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

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

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

