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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  2.79k|      : quantization_bits_(-1),
   54|  2.79k|        max_quantized_value_(-1),
   55|  2.79k|        max_value_(-1),
   56|  2.79k|        dequantization_scale_(1.f),
   57|  2.79k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  2.52k|  bool SetQuantizationBits(int32_t q) {
   60|  2.52k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 705, False: 1.82k]
  |  Branch (60:18): [True: 177, False: 1.64k]
  ------------------
   61|    882|      return false;
   62|    882|    }
   63|  1.64k|    quantization_bits_ = q;
   64|  1.64k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.64k|    max_value_ = max_quantized_value_ - 1;
   66|  1.64k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.64k|    center_value_ = max_value_ / 2;
   68|  1.64k|    return true;
   69|  2.52k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  2.70M|                                           int32_t *out_t) const {
   77|  2.70M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 3.80k, False: 2.70M]
  |  Branch (77:20): [True: 0, False: 3.80k]
  |  Branch (77:32): [True: 3.80k, False: 2.70M]
  |  Branch (77:42): [True: 0, False: 3.80k]
  ------------------
   78|  2.70M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 2.09M, False: 609k]
  |  Branch (78:29): [True: 4.75k, False: 2.09M]
  ------------------
   79|  4.75k|      s = max_value_;
   80|  4.75k|      t = max_value_;
   81|  2.70M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 3.80k, False: 2.70M]
  |  Branch (81:26): [True: 1.25k, False: 2.55k]
  ------------------
   82|  1.25k|      t = center_value_ - (t - center_value_);
   83|  2.70M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 2.09M, False: 608k]
  |  Branch (83:35): [True: 4.77k, False: 2.09M]
  ------------------
   84|  4.77k|      t = center_value_ + (center_value_ - t);
   85|  2.69M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 2.09M, False: 606k]
  |  Branch (85:35): [True: 629, False: 2.09M]
  ------------------
   86|    629|      s = center_value_ + (center_value_ - s);
   87|  2.69M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 4.46k, False: 2.69M]
  |  Branch (87:26): [True: 1.64k, False: 2.81k]
  ------------------
   88|  1.64k|      s = center_value_ - (s - center_value_);
   89|  1.64k|    }
   90|       |
   91|  2.70M|    *out_s = s;
   92|  2.70M|    *out_t = t;
   93|  2.70M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  2.70M|                                                       int32_t *out_t) const {
  100|  2.70M|    DRACO_DCHECK_EQ(
  101|  2.70M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  2.70M|        center_value_);
  103|  2.70M|    int32_t s, t;
  104|  2.70M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 1.46M, False: 1.24M]
  ------------------
  105|       |      // Right hemisphere.
  106|  1.46M|      s = (int_vec[1] + center_value_);
  107|  1.46M|      t = (int_vec[2] + center_value_);
  108|  1.46M|    } else {
  109|       |      // Left hemisphere.
  110|  1.24M|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 47.4k, False: 1.19M]
  ------------------
  111|  47.4k|        s = std::abs(int_vec[2]);
  112|  1.19M|      } else {
  113|  1.19M|        s = (max_value_ - std::abs(int_vec[2]));
  114|  1.19M|      }
  115|  1.24M|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 52.3k, False: 1.19M]
  ------------------
  116|  52.3k|        t = std::abs(int_vec[1]);
  117|  1.19M|      } else {
  118|  1.19M|        t = (max_value_ - std::abs(int_vec[1]));
  119|  1.19M|      }
  120|  1.24M|    }
  121|  2.70M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  2.70M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|   306k|                                                    float *out_vector) const {
  199|   306k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|   306k|                                 in_t * dequantization_scale_ - 1.f,
  201|   306k|                                 out_vector);
  202|   306k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  2.16M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  2.16M|    DRACO_DCHECK_LE(s, center_value_);
  208|  2.16M|    DRACO_DCHECK_LE(t, center_value_);
  209|  2.16M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  2.16M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  2.16M|    const uint32_t st =
  212|  2.16M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  2.16M|    return st <= center_value_;
  214|  2.16M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  3.32M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  3.32M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  3.32M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  3.32M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  3.32M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  3.32M|    int32_t sign_s = 0;
  223|  3.32M|    int32_t sign_t = 0;
  224|  3.32M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 2.96M, False: 357k]
  |  Branch (224:20): [True: 2.83M, False: 133k]
  ------------------
  225|  2.83M|      sign_s = 1;
  226|  2.83M|      sign_t = 1;
  227|  2.83M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 381k, False: 109k]
  |  Branch (227:27): [True: 277k, False: 104k]
  ------------------
  228|   277k|      sign_s = -1;
  229|   277k|      sign_t = -1;
  230|   277k|    } else {
  231|   213k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 109k, False: 104k]
  ------------------
  232|   213k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 104k, False: 109k]
  ------------------
  233|   213k|    }
  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|  3.32M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  3.32M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  3.32M|    uint32_t us = *s;
  241|  3.32M|    uint32_t ut = *t;
  242|  3.32M|    us = us + us - corner_point_s;
  243|  3.32M|    ut = ut + ut - corner_point_t;
  244|  3.32M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 3.10M, False: 213k]
  ------------------
  245|  3.10M|      uint32_t temp = us;
  246|  3.10M|      us = -ut;
  247|  3.10M|      ut = -temp;
  248|  3.10M|    } else {
  249|   213k|      std::swap(us, ut);
  250|   213k|    }
  251|  3.32M|    us = us + corner_point_s;
  252|  3.32M|    ut = ut + corner_point_t;
  253|       |
  254|  3.32M|    *s = us;
  255|  3.32M|    *t = ut;
  256|  3.32M|    *s /= 2;
  257|  3.32M|    *t /= 2;
  258|  3.32M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  4.33M|  int32_t ModMax(int32_t x) const {
  273|  4.33M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 8.62k, False: 4.32M]
  ------------------
  274|  8.62k|      return x - this->max_quantized_value();
  275|  8.62k|    }
  276|  4.32M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 4.64k, False: 4.32M]
  ------------------
  277|  4.64k|      return x + this->max_quantized_value();
  278|  4.64k|    }
  279|  4.32M|    return x;
  280|  4.32M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.55k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  13.2k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  12.9M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|   306k|                                           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|   306k|    float y = in_s_scaled;
  329|   306k|    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|   306k|    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|   306k|    float x_offset = -x;
  342|   306k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 134k, False: 171k]
  ------------------
  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|   306k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 52.1k, False: 254k]
  ------------------
  348|   306k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 52.1k, False: 254k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|   306k|    const float norm_squared = x * x + y * y + z * z;
  352|   306k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 306k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|   306k|    } else {
  357|   306k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|   306k|      out_vector[0] = x * d;
  359|   306k|      out_vector[1] = y * d;
  360|   306k|      out_vector[2] = z * d;
  361|   306k|    }
  362|   306k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  2.70M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  2.70M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  2.70M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  2.70M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  2.70M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  2.70M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  2.70M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 2.46M, False: 249k]
  ------------------
  181|  2.46M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  2.46M|    } else {
  183|   249k|      vec[0] =
  184|   249k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   249k|          abs_sum;
  186|   249k|      vec[1] =
  187|   249k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   249k|          abs_sum;
  189|   249k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 133k, False: 115k]
  ------------------
  190|   133k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   133k|      } else {
  192|   115k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   115k|      }
  194|   249k|    }
  195|  2.70M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    396|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    396|            attribute, transform, mesh_data),
   52|    396|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    381|                                                                *buffer) {
  194|    381|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    381|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    381|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 6, False: 375]
  ------------------
  196|       |    // Decode prediction mode.
  197|      6|    uint8_t mode;
  198|      6|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 6]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      6|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 4, False: 2]
  ------------------
  203|       |      // Unsupported mode.
  204|      4|      return false;
  205|      4|    }
  206|      6|  }
  207|    377|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.72k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.42k, False: 305]
  ------------------
  211|  1.42k|    uint32_t num_flags;
  212|  1.42k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 12, False: 1.41k]
  ------------------
  213|     12|      return false;
  214|     12|    }
  215|  1.41k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 42, False: 1.36k]
  ------------------
  216|     42|      return false;
  217|     42|    }
  218|  1.36k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 549, False: 819]
  ------------------
  219|    549|      is_crease_edge_[i].resize(num_flags);
  220|    549|      RAnsBitDecoder decoder;
  221|    549|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 18, False: 531]
  ------------------
  222|     18|        return false;
  223|     18|      }
  224|  2.44M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 2.44M, False: 531]
  ------------------
  225|  2.44M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  2.44M|      }
  227|    531|      decoder.EndDecoding();
  228|    531|    }
  229|  1.36k|  }
  230|    305|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    305|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    377|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    266|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    266|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    266|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.33k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.06k, False: 266]
  ------------------
   93|  1.06k|    pred_vals[i].resize(num_components, 0);
   94|  1.06k|  }
   95|    266|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    266|                                         out_data);
   97|       |
   98|    266|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    266|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    266|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    266|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    266|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    266|  const int corner_map_size =
  109|    266|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  1.12M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 1.12M, False: 173]
  ------------------
  111|  1.12M|    const CornerIndex start_corner_id =
  112|  1.12M|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  1.12M|    CornerIndex corner_id(start_corner_id);
  115|  1.12M|    int num_parallelograms = 0;
  116|  1.12M|    bool first_pass = true;
  117|  2.44M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 1.35M, False: 1.08M]
  ------------------
  118|  1.35M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 91.0k, False: 1.26M]
  ------------------
  119|  1.35M|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  1.35M|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  91.0k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  91.0k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 726, False: 90.3k]
  ------------------
  127|    726|          break;
  128|    726|        }
  129|  91.0k|      }
  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.35M|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 1.34M, False: 10.1k]
  ------------------
  134|  1.34M|        corner_id = table->SwingLeft(corner_id);
  135|  1.34M|      } else {
  136|  10.1k|        corner_id = table->SwingRight(corner_id);
  137|  10.1k|      }
  138|  1.35M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 42.7k, False: 1.31M]
  ------------------
  139|  42.7k|        break;
  140|  42.7k|      }
  141|  1.31M|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 1.08M, False: 228k]
  |  Branch (141:47): [True: 1.08M, False: 4.56k]
  ------------------
  142|  1.08M|        first_pass = false;
  143|  1.08M|        corner_id = table->SwingRight(start_corner_id);
  144|  1.08M|      }
  145|  1.31M|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  1.12M|    int num_used_parallelograms = 0;
  150|  1.12M|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 50.0k, False: 1.07M]
  ------------------
  151|  7.26M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 7.21M, False: 50.0k]
  ------------------
  152|  7.21M|        multi_pred_vals[i] = 0;
  153|  7.21M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   141k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 91.0k, False: 50.0k]
  ------------------
  156|  91.0k|        const int context = num_parallelograms - 1;
  157|  91.0k|        const int pos = is_crease_edge_pos[context]++;
  158|  91.0k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 93, False: 90.9k]
  ------------------
  159|     93|          return false;
  160|     93|        }
  161|  90.9k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  90.9k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 27.7k, False: 63.2k]
  ------------------
  163|  27.7k|          ++num_used_parallelograms;
  164|  3.61M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 3.59M, False: 27.7k]
  ------------------
  165|  3.59M|            multi_pred_vals[j] =
  166|  3.59M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  3.59M|          }
  168|  27.7k|        }
  169|  90.9k|      }
  170|  50.0k|    }
  171|  1.12M|    const int dst_offset = p * num_components;
  172|  1.12M|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 1.11M, False: 11.4k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  1.11M|      const int src_offset = (p - 1) * num_components;
  176|  1.11M|      this->transform().ComputeOriginalValue(
  177|  1.11M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  1.11M|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|  1.46M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 1.45M, False: 11.4k]
  ------------------
  181|  1.45M|        multi_pred_vals[c] /= num_used_parallelograms;
  182|  1.45M|      }
  183|  11.4k|      this->transform().ComputeOriginalValue(
  184|  11.4k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  11.4k|    }
  186|  1.12M|  }
  187|    173|  return true;
  188|    266|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    484|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    484|            attribute, transform, mesh_data),
   52|    484|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    456|                                                                *buffer) {
  194|    456|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    456|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    456|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 2, False: 454]
  ------------------
  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|    455|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.97k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.63k, False: 338]
  ------------------
  211|  1.63k|    uint32_t num_flags;
  212|  1.63k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 14, False: 1.62k]
  ------------------
  213|     14|      return false;
  214|     14|    }
  215|  1.62k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 66, False: 1.55k]
  ------------------
  216|     66|      return false;
  217|     66|    }
  218|  1.55k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 731, False: 824]
  ------------------
  219|    731|      is_crease_edge_[i].resize(num_flags);
  220|    731|      RAnsBitDecoder decoder;
  221|    731|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 37, False: 694]
  ------------------
  222|     37|        return false;
  223|     37|      }
  224|  1.54M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.54M, False: 694]
  ------------------
  225|  1.54M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.54M|      }
  227|    694|      decoder.EndDecoding();
  228|    694|    }
  229|  1.55k|  }
  230|    338|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    338|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    455|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    291|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    291|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    291|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.45k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.16k, False: 291]
  ------------------
   93|  1.16k|    pred_vals[i].resize(num_components, 0);
   94|  1.16k|  }
   95|    291|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    291|                                         out_data);
   97|       |
   98|    291|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    291|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    291|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    291|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    291|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    291|  const int corner_map_size =
  109|    291|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   117k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 117k, False: 111]
  ------------------
  111|   117k|    const CornerIndex start_corner_id =
  112|   117k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   117k|    CornerIndex corner_id(start_corner_id);
  115|   117k|    int num_parallelograms = 0;
  116|   117k|    bool first_pass = true;
  117|   686k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 681k, False: 5.77k]
  ------------------
  118|   681k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 220k, False: 460k]
  ------------------
  119|   681k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   681k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   220k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   220k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 422, False: 220k]
  ------------------
  127|    422|          break;
  128|    422|        }
  129|   220k|      }
  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|   680k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 674k, False: 6.18k]
  ------------------
  134|   674k|        corner_id = table->SwingLeft(corner_id);
  135|   674k|      } else {
  136|  6.18k|        corner_id = table->SwingRight(corner_id);
  137|  6.18k|      }
  138|   680k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 111k, False: 569k]
  ------------------
  139|   111k|        break;
  140|   111k|      }
  141|   569k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 8.91k, False: 560k]
  |  Branch (141:47): [True: 5.78k, False: 3.13k]
  ------------------
  142|  5.78k|        first_pass = false;
  143|  5.78k|        corner_id = table->SwingRight(start_corner_id);
  144|  5.78k|      }
  145|   569k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   117k|    int num_used_parallelograms = 0;
  150|   117k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 114k, False: 2.91k]
  ------------------
  151|  4.96M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 4.84M, False: 114k]
  ------------------
  152|  4.84M|        multi_pred_vals[i] = 0;
  153|  4.84M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   334k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 220k, False: 114k]
  ------------------
  156|   220k|        const int context = num_parallelograms - 1;
  157|   220k|        const int pos = is_crease_edge_pos[context]++;
  158|   220k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 180, False: 220k]
  ------------------
  159|    180|          return false;
  160|    180|        }
  161|   220k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   220k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 41.4k, False: 178k]
  ------------------
  163|  41.4k|          ++num_used_parallelograms;
  164|  1.67M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 1.63M, False: 41.4k]
  ------------------
  165|  1.63M|            multi_pred_vals[j] =
  166|  1.63M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  1.63M|          }
  168|  41.4k|        }
  169|   220k|      }
  170|   114k|    }
  171|   117k|    const int dst_offset = p * num_components;
  172|   117k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 97.2k, False: 19.8k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  97.2k|      const int src_offset = (p - 1) * num_components;
  176|  97.2k|      this->transform().ComputeOriginalValue(
  177|  97.2k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  97.2k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   888k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 868k, False: 19.8k]
  ------------------
  181|   868k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   868k|      }
  183|  19.8k|      this->transform().ComputeOriginalValue(
  184|  19.8k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  19.8k|    }
  186|   117k|  }
  187|    111|  return true;
  188|    291|}

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

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   957k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   154k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   363k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   259k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.91k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.91k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  11.4M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.25k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.25k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  3.08M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    168|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    168|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    133|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    133|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    157|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    157|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    174|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    174|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    335|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    168|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    168|    DRACO_DCHECK_EQ(i, 0);
   70|    168|    (void)i;
   71|    168|    return GeometryAttribute::POSITION;
   72|    168|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    168|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    168|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 168]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    168|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 167]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    167|    predictor_.SetPositionAttribute(*att);
   82|    167|    return true;
   83|    168|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    167|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    167|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 8, False: 159]
  ------------------
  145|      8|    return false;
  146|      8|  }
  147|       |
  148|    159|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    159|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    159|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 40, False: 119]
  ------------------
  150|     40|    uint8_t prediction_mode;
  151|     40|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 40]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     40|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 39]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     39|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 39]
  ------------------
  160|     39|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     39|  }
  164|    158|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    158|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 9, False: 149]
  ------------------
  168|      9|    return false;
  169|      9|  }
  170|       |
  171|    149|  return true;
  172|    158|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    149|                                      const PointIndex *entry_to_point_id_map) {
  103|    149|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    149|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    149|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    149|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    149|  const int corner_map_size =
  111|    149|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    149|  VectorD<int32_t, 3> pred_normal_3d;
  114|    149|  int32_t pred_normal_oct[2];
  115|       |
  116|   957k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 957k, False: 149]
  ------------------
  117|   957k|    const CornerIndex corner_id =
  118|   957k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   957k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   957k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   957k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   957k|                    octahedron_tool_box_.center_value());
  125|   957k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 604k, False: 352k]
  ------------------
  126|   604k|      pred_normal_3d = -pred_normal_3d;
  127|   604k|    }
  128|   957k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   957k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   957k|    const int data_offset = data_id * 2;
  132|   957k|    this->transform().ComputeOriginalValue(
  133|   957k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   957k|  }
  135|    149|  flip_normal_bit_decoder_.EndDecoding();
  136|    149|  return true;
  137|    149|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    149|  void SetQuantizationBits(int q) {
   85|    149|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    149|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    265|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    133|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    133|    DRACO_DCHECK_EQ(i, 0);
   70|    133|    (void)i;
   71|    133|    return GeometryAttribute::POSITION;
   72|    133|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    133|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    133|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 133]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    133|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 132]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    132|    predictor_.SetPositionAttribute(*att);
   82|    132|    return true;
   83|    133|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    132|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    132|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 127]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|       |
  148|    127|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    127|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    127|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 13, False: 114]
  ------------------
  150|     13|    uint8_t prediction_mode;
  151|     13|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 13]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     13|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 12]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     12|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 12]
  ------------------
  160|     12|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     12|  }
  164|    126|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    126|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 3, False: 123]
  ------------------
  168|      3|    return false;
  169|      3|  }
  170|       |
  171|    123|  return true;
  172|    126|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    123|                                      const PointIndex *entry_to_point_id_map) {
  103|    123|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    123|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    123|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    123|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    123|  const int corner_map_size =
  111|    123|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    123|  VectorD<int32_t, 3> pred_normal_3d;
  114|    123|  int32_t pred_normal_oct[2];
  115|       |
  116|   154k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 154k, False: 123]
  ------------------
  117|   154k|    const CornerIndex corner_id =
  118|   154k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   154k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   154k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   154k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   154k|                    octahedron_tool_box_.center_value());
  125|   154k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 146k, False: 7.63k]
  ------------------
  126|   146k|      pred_normal_3d = -pred_normal_3d;
  127|   146k|    }
  128|   154k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   154k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   154k|    const int data_offset = data_id * 2;
  132|   154k|    this->transform().ComputeOriginalValue(
  133|   154k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   154k|  }
  135|    123|  flip_normal_bit_decoder_.EndDecoding();
  136|    123|  return true;
  137|    123|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    123|  void SetQuantizationBits(int q) {
   85|    123|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    123|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    312|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    157|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    157|    DRACO_DCHECK_EQ(i, 0);
   70|    157|    (void)i;
   71|    157|    return GeometryAttribute::POSITION;
   72|    157|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    156|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    156|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 156]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    156|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 155]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    155|    predictor_.SetPositionAttribute(*att);
   82|    155|    return true;
   83|    156|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    154|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    154|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 7, False: 147]
  ------------------
  145|      7|    return false;
  146|      7|  }
  147|       |
  148|    147|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    147|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    147|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 55, False: 92]
  ------------------
  150|     55|    uint8_t prediction_mode;
  151|     55|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 55]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     55|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 14, False: 41]
  ------------------
  155|       |      // Invalid prediction mode.
  156|     14|      return false;
  157|     14|    }
  158|       |
  159|     41|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 41]
  ------------------
  160|     41|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     41|  }
  164|    133|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    133|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 5, False: 128]
  ------------------
  168|      5|    return false;
  169|      5|  }
  170|       |
  171|    128|  return true;
  172|    133|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    128|                                      const PointIndex *entry_to_point_id_map) {
  103|    128|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    128|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    128|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    128|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    128|  const int corner_map_size =
  111|    128|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    128|  VectorD<int32_t, 3> pred_normal_3d;
  114|    128|  int32_t pred_normal_oct[2];
  115|       |
  116|   363k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 363k, False: 128]
  ------------------
  117|   363k|    const CornerIndex corner_id =
  118|   363k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   363k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   363k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   363k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   363k|                    octahedron_tool_box_.center_value());
  125|   363k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 340k, False: 22.6k]
  ------------------
  126|   340k|      pred_normal_3d = -pred_normal_3d;
  127|   340k|    }
  128|   363k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   363k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   363k|    const int data_offset = data_id * 2;
  132|   363k|    this->transform().ComputeOriginalValue(
  133|   363k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   363k|  }
  135|    128|  flip_normal_bit_decoder_.EndDecoding();
  136|    128|  return true;
  137|    128|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    128|  void SetQuantizationBits(int q) {
   85|    128|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    128|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    342|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    174|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    174|    DRACO_DCHECK_EQ(i, 0);
   70|    174|    (void)i;
   71|    174|    return GeometryAttribute::POSITION;
   72|    174|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    174|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    174|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 174]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    174|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 6, False: 168]
  ------------------
   79|      6|      return false;  // Currently works only for 3 component positions.
   80|      6|    }
   81|    168|    predictor_.SetPositionAttribute(*att);
   82|    168|    return true;
   83|    174|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    167|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    167|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 162]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|       |
  148|    162|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    162|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    162|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 21, False: 141]
  ------------------
  150|     21|    uint8_t prediction_mode;
  151|     21|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 21]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     21|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 20]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     20|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 20]
  ------------------
  160|     20|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     20|  }
  164|    161|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    161|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 6, False: 155]
  ------------------
  168|      6|    return false;
  169|      6|  }
  170|       |
  171|    155|  return true;
  172|    161|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    155|                                      const PointIndex *entry_to_point_id_map) {
  103|    155|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    155|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    155|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    155|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    155|  const int corner_map_size =
  111|    155|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    155|  VectorD<int32_t, 3> pred_normal_3d;
  114|    155|  int32_t pred_normal_oct[2];
  115|       |
  116|   259k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 259k, False: 155]
  ------------------
  117|   259k|    const CornerIndex corner_id =
  118|   259k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   259k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   259k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   259k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   259k|                    octahedron_tool_box_.center_value());
  125|   259k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 257k, False: 1.53k]
  ------------------
  126|   257k|      pred_normal_3d = -pred_normal_3d;
  127|   257k|    }
  128|   259k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   259k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   259k|    const int data_offset = data_id * 2;
  132|   259k|    this->transform().ComputeOriginalValue(
  133|   259k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   259k|  }
  135|    155|  flip_normal_bit_decoder_.EndDecoding();
  136|    155|  return true;
  137|    155|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    155|  void SetQuantizationBits(int q) {
   85|    155|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    155|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    228|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    228|            attribute, transform, mesh_data),
   37|    228|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    453|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    228|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    228|    DRACO_DCHECK_EQ(i, 0);
   70|    228|    (void)i;
   71|    228|    return GeometryAttribute::POSITION;
   72|    228|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    226|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    226|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 226]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    226|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 225]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    225|    predictor_.SetPositionAttribute(*att);
   82|    225|    return true;
   83|    226|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    222|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    222|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 19, False: 203]
  ------------------
  145|     19|    return false;
  146|     19|  }
  147|       |
  148|    203|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    203|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    203|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 67, False: 136]
  ------------------
  150|     67|    uint8_t prediction_mode;
  151|     67|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 67]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     67|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 3, False: 64]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      3|      return false;
  157|      3|    }
  158|       |
  159|     64|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 64]
  ------------------
  160|     64|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     64|  }
  164|    200|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    200|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 9, False: 191]
  ------------------
  168|      9|    return false;
  169|      9|  }
  170|       |
  171|    191|  return true;
  172|    200|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    191|                                      const PointIndex *entry_to_point_id_map) {
  103|    191|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    191|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    191|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    191|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    191|  const int corner_map_size =
  111|    191|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    191|  VectorD<int32_t, 3> pred_normal_3d;
  114|    191|  int32_t pred_normal_oct[2];
  115|       |
  116|   822k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 822k, False: 191]
  ------------------
  117|   822k|    const CornerIndex corner_id =
  118|   822k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   822k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   822k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   822k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   822k|                    octahedron_tool_box_.center_value());
  125|   822k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 819k, False: 3.37k]
  ------------------
  126|   819k|      pred_normal_3d = -pred_normal_3d;
  127|   819k|    }
  128|   822k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   822k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   822k|    const int data_offset = data_id * 2;
  132|   822k|    this->transform().ComputeOriginalValue(
  133|   822k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   822k|  }
  135|    191|  flip_normal_bit_decoder_.EndDecoding();
  136|    191|  return true;
  137|    191|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    191|  void SetQuantizationBits(int q) {
   85|    191|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    191|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    422|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    422|            attribute, transform, mesh_data),
   37|    422|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    842|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    422|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    422|    DRACO_DCHECK_EQ(i, 0);
   70|    422|    (void)i;
   71|    422|    return GeometryAttribute::POSITION;
   72|    422|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    421|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    421|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 421]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    421|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 420]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    420|    predictor_.SetPositionAttribute(*att);
   82|    420|    return true;
   83|    421|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    414|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    414|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 24, False: 390]
  ------------------
  145|     24|    return false;
  146|     24|  }
  147|       |
  148|    390|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    390|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    390|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 81, False: 309]
  ------------------
  150|     81|    uint8_t prediction_mode;
  151|     81|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 9, False: 72]
  ------------------
  152|      9|      return false;
  153|      9|    }
  154|     72|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 71]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     71|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 71]
  ------------------
  160|     71|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     71|  }
  164|    380|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    380|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 15, False: 365]
  ------------------
  168|     15|    return false;
  169|     15|  }
  170|       |
  171|    365|  return true;
  172|    380|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    365|                                      const PointIndex *entry_to_point_id_map) {
  103|    365|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    365|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    365|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    365|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    365|  const int corner_map_size =
  111|    365|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    365|  VectorD<int32_t, 3> pred_normal_3d;
  114|    365|  int32_t pred_normal_oct[2];
  115|       |
  116|   153k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 153k, False: 365]
  ------------------
  117|   153k|    const CornerIndex corner_id =
  118|   153k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   153k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   153k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   153k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   153k|                    octahedron_tool_box_.center_value());
  125|   153k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 143k, False: 9.62k]
  ------------------
  126|   143k|      pred_normal_3d = -pred_normal_3d;
  127|   143k|    }
  128|   153k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   153k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   153k|    const int data_offset = data_id * 2;
  132|   153k|    this->transform().ComputeOriginalValue(
  133|   153k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   153k|  }
  135|    365|  flip_normal_bit_decoder_.EndDecoding();
  136|    365|  return true;
  137|    365|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    365|  void SetQuantizationBits(int q) {
   85|    365|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    365|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    168|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    168|            attribute, transform, mesh_data),
   37|    168|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    133|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    133|            attribute, transform, mesh_data),
   37|    133|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    157|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    157|            attribute, transform, mesh_data),
   37|    157|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    174|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    174|            attribute, transform, mesh_data),
   37|    174|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    207|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    207|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 37, False: 170]
  ------------------
  105|     37|      this->normal_prediction_mode_ = mode;
  106|     37|      return true;
  107|    170|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 170, False: 0]
  ------------------
  108|    170|      this->normal_prediction_mode_ = mode;
  109|    170|      return true;
  110|    170|    }
  111|      0|    return false;
  112|    207|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   957k|                             DataTypeT *prediction) override {
   42|   957k|    DRACO_DCHECK(this->IsInitialized());
   43|   957k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   957k|    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|   957k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   957k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   957k|    VectorD<int64_t, 3> normal;
   53|   957k|    CornerIndex c_next, c_prev;
   54|  2.20M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.25M, False: 957k]
  ------------------
   55|       |      // Getting corners.
   56|  1.25M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 192, False: 1.25M]
  ------------------
   57|    192|        c_next = corner_table->Next(corner_id);
   58|    192|        c_prev = corner_table->Previous(corner_id);
   59|  1.25M|      } else {
   60|  1.25M|        c_next = corner_table->Next(cit.Corner());
   61|  1.25M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.25M|      }
   63|  1.25M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.25M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.25M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.25M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.25M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.25M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.25M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.25M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.25M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.25M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.25M|      cit.Next();
   81|  1.25M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   957k|    constexpr int64_t upper_bound = 1 << 29;
   85|   957k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 128, False: 957k]
  ------------------
   86|    128|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    128|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 58, False: 70]
  ------------------
   88|     58|        const int64_t quotient = abs_sum / upper_bound;
   89|     58|        normal = normal / quotient;
   90|     58|      }
   91|   957k|    } else {
   92|   957k|      const int64_t abs_sum = normal.AbsSum();
   93|   957k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.91k, False: 955k]
  ------------------
   94|  1.91k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.91k|        normal = normal / quotient;
   96|  1.91k|      }
   97|   957k|    }
   98|   957k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   957k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   957k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   957k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   957k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    145|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    145|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 11, False: 134]
  ------------------
  105|     11|      this->normal_prediction_mode_ = mode;
  106|     11|      return true;
  107|    134|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 134, False: 0]
  ------------------
  108|    134|      this->normal_prediction_mode_ = mode;
  109|    134|      return true;
  110|    134|    }
  111|      0|    return false;
  112|    145|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   154k|                             DataTypeT *prediction) override {
   42|   154k|    DRACO_DCHECK(this->IsInitialized());
   43|   154k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   154k|    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|   154k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   154k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   154k|    VectorD<int64_t, 3> normal;
   53|   154k|    CornerIndex c_next, c_prev;
   54|  1.07M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 921k, False: 154k]
  ------------------
   55|       |      // Getting corners.
   56|   921k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 54, False: 921k]
  ------------------
   57|     54|        c_next = corner_table->Next(corner_id);
   58|     54|        c_prev = corner_table->Previous(corner_id);
   59|   921k|      } else {
   60|   921k|        c_next = corner_table->Next(cit.Corner());
   61|   921k|        c_prev = corner_table->Previous(cit.Corner());
   62|   921k|      }
   63|   921k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   921k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   921k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   921k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   921k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   921k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   921k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   921k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   921k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   921k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   921k|      cit.Next();
   81|   921k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   154k|    constexpr int64_t upper_bound = 1 << 29;
   85|   154k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 36, False: 154k]
  ------------------
   86|     36|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     36|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 14, False: 22]
  ------------------
   88|     14|        const int64_t quotient = abs_sum / upper_bound;
   89|     14|        normal = normal / quotient;
   90|     14|      }
   91|   154k|    } else {
   92|   154k|      const int64_t abs_sum = normal.AbsSum();
   93|   154k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 106k, False: 47.9k]
  ------------------
   94|   106k|        const int64_t quotient = abs_sum / upper_bound;
   95|   106k|        normal = normal / quotient;
   96|   106k|      }
   97|   154k|    }
   98|   154k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   154k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   154k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   154k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   154k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    198|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    198|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 39, False: 159]
  ------------------
  105|     39|      this->normal_prediction_mode_ = mode;
  106|     39|      return true;
  107|    159|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 159, False: 0]
  ------------------
  108|    159|      this->normal_prediction_mode_ = mode;
  109|    159|      return true;
  110|    159|    }
  111|      0|    return false;
  112|    198|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   363k|                             DataTypeT *prediction) override {
   42|   363k|    DRACO_DCHECK(this->IsInitialized());
   43|   363k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   363k|    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|   363k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   363k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   363k|    VectorD<int64_t, 3> normal;
   53|   363k|    CornerIndex c_next, c_prev;
   54|  1.11M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 751k, False: 363k]
  ------------------
   55|       |      // Getting corners.
   56|   751k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 222, False: 751k]
  ------------------
   57|    222|        c_next = corner_table->Next(corner_id);
   58|    222|        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|   363k|    constexpr int64_t upper_bound = 1 << 29;
   85|   363k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 148, False: 362k]
  ------------------
   86|    148|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    148|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 63, False: 85]
  ------------------
   88|     63|        const int64_t quotient = abs_sum / upper_bound;
   89|     63|        normal = normal / quotient;
   90|     63|      }
   91|   362k|    } else {
   92|   362k|      const int64_t abs_sum = normal.AbsSum();
   93|   362k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.63k, False: 361k]
  ------------------
   94|  1.63k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.63k|        normal = normal / quotient;
   96|  1.63k|      }
   97|   362k|    }
   98|   363k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   363k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   363k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   363k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   363k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    194|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    194|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 18, False: 176]
  ------------------
  105|     18|      this->normal_prediction_mode_ = mode;
  106|     18|      return true;
  107|    176|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 176, False: 0]
  ------------------
  108|    176|      this->normal_prediction_mode_ = mode;
  109|    176|      return true;
  110|    176|    }
  111|      0|    return false;
  112|    194|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   259k|                             DataTypeT *prediction) override {
   42|   259k|    DRACO_DCHECK(this->IsInitialized());
   43|   259k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   259k|    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|   259k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   259k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   259k|    VectorD<int64_t, 3> normal;
   53|   259k|    CornerIndex c_next, c_prev;
   54|  1.80M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.54M, False: 259k]
  ------------------
   55|       |      // Getting corners.
   56|  1.54M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 102, False: 1.54M]
  ------------------
   57|    102|        c_next = corner_table->Next(corner_id);
   58|    102|        c_prev = corner_table->Previous(corner_id);
   59|  1.54M|      } else {
   60|  1.54M|        c_next = corner_table->Next(cit.Corner());
   61|  1.54M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.54M|      }
   63|  1.54M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.54M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.54M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.54M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.54M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.54M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.54M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.54M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.54M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.54M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.54M|      cit.Next();
   81|  1.54M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   259k|    constexpr int64_t upper_bound = 1 << 29;
   85|   259k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 68, False: 259k]
  ------------------
   86|     68|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     68|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 19, False: 49]
  ------------------
   88|     19|        const int64_t quotient = abs_sum / upper_bound;
   89|     19|        normal = normal / quotient;
   90|     19|      }
   91|   259k|    } else {
   92|   259k|      const int64_t abs_sum = normal.AbsSum();
   93|   259k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 119k, False: 139k]
  ------------------
   94|   119k|        const int64_t quotient = abs_sum / upper_bound;
   95|   119k|        normal = normal / quotient;
   96|   119k|      }
   97|   259k|    }
   98|   259k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   259k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   259k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   259k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   259k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    228|      : Base(md) {
   35|    228|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    228|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    292|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    292|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 63, False: 229]
  ------------------
  105|     63|      this->normal_prediction_mode_ = mode;
  106|     63|      return true;
  107|    229|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 229, False: 0]
  ------------------
  108|    229|      this->normal_prediction_mode_ = mode;
  109|    229|      return true;
  110|    229|    }
  111|      0|    return false;
  112|    292|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   822k|                             DataTypeT *prediction) override {
   42|   822k|    DRACO_DCHECK(this->IsInitialized());
   43|   822k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   822k|    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|   822k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   822k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   822k|    VectorD<int64_t, 3> normal;
   53|   822k|    CornerIndex c_next, c_prev;
   54|  1.66M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 845k, False: 822k]
  ------------------
   55|       |      // Getting corners.
   56|   845k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 360, False: 845k]
  ------------------
   57|    360|        c_next = corner_table->Next(corner_id);
   58|    360|        c_prev = corner_table->Previous(corner_id);
   59|   845k|      } else {
   60|   845k|        c_next = corner_table->Next(cit.Corner());
   61|   845k|        c_prev = corner_table->Previous(cit.Corner());
   62|   845k|      }
   63|   845k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   845k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   845k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   845k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   845k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   845k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   845k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   845k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   845k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   845k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   845k|      cit.Next();
   81|   845k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   822k|    constexpr int64_t upper_bound = 1 << 29;
   85|   822k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 308, False: 822k]
  ------------------
   86|    308|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    308|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 99, False: 209]
  ------------------
   88|     99|        const int64_t quotient = abs_sum / upper_bound;
   89|     99|        normal = normal / quotient;
   90|     99|      }
   91|   822k|    } else {
   92|   822k|      const int64_t abs_sum = normal.AbsSum();
   93|   822k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.27k, False: 820k]
  ------------------
   94|  1.27k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.27k|        normal = normal / quotient;
   96|  1.27k|      }
   97|   822k|    }
   98|   822k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   822k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   822k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   822k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   822k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    422|      : Base(md) {
   35|    422|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    422|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    493|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    493|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 70, False: 423]
  ------------------
  105|     70|      this->normal_prediction_mode_ = mode;
  106|     70|      return true;
  107|    423|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 423, False: 0]
  ------------------
  108|    423|      this->normal_prediction_mode_ = mode;
  109|    423|      return true;
  110|    423|    }
  111|      0|    return false;
  112|    493|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   153k|                             DataTypeT *prediction) override {
   42|   153k|    DRACO_DCHECK(this->IsInitialized());
   43|   153k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   153k|    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|   153k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   153k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   153k|    VectorD<int64_t, 3> normal;
   53|   153k|    CornerIndex c_next, c_prev;
   54|  1.01M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 860k, False: 153k]
  ------------------
   55|       |      // Getting corners.
   56|   860k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 390, False: 860k]
  ------------------
   57|    390|        c_next = corner_table->Next(corner_id);
   58|    390|        c_prev = corner_table->Previous(corner_id);
   59|   860k|      } else {
   60|   860k|        c_next = corner_table->Next(cit.Corner());
   61|   860k|        c_prev = corner_table->Previous(cit.Corner());
   62|   860k|      }
   63|   860k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   860k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   860k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   860k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   860k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   860k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   860k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   860k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   860k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   860k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   860k|      cit.Next();
   81|   860k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   153k|    constexpr int64_t upper_bound = 1 << 29;
   85|   153k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 368, False: 152k]
  ------------------
   86|    368|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    368|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 108, False: 260]
  ------------------
   88|    108|        const int64_t quotient = abs_sum / upper_bound;
   89|    108|        normal = normal / quotient;
   90|    108|      }
   91|   152k|    } else {
   92|   152k|      const int64_t abs_sum = normal.AbsSum();
   93|   152k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 3.66k, False: 149k]
  ------------------
   94|  3.66k|        const int64_t quotient = abs_sum / upper_bound;
   95|  3.66k|        normal = normal / quotient;
   96|  3.66k|      }
   97|   152k|    }
   98|   153k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   153k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   153k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   153k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   153k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    168|      : Base(md) {
   35|    168|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    168|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    133|      : Base(md) {
   35|    133|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    133|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    157|      : Base(md) {
   35|    157|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    157|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    174|      : Base(md) {
   35|    174|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    174|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.45M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.45M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.45M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.45M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.45M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.45M|    return GetPositionForDataId(data_id);
   77|  3.45M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  3.45M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.45M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.45M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.45M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.45M|    VectorD<int64_t, 3> pos;
   68|  3.45M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.45M|    return pos;
   70|  3.45M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    167|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    167|    pos_attribute_ = &position_attribute;
   43|    167|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    149|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    149|    entry_to_point_id_map_ = map;
   46|    149|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.99M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.99M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.99M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.99M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.99M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.99M|    return GetPositionForDataId(data_id);
   77|  1.99M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.99M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.99M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.99M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.99M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.99M|    VectorD<int64_t, 3> pos;
   68|  1.99M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.99M|    return pos;
   70|  1.99M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    132|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    132|    pos_attribute_ = &position_attribute;
   43|    132|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    123|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    123|    entry_to_point_id_map_ = map;
   46|    123|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.86M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.86M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.86M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.86M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.86M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.86M|    return GetPositionForDataId(data_id);
   77|  1.86M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.86M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.86M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.86M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.86M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.86M|    VectorD<int64_t, 3> pos;
   68|  1.86M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.86M|    return pos;
   70|  1.86M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    155|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    155|    pos_attribute_ = &position_attribute;
   43|    155|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    128|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    128|    entry_to_point_id_map_ = map;
   46|    128|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.34M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.34M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.34M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.34M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.34M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.34M|    return GetPositionForDataId(data_id);
   77|  3.34M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  3.34M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.34M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.34M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.34M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.34M|    VectorD<int64_t, 3> pos;
   68|  3.34M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.34M|    return pos;
   70|  3.34M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    168|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    168|    pos_attribute_ = &position_attribute;
   43|    168|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    155|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    155|    entry_to_point_id_map_ = map;
   46|    155|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    228|      : pos_attribute_(nullptr),
   36|    228|        entry_to_point_id_map_(nullptr),
   37|    228|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    228|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.51M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.51M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.51M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.51M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.51M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.51M|    return GetPositionForDataId(data_id);
   77|  2.51M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.51M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.51M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.51M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.51M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.51M|    VectorD<int64_t, 3> pos;
   68|  2.51M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.51M|    return pos;
   70|  2.51M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    225|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    225|    pos_attribute_ = &position_attribute;
   43|    225|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    191|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    191|    entry_to_point_id_map_ = map;
   46|    191|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    422|      : pos_attribute_(nullptr),
   36|    422|        entry_to_point_id_map_(nullptr),
   37|    422|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    422|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.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_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   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_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    420|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    420|    pos_attribute_ = &position_attribute;
   43|    420|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    365|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    365|    entry_to_point_id_map_ = map;
   46|    365|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    168|      : pos_attribute_(nullptr),
   36|    168|        entry_to_point_id_map_(nullptr),
   37|    168|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    168|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    133|      : pos_attribute_(nullptr),
   36|    133|        entry_to_point_id_map_(nullptr),
   37|    133|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    133|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    157|      : pos_attribute_(nullptr),
   36|    157|        entry_to_point_id_map_(nullptr),
   37|    157|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    157|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    174|      : pos_attribute_(nullptr),
   36|    174|        entry_to_point_id_map_(nullptr),
   37|    174|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    174|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    349|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    349|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    331|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    331|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    331|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    331|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    331|      new DataTypeT[num_components]());
   70|       |
   71|    331|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    331|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    331|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    331|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    331|  const int corner_map_size =
   78|    331|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|  1.57M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 1.57M, False: 331]
  ------------------
   80|  1.57M|    const CornerIndex start_corner_id =
   81|  1.57M|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|  1.57M|    CornerIndex corner_id(start_corner_id);
   84|  1.57M|    int num_parallelograms = 0;
   85|  71.1M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 69.6M, False: 1.57M]
  ------------------
   86|  69.6M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  69.6M|    }
   88|  3.76M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 2.18M, False: 1.57M]
  ------------------
   89|  2.18M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 251k, False: 1.93M]
  ------------------
   90|  2.18M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  2.18M|              num_components, parallelogram_pred_vals.get())) {
   92|  6.20M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 5.95M, False: 251k]
  ------------------
   93|  5.95M|          pred_vals[c] =
   94|  5.95M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  5.95M|        }
   96|   251k|        ++num_parallelograms;
   97|   251k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  2.18M|      corner_id = table->SwingRight(corner_id);
  101|  2.18M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 118k, False: 2.07M]
  ------------------
  102|   118k|        corner_id = kInvalidCornerIndex;
  103|   118k|      }
  104|  2.18M|    }
  105|       |
  106|  1.57M|    const int dst_offset = p * num_components;
  107|  1.57M|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 1.43M, False: 134k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  1.43M|      const int src_offset = (p - 1) * num_components;
  111|  1.43M|      this->transform().ComputeOriginalValue(
  112|  1.43M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|  1.43M|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  3.34M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 3.21M, False: 134k]
  ------------------
  116|  3.21M|        pred_vals[c] /= num_parallelograms;
  117|  3.21M|      }
  118|   134k|      this->transform().ComputeOriginalValue(
  119|   134k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   134k|    }
  121|  1.57M|  }
  122|    331|  return true;
  123|    331|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    416|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    416|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    390|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    390|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    390|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    390|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    390|      new DataTypeT[num_components]());
   70|       |
   71|    390|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    390|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    390|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    390|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    390|  const int corner_map_size =
   78|    390|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   787k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 787k, False: 390]
  ------------------
   80|   787k|    const CornerIndex start_corner_id =
   81|   787k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   787k|    CornerIndex corner_id(start_corner_id);
   84|   787k|    int num_parallelograms = 0;
   85|  18.7M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 17.9M, False: 787k]
  ------------------
   86|  17.9M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  17.9M|    }
   88|  5.46M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 4.67M, False: 787k]
  ------------------
   89|  4.67M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 1.53M, False: 3.13M]
  ------------------
   90|  4.67M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  4.67M|              num_components, parallelogram_pred_vals.get())) {
   92|  36.6M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 35.1M, False: 1.53M]
  ------------------
   93|  35.1M|          pred_vals[c] =
   94|  35.1M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  35.1M|        }
   96|  1.53M|        ++num_parallelograms;
   97|  1.53M|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  4.67M|      corner_id = table->SwingRight(corner_id);
  101|  4.67M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 774k, False: 3.89M]
  ------------------
  102|   774k|        corner_id = kInvalidCornerIndex;
  103|   774k|      }
  104|  4.67M|    }
  105|       |
  106|   787k|    const int dst_offset = p * num_components;
  107|   787k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 1.22k, False: 786k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  1.22k|      const int src_offset = (p - 1) * num_components;
  111|  1.22k|      this->transform().ComputeOriginalValue(
  112|  1.22k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   786k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  18.6M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 17.9M, False: 786k]
  ------------------
  116|  17.9M|        pred_vals[c] /= num_parallelograms;
  117|  17.9M|      }
  118|   786k|      this->transform().ComputeOriginalValue(
  119|   786k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   786k|    }
  121|   787k|  }
  122|    390|  return true;
  123|    390|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  5.27M|    int num_components, DataTypeT *out_prediction) {
   49|  5.27M|  const CornerIndex oci = table->Opposite(ci);
   50|  5.27M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 4.20M, False: 1.07M]
  ------------------
   51|  4.20M|    return false;
   52|  4.20M|  }
   53|  1.07M|  int vert_opp, vert_next, vert_prev;
   54|  1.07M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  1.07M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  1.07M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 563k, False: 512k]
  |  Branch (56:35): [True: 428k, False: 135k]
  ------------------
   57|   428k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 399k, False: 28.5k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   399k|    const int v_opp_off = vert_opp * num_components;
   60|   399k|    const int v_next_off = vert_next * num_components;
   61|   399k|    const int v_prev_off = vert_prev * num_components;
   62|  23.5M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 23.1M, False: 399k]
  ------------------
   63|  23.1M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  23.1M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  23.1M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  23.1M|      const int64_t result =
   67|  23.1M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  23.1M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  23.1M|    }
   71|   399k|    return true;
   72|   399k|  }
   73|   676k|  return false;  // Not all data is available for prediction
   74|  1.07M|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  1.07M|    int *next_entry, int *prev_entry) {
   32|       |  // One vertex of the input |table| correspond to exactly one attribute value
   33|       |  // entry. The |table| can be either CornerTable for per-vertex attributes,
   34|       |  // or MeshAttributeCornerTable for attributes with interior seams.
   35|  1.07M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  1.07M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  1.07M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  1.07M|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  5.82M|    int num_components, DataTypeT *out_prediction) {
   49|  5.82M|  const CornerIndex oci = table->Opposite(ci);
   50|  5.82M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 18.5k, False: 5.80M]
  ------------------
   51|  18.5k|    return false;
   52|  18.5k|  }
   53|  5.80M|  int vert_opp, vert_next, vert_prev;
   54|  5.80M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  5.80M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  5.80M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 3.11M, False: 2.68M]
  |  Branch (56:35): [True: 2.36M, False: 755k]
  ------------------
   57|  2.36M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 2.22M, False: 138k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  2.22M|    const int v_opp_off = vert_opp * num_components;
   60|  2.22M|    const int v_next_off = vert_next * num_components;
   61|  2.22M|    const int v_prev_off = vert_prev * num_components;
   62|  73.5M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 71.3M, False: 2.22M]
  ------------------
   63|  71.3M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  71.3M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  71.3M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  71.3M|      const int64_t result =
   67|  71.3M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  71.3M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  71.3M|    }
   71|  2.22M|    return true;
   72|  2.22M|  }
   73|  3.57M|  return false;  // Not all data is available for prediction
   74|  5.80M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  5.80M|    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.80M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  5.80M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  5.80M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  5.80M|}

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

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

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    212|      : pos_attribute_(nullptr),
   39|    212|        entry_to_point_id_map_(nullptr),
   40|    212|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    210|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    210|    pos_attribute_ = &position_attribute;
   43|    210|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    204|  void ResizeOrientations(int num_orientations) {
   74|    204|    orientations_.resize(num_orientations);
   75|    204|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|  2.91G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    174|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    174|    entry_to_point_id_map_ = map;
   46|    174|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|  1.15M|                                                 int data_id) {
   94|       |  // Compute the predicted UV coordinate from the positions on all corners
   95|       |  // of the processed triangle. For the best prediction, the UV coordinates
   96|       |  // on the next/previous corners need to be already encoded/decoded.
   97|  1.15M|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|  1.15M|  const CornerIndex prev_corner_id =
   99|  1.15M|      mesh_data_.corner_table()->Previous(corner_id);
  100|       |  // Get the encoded data ids from the next and previous corners.
  101|       |  // The data id is the encoding order of the UV coordinates.
  102|  1.15M|  int next_data_id, prev_data_id;
  103|       |
  104|  1.15M|  int next_vert_id, prev_vert_id;
  105|  1.15M|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|  1.15M|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|  1.15M|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|  1.15M|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|  1.15M|  typedef VectorD<int64_t, 2> Vec2;
  112|  1.15M|  typedef VectorD<int64_t, 3> Vec3;
  113|  1.15M|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|  1.15M|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 790k, False: 368k]
  |  Branch (115:33): [True: 421k, False: 368k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   421k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   421k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   421k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 395k, False: 25.4k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   395k|      predicted_value_[0] = p_uv[0];
  122|   395k|      predicted_value_[1] = p_uv[1];
  123|   395k|      return true;
  124|   395k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  25.4k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  25.4k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  25.4k|    const Vec3 prev_pos = GetPositionForEntryId(prev_data_id);
  130|       |    // We use the positions of the above triangle to predict the texture
  131|       |    // coordinate on the tip corner C.
  132|       |    // To convert the triangle into the UV coordinate system we first compute
  133|       |    // position X on the vector |prev_pos - next_pos| that is the projection of
  134|       |    // point C onto vector |prev_pos - next_pos|:
  135|       |    //
  136|       |    //              C
  137|       |    //             /.  \
  138|       |    //            / .     \
  139|       |    //           /  .        \
  140|       |    //          N---X----------P
  141|       |    //
  142|       |    // Where next_pos is point (N), prev_pos is point (P) and tip_pos is the
  143|       |    // position of predicted coordinate (C).
  144|       |    //
  145|  25.4k|    const Vec3 pn = prev_pos - next_pos;
  146|  25.4k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  25.4k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.96k, False: 23.4k]
  ------------------
  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.96k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.96k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.96k|      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.96k|      const int64_t n_uv_absmax_element =
  164|  1.96k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.96k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 27, False: 1.94k]
  ------------------
  166|  1.96k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     27|        return false;
  169|     27|      }
  170|  1.94k|      const int64_t pn_uv_absmax_element =
  171|  1.94k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.94k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 23, False: 1.91k]
  ------------------
  173|  1.94k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     23|        return false;
  176|     23|      }
  177|  1.91k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.91k|      const int64_t pn_absmax_element =
  179|  1.91k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.91k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 8, False: 1.91k]
  ------------------
  181|  1.91k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|      8|        return false;
  184|      8|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.91k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.91k|      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.91k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.91k|      const uint64_t norm_squared =
  207|  1.91k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.91k|      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.91k|      Vec2 predicted_uv;
  214|  1.91k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.91k]
  ------------------
  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.91k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.91k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 5, False: 1.90k]
  ------------------
  233|      5|          return false;
  234|      5|        }
  235|  1.90k|        const bool orientation = orientations_.back();
  236|  1.90k|        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.90k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 569, False: 1.33k]
  ------------------
  240|    569|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|  1.33k|        } else {
  242|  1.33k|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|  1.33k|        }
  244|  1.90k|      }
  245|  1.90k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.90k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.90k|      return true;
  248|  1.91k|    }
  249|  25.4k|  }
  250|       |  // Else we don't have available textures on both corners or the position data
  251|       |  // is invalid. For such cases we can't use positions for predicting the uv
  252|       |  // value and we resort to delta coding.
  253|   760k|  int data_offset = 0;
  254|   760k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 392k, False: 368k]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|   392k|    data_offset = prev_data_id * kNumComponents;
  257|   392k|  }
  258|   760k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 23.4k, False: 737k]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  23.4k|    data_offset = next_data_id * kNumComponents;
  261|   737k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|   737k|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 737k, False: 174]
  ------------------
  265|   737k|      data_offset = (data_id - 1) * kNumComponents;
  266|   737k|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    522|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 348, False: 174]
  ------------------
  269|    348|        predicted_value_[i] = 0;
  270|    348|      }
  271|    174|      return true;
  272|    174|    }
  273|   737k|  }
  274|  2.28M|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 1.52M, False: 760k]
  ------------------
  275|  1.52M|    predicted_value_[i] = data[data_offset + i];
  276|  1.52M|  }
  277|   760k|  return true;
  278|   760k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   842k|                                            const DataTypeT *data) const {
   59|   842k|    const int data_offset = entry_id * kNumComponents;
   60|   842k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   842k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  76.3k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  76.3k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  76.3k|    VectorD<int64_t, 3> pos;
   52|  76.3k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  76.3k|                                 &pos[0]);
   54|  76.3k|    return pos;
   55|  76.3k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|  1.15M|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    227|      : pos_attribute_(nullptr),
   39|    227|        entry_to_point_id_map_(nullptr),
   40|    227|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    224|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    224|    pos_attribute_ = &position_attribute;
   43|    224|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    216|  void ResizeOrientations(int num_orientations) {
   74|    216|    orientations_.resize(num_orientations);
   75|    216|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  2.08G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    162|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    162|    entry_to_point_id_map_ = map;
   46|    162|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   272k|                                                 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|   272k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   272k|  const CornerIndex prev_corner_id =
   99|   272k|      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|   272k|  int next_data_id, prev_data_id;
  103|       |
  104|   272k|  int next_vert_id, prev_vert_id;
  105|   272k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   272k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   272k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   272k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   272k|  typedef VectorD<int64_t, 2> Vec2;
  112|   272k|  typedef VectorD<int64_t, 3> Vec3;
  113|   272k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   272k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 272k, False: 274]
  |  Branch (115:33): [True: 272k, False: 268]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   272k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   272k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   272k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 264k, False: 7.65k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   264k|      predicted_value_[0] = p_uv[0];
  122|   264k|      predicted_value_[1] = p_uv[1];
  123|   264k|      return true;
  124|   264k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  7.65k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  7.65k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  7.65k|    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|  7.65k|    const Vec3 pn = prev_pos - next_pos;
  146|  7.65k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  7.65k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.07k, False: 6.58k]
  ------------------
  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.07k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.07k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.07k|      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.07k|      const int64_t n_uv_absmax_element =
  164|  1.07k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.07k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 39, False: 1.03k]
  ------------------
  166|  1.07k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     39|        return false;
  169|     39|      }
  170|  1.03k|      const int64_t pn_uv_absmax_element =
  171|  1.03k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.03k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 14, False: 1.01k]
  ------------------
  173|  1.03k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     14|        return false;
  176|     14|      }
  177|  1.01k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.01k|      const int64_t pn_absmax_element =
  179|  1.01k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.01k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 8, False: 1.01k]
  ------------------
  181|  1.01k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|      8|        return false;
  184|      8|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.01k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.01k|      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.01k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.01k|      const uint64_t norm_squared =
  207|  1.01k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.01k|      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.01k|      Vec2 predicted_uv;
  214|  1.01k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.01k]
  ------------------
  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.01k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.01k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 2, False: 1.00k]
  ------------------
  233|      2|          return false;
  234|      2|        }
  235|  1.00k|        const bool orientation = orientations_.back();
  236|  1.00k|        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.00k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 247, False: 762]
  ------------------
  240|    247|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    762|        } else {
  242|    762|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    762|        }
  244|  1.00k|      }
  245|  1.00k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.00k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.00k|      return true;
  248|  1.01k|    }
  249|  7.65k|  }
  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|  7.12k|  int data_offset = 0;
  254|  7.12k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 6.85k, False: 274]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  6.85k|    data_offset = prev_data_id * kNumComponents;
  257|  6.85k|  }
  258|  7.12k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 6.59k, False: 532]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  6.59k|    data_offset = next_data_id * kNumComponents;
  261|  6.59k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|    532|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 370, False: 162]
  ------------------
  265|    370|      data_offset = (data_id - 1) * kNumComponents;
  266|    370|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    486|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 324, False: 162]
  ------------------
  269|    324|        predicted_value_[i] = 0;
  270|    324|      }
  271|    162|      return true;
  272|    162|    }
  273|    532|  }
  274|  20.8k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 13.9k, False: 6.96k]
  ------------------
  275|  13.9k|    predicted_value_[i] = data[data_offset + i];
  276|  13.9k|  }
  277|  6.96k|  return true;
  278|  7.12k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   544k|                                            const DataTypeT *data) const {
   59|   544k|    const int data_offset = entry_id * kNumComponents;
   60|   544k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   544k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|  22.9k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  22.9k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  22.9k|    VectorD<int64_t, 3> pos;
   52|  22.9k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  22.9k|                                 &pos[0]);
   54|  22.9k|    return pos;
   55|  22.9k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   272k|  const DataTypeT *predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    173|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    452|  bool AreCorrectionsPositive() override {
   71|    452|    return transform_.AreCorrectionsPositive();
   72|    452|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    153|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    153|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 24, False: 129]
  ------------------
   50|     24|      return false;
   51|     24|    }
   52|    129|    return true;
   53|    153|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|  1.17M|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    234|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    541|  bool AreCorrectionsPositive() override {
   71|    541|    return transform_.AreCorrectionsPositive();
   72|    541|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    220|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    220|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 28, False: 192]
  ------------------
   50|     28|      return false;
   51|     28|    }
   52|    192|    return true;
   53|    220|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|   993k|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  4.61k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  3.23k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  4.40k|  bool AreCorrectionsPositive() override {
   71|  4.40k|    return transform_.AreCorrectionsPositive();
   72|  4.40k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  3.50k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  3.50k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 280, False: 3.22k]
  ------------------
   50|    280|      return false;
   51|    280|    }
   52|  3.22k|    return true;
   53|  3.50k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  27.9M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    474|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    565|      : attribute_(attribute), transform_(transform) {}

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

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

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    455|    uint16_t bitstream_version) {
   38|    455|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    455|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 455, False: 0]
  ------------------
   40|    455|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 7, False: 448]
  ------------------
   41|    448|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 30, False: 418]
  ------------------
   42|    418|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 1, False: 417]
  ------------------
   43|    417|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 31, False: 386]
  ------------------
   44|    386|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 301, False: 85]
  ------------------
   45|    437|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 67, False: 18]
  ------------------
   46|    437|    const CornerTable *const ct = source->GetCornerTable();
   47|    437|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    437|        source->GetAttributeEncodingData(att_id);
   49|    437|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 124, False: 313]
  |  Branch (49:26): [True: 0, False: 313]
  ------------------
   50|       |      // No connectivity data found.
   51|    124|      return nullptr;
   52|    124|    }
   53|       |    // Connectivity data exists.
   54|    313|    const MeshAttributeCornerTable *const att_ct =
   55|    313|        source->GetAttributeCornerTable(att_id);
   56|    313|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 172, False: 141]
  ------------------
   57|    172|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    172|      MeshData md;
   59|    172|      md.Set(source->mesh(), att_ct,
   60|    172|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    172|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    172|      MeshPredictionSchemeFactoryT factory;
   63|    172|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    172|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 168, False: 4]
  ------------------
   65|    168|        return ret;
   66|    168|      }
   67|    172|    } else {
   68|    141|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    141|      MeshData md;
   70|    141|      md.Set(source->mesh(), ct,
   71|    141|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    141|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    141|      MeshPredictionSchemeFactoryT factory;
   74|    141|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    141|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 133, False: 8]
  ------------------
   76|    133|        return ret;
   77|    133|      }
   78|    141|    }
   79|    313|  }
   80|     30|  return nullptr;
   81|    455|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    562|    uint16_t bitstream_version) {
   38|    562|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    562|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 562, False: 0]
  ------------------
   40|    562|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 43, False: 519]
  ------------------
   41|    519|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 31, False: 488]
  ------------------
   42|    488|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 4, False: 484]
  ------------------
   43|    484|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 38, False: 446]
  ------------------
   44|    446|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 372, False: 74]
  ------------------
   45|    550|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 62, False: 12]
  ------------------
   46|    550|    const CornerTable *const ct = source->GetCornerTable();
   47|    550|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    550|        source->GetAttributeEncodingData(att_id);
   49|    550|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 190, False: 360]
  |  Branch (49:26): [True: 0, False: 360]
  ------------------
   50|       |      // No connectivity data found.
   51|    190|      return nullptr;
   52|    190|    }
   53|       |    // Connectivity data exists.
   54|    360|    const MeshAttributeCornerTable *const att_ct =
   55|    360|        source->GetAttributeCornerTable(att_id);
   56|    360|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 184, False: 176]
  ------------------
   57|    184|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    184|      MeshData md;
   59|    184|      md.Set(source->mesh(), att_ct,
   60|    184|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    184|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    184|      MeshPredictionSchemeFactoryT factory;
   63|    184|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    184|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 157, False: 27]
  ------------------
   65|    157|        return ret;
   66|    157|      }
   67|    184|    } else {
   68|    176|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    176|      MeshData md;
   70|    176|      md.Set(source->mesh(), ct,
   71|    176|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    176|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    176|      MeshPredictionSchemeFactoryT factory;
   74|    176|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    176|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 174, False: 2]
  ------------------
   76|    174|        return ret;
   77|    174|      }
   78|    176|    }
   79|    360|  }
   80|     41|  return nullptr;
   81|    562|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  4.59k|    uint16_t bitstream_version) {
   38|  4.59k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  4.59k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 4.59k, False: 0]
  ------------------
   40|  4.59k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 1.26k, False: 3.32k]
  ------------------
   41|  3.32k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 801, False: 2.52k]
  ------------------
   42|  2.52k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 910, False: 1.61k]
  ------------------
   43|  1.61k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 463, False: 1.15k]
  ------------------
   44|  1.15k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 658, False: 496]
  ------------------
   45|  4.39k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 295, False: 201]
  ------------------
   46|  4.39k|    const CornerTable *const ct = source->GetCornerTable();
   47|  4.39k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  4.39k|        source->GetAttributeEncodingData(att_id);
   49|  4.39k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 229, False: 4.16k]
  |  Branch (49:26): [True: 0, False: 4.16k]
  ------------------
   50|       |      // No connectivity data found.
   51|    229|      return nullptr;
   52|    229|    }
   53|       |    // Connectivity data exists.
   54|  4.16k|    const MeshAttributeCornerTable *const att_ct =
   55|  4.16k|        source->GetAttributeCornerTable(att_id);
   56|  4.16k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 1.91k, False: 2.25k]
  ------------------
   57|  1.91k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  1.91k|      MeshData md;
   59|  1.91k|      md.Set(source->mesh(), att_ct,
   60|  1.91k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  1.91k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  1.91k|      MeshPredictionSchemeFactoryT factory;
   63|  1.91k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  1.91k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 1.91k, False: 0]
  ------------------
   65|  1.91k|        return ret;
   66|  1.91k|      }
   67|  2.25k|    } else {
   68|  2.25k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  2.25k|      MeshData md;
   70|  2.25k|      md.Set(source->mesh(), ct,
   71|  2.25k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  2.25k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  2.25k|      MeshPredictionSchemeFactoryT factory;
   74|  2.25k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  2.25k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 2.25k, False: 0]
  ------------------
   76|  2.25k|        return ret;
   77|  2.25k|      }
   78|  2.25k|    }
   79|  4.16k|  }
   80|    201|  return nullptr;
   81|  4.59k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|   992k|  bool IsInBottomLeft(const Point2 &p) const {
   93|   992k|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 663k, False: 329k]
  |  Branch (93:22): [True: 590k, False: 72.6k]
  ------------------
   94|   590k|      return true;
   95|   590k|    }
   96|   401k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 175k, False: 226k]
  |  Branch (96:25): [True: 119k, False: 55.4k]
  ------------------
   97|   992k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|   992k|  int32_t GetRotationCount(Point2 pred) const {
   51|   992k|    const DataType sign_x = pred[0];
   52|   992k|    const DataType sign_y = pred[1];
   53|       |
   54|   992k|    int32_t rotation_count = 0;
   55|   992k|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 663k, False: 329k]
  ------------------
   56|   663k|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 590k, False: 72.6k]
  ------------------
   57|   590k|        rotation_count = 0;
   58|   590k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 46.9k, False: 25.7k]
  ------------------
   59|  46.9k|        rotation_count = 3;
   60|  46.9k|      } else {
   61|  25.7k|        rotation_count = 1;
   62|  25.7k|      }
   63|   663k|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 154k, False: 175k]
  ------------------
   64|   154k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 98.9k, False: 55.0k]
  ------------------
   65|  98.9k|        rotation_count = 2;
   66|  98.9k|      } else {
   67|  55.0k|        rotation_count = 1;
   68|  55.0k|      }
   69|   175k|    } else {
   70|   175k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 119k, False: 55.4k]
  ------------------
   71|   119k|        rotation_count = 0;
   72|   119k|      } else {
   73|  55.4k|        rotation_count = 3;
   74|  55.4k|      }
   75|   175k|    }
   76|   992k|    return rotation_count;
   77|   992k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   564k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   564k|    switch (rotation_count) {
   81|   183k|      case 1:
  ------------------
  |  Branch (81:7): [True: 183k, False: 381k]
  ------------------
   82|   183k|        return Point2(p[1], -p[0]);
   83|   197k|      case 2:
  ------------------
  |  Branch (83:7): [True: 197k, False: 366k]
  ------------------
   84|   197k|        return Point2(-p[0], -p[1]);
   85|   183k|      case 3:
  ------------------
  |  Branch (85:7): [True: 183k, False: 381k]
  ------------------
   86|   183k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 564k]
  ------------------
   88|      0|        return p;
   89|   564k|    }
   90|   564k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    565|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|  4.40k|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|  3.84k|  inline void set_min_value(const DataTypeT &v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|  3.84k|  inline void set_max_value(const DataTypeT &v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|  3.84k|  bool InitCorrectionBounds() {
   84|  3.84k|    const int64_t dif =
   85|  3.84k|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|  3.84k|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 3.84k]
  |  Branch (86:20): [True: 22, False: 3.81k]
  ------------------
   87|     22|      return false;
   88|     22|    }
   89|  3.81k|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|  3.81k|    max_correction_ = max_dif_ / 2;
   91|  3.81k|    min_correction_ = -max_correction_;
   92|  3.81k|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 1.72k, False: 2.09k]
  ------------------
   93|  1.72k|      max_correction_ -= 1;
   94|  1.72k|    }
   95|  3.81k|    return true;
   96|  3.84k|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|  3.20k|  void Init(int num_components) {
   56|  3.20k|    num_components_ = num_components;
   57|  3.20k|    clamped_value_.resize(num_components);
   58|  3.20k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|  27.9M|      const DataTypeT *predicted_val) const {
   64|   421M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 393M, False: 27.9M]
  ------------------
   65|   393M|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 432k, False: 393M]
  ------------------
   66|   432k|        clamped_value_[i] = max_value_;
   67|   393M|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 5.20M, False: 388M]
  ------------------
   68|  5.20M|        clamped_value_[i] = min_value_;
   69|   388M|      } else {
   70|   388M|        clamped_value_[i] = predicted_val[i];
   71|   388M|      }
   72|   393M|    }
   73|  27.9M|    return clamped_value_.data();
   74|  27.9M|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|   843M|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|   393M|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|  1.71M|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|   393M|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|    556|  int quantization_bits() const {
   78|    556|    DRACO_DCHECK(false);
   79|    556|    return -1;
   80|    556|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   44|  4.61k|      : num_components_(0),
   45|  4.61k|        min_value_(0),
   46|  4.61k|        max_value_(0),
   47|  4.61k|        max_dif_(0),
   48|  4.61k|        max_correction_(0),
   49|  4.61k|        min_correction_(0) {}

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

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  7.42k|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|   222M|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  5.65k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  26.1k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  8.50k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  8.50k|    portable_attribute_ = std::move(att);
   71|  8.50k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  28.1k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  17.0k|  virtual ~SequentialAttributeDecoder() = default;

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  32.1k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  5.42k|    DecoderBuffer *buffer) {
   30|  5.42k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 295, False: 5.13k]
  ------------------
   31|    295|    return false;
   32|    295|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  5.13k|  const int32_t num_attributes = GetNumAttributes();
   35|  5.13k|  sequential_decoders_.resize(num_attributes);
   36|  22.1k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 17.0k, False: 5.10k]
  ------------------
   37|  17.0k|    uint8_t decoder_type;
   38|  17.0k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 7, False: 17.0k]
  ------------------
   39|      7|      return false;
   40|      7|    }
   41|       |    // Create the decoder from the id.
   42|  17.0k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  17.0k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 18, False: 17.0k]
  ------------------
   44|     18|      return false;
   45|     18|    }
   46|  17.0k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 8, False: 17.0k]
  ------------------
   47|      8|      return false;
   48|      8|    }
   49|  17.0k|  }
   50|  5.10k|  return true;
   51|  5.13k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  4.77k|    DecoderBuffer *buffer) {
   55|  4.77k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 4.77k]
  |  Branch (55:22): [True: 7, False: 4.76k]
  ------------------
   56|      7|    return false;
   57|      7|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  4.76k|  const int32_t num_attributes = GetNumAttributes();
   60|  21.2k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 16.4k, False: 4.76k]
  ------------------
   61|  16.4k|    PointAttribute *const pa =
   62|  16.4k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  16.4k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 0, False: 16.4k]
  ------------------
   64|      0|      return false;
   65|      0|    }
   66|  16.4k|  }
   67|  4.76k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  4.76k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  4.76k|    DecoderBuffer *in_buffer) {
   72|  4.76k|  const int32_t num_attributes = GetNumAttributes();
   73|  13.1k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 10.4k, False: 2.70k]
  ------------------
   74|  10.4k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 2.06k, False: 8.36k]
  ------------------
   75|  10.4k|                                                          in_buffer)) {
   76|  2.06k|      return false;
   77|  2.06k|    }
   78|  10.4k|  }
   79|  2.70k|  return true;
   80|  4.76k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  2.70k|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|  2.70k|  const int32_t num_attributes = GetNumAttributes();
   85|  7.22k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 5.00k, False: 2.22k]
  ------------------
   86|  5.00k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 480, False: 4.52k]
  ------------------
   87|  5.00k|            point_ids_, in_buffer)) {
   88|    480|      return false;
   89|    480|    }
   90|  5.00k|  }
   91|  2.22k|  return true;
   92|  2.70k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  2.22k|    TransformAttributesToOriginalFormat() {
   96|  2.22k|  const int32_t num_attributes = GetNumAttributes();
   97|  5.79k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 4.04k, False: 1.75k]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  4.04k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 4.04k, False: 0]
  ------------------
  100|  4.04k|      const PointAttribute *const attribute =
  101|  4.04k|          sequential_decoders_[i]->attribute();
  102|  4.04k|      const PointAttribute *const portable_attribute =
  103|  4.04k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  4.04k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 3.19k, False: 849]
  |  Branch (104:11): [True: 1.05k, False: 2.99k]
  ------------------
  105|  3.19k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 1.05k, False: 2.14k]
  ------------------
  106|  3.19k|              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|  1.05k|        sequential_decoders_[i]->attribute()->CopyFrom(*portable_attribute);
  113|  1.05k|        continue;
  114|  1.05k|      }
  115|  4.04k|    }
  116|  2.99k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 471, False: 2.51k]
  ------------------
  117|  2.99k|            point_ids_)) {
  118|    471|      return false;
  119|    471|    }
  120|  2.99k|  }
  121|  1.75k|  return true;
  122|  2.22k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  17.0k|    uint8_t decoder_type) {
  127|  17.0k|  switch (decoder_type) {
  128|  2.87k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 2.87k, False: 14.1k]
  ------------------
  129|  2.87k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  2.87k|          new SequentialAttributeDecoder());
  131|  12.6k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 12.6k, False: 4.33k]
  ------------------
  132|  12.6k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  12.6k|          new SequentialIntegerAttributeDecoder());
  134|    203|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 203, False: 16.8k]
  ------------------
  135|    203|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    203|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|  1.23k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 1.23k, False: 15.7k]
  ------------------
  139|  1.23k|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|  1.23k|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|     18|    default:
  ------------------
  |  Branch (142:5): [True: 18, False: 17.0k]
  ------------------
  143|     18|      break;
  144|  17.0k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|     18|  return nullptr;
  147|  17.0k|}

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

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

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

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

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

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

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

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|  6.04M|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|  6.04M|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|  6.04M|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|  6.04M|    const int remaining = 32 - num_used_bits_;
   54|  6.04M|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 4.27M, False: 1.76M]
  ------------------
   55|  4.27M|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 3.90M, False: 376k]
  ------------------
   56|  3.90M|        return false;
   57|  3.90M|      }
   58|   376k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   376k|      num_used_bits_ += nbits;
   60|   376k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 12.4k, False: 364k]
  ------------------
   61|  12.4k|        ++pos_;
   62|  12.4k|        num_used_bits_ = 0;
   63|  12.4k|      }
   64|  1.76M|    } else {
   65|  1.76M|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 1.75M, False: 13.5k]
  ------------------
   66|  1.75M|        return false;
   67|  1.75M|      }
   68|  13.5k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  13.5k|      num_used_bits_ = nbits - remaining;
   70|  13.5k|      ++pos_;
   71|  13.5k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  13.5k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  13.5k|    }
   74|   390k|    return true;
   75|  6.04M|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  7.46M|  bool DecodeNextBit() {
   35|  7.46M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  7.46M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 6.91M, False: 559k]
  ------------------
   37|  6.91M|      return false;
   38|  6.91M|    }
   39|   559k|    const bool bit = *pos_ & selector;
   40|   559k|    ++num_used_bits_;
   41|   559k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 17.3k, False: 541k]
  ------------------
   42|  17.3k|      ++pos_;
   43|  17.3k|      num_used_bits_ = 0;
   44|  17.3k|    }
   45|   559k|    return bit;
   46|  7.46M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    780|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    667|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    432|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  10.2k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 9.97k, False: 284]
  ------------------
   35|  9.97k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 148, False: 9.83k]
  ------------------
   36|    148|        return false;
   37|    148|      }
   38|  9.97k|    }
   39|    284|    return bit_decoder_.StartDecoding(source_buffer);
   40|    432|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  3.02M|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|  3.02M|    uint32_t result = 0;
   49|  18.8M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 15.8M, False: 3.02M]
  ------------------
   50|  15.8M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  15.8M|      result = (result << 1) + bit;
   52|  15.8M|    }
   53|  3.02M|    *value = result;
   54|  3.02M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|    140|  void EndDecoding() {
   57|  4.62k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 4.48k, False: 140]
  ------------------
   58|  4.48k|      folded_number_decoders_[i].EndDecoding();
   59|  4.48k|    }
   60|    140|    bit_decoder_.EndDecoding();
   61|    140|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    667|  FoldedBit32Decoder() {}

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  57.3k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  30.2k|                                const uint8_t *const buf, int offset) {
  301|  30.2k|  unsigned x;
  302|  30.2k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 55, False: 30.1k]
  ------------------
  303|     55|    return 1;
  304|     55|  }
  305|  30.1k|  ans->buf = buf;
  306|  30.1k|  x = buf[offset - 1] >> 6;
  307|  30.1k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 26.3k, False: 3.82k]
  ------------------
  308|  26.3k|    ans->buf_offset = offset - 1;
  309|  26.3k|    ans->state = buf[offset - 1] & 0x3F;
  310|  26.3k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 3.49k, False: 329]
  ------------------
  311|  3.49k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 5, False: 3.48k]
  ------------------
  312|      5|      return 1;
  313|      5|    }
  314|  3.48k|    ans->buf_offset = offset - 2;
  315|  3.48k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  3.48k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 319, False: 10]
  ------------------
  317|    319|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 5, False: 314]
  ------------------
  318|      5|      return 1;
  319|      5|    }
  320|    314|    ans->buf_offset = offset - 3;
  321|    314|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    314|  } else {
  323|     10|    return 1;
  324|     10|  }
  325|  30.1k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  30.1k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  30.1k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  30.1k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  30.1k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 8, False: 30.1k]
  ------------------
  327|      8|    return 1;
  328|      8|  }
  329|  30.1k|  return 0;
  330|  30.1k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  3.48k|static uint32_t mem_get_le16(const void *vmem) {
   68|  3.48k|  uint32_t val;
   69|  3.48k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  3.48k|  val = mem[1] << 8;
   72|  3.48k|  val |= mem[0];
   73|  3.48k|  return val;
   74|  3.48k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    314|static uint32_t mem_get_le24(const void *vmem) {
   77|    314|  uint32_t val;
   78|    314|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    314|  val = mem[2] << 16;
   81|    314|  val |= mem[1] << 8;
   82|    314|  val |= mem[0];
   83|    314|  return val;
   84|    314|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  5.12G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  5.12G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  5.12G|  unsigned quot, rem, x, xn;
  172|  5.12G|#endif
  173|  5.12G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  5.12G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  5.12G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  10.2G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 4.32G, False: 800M]
  |  Branch (174:40): [True: 116k, False: 4.32G]
  ------------------
  175|   116k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   116k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   116k|  }
  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.12G|  x = ans->state;
  184|  5.12G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  5.12G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  5.12G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  5.12G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  5.12G|  xn = quot * p;
  187|  5.12G|  val = rem < p;
  188|  5.12G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  10.2G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 4.32G, False: 794M]
  |  |  ------------------
  ------------------
  189|  4.32G|    ans->state = xn + rem;
  190|  4.32G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   794M|    ans->state = x - xn - p;
  193|   794M|  }
  194|  5.12G|#endif
  195|  5.12G|  return val;
  196|  5.12G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  79.1k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  79.1k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  79.1k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  79.1k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  4.95k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|  2.67k|                                       uint32_t num_symbols) {
  482|  2.67k|    lut_table_.resize(rans_precision);
  483|  2.67k|    probability_table_.resize(num_symbols);
  484|  2.67k|    uint32_t cum_prob = 0;
  485|  2.67k|    uint32_t act_prob = 0;
  486|  23.8k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 21.4k, False: 2.42k]
  ------------------
  487|  21.4k|      probability_table_[i].prob = token_probs[i];
  488|  21.4k|      probability_table_[i].cum_prob = cum_prob;
  489|  21.4k|      cum_prob += token_probs[i];
  490|  21.4k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 243, False: 21.2k]
  ------------------
  491|    243|        return false;
  492|    243|      }
  493|  9.06M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 9.04M, False: 21.2k]
  ------------------
  494|  9.04M|        lut_table_[j] = i;
  495|  9.04M|      }
  496|  21.2k|      act_prob = cum_prob;
  497|  21.2k|    }
  498|  2.42k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 274, False: 2.15k]
  ------------------
  499|    274|      return false;
  500|    274|    }
  501|  2.15k|    return true;
  502|  2.42k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.72k|  inline int read_init(const uint8_t *const buf, int offset) {
  422|  1.72k|    unsigned x;
  423|  1.72k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 124, False: 1.60k]
  ------------------
  424|    124|      return 1;
  425|    124|    }
  426|  1.60k|    ans_.buf = buf;
  427|  1.60k|    x = buf[offset - 1] >> 6;
  428|  1.60k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 1.01k, False: 592]
  ------------------
  429|  1.01k|      ans_.buf_offset = offset - 1;
  430|  1.01k|      ans_.state = buf[offset - 1] & 0x3F;
  431|  1.01k|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 225, False: 367]
  ------------------
  432|    225|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 27, False: 198]
  ------------------
  433|     27|        return 1;
  434|     27|      }
  435|    198|      ans_.buf_offset = offset - 2;
  436|    198|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    367|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 228, False: 139]
  ------------------
  438|    228|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 48, False: 180]
  ------------------
  439|     48|        return 1;
  440|     48|      }
  441|    180|      ans_.buf_offset = offset - 3;
  442|    180|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    180|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 139, False: 0]
  ------------------
  444|    139|      ans_.buf_offset = offset - 4;
  445|    139|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    139|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|  1.52k|    ans_.state += l_rans_base;
  450|  1.52k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.52k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 129, False: 1.40k]
  ------------------
  451|    129|      return 1;
  452|    129|    }
  453|  1.40k|    return 0;
  454|  1.52k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    318|static uint32_t mem_get_le16(const void *vmem) {
   68|    318|  uint32_t val;
   69|    318|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    318|  val = mem[1] << 8;
   72|    318|  val |= mem[0];
   73|    318|  return val;
   74|    318|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    280|static uint32_t mem_get_le24(const void *vmem) {
   77|    280|  uint32_t val;
   78|    280|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    280|  val = mem[2] << 16;
   81|    280|  val |= mem[1] << 8;
   82|    280|  val |= mem[0];
   83|    280|  return val;
   84|    280|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    410|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    410|  uint32_t val;
   88|    410|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    410|  val = mem[3] << 24;
   91|    410|  val |= mem[2] << 16;
   92|    410|  val |= mem[1] << 8;
   93|    410|  val |= mem[0];
   94|    410|  return val;
   95|    410|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|  82.4M|  inline int rans_read() {
  463|  82.4M|    unsigned rem;
  464|  82.4M|    unsigned quo;
  465|  82.4M|    struct rans_dec_sym sym;
  466|  82.4M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 73.0M, False: 9.48M]
  |  Branch (466:40): [True: 29.0k, False: 72.9M]
  ------------------
  467|  29.0k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  29.0k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  29.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|  82.4M|    quo = ans_.state / rans_precision;
  472|  82.4M|    rem = ans_.state % rans_precision;
  473|  82.4M|    fetch_sym(&sym, rem);
  474|  82.4M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  82.4M|    return sym.val;
  476|  82.4M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|  82.4M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  82.4M|    uint32_t symbol = lut_table_[rem];
  507|  82.4M|    out->val = symbol;
  508|  82.4M|    out->prob = probability_table_[symbol].prob;
  509|  82.4M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  82.4M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|  1.32k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    370|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|    216|                                       uint32_t num_symbols) {
  482|    216|    lut_table_.resize(rans_precision);
  483|    216|    probability_table_.resize(num_symbols);
  484|    216|    uint32_t cum_prob = 0;
  485|    216|    uint32_t act_prob = 0;
  486|  3.21k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 3.02k, False: 187]
  ------------------
  487|  3.02k|      probability_table_[i].prob = token_probs[i];
  488|  3.02k|      probability_table_[i].cum_prob = cum_prob;
  489|  3.02k|      cum_prob += token_probs[i];
  490|  3.02k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 29, False: 2.99k]
  ------------------
  491|     29|        return false;
  492|     29|      }
  493|  1.35M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.35M, False: 2.99k]
  ------------------
  494|  1.35M|        lut_table_[j] = i;
  495|  1.35M|      }
  496|  2.99k|      act_prob = cum_prob;
  497|  2.99k|    }
  498|    187|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 33, False: 154]
  ------------------
  499|     33|      return false;
  500|     33|    }
  501|    154|    return true;
  502|    187|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|     70|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     70|    unsigned x;
  423|     70|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 3, False: 67]
  ------------------
  424|      3|      return 1;
  425|      3|    }
  426|     67|    ans_.buf = buf;
  427|     67|    x = buf[offset - 1] >> 6;
  428|     67|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 30, False: 37]
  ------------------
  429|     30|      ans_.buf_offset = offset - 1;
  430|     30|      ans_.state = buf[offset - 1] & 0x3F;
  431|     37|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 3, False: 34]
  ------------------
  432|      3|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 2]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      2|      ans_.buf_offset = offset - 2;
  436|      2|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     34|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 17, False: 17]
  ------------------
  438|     17|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 8, False: 9]
  ------------------
  439|      8|        return 1;
  440|      8|      }
  441|      9|      ans_.buf_offset = offset - 3;
  442|      9|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     17|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 17, False: 0]
  ------------------
  444|     17|      ans_.buf_offset = offset - 4;
  445|     17|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     17|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     58|    ans_.state += l_rans_base;
  450|     58|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     58|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 15, False: 43]
  ------------------
  451|     15|      return 1;
  452|     15|    }
  453|     43|    return 0;
  454|     58|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|  94.3k|  inline int rans_read() {
  463|  94.3k|    unsigned rem;
  464|  94.3k|    unsigned quo;
  465|  94.3k|    struct rans_dec_sym sym;
  466|  95.0k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 45.9k, False: 49.1k]
  |  Branch (466:40): [True: 769, False: 45.1k]
  ------------------
  467|    769|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    769|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    769|    }
  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|  94.3k|    quo = ans_.state / rans_precision;
  472|  94.3k|    rem = ans_.state % rans_precision;
  473|  94.3k|    fetch_sym(&sym, rem);
  474|  94.3k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  94.3k|    return sym.val;
  476|  94.3k|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|  94.3k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  94.3k|    uint32_t symbol = lut_table_[rem];
  507|  94.3k|    out->val = symbol;
  508|  94.3k|    out->prob = probability_table_[symbol].prob;
  509|  94.3k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  94.3k|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|     43|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    370|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|    199|                                       uint32_t num_symbols) {
  482|    199|    lut_table_.resize(rans_precision);
  483|    199|    probability_table_.resize(num_symbols);
  484|    199|    uint32_t cum_prob = 0;
  485|    199|    uint32_t act_prob = 0;
  486|  5.08k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 4.91k, False: 170]
  ------------------
  487|  4.91k|      probability_table_[i].prob = token_probs[i];
  488|  4.91k|      probability_table_[i].cum_prob = cum_prob;
  489|  4.91k|      cum_prob += token_probs[i];
  490|  4.91k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 29, False: 4.88k]
  ------------------
  491|     29|        return false;
  492|     29|      }
  493|  4.81M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 4.81M, False: 4.88k]
  ------------------
  494|  4.81M|        lut_table_[j] = i;
  495|  4.81M|      }
  496|  4.88k|      act_prob = cum_prob;
  497|  4.88k|    }
  498|    170|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 41, False: 129]
  ------------------
  499|     41|      return false;
  500|     41|    }
  501|    129|    return true;
  502|    170|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|     85|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     85|    unsigned x;
  423|     85|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 1, False: 84]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|     84|    ans_.buf = buf;
  427|     84|    x = buf[offset - 1] >> 6;
  428|     84|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 31, False: 53]
  ------------------
  429|     31|      ans_.buf_offset = offset - 1;
  430|     31|      ans_.state = buf[offset - 1] & 0x3F;
  431|     53|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 20, False: 33]
  ------------------
  432|     20|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 6, False: 14]
  ------------------
  433|      6|        return 1;
  434|      6|      }
  435|     14|      ans_.buf_offset = offset - 2;
  436|     14|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     33|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 15, False: 18]
  ------------------
  438|     15|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 3, False: 12]
  ------------------
  439|      3|        return 1;
  440|      3|      }
  441|     12|      ans_.buf_offset = offset - 3;
  442|     12|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     18|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 18, False: 0]
  ------------------
  444|     18|      ans_.buf_offset = offset - 4;
  445|     18|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     18|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     75|    ans_.state += l_rans_base;
  450|     75|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     75|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 16, False: 59]
  ------------------
  451|     16|      return 1;
  452|     16|    }
  453|     59|    return 0;
  454|     75|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|   467k|  inline int rans_read() {
  463|   467k|    unsigned rem;
  464|   467k|    unsigned quo;
  465|   467k|    struct rans_dec_sym sym;
  466|   470k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 450k, False: 20.2k]
  |  Branch (466:40): [True: 2.80k, False: 447k]
  ------------------
  467|  2.80k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  2.80k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  2.80k|    }
  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|   467k|    quo = ans_.state / rans_precision;
  472|   467k|    rem = ans_.state % rans_precision;
  473|   467k|    fetch_sym(&sym, rem);
  474|   467k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   467k|    return sym.val;
  476|   467k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|   467k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   467k|    uint32_t symbol = lut_table_[rem];
  507|   467k|    out->val = symbol;
  508|   467k|    out->prob = probability_table_[symbol].prob;
  509|   467k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   467k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     59|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    430|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|    264|                                       uint32_t num_symbols) {
  482|    264|    lut_table_.resize(rans_precision);
  483|    264|    probability_table_.resize(num_symbols);
  484|    264|    uint32_t cum_prob = 0;
  485|    264|    uint32_t act_prob = 0;
  486|  27.6k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 27.4k, False: 223]
  ------------------
  487|  27.4k|      probability_table_[i].prob = token_probs[i];
  488|  27.4k|      probability_table_[i].cum_prob = cum_prob;
  489|  27.4k|      cum_prob += token_probs[i];
  490|  27.4k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 41, False: 27.3k]
  ------------------
  491|     41|        return false;
  492|     41|      }
  493|  13.0M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 13.0M, False: 27.3k]
  ------------------
  494|  13.0M|        lut_table_[j] = i;
  495|  13.0M|      }
  496|  27.3k|      act_prob = cum_prob;
  497|  27.3k|    }
  498|    223|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 52, False: 171]
  ------------------
  499|     52|      return false;
  500|     52|    }
  501|    171|    return true;
  502|    223|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     87|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     87|    unsigned x;
  423|     87|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 7, False: 80]
  ------------------
  424|      7|      return 1;
  425|      7|    }
  426|     80|    ans_.buf = buf;
  427|     80|    x = buf[offset - 1] >> 6;
  428|     80|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 26, False: 54]
  ------------------
  429|     26|      ans_.buf_offset = offset - 1;
  430|     26|      ans_.state = buf[offset - 1] & 0x3F;
  431|     54|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 19, False: 35]
  ------------------
  432|     19|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 11, False: 8]
  ------------------
  433|     11|        return 1;
  434|     11|      }
  435|      8|      ans_.buf_offset = offset - 2;
  436|      8|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     35|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 28, False: 7]
  ------------------
  438|     28|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 24, False: 4]
  ------------------
  439|     24|        return 1;
  440|     24|      }
  441|      4|      ans_.buf_offset = offset - 3;
  442|      4|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      7|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 7, False: 0]
  ------------------
  444|      7|      ans_.buf_offset = offset - 4;
  445|      7|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      7|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     45|    ans_.state += l_rans_base;
  450|     45|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     45|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 6, False: 39]
  ------------------
  451|      6|      return 1;
  452|      6|    }
  453|     39|    return 0;
  454|     45|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|  51.4k|  inline int rans_read() {
  463|  51.4k|    unsigned rem;
  464|  51.4k|    unsigned quo;
  465|  51.4k|    struct rans_dec_sym sym;
  466|  51.9k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 50.0k, False: 1.98k]
  |  Branch (466:40): [True: 583, False: 49.4k]
  ------------------
  467|    583|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    583|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    583|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  51.4k|    quo = ans_.state / rans_precision;
  472|  51.4k|    rem = ans_.state % rans_precision;
  473|  51.4k|    fetch_sym(&sym, rem);
  474|  51.4k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  51.4k|    return sym.val;
  476|  51.4k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|  51.4k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  51.4k|    uint32_t symbol = lut_table_[rem];
  507|  51.4k|    out->val = symbol;
  508|  51.4k|    out->prob = probability_table_[symbol].prob;
  509|  51.4k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  51.4k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|     39|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    426|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|    264|                                       uint32_t num_symbols) {
  482|    264|    lut_table_.resize(rans_precision);
  483|    264|    probability_table_.resize(num_symbols);
  484|    264|    uint32_t cum_prob = 0;
  485|    264|    uint32_t act_prob = 0;
  486|  11.6k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 11.4k, False: 224]
  ------------------
  487|  11.4k|      probability_table_[i].prob = token_probs[i];
  488|  11.4k|      probability_table_[i].cum_prob = cum_prob;
  489|  11.4k|      cum_prob += token_probs[i];
  490|  11.4k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 40, False: 11.3k]
  ------------------
  491|     40|        return false;
  492|     40|      }
  493|  47.4M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 47.4M, False: 11.3k]
  ------------------
  494|  47.4M|        lut_table_[j] = i;
  495|  47.4M|      }
  496|  11.3k|      act_prob = cum_prob;
  497|  11.3k|    }
  498|    224|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 63, False: 161]
  ------------------
  499|     63|      return false;
  500|     63|    }
  501|    161|    return true;
  502|    224|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     84|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     84|    unsigned x;
  423|     84|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 78]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     78|    ans_.buf = buf;
  427|     78|    x = buf[offset - 1] >> 6;
  428|     78|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 18, False: 60]
  ------------------
  429|     18|      ans_.buf_offset = offset - 1;
  430|     18|      ans_.state = buf[offset - 1] & 0x3F;
  431|     60|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 9, False: 51]
  ------------------
  432|      9|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 2, False: 7]
  ------------------
  433|      2|        return 1;
  434|      2|      }
  435|      7|      ans_.buf_offset = offset - 2;
  436|      7|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     51|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 30, False: 21]
  ------------------
  438|     30|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 13, False: 17]
  ------------------
  439|     13|        return 1;
  440|     13|      }
  441|     17|      ans_.buf_offset = offset - 3;
  442|     17|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     21|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 21, False: 0]
  ------------------
  444|     21|      ans_.buf_offset = offset - 4;
  445|     21|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     21|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     63|    ans_.state += l_rans_base;
  450|     63|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     63|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 8, False: 55]
  ------------------
  451|      8|      return 1;
  452|      8|    }
  453|     55|    return 0;
  454|     63|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|   168k|  inline int rans_read() {
  463|   168k|    unsigned rem;
  464|   168k|    unsigned quo;
  465|   168k|    struct rans_dec_sym sym;
  466|   168k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 118k, False: 49.9k]
  |  Branch (466:40): [True: 379, False: 118k]
  ------------------
  467|    379|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    379|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    379|    }
  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|   168k|    quo = ans_.state / rans_precision;
  472|   168k|    rem = ans_.state % rans_precision;
  473|   168k|    fetch_sym(&sym, rem);
  474|   168k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   168k|    return sym.val;
  476|   168k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|   168k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   168k|    uint32_t symbol = lut_table_[rem];
  507|   168k|    out->val = symbol;
  508|   168k|    out->prob = probability_table_[symbol].prob;
  509|   168k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   168k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|     55|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    368|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|    230|                                       uint32_t num_symbols) {
  482|    230|    lut_table_.resize(rans_precision);
  483|    230|    probability_table_.resize(num_symbols);
  484|    230|    uint32_t cum_prob = 0;
  485|    230|    uint32_t act_prob = 0;
  486|  5.63k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 5.42k, False: 203]
  ------------------
  487|  5.42k|      probability_table_[i].prob = token_probs[i];
  488|  5.42k|      probability_table_[i].cum_prob = cum_prob;
  489|  5.42k|      cum_prob += token_probs[i];
  490|  5.42k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 27, False: 5.40k]
  ------------------
  491|     27|        return false;
  492|     27|      }
  493|  85.9M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 85.9M, False: 5.40k]
  ------------------
  494|  85.9M|        lut_table_[j] = i;
  495|  85.9M|      }
  496|  5.40k|      act_prob = cum_prob;
  497|  5.40k|    }
  498|    203|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 56, False: 147]
  ------------------
  499|     56|      return false;
  500|     56|    }
  501|    147|    return true;
  502|    203|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     99|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     99|    unsigned x;
  423|     99|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 93]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     93|    ans_.buf = buf;
  427|     93|    x = buf[offset - 1] >> 6;
  428|     93|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 35, False: 58]
  ------------------
  429|     35|      ans_.buf_offset = offset - 1;
  430|     35|      ans_.state = buf[offset - 1] & 0x3F;
  431|     58|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 8, False: 50]
  ------------------
  432|      8|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 7]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|      7|      ans_.buf_offset = offset - 2;
  436|      7|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     50|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 12, False: 38]
  ------------------
  438|     12|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 11]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|     11|      ans_.buf_offset = offset - 3;
  442|     11|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     38|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 38, False: 0]
  ------------------
  444|     38|      ans_.buf_offset = offset - 4;
  445|     38|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     38|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     91|    ans_.state += l_rans_base;
  450|     91|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     91|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 20, False: 71]
  ------------------
  451|     20|      return 1;
  452|     20|    }
  453|     71|    return 0;
  454|     91|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|   550k|  inline int rans_read() {
  463|   550k|    unsigned rem;
  464|   550k|    unsigned quo;
  465|   550k|    struct rans_dec_sym sym;
  466|   551k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 382k, False: 168k]
  |  Branch (466:40): [True: 1.51k, False: 381k]
  ------------------
  467|  1.51k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.51k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.51k|    }
  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|   550k|    quo = ans_.state / rans_precision;
  472|   550k|    rem = ans_.state % rans_precision;
  473|   550k|    fetch_sym(&sym, rem);
  474|   550k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   550k|    return sym.val;
  476|   550k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|   550k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   550k|    uint32_t symbol = lut_table_[rem];
  507|   550k|    out->val = symbol;
  508|   550k|    out->prob = probability_table_[symbol].prob;
  509|   550k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   550k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     71|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.95k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|  1.09k|                                       uint32_t num_symbols) {
  482|  1.09k|    lut_table_.resize(rans_precision);
  483|  1.09k|    probability_table_.resize(num_symbols);
  484|  1.09k|    uint32_t cum_prob = 0;
  485|  1.09k|    uint32_t act_prob = 0;
  486|  19.2k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 18.2k, False: 1.05k]
  ------------------
  487|  18.2k|      probability_table_[i].prob = token_probs[i];
  488|  18.2k|      probability_table_[i].cum_prob = cum_prob;
  489|  18.2k|      cum_prob += token_probs[i];
  490|  18.2k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 45, False: 18.1k]
  ------------------
  491|     45|        return false;
  492|     45|      }
  493|  1.01G|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.01G, False: 18.1k]
  ------------------
  494|  1.01G|        lut_table_[j] = i;
  495|  1.01G|      }
  496|  18.1k|      act_prob = cum_prob;
  497|  18.1k|    }
  498|  1.05k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 114, False: 940]
  ------------------
  499|    114|      return false;
  500|    114|    }
  501|    940|    return true;
  502|  1.05k|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    502|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    502|    unsigned x;
  423|    502|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 27, False: 475]
  ------------------
  424|     27|      return 1;
  425|     27|    }
  426|    475|    ans_.buf = buf;
  427|    475|    x = buf[offset - 1] >> 6;
  428|    475|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 129, False: 346]
  ------------------
  429|    129|      ans_.buf_offset = offset - 1;
  430|    129|      ans_.state = buf[offset - 1] & 0x3F;
  431|    346|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 112, False: 234]
  ------------------
  432|    112|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 30, False: 82]
  ------------------
  433|     30|        return 1;
  434|     30|      }
  435|     82|      ans_.buf_offset = offset - 2;
  436|     82|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    234|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 64, False: 170]
  ------------------
  438|     64|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 17, False: 47]
  ------------------
  439|     17|        return 1;
  440|     17|      }
  441|     47|      ans_.buf_offset = offset - 3;
  442|     47|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    170|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 170, False: 0]
  ------------------
  444|    170|      ans_.buf_offset = offset - 4;
  445|    170|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    170|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    428|    ans_.state += l_rans_base;
  450|    428|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    428|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 44, False: 384]
  ------------------
  451|     44|      return 1;
  452|     44|    }
  453|    384|    return 0;
  454|    428|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  86.9M|  inline int rans_read() {
  463|  86.9M|    unsigned rem;
  464|  86.9M|    unsigned quo;
  465|  86.9M|    struct rans_dec_sym sym;
  466|  86.9M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 77.8M, False: 9.08M]
  |  Branch (466:40): [True: 4.74k, False: 77.8M]
  ------------------
  467|  4.74k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  4.74k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  4.74k|    }
  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|  86.9M|    quo = ans_.state / rans_precision;
  472|  86.9M|    rem = ans_.state % rans_precision;
  473|  86.9M|    fetch_sym(&sym, rem);
  474|  86.9M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  86.9M|    return sym.val;
  476|  86.9M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  86.9M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  86.9M|    uint32_t symbol = lut_table_[rem];
  507|  86.9M|    out->val = symbol;
  508|  86.9M|    out->prob = probability_table_[symbol].prob;
  509|  86.9M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  86.9M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    384|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|  1.48k|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|  1.48k|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|  1.48k|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 1.48k]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|  1.48k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|  1.48k|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.48k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 90, False: 1.39k]
  ------------------
   67|     90|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 8, False: 82]
  ------------------
   68|      8|      return false;
   69|      8|    }
   70|       |
   71|     90|  } else
   72|  1.39k|#endif
   73|  1.39k|  {
   74|  1.39k|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 38, False: 1.35k]
  ------------------
   75|     38|      return false;
   76|     38|    }
   77|  1.39k|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|  1.44k|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 89, False: 1.35k]
  ------------------
   83|     89|    return false;
   84|     89|  }
   85|  1.35k|  probability_table_.resize(num_symbols_);
   86|  1.35k|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 528, False: 823]
  ------------------
   87|    528|    return true;
   88|    528|  }
   89|       |  // Decode the table.
   90|  44.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 43.7k, False: 586]
  ------------------
   91|  43.7k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  43.7k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 89, False: 43.6k]
  ------------------
   95|     89|      return false;
   96|     89|    }
   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|  43.6k|    const int token = prob_data & 3;
  102|  43.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 16.1k, False: 27.5k]
  ------------------
  103|  16.1k|      const uint32_t offset = prob_data >> 2;
  104|  16.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 120, False: 15.9k]
  ------------------
  105|    120|        return false;
  106|    120|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   510k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 494k, False: 15.9k]
  ------------------
  109|   494k|        probability_table_[i + j] = 0;
  110|   494k|      }
  111|  15.9k|      i += offset;
  112|  27.5k|    } else {
  113|  27.5k|      const int extra_bytes = token;
  114|  27.5k|      uint32_t prob = prob_data >> 2;
  115|  54.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 26.5k, False: 27.4k]
  ------------------
  116|  26.5k|        uint8_t eb;
  117|  26.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 28, False: 26.5k]
  ------------------
  118|     28|          return false;
  119|     28|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  26.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  26.5k|      }
  124|  27.4k|      probability_table_[i] = prob;
  125|  27.4k|    }
  126|  43.6k|  }
  127|    586|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 199, False: 387]
  ------------------
  128|    199|    return false;
  129|    199|  }
  130|    387|  return true;
  131|    586|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    773|    DecoderBuffer *buffer) {
  136|    773|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    773|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    773|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    773|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 58, False: 715]
  ------------------
  140|     58|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 7, False: 51]
  ------------------
  141|      7|      return false;
  142|      7|    }
  143|       |
  144|     58|  } else
  145|    715|#endif
  146|    715|  {
  147|    715|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 41, False: 674]
  ------------------
  148|     41|      return false;
  149|     41|    }
  150|    715|  }
  151|    725|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 166, False: 559]
  ------------------
  152|    166|    return false;
  153|    166|  }
  154|    559|  const uint8_t *const data_head =
  155|    559|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    559|  buffer->Advance(bytes_encoded);
  158|    559|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 131, False: 428]
  ------------------
  159|    131|    return false;
  160|    131|  }
  161|    428|  return true;
  162|    559|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    589|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  1.51M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    356|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    356|  ans_.read_end();
  167|    356|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    624|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    624|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    624|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 624]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    624|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    624|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    624|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 78, False: 546]
  ------------------
   67|     78|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 5, False: 73]
  ------------------
   68|      5|      return false;
   69|      5|    }
   70|       |
   71|     78|  } else
   72|    546|#endif
   73|    546|  {
   74|    546|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 536]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    546|  }
   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|    609|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 58, False: 551]
  ------------------
   83|     58|    return false;
   84|     58|  }
   85|    551|  probability_table_.resize(num_symbols_);
   86|    551|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 22, False: 529]
  ------------------
   87|     22|    return true;
   88|     22|  }
   89|       |  // Decode the table.
   90|  2.54M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 2.54M, False: 343]
  ------------------
   91|  2.54M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  2.54M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 69, False: 2.54M]
  ------------------
   95|     69|      return false;
   96|     69|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  2.54M|    const int token = prob_data & 3;
  102|  2.54M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 760k, False: 1.78M]
  ------------------
  103|   760k|      const uint32_t offset = prob_data >> 2;
  104|   760k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 86, False: 759k]
  ------------------
  105|     86|        return false;
  106|     86|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  23.3M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 22.5M, False: 759k]
  ------------------
  109|  22.5M|        probability_table_[i + j] = 0;
  110|  22.5M|      }
  111|   759k|      i += offset;
  112|  1.78M|    } else {
  113|  1.78M|      const int extra_bytes = token;
  114|  1.78M|      uint32_t prob = prob_data >> 2;
  115|  1.83M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 50.5k, False: 1.78M]
  ------------------
  116|  50.5k|        uint8_t eb;
  117|  50.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 31, False: 50.5k]
  ------------------
  118|     31|          return false;
  119|     31|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  50.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  50.5k|      }
  124|  1.78M|      probability_table_[i] = prob;
  125|  1.78M|    }
  126|  2.54M|  }
  127|    343|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 127, False: 216]
  ------------------
  128|    127|    return false;
  129|    127|  }
  130|    216|  return true;
  131|    343|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    238|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    216|    DecoderBuffer *buffer) {
  136|    216|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    216|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    216|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    216|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 12, False: 204]
  ------------------
  140|     12|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 11]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     12|  } else
  145|    204|#endif
  146|    204|  {
  147|    204|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 202]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    204|  }
  151|    213|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 41, False: 172]
  ------------------
  152|     41|    return false;
  153|     41|  }
  154|    172|  const uint8_t *const data_head =
  155|    172|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    172|  buffer->Advance(bytes_encoded);
  158|    172|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 20, False: 152]
  ------------------
  159|     20|    return false;
  160|     20|  }
  161|    152|  return true;
  162|    172|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  42.6M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    152|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    152|  ans_.read_end();
  167|    152|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    692|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    692|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    692|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 692]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    692|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    692|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    692|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 59, False: 633]
  ------------------
   67|     59|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 57]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     59|  } else
   72|    633|#endif
   73|    633|  {
   74|    633|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 626]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    633|  }
   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|    683|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 47, False: 636]
  ------------------
   83|     47|    return false;
   84|     47|  }
   85|    636|  probability_table_.resize(num_symbols_);
   86|    636|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 14, False: 622]
  ------------------
   87|     14|    return true;
   88|     14|  }
   89|       |  // Decode the table.
   90|   599k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 599k, False: 462]
  ------------------
   91|   599k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|   599k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 84, False: 598k]
  ------------------
   95|     84|      return false;
   96|     84|    }
   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|   598k|    const int token = prob_data & 3;
  102|   598k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 316k, False: 282k]
  ------------------
  103|   316k|      const uint32_t offset = prob_data >> 2;
  104|   316k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 40, False: 316k]
  ------------------
  105|     40|        return false;
  106|     40|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  10.2M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 9.97M, False: 316k]
  ------------------
  109|  9.97M|        probability_table_[i + j] = 0;
  110|  9.97M|      }
  111|   316k|      i += offset;
  112|   316k|    } else {
  113|   282k|      const int extra_bytes = token;
  114|   282k|      uint32_t prob = prob_data >> 2;
  115|   444k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 162k, False: 282k]
  ------------------
  116|   162k|        uint8_t eb;
  117|   162k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 36, False: 162k]
  ------------------
  118|     36|          return false;
  119|     36|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   162k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   162k|      }
  124|   282k|      probability_table_[i] = prob;
  125|   282k|    }
  126|   598k|  }
  127|    462|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 41, False: 421]
  ------------------
  128|     41|    return false;
  129|     41|  }
  130|    421|  return true;
  131|    462|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    435|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    421|    DecoderBuffer *buffer) {
  136|    421|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    421|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    421|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    421|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 27, False: 394]
  ------------------
  140|     27|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 25]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     27|  } else
  145|    394|#endif
  146|    394|  {
  147|    394|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 7, False: 387]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|    394|  }
  151|    412|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 101, False: 311]
  ------------------
  152|    101|    return false;
  153|    101|  }
  154|    311|  const uint8_t *const data_head =
  155|    311|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    311|  buffer->Advance(bytes_encoded);
  158|    311|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 19, False: 292]
  ------------------
  159|     19|    return false;
  160|     19|  }
  161|    292|  return true;
  162|    311|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  7.50M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    292|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    292|  ans_.read_end();
  167|    292|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    439|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    439|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    439|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 439]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    439|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    439|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    439|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 70, False: 369]
  ------------------
   67|     70|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 69]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     70|  } else
   72|    369|#endif
   73|    369|  {
   74|    369|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 366]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    369|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    435|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 16, False: 419]
  ------------------
   83|     16|    return false;
   84|     16|  }
   85|    419|  probability_table_.resize(num_symbols_);
   86|    419|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 415]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|  8.98k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 8.69k, False: 295]
  ------------------
   91|  8.69k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  8.69k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 76, False: 8.61k]
  ------------------
   95|     76|      return false;
   96|     76|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  8.61k|    const int token = prob_data & 3;
  102|  8.61k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.49k, False: 5.12k]
  ------------------
  103|  3.49k|      const uint32_t offset = prob_data >> 2;
  104|  3.49k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 28, False: 3.46k]
  ------------------
  105|     28|        return false;
  106|     28|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   130k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 126k, False: 3.46k]
  ------------------
  109|   126k|        probability_table_[i + j] = 0;
  110|   126k|      }
  111|  3.46k|      i += offset;
  112|  5.12k|    } else {
  113|  5.12k|      const int extra_bytes = token;
  114|  5.12k|      uint32_t prob = prob_data >> 2;
  115|  8.91k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.81k, False: 5.10k]
  ------------------
  116|  3.81k|        uint8_t eb;
  117|  3.81k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 3.79k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.79k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.79k|      }
  124|  5.10k|      probability_table_[i] = prob;
  125|  5.10k|    }
  126|  8.61k|  }
  127|    295|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 28, False: 267]
  ------------------
  128|     28|    return false;
  129|     28|  }
  130|    267|  return true;
  131|    295|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    271|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    267|    DecoderBuffer *buffer) {
  136|    267|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    267|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    267|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    267|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 62, False: 205]
  ------------------
  140|     62|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 5, False: 57]
  ------------------
  141|      5|      return false;
  142|      5|    }
  143|       |
  144|     62|  } else
  145|    205|#endif
  146|    205|  {
  147|    205|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 202]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    205|  }
  151|    259|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 129, False: 130]
  ------------------
  152|    129|    return false;
  153|    129|  }
  154|    130|  const uint8_t *const data_head =
  155|    130|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    130|  buffer->Advance(bytes_encoded);
  158|    130|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 105]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|    105|  return true;
  162|    130|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  4.45M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    105|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    105|  ans_.read_end();
  167|    105|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    315|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    315|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    315|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 315]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    315|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    315|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    315|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 34, False: 281]
  ------------------
   67|     34|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 32]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     34|  } else
   72|    281|#endif
   73|    281|  {
   74|    281|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 270]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    281|  }
   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|    302|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 11, False: 291]
  ------------------
   83|     11|    return false;
   84|     11|  }
   85|    291|  probability_table_.resize(num_symbols_);
   86|    291|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 284]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  8.93k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 8.77k, False: 161]
  ------------------
   91|  8.77k|    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|  8.77k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 64, False: 8.70k]
  ------------------
   95|     64|      return false;
   96|     64|    }
   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|  8.70k|    const int token = prob_data & 3;
  102|  8.70k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.23k, False: 4.47k]
  ------------------
  103|  4.23k|      const uint32_t offset = prob_data >> 2;
  104|  4.23k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 4.20k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  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.20k]
  ------------------
  109|   140k|        probability_table_[i + j] = 0;
  110|   140k|      }
  111|  4.20k|      i += offset;
  112|  4.47k|    } else {
  113|  4.47k|      const int extra_bytes = token;
  114|  4.47k|      uint32_t prob = prob_data >> 2;
  115|  7.47k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.03k, False: 4.44k]
  ------------------
  116|  3.03k|        uint8_t eb;
  117|  3.03k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 29, False: 3.00k]
  ------------------
  118|     29|          return false;
  119|     29|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.00k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.00k|      }
  124|  4.44k|      probability_table_[i] = prob;
  125|  4.44k|    }
  126|  8.70k|  }
  127|    161|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 24, False: 137]
  ------------------
  128|     24|    return false;
  129|     24|  }
  130|    137|  return true;
  131|    161|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    144|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    137|    DecoderBuffer *buffer) {
  136|    137|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    137|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    137|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    137|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 121]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 13]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     16|  } else
  145|    121|#endif
  146|    121|  {
  147|    121|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 118]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    121|  }
  151|    131|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 23, False: 108]
  ------------------
  152|     23|    return false;
  153|     23|  }
  154|    108|  const uint8_t *const data_head =
  155|    108|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    108|  buffer->Advance(bytes_encoded);
  158|    108|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 16, False: 92]
  ------------------
  159|     16|    return false;
  160|     16|  }
  161|     92|  return true;
  162|    108|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  3.01M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|     92|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     92|  ans_.read_end();
  167|     92|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    457|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    457|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    457|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 457]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    457|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    457|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    457|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 82, False: 375]
  ------------------
   67|     82|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 80]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     82|  } else
   72|    375|#endif
   73|    375|  {
   74|    375|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 370]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    375|  }
   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|    450|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 27, False: 423]
  ------------------
   83|     27|    return false;
   84|     27|  }
   85|    423|  probability_table_.resize(num_symbols_);
   86|    423|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 418]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|  9.77k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 9.46k, False: 303]
  ------------------
   91|  9.46k|    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.46k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 65, False: 9.40k]
  ------------------
   95|     65|      return false;
   96|     65|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  9.40k|    const int token = prob_data & 3;
  102|  9.40k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.77k, False: 5.62k]
  ------------------
  103|  3.77k|      const uint32_t offset = prob_data >> 2;
  104|  3.77k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 3.74k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   131k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 127k, False: 3.74k]
  ------------------
  109|   127k|        probability_table_[i + j] = 0;
  110|   127k|      }
  111|  3.74k|      i += offset;
  112|  5.62k|    } else {
  113|  5.62k|      const int extra_bytes = token;
  114|  5.62k|      uint32_t prob = prob_data >> 2;
  115|  10.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.51k, False: 5.60k]
  ------------------
  116|  4.51k|        uint8_t eb;
  117|  4.51k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 4.49k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.49k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.49k|      }
  124|  5.60k|      probability_table_[i] = prob;
  125|  5.60k|    }
  126|  9.40k|  }
  127|    303|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 31, False: 272]
  ------------------
  128|     31|    return false;
  129|     31|  }
  130|    272|  return true;
  131|    303|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    277|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    272|    DecoderBuffer *buffer) {
  136|    272|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    272|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    272|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    272|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 55, False: 217]
  ------------------
  140|     55|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 52]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     55|  } else
  145|    217|#endif
  146|    217|  {
  147|    217|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 216]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    217|  }
  151|    268|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 96, False: 172]
  ------------------
  152|     96|    return false;
  153|     96|  }
  154|    172|  const uint8_t *const data_head =
  155|    172|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    172|  buffer->Advance(bytes_encoded);
  158|    172|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 38, False: 134]
  ------------------
  159|     38|    return false;
  160|     38|  }
  161|    134|  return true;
  162|    172|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  10.0M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|    134|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    134|  ans_.read_end();
  167|    134|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    469|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    469|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    469|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 469]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    469|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    469|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    469|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 58, False: 411]
  ------------------
   67|     58|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 55]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     58|  } else
   72|    411|#endif
   73|    411|  {
   74|    411|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 404]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    411|  }
   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|    459|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 23, False: 436]
  ------------------
   83|     23|    return false;
   84|     23|  }
   85|    436|  probability_table_.resize(num_symbols_);
   86|    436|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 17, False: 419]
  ------------------
   87|     17|    return true;
   88|     17|  }
   89|       |  // Decode the table.
   90|   739k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 739k, False: 241]
  ------------------
   91|   739k|    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|   739k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 82, False: 739k]
  ------------------
   95|     82|      return false;
   96|     82|    }
   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|   739k|    const int token = prob_data & 3;
  102|   739k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 258k, False: 481k]
  ------------------
  103|   258k|      const uint32_t offset = prob_data >> 2;
  104|   258k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 51, False: 258k]
  ------------------
  105|     51|        return false;
  106|     51|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  10.1M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 9.91M, False: 258k]
  ------------------
  109|  9.91M|        probability_table_[i + j] = 0;
  110|  9.91M|      }
  111|   258k|      i += offset;
  112|   481k|    } else {
  113|   481k|      const int extra_bytes = token;
  114|   481k|      uint32_t prob = prob_data >> 2;
  115|   808k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 327k, False: 481k]
  ------------------
  116|   327k|        uint8_t eb;
  117|   327k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 45, False: 326k]
  ------------------
  118|     45|          return false;
  119|     45|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   326k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   326k|      }
  124|   481k|      probability_table_[i] = prob;
  125|   481k|    }
  126|   739k|  }
  127|    241|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 26, False: 215]
  ------------------
  128|     26|    return false;
  129|     26|  }
  130|    215|  return true;
  131|    241|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    232|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    215|    DecoderBuffer *buffer) {
  136|    215|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    215|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    215|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    215|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 22, False: 193]
  ------------------
  140|     22|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 5, False: 17]
  ------------------
  141|      5|      return false;
  142|      5|    }
  143|       |
  144|     22|  } else
  145|    193|#endif
  146|    193|  {
  147|    193|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 190]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    193|  }
  151|    207|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 59, False: 148]
  ------------------
  152|     59|    return false;
  153|     59|  }
  154|    148|  const uint8_t *const data_head =
  155|    148|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    148|  buffer->Advance(bytes_encoded);
  158|    148|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 31, False: 117]
  ------------------
  159|     31|    return false;
  160|     31|  }
  161|    117|  return true;
  162|    148|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  11.1M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|    117|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    117|  ans_.read_end();
  167|    117|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    475|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    475|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    475|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 475]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    475|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    475|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    475|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 77, False: 398]
  ------------------
   67|     77|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 73]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     77|  } else
   72|    398|#endif
   73|    398|  {
   74|    398|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 21, False: 377]
  ------------------
   75|     21|      return false;
   76|     21|    }
   77|    398|  }
   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|    450|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 41, False: 409]
  ------------------
   83|     41|    return false;
   84|     41|  }
   85|    409|  probability_table_.resize(num_symbols_);
   86|    409|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 406]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|  23.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 22.9k, False: 281]
  ------------------
   91|  22.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|  22.9k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 50, False: 22.9k]
  ------------------
   95|     50|      return false;
   96|     50|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  22.9k|    const int token = prob_data & 3;
  102|  22.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 8.08k, False: 14.8k]
  ------------------
  103|  8.08k|      const uint32_t offset = prob_data >> 2;
  104|  8.08k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 49, False: 8.03k]
  ------------------
  105|     49|        return false;
  106|     49|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   256k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 248k, False: 8.03k]
  ------------------
  109|   248k|        probability_table_[i + j] = 0;
  110|   248k|      }
  111|  8.03k|      i += offset;
  112|  14.8k|    } else {
  113|  14.8k|      const int extra_bytes = token;
  114|  14.8k|      uint32_t prob = prob_data >> 2;
  115|  25.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 10.3k, False: 14.8k]
  ------------------
  116|  10.3k|        uint8_t eb;
  117|  10.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 26, False: 10.3k]
  ------------------
  118|     26|          return false;
  119|     26|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  10.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  10.3k|      }
  124|  14.8k|      probability_table_[i] = prob;
  125|  14.8k|    }
  126|  22.9k|  }
  127|    281|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 41, False: 240]
  ------------------
  128|     41|    return false;
  129|     41|  }
  130|    240|  return true;
  131|    281|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    243|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_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: 50, False: 190]
  ------------------
  140|     50|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 48]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     50|  } else
  145|    190|#endif
  146|    190|  {
  147|    190|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 188]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    190|  }
  151|    236|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 108, False: 128]
  ------------------
  152|    108|    return false;
  153|    108|  }
  154|    128|  const uint8_t *const data_head =
  155|    128|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    128|  buffer->Advance(bytes_encoded);
  158|    128|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 48, False: 80]
  ------------------
  159|     48|    return false;
  160|     48|  }
  161|     80|  return true;
  162|    128|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  2.16M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     80|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     80|  ans_.read_end();
  167|     80|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    370|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    370|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    370|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 370]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    370|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    370|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    370|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 21, False: 349]
  ------------------
   67|     21|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 20]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     21|  } else
   72|    349|#endif
   73|    349|  {
   74|    349|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 341]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    349|  }
   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|    361|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 21, False: 340]
  ------------------
   83|     21|    return false;
   84|     21|  }
   85|    340|  probability_table_.resize(num_symbols_);
   86|    340|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 329]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|  25.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 25.0k, False: 216]
  ------------------
   91|  25.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|  25.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 47, False: 24.9k]
  ------------------
   95|     47|      return false;
   96|     47|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  24.9k|    const int token = prob_data & 3;
  102|  24.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 14.5k, False: 10.4k]
  ------------------
  103|  14.5k|      const uint32_t offset = prob_data >> 2;
  104|  14.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 38, False: 14.5k]
  ------------------
  105|     38|        return false;
  106|     38|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   580k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 566k, False: 14.5k]
  ------------------
  109|   566k|        probability_table_[i + j] = 0;
  110|   566k|      }
  111|  14.5k|      i += offset;
  112|  14.5k|    } else {
  113|  10.4k|      const int extra_bytes = token;
  114|  10.4k|      uint32_t prob = prob_data >> 2;
  115|  16.5k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 6.17k, False: 10.4k]
  ------------------
  116|  6.17k|        uint8_t eb;
  117|  6.17k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 28, False: 6.15k]
  ------------------
  118|     28|          return false;
  119|     28|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  6.15k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  6.15k|      }
  124|  10.4k|      probability_table_[i] = prob;
  125|  10.4k|    }
  126|  24.9k|  }
  127|    216|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 62, False: 154]
  ------------------
  128|     62|    return false;
  129|     62|  }
  130|    154|  return true;
  131|    216|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    165|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|    154|    DecoderBuffer *buffer) {
  136|    154|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    154|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    154|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    154|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 154]
  ------------------
  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|    154|#endif
  146|    154|  {
  147|    154|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 152]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    154|  }
  151|    152|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 82, False: 70]
  ------------------
  152|     82|    return false;
  153|     82|  }
  154|     70|  const uint8_t *const data_head =
  155|     70|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     70|  buffer->Advance(bytes_encoded);
  158|     70|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 27, False: 43]
  ------------------
  159|     27|    return false;
  160|     27|  }
  161|     43|  return true;
  162|     70|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|  94.3k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     43|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     43|  ans_.read_end();
  167|     43|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    370|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    370|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    370|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 370]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    370|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    370|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    370|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 11, False: 359]
  ------------------
   67|     11|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 10]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     11|  } else
   72|    359|#endif
   73|    359|  {
   74|    359|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 354]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    359|  }
   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|    364|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 18, False: 346]
  ------------------
   83|     18|    return false;
   84|     18|  }
   85|    346|  probability_table_.resize(num_symbols_);
   86|    346|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 340]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|   150k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 150k, False: 199]
  ------------------
   91|   150k|    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|   150k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 61, False: 150k]
  ------------------
   95|     61|      return false;
   96|     61|    }
   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|   150k|    const int token = prob_data & 3;
  102|   150k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 35.5k, False: 114k]
  ------------------
  103|  35.5k|      const uint32_t offset = prob_data >> 2;
  104|  35.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 48, False: 35.5k]
  ------------------
  105|     48|        return false;
  106|     48|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.21M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.18M, False: 35.5k]
  ------------------
  109|  1.18M|        probability_table_[i + j] = 0;
  110|  1.18M|      }
  111|  35.5k|      i += offset;
  112|   114k|    } else {
  113|   114k|      const int extra_bytes = token;
  114|   114k|      uint32_t prob = prob_data >> 2;
  115|   184k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 70.2k, False: 114k]
  ------------------
  116|  70.2k|        uint8_t eb;
  117|  70.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 32, False: 70.1k]
  ------------------
  118|     32|          return false;
  119|     32|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  70.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  70.1k|      }
  124|   114k|      probability_table_[i] = prob;
  125|   114k|    }
  126|   150k|  }
  127|    199|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 70, False: 129]
  ------------------
  128|     70|    return false;
  129|     70|  }
  130|    129|  return true;
  131|    199|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    135|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    129|    DecoderBuffer *buffer) {
  136|    129|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    129|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    129|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    129|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 129]
  ------------------
  140|      0|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      0|  } else
  145|    129|#endif
  146|    129|  {
  147|    129|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 128]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    129|  }
  151|    128|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 43, False: 85]
  ------------------
  152|     43|    return false;
  153|     43|  }
  154|     85|  const uint8_t *const data_head =
  155|     85|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     85|  buffer->Advance(bytes_encoded);
  158|     85|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 26, False: 59]
  ------------------
  159|     26|    return false;
  160|     26|  }
  161|     59|  return true;
  162|     85|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   467k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     59|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     59|  ans_.read_end();
  167|     59|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    430|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    430|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    430|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 430]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    430|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    430|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    430|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 35, False: 395]
  ------------------
   67|     35|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 34]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     35|  } else
   72|    395|#endif
   73|    395|  {
   74|    395|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 393]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    395|  }
   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|    427|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 18, False: 409]
  ------------------
   83|     18|    return false;
   84|     18|  }
   85|    409|  probability_table_.resize(num_symbols_);
   86|    409|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 402]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  45.8k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 45.6k, False: 264]
  ------------------
   91|  45.6k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  45.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 49, False: 45.5k]
  ------------------
   95|     49|      return false;
   96|     49|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  45.5k|    const int token = prob_data & 3;
  102|  45.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 18.2k, False: 27.3k]
  ------------------
  103|  18.2k|      const uint32_t offset = prob_data >> 2;
  104|  18.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 56, False: 18.1k]
  ------------------
  105|     56|        return false;
  106|     56|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   778k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 760k, False: 18.1k]
  ------------------
  109|   760k|        probability_table_[i + j] = 0;
  110|   760k|      }
  111|  18.1k|      i += offset;
  112|  27.3k|    } else {
  113|  27.3k|      const int extra_bytes = token;
  114|  27.3k|      uint32_t prob = prob_data >> 2;
  115|  41.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 14.4k, False: 27.3k]
  ------------------
  116|  14.4k|        uint8_t eb;
  117|  14.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 33, False: 14.4k]
  ------------------
  118|     33|          return false;
  119|     33|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  14.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  14.4k|      }
  124|  27.3k|      probability_table_[i] = prob;
  125|  27.3k|    }
  126|  45.5k|  }
  127|    264|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 93, False: 171]
  ------------------
  128|     93|    return false;
  129|     93|  }
  130|    171|  return true;
  131|    264|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|    178|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|    171|    DecoderBuffer *buffer) {
  136|    171|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    171|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    171|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    171|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 171]
  ------------------
  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|    171|#endif
  146|    171|  {
  147|    171|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 4, False: 167]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|    171|  }
  151|    167|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 80, False: 87]
  ------------------
  152|     80|    return false;
  153|     80|  }
  154|     87|  const uint8_t *const data_head =
  155|     87|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     87|  buffer->Advance(bytes_encoded);
  158|     87|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 48, False: 39]
  ------------------
  159|     48|    return false;
  160|     48|  }
  161|     39|  return true;
  162|     87|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|  51.4k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     39|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     39|  ans_.read_end();
  167|     39|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    426|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    426|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    426|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 426]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    426|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    426|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    426|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 3, False: 423]
  ------------------
   67|      3|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 2]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|      3|  } else
   72|    423|#endif
   73|    423|  {
   74|    423|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 12, False: 411]
  ------------------
   75|     12|      return false;
   76|     12|    }
   77|    423|  }
   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|    413|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 404]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|    404|  probability_table_.resize(num_symbols_);
   86|    404|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 395]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|   100k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 100k, False: 264]
  ------------------
   91|   100k|    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|   100k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 71, False: 100k]
  ------------------
   95|     71|      return false;
   96|     71|    }
   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|   100k|    const int token = prob_data & 3;
  102|   100k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 35.1k, False: 65.0k]
  ------------------
  103|  35.1k|      const uint32_t offset = prob_data >> 2;
  104|  35.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 32, False: 35.1k]
  ------------------
  105|     32|        return false;
  106|     32|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.14M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.11M, False: 35.1k]
  ------------------
  109|  1.11M|        probability_table_[i + j] = 0;
  110|  1.11M|      }
  111|  35.1k|      i += offset;
  112|  65.0k|    } else {
  113|  65.0k|      const int extra_bytes = token;
  114|  65.0k|      uint32_t prob = prob_data >> 2;
  115|  90.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 25.0k, False: 65.0k]
  ------------------
  116|  25.0k|        uint8_t eb;
  117|  25.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 28, False: 25.0k]
  ------------------
  118|     28|          return false;
  119|     28|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  25.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  25.0k|      }
  124|  65.0k|      probability_table_[i] = prob;
  125|  65.0k|    }
  126|   100k|  }
  127|    264|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 103, False: 161]
  ------------------
  128|    103|    return false;
  129|    103|  }
  130|    161|  return true;
  131|    264|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    170|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    161|    DecoderBuffer *buffer) {
  136|    161|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    161|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    161|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    161|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 161]
  ------------------
  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|    161|#endif
  146|    161|  {
  147|    161|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 158]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    161|  }
  151|    158|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 74, False: 84]
  ------------------
  152|     74|    return false;
  153|     74|  }
  154|     84|  const uint8_t *const data_head =
  155|     84|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     84|  buffer->Advance(bytes_encoded);
  158|     84|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 29, False: 55]
  ------------------
  159|     29|    return false;
  160|     29|  }
  161|     55|  return true;
  162|     84|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|   168k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     55|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     55|  ans_.read_end();
  167|     55|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    368|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    368|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    368|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 368]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    368|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    368|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    368|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 20, False: 348]
  ------------------
   67|     20|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 18]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     20|  } else
   72|    348|#endif
   73|    348|  {
   74|    348|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 347]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    348|  }
   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|    365|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 13, False: 352]
  ------------------
   83|     13|    return false;
   84|     13|  }
   85|    352|  probability_table_.resize(num_symbols_);
   86|    352|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 341]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|   226k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 226k, False: 230]
  ------------------
   91|   226k|    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|   226k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 44, False: 226k]
  ------------------
   95|     44|      return false;
   96|     44|    }
   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|   226k|    const int token = prob_data & 3;
  102|   226k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 56.8k, False: 169k]
  ------------------
  103|  56.8k|      const uint32_t offset = prob_data >> 2;
  104|  56.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 37, False: 56.7k]
  ------------------
  105|     37|        return false;
  106|     37|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.02M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.96M, False: 56.7k]
  ------------------
  109|  1.96M|        probability_table_[i + j] = 0;
  110|  1.96M|      }
  111|  56.7k|      i += offset;
  112|   169k|    } else {
  113|   169k|      const int extra_bytes = token;
  114|   169k|      uint32_t prob = prob_data >> 2;
  115|   302k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 133k, False: 169k]
  ------------------
  116|   133k|        uint8_t eb;
  117|   133k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 30, False: 133k]
  ------------------
  118|     30|          return false;
  119|     30|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   133k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   133k|      }
  124|   169k|      probability_table_[i] = prob;
  125|   169k|    }
  126|   226k|  }
  127|    230|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 83, False: 147]
  ------------------
  128|     83|    return false;
  129|     83|  }
  130|    147|  return true;
  131|    230|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|    158|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|    147|    DecoderBuffer *buffer) {
  136|    147|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    147|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    147|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    147|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 147]
  ------------------
  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|    147|#endif
  146|    147|  {
  147|    147|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 142]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|    147|  }
  151|    142|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 43, False: 99]
  ------------------
  152|     43|    return false;
  153|     43|  }
  154|     99|  const uint8_t *const data_head =
  155|     99|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     99|  buffer->Advance(bytes_encoded);
  158|     99|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 28, False: 71]
  ------------------
  159|     28|    return false;
  160|     28|  }
  161|     71|  return true;
  162|     99|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   550k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     71|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     71|  ans_.read_end();
  167|     71|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    397|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    397|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    397|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 397]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    397|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    397|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    397|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 27, False: 370]
  ------------------
   67|     27|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 26]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     27|  } else
   72|    370|#endif
   73|    370|  {
   74|    370|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 13, False: 357]
  ------------------
   75|     13|      return false;
   76|     13|    }
   77|    370|  }
   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|    383|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 28, False: 355]
  ------------------
   83|     28|    return false;
   84|     28|  }
   85|    355|  probability_table_.resize(num_symbols_);
   86|    355|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 346]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  38.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 37.9k, False: 214]
  ------------------
   91|  37.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|  37.9k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 53, False: 37.9k]
  ------------------
   95|     53|      return false;
   96|     53|    }
   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|  37.9k|    const int token = prob_data & 3;
  102|  37.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 19.1k, False: 18.7k]
  ------------------
  103|  19.1k|      const uint32_t offset = prob_data >> 2;
  104|  19.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 45, False: 19.1k]
  ------------------
  105|     45|        return false;
  106|     45|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   943k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 924k, False: 19.1k]
  ------------------
  109|   924k|        probability_table_[i + j] = 0;
  110|   924k|      }
  111|  19.1k|      i += offset;
  112|  19.1k|    } else {
  113|  18.7k|      const int extra_bytes = token;
  114|  18.7k|      uint32_t prob = prob_data >> 2;
  115|  29.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 10.3k, False: 18.7k]
  ------------------
  116|  10.3k|        uint8_t eb;
  117|  10.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 34, False: 10.3k]
  ------------------
  118|     34|          return false;
  119|     34|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  10.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  10.3k|      }
  124|  18.7k|      probability_table_[i] = prob;
  125|  18.7k|    }
  126|  37.9k|  }
  127|    214|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 39, False: 175]
  ------------------
  128|     39|    return false;
  129|     39|  }
  130|    175|  return true;
  131|    214|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    184|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    175|    DecoderBuffer *buffer) {
  136|    175|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    175|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    175|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    175|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 4, False: 171]
  ------------------
  140|      4|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 1]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|      4|  } else
  145|    171|#endif
  146|    171|  {
  147|    171|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 8, False: 163]
  ------------------
  148|      8|      return false;
  149|      8|    }
  150|    171|  }
  151|    164|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 59, False: 105]
  ------------------
  152|     59|    return false;
  153|     59|  }
  154|    105|  const uint8_t *const data_head =
  155|    105|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    105|  buffer->Advance(bytes_encoded);
  158|    105|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 26, False: 79]
  ------------------
  159|     26|    return false;
  160|     26|  }
  161|     79|  return true;
  162|    105|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  5.21M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     79|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     79|  ans_.read_end();
  167|     79|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    423|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    423|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    423|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 423]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    423|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    423|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    423|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 74, False: 349]
  ------------------
   67|     74|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 73]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     74|  } else
   72|    349|#endif
   73|    349|  {
   74|    349|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 345]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    349|  }
   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|    418|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 406]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    406|  probability_table_.resize(num_symbols_);
   86|    406|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 17, False: 389]
  ------------------
   87|     17|    return true;
   88|     17|  }
   89|       |  // Decode the table.
   90|   212k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 211k, False: 257]
  ------------------
   91|   211k|    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|   211k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 66, False: 211k]
  ------------------
   95|     66|      return false;
   96|     66|    }
   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|   211k|    const int token = prob_data & 3;
  102|   211k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 28.0k, False: 183k]
  ------------------
  103|  28.0k|      const uint32_t offset = prob_data >> 2;
  104|  28.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 35, False: 27.9k]
  ------------------
  105|     35|        return false;
  106|     35|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.00M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 977k, False: 27.9k]
  ------------------
  109|   977k|        probability_table_[i + j] = 0;
  110|   977k|      }
  111|  27.9k|      i += offset;
  112|   183k|    } else {
  113|   183k|      const int extra_bytes = token;
  114|   183k|      uint32_t prob = prob_data >> 2;
  115|   247k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 63.6k, False: 183k]
  ------------------
  116|  63.6k|        uint8_t eb;
  117|  63.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 31, False: 63.6k]
  ------------------
  118|     31|          return false;
  119|     31|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  63.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  63.6k|      }
  124|   183k|      probability_table_[i] = prob;
  125|   183k|    }
  126|   211k|  }
  127|    257|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 41, False: 216]
  ------------------
  128|     41|    return false;
  129|     41|  }
  130|    216|  return true;
  131|    257|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    233|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|    216|    DecoderBuffer *buffer) {
  136|    216|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    216|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    216|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    216|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 52, False: 164]
  ------------------
  140|     52|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 51]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     52|  } else
  145|    164|#endif
  146|    164|  {
  147|    164|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 8, False: 156]
  ------------------
  148|      8|      return false;
  149|      8|    }
  150|    164|  }
  151|    207|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 81, False: 126]
  ------------------
  152|     81|    return false;
  153|     81|  }
  154|    126|  const uint8_t *const data_head =
  155|    126|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    126|  buffer->Advance(bytes_encoded);
  158|    126|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 34, False: 92]
  ------------------
  159|     34|    return false;
  160|     34|  }
  161|     92|  return true;
  162|    126|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  5.05M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     92|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     92|  ans_.read_end();
  167|     92|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    386|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    386|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    386|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 386]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    386|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    386|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    386|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 46, False: 340]
  ------------------
   67|     46|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 45]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     46|  } else
   72|    340|#endif
   73|    340|  {
   74|    340|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 331]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    340|  }
   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|    376|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 27, False: 349]
  ------------------
   83|     27|    return false;
   84|     27|  }
   85|    349|  probability_table_.resize(num_symbols_);
   86|    349|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 343]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|  11.9k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 11.6k, False: 227]
  ------------------
   91|  11.6k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  11.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 54, False: 11.6k]
  ------------------
   95|     54|      return false;
   96|     54|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  11.6k|    const int token = prob_data & 3;
  102|  11.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.96k, False: 4.66k]
  ------------------
  103|  6.96k|      const uint32_t offset = prob_data >> 2;
  104|  6.96k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 36, False: 6.93k]
  ------------------
  105|     36|        return false;
  106|     36|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   249k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 242k, False: 6.93k]
  ------------------
  109|   242k|        probability_table_[i + j] = 0;
  110|   242k|      }
  111|  6.93k|      i += offset;
  112|  6.93k|    } else {
  113|  4.66k|      const int extra_bytes = token;
  114|  4.66k|      uint32_t prob = prob_data >> 2;
  115|  8.30k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.66k, False: 4.64k]
  ------------------
  116|  3.66k|        uint8_t eb;
  117|  3.66k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 26, False: 3.63k]
  ------------------
  118|     26|          return false;
  119|     26|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.63k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.63k|      }
  124|  4.64k|      probability_table_[i] = prob;
  125|  4.64k|    }
  126|  11.6k|  }
  127|    227|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 24, False: 203]
  ------------------
  128|     24|    return false;
  129|     24|  }
  130|    203|  return true;
  131|    227|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    209|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    203|    DecoderBuffer *buffer) {
  136|    203|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    203|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    203|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    203|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 27, False: 176]
  ------------------
  140|     27|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 25]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     27|  } else
  145|    176|#endif
  146|    176|  {
  147|    176|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 15, False: 161]
  ------------------
  148|     15|      return false;
  149|     15|    }
  150|    176|  }
  151|    186|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 77, False: 109]
  ------------------
  152|     77|    return false;
  153|     77|  }
  154|    109|  const uint8_t *const data_head =
  155|    109|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    109|  buffer->Advance(bytes_encoded);
  158|    109|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 27, False: 82]
  ------------------
  159|     27|    return false;
  160|     27|  }
  161|     82|  return true;
  162|    109|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  25.9M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     82|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     82|  ans_.read_end();
  167|     82|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    382|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    382|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    382|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 382]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    382|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    382|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    382|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 53, False: 329]
  ------------------
   67|     53|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 52]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     53|  } else
   72|    329|#endif
   73|    329|  {
   74|    329|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 324]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    329|  }
   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|    376|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 26, False: 350]
  ------------------
   83|     26|    return false;
   84|     26|  }
   85|    350|  probability_table_.resize(num_symbols_);
   86|    350|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 14, False: 336]
  ------------------
   87|     14|    return true;
   88|     14|  }
   89|       |  // Decode the table.
   90|  7.68k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 7.48k, False: 194]
  ------------------
   91|  7.48k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  7.48k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 72, False: 7.41k]
  ------------------
   95|     72|      return false;
   96|     72|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  7.41k|    const int token = prob_data & 3;
  102|  7.41k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.02k, False: 3.38k]
  ------------------
  103|  4.02k|      const uint32_t offset = prob_data >> 2;
  104|  4.02k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 43, False: 3.98k]
  ------------------
  105|     43|        return false;
  106|     43|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   135k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 131k, False: 3.98k]
  ------------------
  109|   131k|        probability_table_[i + j] = 0;
  110|   131k|      }
  111|  3.98k|      i += offset;
  112|  3.98k|    } else {
  113|  3.38k|      const int extra_bytes = token;
  114|  3.38k|      uint32_t prob = prob_data >> 2;
  115|  6.18k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 2.83k, False: 3.35k]
  ------------------
  116|  2.83k|        uint8_t eb;
  117|  2.83k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 27, False: 2.80k]
  ------------------
  118|     27|          return false;
  119|     27|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  2.80k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  2.80k|      }
  124|  3.35k|      probability_table_[i] = prob;
  125|  3.35k|    }
  126|  7.41k|  }
  127|    194|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 26, False: 168]
  ------------------
  128|     26|    return false;
  129|     26|  }
  130|    168|  return true;
  131|    194|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    182|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    168|    DecoderBuffer *buffer) {
  136|    168|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    168|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    168|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    168|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 35, False: 133]
  ------------------
  140|     35|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 33]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     35|  } else
  145|    133|#endif
  146|    133|  {
  147|    133|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 130]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    133|  }
  151|    163|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 77, False: 86]
  ------------------
  152|     77|    return false;
  153|     77|  }
  154|     86|  const uint8_t *const data_head =
  155|     86|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     86|  buffer->Advance(bytes_encoded);
  158|     86|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 22, False: 64]
  ------------------
  159|     22|    return false;
  160|     22|  }
  161|     64|  return true;
  162|     86|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  17.4M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     64|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     64|  ans_.read_end();
  167|     64|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    371|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    371|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    371|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 371]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    371|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    371|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    371|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 91, False: 280]
  ------------------
   67|     91|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 90]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     91|  } else
   72|    280|#endif
   73|    280|  {
   74|    280|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 269]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    280|  }
   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|    359|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 20, False: 339]
  ------------------
   83|     20|    return false;
   84|     20|  }
   85|    339|  probability_table_.resize(num_symbols_);
   86|    339|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 333]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|  69.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 69.2k, False: 207]
  ------------------
   91|  69.2k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  69.2k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 65, False: 69.1k]
  ------------------
   95|     65|      return false;
   96|     65|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  69.1k|    const int token = prob_data & 3;
  102|  69.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 48.3k, False: 20.7k]
  ------------------
  103|  48.3k|      const uint32_t offset = prob_data >> 2;
  104|  48.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 33, False: 48.3k]
  ------------------
  105|     33|        return false;
  106|     33|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   551k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 503k, False: 48.3k]
  ------------------
  109|   503k|        probability_table_[i + j] = 0;
  110|   503k|      }
  111|  48.3k|      i += offset;
  112|  48.3k|    } else {
  113|  20.7k|      const int extra_bytes = token;
  114|  20.7k|      uint32_t prob = prob_data >> 2;
  115|  44.4k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 23.7k, False: 20.7k]
  ------------------
  116|  23.7k|        uint8_t eb;
  117|  23.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 28, False: 23.6k]
  ------------------
  118|     28|          return false;
  119|     28|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  23.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  23.6k|      }
  124|  20.7k|      probability_table_[i] = prob;
  125|  20.7k|    }
  126|  69.1k|  }
  127|    207|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 29, False: 178]
  ------------------
  128|     29|    return false;
  129|     29|  }
  130|    178|  return true;
  131|    207|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    184|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    178|    DecoderBuffer *buffer) {
  136|    178|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    178|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    178|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    178|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 77, False: 101]
  ------------------
  140|     77|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 76]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     77|  } else
  145|    101|#endif
  146|    101|  {
  147|    101|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 4, False: 97]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|    101|  }
  151|    173|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 97, False: 76]
  ------------------
  152|     97|    return false;
  153|     97|  }
  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: 9, False: 67]
  ------------------
  159|      9|    return false;
  160|      9|  }
  161|     67|  return true;
  162|     76|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  33.3M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     67|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     67|  ans_.read_end();
  167|     67|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  12.0k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  12.0k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 37, False: 12.0k]
  ------------------
   35|     37|    return true;
   36|     37|  }
   37|       |  // Decode which scheme to use.
   38|  12.0k|  uint8_t scheme;
   39|  12.0k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 147, False: 11.8k]
  ------------------
   40|    147|    return false;
   41|    147|  }
   42|  11.8k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 1.19k, False: 10.7k]
  ------------------
   43|  1.19k|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|  1.19k|                                                  src_buffer, out_values);
   45|  10.7k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 8.07k, False: 2.63k]
  ------------------
   46|  8.07k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  8.07k|                                               out_values);
   48|  8.07k|  }
   49|  2.63k|  return false;
   50|  11.8k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|  1.19k|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|  1.19k|  SymbolDecoderT<5> tag_decoder;
   57|  1.19k|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 512, False: 679]
  ------------------
   58|    512|    return false;
   59|    512|  }
   60|       |
   61|    679|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 326, False: 353]
  ------------------
   62|    326|    return false;
   63|    326|  }
   64|       |
   65|    353|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 353, False: 0]
  |  Branch (65:25): [True: 72, False: 281]
  ------------------
   66|     72|    return false;  // Wrong number of symbols.
   67|     72|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    281|  src_buffer->StartBitDecoding(false, nullptr);
   72|    281|  int value_id = 0;
   73|   858k|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 857k, False: 281]
  ------------------
   74|       |    // Decode the tag.
   75|   857k|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  2.24M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 1.38M, False: 857k]
  ------------------
   78|  1.38M|      uint32_t val;
   79|  1.38M|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 0, False: 1.38M]
  ------------------
   80|      0|        return false;
   81|      0|      }
   82|  1.38M|      out_values[value_id++] = val;
   83|  1.38M|    }
   84|   857k|  }
   85|    281|  tag_decoder.EndDecoding();
   86|    281|  src_buffer->EndBitDecoding();
   87|    281|  return true;
   88|    281|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  8.07k|                      uint32_t *out_values) {
  117|  8.07k|  uint8_t max_bit_length;
  118|  8.07k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 35, False: 8.03k]
  ------------------
  119|     35|    return false;
  120|     35|  }
  121|  8.03k|  switch (max_bit_length) {
  122|    624|    case 1:
  ------------------
  |  Branch (122:5): [True: 624, False: 7.41k]
  ------------------
  123|    624|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    624|                                                         out_values);
  125|    692|    case 2:
  ------------------
  |  Branch (125:5): [True: 692, False: 7.34k]
  ------------------
  126|    692|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    692|                                                         out_values);
  128|    439|    case 3:
  ------------------
  |  Branch (128:5): [True: 439, False: 7.59k]
  ------------------
  129|    439|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    439|                                                         out_values);
  131|    315|    case 4:
  ------------------
  |  Branch (131:5): [True: 315, False: 7.72k]
  ------------------
  132|    315|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    315|                                                         out_values);
  134|    295|    case 5:
  ------------------
  |  Branch (134:5): [True: 295, False: 7.74k]
  ------------------
  135|    295|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    295|                                                         out_values);
  137|    457|    case 6:
  ------------------
  |  Branch (137:5): [True: 457, False: 7.57k]
  ------------------
  138|    457|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    457|                                                         out_values);
  140|    469|    case 7:
  ------------------
  |  Branch (140:5): [True: 469, False: 7.56k]
  ------------------
  141|    469|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    469|                                                         out_values);
  143|    475|    case 8:
  ------------------
  |  Branch (143:5): [True: 475, False: 7.56k]
  ------------------
  144|    475|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    475|                                                         out_values);
  146|    370|    case 9:
  ------------------
  |  Branch (146:5): [True: 370, False: 7.66k]
  ------------------
  147|    370|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    370|                                                         out_values);
  149|    370|    case 10:
  ------------------
  |  Branch (149:5): [True: 370, False: 7.66k]
  ------------------
  150|    370|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    370|          num_values, src_buffer, out_values);
  152|    430|    case 11:
  ------------------
  |  Branch (152:5): [True: 430, False: 7.60k]
  ------------------
  153|    430|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    430|          num_values, src_buffer, out_values);
  155|    426|    case 12:
  ------------------
  |  Branch (155:5): [True: 426, False: 7.60k]
  ------------------
  156|    426|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    426|          num_values, src_buffer, out_values);
  158|    368|    case 13:
  ------------------
  |  Branch (158:5): [True: 368, False: 7.66k]
  ------------------
  159|    368|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    368|          num_values, src_buffer, out_values);
  161|    397|    case 14:
  ------------------
  |  Branch (161:5): [True: 397, False: 7.63k]
  ------------------
  162|    397|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    397|          num_values, src_buffer, out_values);
  164|    423|    case 15:
  ------------------
  |  Branch (164:5): [True: 423, False: 7.61k]
  ------------------
  165|    423|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    423|          num_values, src_buffer, out_values);
  167|    386|    case 16:
  ------------------
  |  Branch (167:5): [True: 386, False: 7.64k]
  ------------------
  168|    386|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    386|          num_values, src_buffer, out_values);
  170|    382|    case 17:
  ------------------
  |  Branch (170:5): [True: 382, False: 7.65k]
  ------------------
  171|    382|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    382|          num_values, src_buffer, out_values);
  173|    371|    case 18:
  ------------------
  |  Branch (173:5): [True: 371, False: 7.66k]
  ------------------
  174|    371|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    371|          num_values, src_buffer, out_values);
  176|    346|    default:
  ------------------
  |  Branch (176:5): [True: 346, False: 7.68k]
  ------------------
  177|    346|      return false;
  178|  8.03k|  }
  179|  8.03k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    624|                              uint32_t *out_values) {
   93|    624|  SymbolDecoderT decoder;
   94|    624|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 386, False: 238]
  ------------------
   95|    386|    return false;
   96|    386|  }
   97|       |
   98|    238|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 238, False: 0]
  |  Branch (98:25): [True: 22, False: 216]
  ------------------
   99|     22|    return false;  // Wrong number of symbols.
  100|     22|  }
  101|       |
  102|    216|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 64, False: 152]
  ------------------
  103|     64|    return false;
  104|     64|  }
  105|  42.6M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 42.6M, False: 152]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  42.6M|    const uint32_t value = decoder.DecodeSymbol();
  108|  42.6M|    out_values[i] = value;
  109|  42.6M|  }
  110|    152|  decoder.EndDecoding();
  111|    152|  return true;
  112|    216|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    692|                              uint32_t *out_values) {
   93|    692|  SymbolDecoderT decoder;
   94|    692|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 257, False: 435]
  ------------------
   95|    257|    return false;
   96|    257|  }
   97|       |
   98|    435|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 435, False: 0]
  |  Branch (98:25): [True: 14, False: 421]
  ------------------
   99|     14|    return false;  // Wrong number of symbols.
  100|     14|  }
  101|       |
  102|    421|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 129, False: 292]
  ------------------
  103|    129|    return false;
  104|    129|  }
  105|  7.51M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 7.50M, False: 292]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  7.50M|    const uint32_t value = decoder.DecodeSymbol();
  108|  7.50M|    out_values[i] = value;
  109|  7.50M|  }
  110|    292|  decoder.EndDecoding();
  111|    292|  return true;
  112|    421|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    439|                              uint32_t *out_values) {
   93|    439|  SymbolDecoderT decoder;
   94|    439|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 168, False: 271]
  ------------------
   95|    168|    return false;
   96|    168|  }
   97|       |
   98|    271|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 271, False: 0]
  |  Branch (98:25): [True: 4, False: 267]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    267|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 162, False: 105]
  ------------------
  103|    162|    return false;
  104|    162|  }
  105|  4.45M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.45M, False: 105]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.45M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.45M|    out_values[i] = value;
  109|  4.45M|  }
  110|    105|  decoder.EndDecoding();
  111|    105|  return true;
  112|    267|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    315|                              uint32_t *out_values) {
   93|    315|  SymbolDecoderT decoder;
   94|    315|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 171, False: 144]
  ------------------
   95|    171|    return false;
   96|    171|  }
   97|       |
   98|    144|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 144, False: 0]
  |  Branch (98:25): [True: 7, False: 137]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    137|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 45, False: 92]
  ------------------
  103|     45|    return false;
  104|     45|  }
  105|  3.01M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.01M, False: 92]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.01M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.01M|    out_values[i] = value;
  109|  3.01M|  }
  110|     92|  decoder.EndDecoding();
  111|     92|  return true;
  112|    137|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    295|                              uint32_t *out_values) {
   93|    295|  SymbolDecoderT decoder;
   94|    295|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 59, False: 236]
  ------------------
   95|     59|    return false;
   96|     59|  }
   97|       |
   98|    236|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 236, False: 0]
  |  Branch (98:25): [True: 142, False: 94]
  ------------------
   99|    142|    return false;  // Wrong number of symbols.
  100|    142|  }
  101|       |
  102|     94|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 19, False: 75]
  ------------------
  103|     19|    return false;
  104|     19|  }
  105|   658k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 658k, False: 75]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   658k|    const uint32_t value = decoder.DecodeSymbol();
  108|   658k|    out_values[i] = value;
  109|   658k|  }
  110|     75|  decoder.EndDecoding();
  111|     75|  return true;
  112|     94|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    457|                              uint32_t *out_values) {
   93|    457|  SymbolDecoderT decoder;
   94|    457|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 180, False: 277]
  ------------------
   95|    180|    return false;
   96|    180|  }
   97|       |
   98|    277|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 277, False: 0]
  |  Branch (98:25): [True: 5, False: 272]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    272|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 138, False: 134]
  ------------------
  103|    138|    return false;
  104|    138|  }
  105|  10.0M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 10.0M, False: 134]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  10.0M|    const uint32_t value = decoder.DecodeSymbol();
  108|  10.0M|    out_values[i] = value;
  109|  10.0M|  }
  110|    134|  decoder.EndDecoding();
  111|    134|  return true;
  112|    272|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    469|                              uint32_t *out_values) {
   93|    469|  SymbolDecoderT decoder;
   94|    469|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 237, False: 232]
  ------------------
   95|    237|    return false;
   96|    237|  }
   97|       |
   98|    232|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 232, False: 0]
  |  Branch (98:25): [True: 17, False: 215]
  ------------------
   99|     17|    return false;  // Wrong number of symbols.
  100|     17|  }
  101|       |
  102|    215|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 98, False: 117]
  ------------------
  103|     98|    return false;
  104|     98|  }
  105|  11.1M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 11.1M, False: 117]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  11.1M|    const uint32_t value = decoder.DecodeSymbol();
  108|  11.1M|    out_values[i] = value;
  109|  11.1M|  }
  110|    117|  decoder.EndDecoding();
  111|    117|  return true;
  112|    215|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    475|                              uint32_t *out_values) {
   93|    475|  SymbolDecoderT decoder;
   94|    475|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 232, False: 243]
  ------------------
   95|    232|    return false;
   96|    232|  }
   97|       |
   98|    243|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 243, False: 0]
  |  Branch (98:25): [True: 3, False: 240]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|    240|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 160, False: 80]
  ------------------
  103|    160|    return false;
  104|    160|  }
  105|  2.16M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.16M, False: 80]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.16M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.16M|    out_values[i] = value;
  109|  2.16M|  }
  110|     80|  decoder.EndDecoding();
  111|     80|  return true;
  112|    240|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    370|                              uint32_t *out_values) {
   93|    370|  SymbolDecoderT decoder;
   94|    370|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 205, False: 165]
  ------------------
   95|    205|    return false;
   96|    205|  }
   97|       |
   98|    165|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 165, False: 0]
  |  Branch (98:25): [True: 11, False: 154]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    154|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 111, False: 43]
  ------------------
  103|    111|    return false;
  104|    111|  }
  105|  94.3k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 94.3k, False: 43]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  94.3k|    const uint32_t value = decoder.DecodeSymbol();
  108|  94.3k|    out_values[i] = value;
  109|  94.3k|  }
  110|     43|  decoder.EndDecoding();
  111|     43|  return true;
  112|    154|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    370|                              uint32_t *out_values) {
   93|    370|  SymbolDecoderT decoder;
   94|    370|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 235, False: 135]
  ------------------
   95|    235|    return false;
   96|    235|  }
   97|       |
   98|    135|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 135, False: 0]
  |  Branch (98:25): [True: 6, False: 129]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|    129|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 70, False: 59]
  ------------------
  103|     70|    return false;
  104|     70|  }
  105|   467k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 467k, False: 59]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   467k|    const uint32_t value = decoder.DecodeSymbol();
  108|   467k|    out_values[i] = value;
  109|   467k|  }
  110|     59|  decoder.EndDecoding();
  111|     59|  return true;
  112|    129|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    430|                              uint32_t *out_values) {
   93|    430|  SymbolDecoderT decoder;
   94|    430|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 252, False: 178]
  ------------------
   95|    252|    return false;
   96|    252|  }
   97|       |
   98|    178|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 178, False: 0]
  |  Branch (98:25): [True: 7, False: 171]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    171|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 132, False: 39]
  ------------------
  103|    132|    return false;
  104|    132|  }
  105|  51.4k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 51.4k, False: 39]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  51.4k|    const uint32_t value = decoder.DecodeSymbol();
  108|  51.4k|    out_values[i] = value;
  109|  51.4k|  }
  110|     39|  decoder.EndDecoding();
  111|     39|  return true;
  112|    171|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    426|                              uint32_t *out_values) {
   93|    426|  SymbolDecoderT decoder;
   94|    426|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 256, False: 170]
  ------------------
   95|    256|    return false;
   96|    256|  }
   97|       |
   98|    170|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 170, False: 0]
  |  Branch (98:25): [True: 9, False: 161]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    161|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 106, False: 55]
  ------------------
  103|    106|    return false;
  104|    106|  }
  105|   168k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 168k, False: 55]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   168k|    const uint32_t value = decoder.DecodeSymbol();
  108|   168k|    out_values[i] = value;
  109|   168k|  }
  110|     55|  decoder.EndDecoding();
  111|     55|  return true;
  112|    161|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    368|                              uint32_t *out_values) {
   93|    368|  SymbolDecoderT decoder;
   94|    368|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 210, False: 158]
  ------------------
   95|    210|    return false;
   96|    210|  }
   97|       |
   98|    158|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 158, False: 0]
  |  Branch (98:25): [True: 11, False: 147]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    147|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 76, False: 71]
  ------------------
  103|     76|    return false;
  104|     76|  }
  105|   550k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 550k, False: 71]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   550k|    const uint32_t value = decoder.DecodeSymbol();
  108|   550k|    out_values[i] = value;
  109|   550k|  }
  110|     71|  decoder.EndDecoding();
  111|     71|  return true;
  112|    147|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    397|                              uint32_t *out_values) {
   93|    397|  SymbolDecoderT decoder;
   94|    397|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 213, False: 184]
  ------------------
   95|    213|    return false;
   96|    213|  }
   97|       |
   98|    184|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 184, False: 0]
  |  Branch (98:25): [True: 9, False: 175]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    175|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 96, False: 79]
  ------------------
  103|     96|    return false;
  104|     96|  }
  105|  5.21M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.21M, False: 79]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.21M|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.21M|    out_values[i] = value;
  109|  5.21M|  }
  110|     79|  decoder.EndDecoding();
  111|     79|  return true;
  112|    175|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    423|                              uint32_t *out_values) {
   93|    423|  SymbolDecoderT decoder;
   94|    423|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 190, False: 233]
  ------------------
   95|    190|    return false;
   96|    190|  }
   97|       |
   98|    233|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 233, False: 0]
  |  Branch (98:25): [True: 17, False: 216]
  ------------------
   99|     17|    return false;  // Wrong number of symbols.
  100|     17|  }
  101|       |
  102|    216|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 124, False: 92]
  ------------------
  103|    124|    return false;
  104|    124|  }
  105|  5.05M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.05M, False: 92]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.05M|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.05M|    out_values[i] = value;
  109|  5.05M|  }
  110|     92|  decoder.EndDecoding();
  111|     92|  return true;
  112|    216|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    386|                              uint32_t *out_values) {
   93|    386|  SymbolDecoderT decoder;
   94|    386|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 177, False: 209]
  ------------------
   95|    177|    return false;
   96|    177|  }
   97|       |
   98|    209|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 209, False: 0]
  |  Branch (98:25): [True: 6, False: 203]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|    203|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 121, False: 82]
  ------------------
  103|    121|    return false;
  104|    121|  }
  105|  25.9M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 25.9M, False: 82]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  25.9M|    const uint32_t value = decoder.DecodeSymbol();
  108|  25.9M|    out_values[i] = value;
  109|  25.9M|  }
  110|     82|  decoder.EndDecoding();
  111|     82|  return true;
  112|    203|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    382|                              uint32_t *out_values) {
   93|    382|  SymbolDecoderT decoder;
   94|    382|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 200, False: 182]
  ------------------
   95|    200|    return false;
   96|    200|  }
   97|       |
   98|    182|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 182, False: 0]
  |  Branch (98:25): [True: 14, False: 168]
  ------------------
   99|     14|    return false;  // Wrong number of symbols.
  100|     14|  }
  101|       |
  102|    168|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 104, False: 64]
  ------------------
  103|    104|    return false;
  104|    104|  }
  105|  17.4M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 17.4M, False: 64]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  17.4M|    const uint32_t value = decoder.DecodeSymbol();
  108|  17.4M|    out_values[i] = value;
  109|  17.4M|  }
  110|     64|  decoder.EndDecoding();
  111|     64|  return true;
  112|    168|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    371|                              uint32_t *out_values) {
   93|    371|  SymbolDecoderT decoder;
   94|    371|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 187, False: 184]
  ------------------
   95|    187|    return false;
   96|    187|  }
   97|       |
   98|    184|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 184, False: 0]
  |  Branch (98:25): [True: 6, False: 178]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|    178|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 111, False: 67]
  ------------------
  103|    111|    return false;
  104|    111|  }
  105|  33.3M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 33.3M, False: 67]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  33.3M|    const uint32_t value = decoder.DecodeSymbol();
  108|  33.3M|    out_values[i] = value;
  109|  33.3M|  }
  110|     67|  decoder.EndDecoding();
  111|     67|  return true;
  112|    178|}

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

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

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

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

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

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  7.13k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  2.41k|  const CornerTable *GetCornerTable() const override {
   67|  2.41k|    return corner_table_.get();
   68|  2.41k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  2.97M|                       int *out_encoder_split_symbol_id) {
   87|  2.97M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 26.3k, False: 2.94M]
  ------------------
   88|  26.3k|      return false;
   89|  26.3k|    }
   90|  2.94M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 29, False: 2.94M]
  ------------------
   91|  2.94M|        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|     29|      *out_encoder_split_symbol_id = -1;
   98|     29|      return true;
   99|     29|    }
  100|  2.94M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 2.94M, False: 1.39k]
  ------------------
  101|  2.94M|      return false;
  102|  2.94M|    }
  103|  1.39k|    *out_face_edge =
  104|  1.39k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.39k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.39k|    topology_split_data_.pop_back();
  108|  1.39k|    return true;
  109|  2.94M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  8.43M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  8.43M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  8.43M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  8.43M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  13.8k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  7.36k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  4.72k|  const CornerTable *GetCornerTable() const override {
   67|  4.72k|    return corner_table_.get();
   68|  4.72k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  31.0M|                       int *out_encoder_split_symbol_id) {
   87|  31.0M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 31.0M, False: 64.3k]
  ------------------
   88|  31.0M|      return false;
   89|  31.0M|    }
   90|  64.3k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 29, False: 64.3k]
  ------------------
   91|  64.3k|        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|     29|      *out_encoder_split_symbol_id = -1;
   98|     29|      return true;
   99|     29|    }
  100|  64.3k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 62.7k, False: 1.56k]
  ------------------
  101|  62.7k|      return false;
  102|  62.7k|    }
  103|  1.56k|    *out_face_edge =
  104|  1.56k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.56k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.56k|    topology_split_data_.pop_back();
  108|  1.56k|    return true;
  109|  64.3k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  92.6M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  92.6M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  92.6M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  92.6M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  11.7k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  12.4k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  2.46k|  const CornerTable *GetCornerTable() const override {
   67|  2.46k|    return corner_table_.get();
   68|  2.46k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  39.3M|                       int *out_encoder_split_symbol_id) {
   87|  39.3M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 38.8M, False: 527k]
  ------------------
   88|  38.8M|      return false;
   89|  38.8M|    }
   90|   527k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 37, False: 527k]
  ------------------
   91|   527k|        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|     37|      *out_encoder_split_symbol_id = -1;
   98|     37|      return true;
   99|     37|    }
  100|   527k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 526k, False: 1.20k]
  ------------------
  101|   526k|      return false;
  102|   526k|    }
  103|  1.20k|    *out_face_edge =
  104|  1.20k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.20k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.20k|    topology_split_data_.pop_back();
  108|  1.20k|    return true;
  109|   527k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  51.0M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  51.0M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  51.0M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  51.0M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  14.0k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

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

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

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

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

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.50k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  3.41M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  3.41M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 3.40M, False: 3.54k]
  ------------------
   61|  3.40M|      return true;  // Already traversed.
   62|  3.40M|    }
   63|       |
   64|  3.54k|    corner_traversal_stack_.clear();
   65|  3.54k|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  3.54k|    const VertexIndex next_vert =
   69|  3.54k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  3.54k|    const VertexIndex prev_vert =
   71|  3.54k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  3.54k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 3.54k]
  |  Branch (72:45): [True: 0, False: 3.54k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  3.54k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.91k, False: 632]
  ------------------
   76|  2.91k|      this->MarkVertexVisited(next_vert);
   77|  2.91k|      this->traversal_observer().OnNewVertexVisited(
   78|  2.91k|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.91k|    }
   80|  3.54k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 3.10k, False: 438]
  ------------------
   81|  3.10k|      this->MarkVertexVisited(prev_vert);
   82|  3.10k|      this->traversal_observer().OnNewVertexVisited(
   83|  3.10k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  3.10k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  24.8k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 21.3k, False: 3.54k]
  ------------------
   88|       |      // Currently processed corner.
   89|  21.3k|      corner_id = corner_traversal_stack_.back();
   90|  21.3k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  21.3k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 21.3k]
  |  Branch (92:47): [True: 1.13k, False: 20.1k]
  ------------------
   93|       |        // This face has been already traversed.
   94|  1.13k|        corner_traversal_stack_.pop_back();
   95|  1.13k|        continue;
   96|  1.13k|      }
   97|  3.41M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 3.41M, Folded]
  ------------------
   98|  3.41M|        this->MarkFaceVisited(face_id);
   99|  3.41M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  3.41M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  3.41M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 3.41M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  3.41M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.72M, False: 1.68M]
  ------------------
  105|  1.72M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.72M|          this->MarkVertexVisited(vert_id);
  107|  1.72M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.72M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 1.68M, False: 40.5k]
  ------------------
  109|  1.68M|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  1.68M|            face_id = FaceIndex(corner_id.value() / 3);
  111|  1.68M|            continue;
  112|  1.68M|          }
  113|  1.72M|        }
  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.72M|        const CornerIndex right_corner_id =
  118|  1.72M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.72M|        const CornerIndex left_corner_id =
  120|  1.72M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.72M|        const FaceIndex right_face_id(
  122|  1.72M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 27.7k, False: 1.70M]
  ------------------
  123|  1.72M|                 ? kInvalidFaceIndex
  124|  1.72M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.72M|        const FaceIndex left_face_id(
  126|  1.72M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 14.9k, False: 1.71M]
  ------------------
  127|  1.72M|                 ? kInvalidFaceIndex
  128|  1.72M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.72M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.68M, False: 41.0k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.68M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 11.2k, False: 1.67M]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  11.2k|            corner_traversal_stack_.pop_back();
  134|  11.2k|            break;  // Break from the while (true) loop.
  135|  1.67M|          } else {
  136|       |            // Go to the left face.
  137|  1.67M|            corner_id = left_corner_id;
  138|  1.67M|            face_id = left_face_id;
  139|  1.67M|          }
  140|  1.68M|        } else {
  141|       |          // Right face was not visited.
  142|  41.0k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 32.2k, False: 8.88k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  32.2k|            corner_id = right_corner_id;
  145|  32.2k|            face_id = right_face_id;
  146|  32.2k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  8.88k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  8.88k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  8.88k|            break;
  159|  8.88k|          }
  160|  41.0k|        }
  161|  1.72M|      }
  162|  20.1k|    }
  163|  3.54k|    return true;
  164|  3.54k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.50k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  3.09k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.70k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  4.51M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  4.51M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.14M, False: 3.36M]
  ------------------
   61|  1.14M|      return true;  // Already traversed.
   62|  1.14M|    }
   63|       |
   64|  3.36M|    corner_traversal_stack_.clear();
   65|  3.36M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  3.36M|    const VertexIndex next_vert =
   69|  3.36M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  3.36M|    const VertexIndex prev_vert =
   71|  3.36M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  3.36M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 3.36M]
  |  Branch (72:45): [True: 0, False: 3.36M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  3.36M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 3.36M, False: 1.34k]
  ------------------
   76|  3.36M|      this->MarkVertexVisited(next_vert);
   77|  3.36M|      this->traversal_observer().OnNewVertexVisited(
   78|  3.36M|          next_vert, this->corner_table()->Next(corner_id));
   79|  3.36M|    }
   80|  3.36M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 3.36M, False: 1.25k]
  ------------------
   81|  3.36M|      this->MarkVertexVisited(prev_vert);
   82|  3.36M|      this->traversal_observer().OnNewVertexVisited(
   83|  3.36M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  3.36M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  6.81M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 3.45M, False: 3.36M]
  ------------------
   88|       |      // Currently processed corner.
   89|  3.45M|      corner_id = corner_traversal_stack_.back();
   90|  3.45M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  3.45M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 3.45M]
  |  Branch (92:47): [True: 6.93k, False: 3.44M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  6.93k|        corner_traversal_stack_.pop_back();
   95|  6.93k|        continue;
   96|  6.93k|      }
   97|  4.51M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 4.51M, Folded]
  ------------------
   98|  4.51M|        this->MarkFaceVisited(face_id);
   99|  4.51M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  4.51M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  4.51M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 4.51M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  4.51M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 3.96M, False: 545k]
  ------------------
  105|  3.96M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  3.96M|          this->MarkVertexVisited(vert_id);
  107|  3.96M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  3.96M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 528k, False: 3.43M]
  ------------------
  109|   528k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   528k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   528k|            continue;
  112|   528k|          }
  113|  3.96M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  3.98M|        const CornerIndex right_corner_id =
  118|  3.98M|            this->corner_table()->GetRightCorner(corner_id);
  119|  3.98M|        const CornerIndex left_corner_id =
  120|  3.98M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  3.98M|        const FaceIndex right_face_id(
  122|  3.98M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 3.40M, False: 578k]
  ------------------
  123|  3.98M|                 ? kInvalidFaceIndex
  124|  3.98M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  3.98M|        const FaceIndex left_face_id(
  126|  3.98M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 3.39M, False: 584k]
  ------------------
  127|  3.98M|                 ? kInvalidFaceIndex
  128|  3.98M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  3.98M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 3.91M, False: 67.4k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  3.91M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 3.40M, False: 513k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  3.40M|            corner_traversal_stack_.pop_back();
  134|  3.40M|            break;  // Break from the while (true) loop.
  135|  3.40M|          } else {
  136|       |            // Go to the left face.
  137|   513k|            corner_id = left_corner_id;
  138|   513k|            face_id = left_face_id;
  139|   513k|          }
  140|  3.91M|        } else {
  141|       |          // Right face was not visited.
  142|  67.4k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 24.2k, False: 43.1k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  24.2k|            corner_id = right_corner_id;
  145|  24.2k|            face_id = right_face_id;
  146|  43.1k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  43.1k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  43.1k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  43.1k|            break;
  159|  43.1k|          }
  160|  67.4k|        }
  161|  3.98M|      }
  162|  3.44M|    }
  163|  3.36M|    return true;
  164|  3.36M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.70k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  3.53k|  DepthFirstTraverser() {}

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

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    375|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  1.17k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  1.17k|    const auto *corner_table = traverser_.corner_table();
   50|  1.17k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  1.17k|    const size_t num_faces = mesh_->num_faces();
   52|  1.17k|    const size_t num_points = mesh_->num_points();
   53|  4.12M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 4.12M, False: 1.17k]
  ------------------
   54|  4.12M|      const auto &face = mesh_->face(f);
   55|  16.4M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 12.3M, False: 4.12M]
  ------------------
   56|  12.3M|        const PointIndex point_id = face[p];
   57|  12.3M|        const VertexIndex vert_id =
   58|  12.3M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  12.3M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 12.3M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  12.3M|        const AttributeValueIndex att_entry_id(
   63|  12.3M|            encoding_data_
   64|  12.3M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  12.3M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 12.3M]
  |  Branch (65:13): [True: 0, False: 12.3M]
  |  Branch (65:39): [True: 0, False: 12.3M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  12.3M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  12.3M|      }
   71|  4.12M|    }
   72|  1.17k|    return true;
   73|  1.17k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    351|  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|    351|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    351|    traverser_.OnTraversalStart();
   82|    351|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 351]
  ------------------
   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|    351|    } else {
   89|    351|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.76M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.76M, False: 351]
  ------------------
   91|  2.76M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.76M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.76M|      }
   95|    351|    }
   96|    351|    traverser_.OnTraversalEnd();
   97|    351|    return true;
   98|    351|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.76M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.76M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.76M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    375|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.54k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  6.13k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  6.13k|    const auto *corner_table = traverser_.corner_table();
   50|  6.13k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  6.13k|    const size_t num_faces = mesh_->num_faces();
   52|  6.13k|    const size_t num_points = mesh_->num_points();
   53|  5.71M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 5.71M, False: 6.13k]
  ------------------
   54|  5.71M|      const auto &face = mesh_->face(f);
   55|  22.8M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 17.1M, False: 5.71M]
  ------------------
   56|  17.1M|        const PointIndex point_id = face[p];
   57|  17.1M|        const VertexIndex vert_id =
   58|  17.1M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  17.1M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 17.1M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  17.1M|        const AttributeValueIndex att_entry_id(
   63|  17.1M|            encoding_data_
   64|  17.1M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  17.1M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 17.1M]
  |  Branch (65:13): [True: 0, False: 17.1M]
  |  Branch (65:39): [True: 0, False: 17.1M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  17.1M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  17.1M|      }
   71|  5.71M|    }
   72|  6.13k|    return true;
   73|  6.13k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.50k|  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.50k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.50k|    traverser_.OnTraversalStart();
   82|  1.50k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.50k]
  ------------------
   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.50k|    } else {
   89|  1.50k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.41M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.41M, False: 1.50k]
  ------------------
   91|  3.41M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.41M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.41M|      }
   95|  1.50k|    }
   96|  1.50k|    traverser_.OnTraversalEnd();
   97|  1.50k|    return true;
   98|  1.50k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.41M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.41M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.41M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.54k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.76k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  7.64k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  7.64k|    const auto *corner_table = traverser_.corner_table();
   50|  7.64k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  7.64k|    const size_t num_faces = mesh_->num_faces();
   52|  7.64k|    const size_t num_points = mesh_->num_points();
   53|  7.26M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 7.26M, False: 7.64k]
  ------------------
   54|  7.26M|      const auto &face = mesh_->face(f);
   55|  29.0M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 21.7M, False: 7.26M]
  ------------------
   56|  21.7M|        const PointIndex point_id = face[p];
   57|  21.7M|        const VertexIndex vert_id =
   58|  21.7M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  21.7M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 21.7M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  21.7M|        const AttributeValueIndex att_entry_id(
   63|  21.7M|            encoding_data_
   64|  21.7M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  21.7M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 21.7M]
  |  Branch (65:13): [True: 0, False: 21.7M]
  |  Branch (65:39): [True: 0, False: 21.7M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  21.7M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  21.7M|      }
   71|  7.26M|    }
   72|  7.64k|    return true;
   73|  7.64k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.70k|  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.70k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.70k|    traverser_.OnTraversalStart();
   82|  1.70k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.70k]
  ------------------
   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.70k|    } else {
   89|  1.70k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  4.51M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 4.51M, False: 1.70k]
  ------------------
   91|  4.51M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 4.51M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  4.51M|      }
   95|  1.70k|    }
   96|  1.70k|    traverser_.OnTraversalEnd();
   97|  1.70k|    return true;
   98|  1.70k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  4.51M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  4.51M|    return traverser_.TraverseFromCorner(corner_id);
  103|  4.51M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.76k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.53k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  36.5M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  18.5M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  18.5M|    return is_vertex_visited_[vert_id.value()];
   65|  18.5M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  3.13M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  3.13M|    is_vertex_visited_[vert_id.value()] = true;
   68|  3.13M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  9.30M|  inline TraversalObserverT &traversal_observer() {
   75|  9.30M|    return traversal_observer_;
   76|  9.30M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  14.2M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  14.2M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 81.0k, False: 14.1M]
  ------------------
   47|  81.0k|      return true;  // Invalid faces are always considered as visited.
   48|  81.0k|    }
   49|  14.1M|    return is_face_visited_[face_id.value()];
   50|  14.2M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  6.17M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  6.17M|    is_face_visited_[face_id.value()] = true;
   62|  6.17M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.84k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.84k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.92k|                    TraversalObserver traversal_observer) {
   37|  1.92k|    corner_table_ = corner_table;
   38|  1.92k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.92k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.92k|    traversal_observer_ = traversal_observer;
   41|  1.92k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  3.41M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  3.41M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.41M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  3.41M|    return is_face_visited_[corner_id.value() / 3];
   58|  3.41M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  37.1M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  4.51M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  4.51M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 4.51M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  4.51M|    return is_face_visited_[corner_id.value() / 3];
   58|  4.51M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  11.2M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  11.2M|    return is_vertex_visited_[vert_id.value()];
   65|  11.2M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  10.6M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  10.6M|    is_vertex_visited_[vert_id.value()] = true;
   68|  10.6M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  15.2M|  inline TraversalObserverT &traversal_observer() {
   75|  15.2M|    return traversal_observer_;
   76|  15.2M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  11.4M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  11.4M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 6.80M, False: 4.61M]
  ------------------
   47|  6.80M|      return true;  // Invalid faces are always considered as visited.
   48|  6.80M|    }
   49|  4.61M|    return is_face_visited_[face_id.value()];
   50|  11.4M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  4.51M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  4.51M|    is_face_visited_[face_id.value()] = true;
   62|  4.51M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.53k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.76k|                    TraversalObserver traversal_observer) {
   37|  1.76k|    corner_table_ = corner_table;
   38|  1.76k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.76k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.76k|    traversal_observer_ = traversal_observer;
   41|  1.76k|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    290|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    290|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 15, False: 275]
  ------------------
  187|     15|    return false;
  188|     15|  }
  189|    275|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 20, False: 255]
  ------------------
  190|     20|    return false;
  191|     20|  }
  192|    255|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 6, False: 249]
  ------------------
  193|      6|    return false;
  194|      6|  }
  195|    249|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 100, False: 149]
  ------------------
  196|    100|    return true;
  197|    100|  }
  198|    149|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 32, False: 117]
  ------------------
  199|     32|    return false;
  200|     32|  }
  201|    117|  num_decoded_points_ = 0;
  202|       |
  203|    117|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 27, False: 90]
  ------------------
  204|     27|    return false;
  205|     27|  }
  206|     90|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 11, False: 79]
  ------------------
  207|     11|    return false;
  208|     11|  }
  209|     79|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 78]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     78|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 4, False: 74]
  ------------------
  213|      4|    return false;
  214|      4|  }
  215|       |
  216|     74|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 54, False: 20]
  ------------------
  217|     54|    return false;
  218|     54|  }
  219|       |
  220|     20|  numbers_decoder_.EndDecoding();
  221|     20|  remaining_bits_decoder_.EndDecoding();
  222|     20|  axis_decoder_.EndDecoding();
  223|     20|  half_decoder_.EndDecoding();
  224|       |
  225|     20|  return true;
  226|     74|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     74|    uint32_t num_points, OutputIteratorT &oit) {
  254|     74|  typedef DecodingStatus Status;
  255|     74|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     74|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     74|  DecodingStatus init_status(num_points, 0, 0);
  258|     74|  std::stack<Status> status_stack;
  259|     74|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  4.21M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 4.21M, False: 20]
  ------------------
  263|  4.21M|    const DecodingStatus status = status_stack.top();
  264|  4.21M|    status_stack.pop();
  265|       |
  266|  4.21M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  4.21M|    const uint32_t last_axis = status.last_axis;
  268|  4.21M|    const uint32_t stack_pos = status.stack_pos;
  269|  4.21M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  4.21M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  4.21M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 4.21M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  4.21M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  4.21M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 4.21M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  4.21M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  4.21M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.10M, False: 2.11M]
  ------------------
  285|   569M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 567M, False: 2.10M]
  ------------------
  286|   567M|        *oit = old_base;
  287|   567M|        ++oit;
  288|   567M|        ++num_decoded_points_;
  289|   567M|      }
  290|  2.10M|      continue;
  291|  2.10M|    }
  292|       |
  293|  2.11M|    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.11M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.96k, False: 2.10M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.96k|      axes_[0] = axis;
  300|  11.9k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 10.0k, False: 1.96k]
  ------------------
  301|  10.0k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  10.0k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 649, False: 9.36k]
  |  |  ------------------
  ------------------
  302|  10.0k|      }
  303|  5.32k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.38k, False: 1.93k]
  ------------------
  304|  23.7k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 20.3k, False: 3.35k]
  ------------------
  305|  20.3k|          p_[axes_[j]] = 0;
  306|  20.3k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  20.3k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 5.05k, False: 15.3k]
  ------------------
  308|  5.05k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 25, False: 5.03k]
  ------------------
  309|  5.05k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     25|              return false;
  311|     25|            }
  312|  5.05k|          }
  313|  20.3k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  20.3k|        }
  315|  3.35k|        *oit = p_;
  316|  3.35k|        ++oit;
  317|  3.35k|        ++num_decoded_points_;
  318|  3.35k|      }
  319|  1.93k|      continue;
  320|  1.96k|    }
  321|       |
  322|  2.10M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 2.10M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  2.10M|    const int num_remaining_bits = bit_length_ - level;
  327|  2.10M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  2.10M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  2.10M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  2.10M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  2.10M|    uint32_t number = 0;
  334|  2.10M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  2.10M|    uint32_t first_half = num_remaining_points / 2;
  337|  2.10M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 29, False: 2.10M]
  ------------------
  338|       |      // Invalid |number|.
  339|     29|      return false;
  340|     29|    }
  341|  2.10M|    first_half -= number;
  342|  2.10M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  2.10M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.13M, False: 976k]
  ------------------
  345|  1.13M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.12M, False: 2.57k]
  ------------------
  346|  1.12M|        std::swap(first_half, second_half);
  347|  1.12M|      }
  348|  1.13M|    }
  349|       |
  350|  2.10M|    levels_stack_[stack_pos][axis] += 1;
  351|  2.10M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  2.10M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 2.10M, False: 56]
  ------------------
  353|  2.10M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  2.10M|    }
  355|  2.10M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.10M, False: 146]
  ------------------
  356|  2.10M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.10M|    }
  358|  2.10M|  }
  359|     20|  return true;
  360|     74|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  134|  5.08M|        : num_remaining_points(num_remaining_points_),
  135|  5.08M|          last_axis(last_axis_),
  136|  5.08M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|  2.54M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.54M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.54M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|    100|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|    408|      : bit_length_(0),
   87|    408|        num_points_(0),
   88|    408|        num_decoded_points_(0),
   89|    408|        dimension_(dimension),
   90|    408|        p_(dimension, 0),
   91|    408|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    408|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    408|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    206|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    206|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 8, False: 198]
  ------------------
  187|      8|    return false;
  188|      8|  }
  189|    198|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 16, False: 182]
  ------------------
  190|     16|    return false;
  191|     16|  }
  192|    182|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 3, False: 179]
  ------------------
  193|      3|    return false;
  194|      3|  }
  195|    179|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 37, False: 142]
  ------------------
  196|     37|    return true;
  197|     37|  }
  198|    142|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 18, False: 124]
  ------------------
  199|     18|    return false;
  200|     18|  }
  201|    124|  num_decoded_points_ = 0;
  202|       |
  203|    124|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 26, False: 98]
  ------------------
  204|     26|    return false;
  205|     26|  }
  206|     98|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 94]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     94|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 5, False: 89]
  ------------------
  210|      5|    return false;
  211|      5|  }
  212|     89|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 86]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|       |
  216|     86|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 61, False: 25]
  ------------------
  217|     61|    return false;
  218|     61|  }
  219|       |
  220|     25|  numbers_decoder_.EndDecoding();
  221|     25|  remaining_bits_decoder_.EndDecoding();
  222|     25|  axis_decoder_.EndDecoding();
  223|     25|  half_decoder_.EndDecoding();
  224|       |
  225|     25|  return true;
  226|     86|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     86|    uint32_t num_points, OutputIteratorT &oit) {
  254|     86|  typedef DecodingStatus Status;
  255|     86|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     86|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     86|  DecodingStatus init_status(num_points, 0, 0);
  258|     86|  std::stack<Status> status_stack;
  259|     86|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  4.61M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 4.61M, False: 25]
  ------------------
  263|  4.61M|    const DecodingStatus status = status_stack.top();
  264|  4.61M|    status_stack.pop();
  265|       |
  266|  4.61M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  4.61M|    const uint32_t last_axis = status.last_axis;
  268|  4.61M|    const uint32_t stack_pos = status.stack_pos;
  269|  4.61M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  4.61M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  4.61M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 4.61M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  4.61M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  4.61M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 4.61M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  4.61M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  4.61M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.30M, False: 2.31M]
  ------------------
  285|   840M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 838M, False: 2.30M]
  ------------------
  286|   838M|        *oit = old_base;
  287|   838M|        ++oit;
  288|   838M|        ++num_decoded_points_;
  289|   838M|      }
  290|  2.30M|      continue;
  291|  2.30M|    }
  292|       |
  293|  2.31M|    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.31M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 2.33k, False: 2.30M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  2.33k|      axes_[0] = axis;
  300|  16.4k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 14.1k, False: 2.33k]
  ------------------
  301|  14.1k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  14.1k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 518, False: 13.5k]
  |  |  ------------------
  ------------------
  302|  14.1k|      }
  303|  6.38k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 4.08k, False: 2.30k]
  ------------------
  304|  32.4k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 28.3k, False: 4.04k]
  ------------------
  305|  28.3k|          p_[axes_[j]] = 0;
  306|  28.3k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  28.3k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 5.48k, False: 22.8k]
  ------------------
  308|  5.48k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 34, False: 5.44k]
  ------------------
  309|  5.48k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     34|              return false;
  311|     34|            }
  312|  5.48k|          }
  313|  28.3k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  28.3k|        }
  315|  4.04k|        *oit = p_;
  316|  4.04k|        ++oit;
  317|  4.04k|        ++num_decoded_points_;
  318|  4.04k|      }
  319|  2.30k|      continue;
  320|  2.33k|    }
  321|       |
  322|  2.30M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 2.30M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  2.30M|    const int num_remaining_bits = bit_length_ - level;
  327|  2.30M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  2.30M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  2.30M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  2.30M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  2.30M|    uint32_t number = 0;
  334|  2.30M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  2.30M|    uint32_t first_half = num_remaining_points / 2;
  337|  2.30M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 27, False: 2.30M]
  ------------------
  338|       |      // Invalid |number|.
  339|     27|      return false;
  340|     27|    }
  341|  2.30M|    first_half -= number;
  342|  2.30M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  2.30M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.23M, False: 1.06M]
  ------------------
  345|  1.23M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.23M, False: 3.85k]
  ------------------
  346|  1.23M|        std::swap(first_half, second_half);
  347|  1.23M|      }
  348|  1.23M|    }
  349|       |
  350|  2.30M|    levels_stack_[stack_pos][axis] += 1;
  351|  2.30M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  2.30M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 2.30M, False: 69]
  ------------------
  353|  2.30M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  2.30M|    }
  355|  2.30M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.30M, False: 444]
  ------------------
  356|  2.30M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.30M|    }
  358|  2.30M|  }
  359|     25|  return true;
  360|     86|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  134|  6.25M|        : num_remaining_points(num_remaining_points_),
  135|  6.25M|          last_axis(last_axis_),
  136|  6.25M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  6.25M|    uint32_t last_axis) {
  232|  6.25M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 6.25M, Folded]
  ------------------
  233|  6.25M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  6.25M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 4.77M, False: 1.48M]
  |  |  ------------------
  ------------------
  234|  6.25M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  6.25M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  3.12M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  3.12M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  3.12M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|     35|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    200|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    200|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 5, False: 195]
  ------------------
  187|      5|    return false;
  188|      5|  }
  189|    195|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 24, False: 171]
  ------------------
  190|     24|    return false;
  191|     24|  }
  192|    171|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 169]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|    169|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 19, False: 150]
  ------------------
  196|     19|    return true;
  197|     19|  }
  198|    150|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 16, False: 134]
  ------------------
  199|     16|    return false;
  200|     16|  }
  201|    134|  num_decoded_points_ = 0;
  202|       |
  203|    134|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 25, False: 109]
  ------------------
  204|     25|    return false;
  205|     25|  }
  206|    109|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 15, False: 94]
  ------------------
  207|     15|    return false;
  208|     15|  }
  209|     94|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 91]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     91|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 89]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     89|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 81, False: 8]
  ------------------
  217|     81|    return false;
  218|     81|  }
  219|       |
  220|      8|  numbers_decoder_.EndDecoding();
  221|      8|  remaining_bits_decoder_.EndDecoding();
  222|      8|  axis_decoder_.EndDecoding();
  223|      8|  half_decoder_.EndDecoding();
  224|       |
  225|      8|  return true;
  226|     89|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     89|    uint32_t num_points, OutputIteratorT &oit) {
  254|     89|  typedef DecodingStatus Status;
  255|     89|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     89|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     89|  DecodingStatus init_status(num_points, 0, 0);
  258|     89|  std::stack<Status> status_stack;
  259|     89|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  31.7k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 31.7k, False: 8]
  ------------------
  263|  31.7k|    const DecodingStatus status = status_stack.top();
  264|  31.7k|    status_stack.pop();
  265|       |
  266|  31.7k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  31.7k|    const uint32_t last_axis = status.last_axis;
  268|  31.7k|    const uint32_t stack_pos = status.stack_pos;
  269|  31.7k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  31.7k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  31.7k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 31.7k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  31.7k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  31.7k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 31.7k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  31.7k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  31.7k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 5.13k, False: 26.6k]
  ------------------
  285|  3.91G|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 3.91G, False: 5.13k]
  ------------------
  286|  3.91G|        *oit = old_base;
  287|  3.91G|        ++oit;
  288|  3.91G|        ++num_decoded_points_;
  289|  3.91G|      }
  290|  5.13k|      continue;
  291|  5.13k|    }
  292|       |
  293|  26.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|  26.6k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 2.09k, False: 24.5k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  2.09k|      axes_[0] = axis;
  300|  5.04k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.95k, False: 2.09k]
  ------------------
  301|  2.95k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.95k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 446, False: 2.50k]
  |  |  ------------------
  ------------------
  302|  2.95k|      }
  303|  5.49k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.43k, False: 2.06k]
  ------------------
  304|  11.5k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 8.13k, False: 3.40k]
  ------------------
  305|  8.13k|          p_[axes_[j]] = 0;
  306|  8.13k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  8.13k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 5.79k, False: 2.33k]
  ------------------
  308|  5.79k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 26, False: 5.77k]
  ------------------
  309|  5.79k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     26|              return false;
  311|     26|            }
  312|  5.79k|          }
  313|  8.10k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  8.10k|        }
  315|  3.40k|        *oit = p_;
  316|  3.40k|        ++oit;
  317|  3.40k|        ++num_decoded_points_;
  318|  3.40k|      }
  319|  2.06k|      continue;
  320|  2.09k|    }
  321|       |
  322|  24.5k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 24.5k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  24.5k|    const int num_remaining_bits = bit_length_ - level;
  327|  24.5k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  24.5k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  24.5k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  24.5k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  24.5k|    uint32_t number = 0;
  334|  24.5k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  24.5k|    uint32_t first_half = num_remaining_points / 2;
  337|  24.5k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 55, False: 24.4k]
  ------------------
  338|       |      // Invalid |number|.
  339|     55|      return false;
  340|     55|    }
  341|  24.4k|    first_half -= number;
  342|  24.4k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  24.4k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 21.3k, False: 3.14k]
  ------------------
  345|  21.3k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 18.4k, False: 2.84k]
  ------------------
  346|  18.4k|        std::swap(first_half, second_half);
  347|  18.4k|      }
  348|  21.3k|    }
  349|       |
  350|  24.4k|    levels_stack_[stack_pos][axis] += 1;
  351|  24.4k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  24.4k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 22.9k, False: 1.56k]
  ------------------
  353|  22.9k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  22.9k|    }
  355|  24.4k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 9.76k, False: 14.7k]
  ------------------
  356|  9.76k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  9.76k|    }
  358|  24.4k|  }
  359|      8|  return true;
  360|     89|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  134|  4.24M|        : num_remaining_points(num_remaining_points_),
  135|  4.24M|          last_axis(last_axis_),
  136|  4.24M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodeNumberEiPj:
  127|  2.13M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.13M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.13M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi2EE18num_decoded_pointsEv:
  118|     17|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|    304|      : bit_length_(0),
   87|    304|        num_points_(0),
   88|    304|        num_decoded_points_(0),
   89|    304|        dimension_(dimension),
   90|    304|        p_(dimension, 0),
   91|    304|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    304|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    304|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    155|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    155|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 154]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    154|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 15, False: 139]
  ------------------
  190|     15|    return false;
  191|     15|  }
  192|    139|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 138]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    138|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 14, False: 124]
  ------------------
  196|     14|    return true;
  197|     14|  }
  198|    124|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 8, False: 116]
  ------------------
  199|      8|    return false;
  200|      8|  }
  201|    116|  num_decoded_points_ = 0;
  202|       |
  203|    116|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 22, False: 94]
  ------------------
  204|     22|    return false;
  205|     22|  }
  206|     94|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 5, False: 89]
  ------------------
  207|      5|    return false;
  208|      5|  }
  209|     89|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 8, False: 81]
  ------------------
  210|      8|    return false;
  211|      8|  }
  212|     81|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 79]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     79|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 73, False: 6]
  ------------------
  217|     73|    return false;
  218|     73|  }
  219|       |
  220|      6|  numbers_decoder_.EndDecoding();
  221|      6|  remaining_bits_decoder_.EndDecoding();
  222|      6|  axis_decoder_.EndDecoding();
  223|      6|  half_decoder_.EndDecoding();
  224|       |
  225|      6|  return true;
  226|     79|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     79|    uint32_t num_points, OutputIteratorT &oit) {
  254|     79|  typedef DecodingStatus Status;
  255|     79|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     79|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     79|  DecodingStatus init_status(num_points, 0, 0);
  258|     79|  std::stack<Status> status_stack;
  259|     79|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  24.7k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 24.7k, False: 6]
  ------------------
  263|  24.7k|    const DecodingStatus status = status_stack.top();
  264|  24.7k|    status_stack.pop();
  265|       |
  266|  24.7k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  24.7k|    const uint32_t last_axis = status.last_axis;
  268|  24.7k|    const uint32_t stack_pos = status.stack_pos;
  269|  24.7k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  24.7k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  24.7k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 24.7k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  24.7k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  24.7k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 24.7k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  24.7k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  24.7k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 4.65k, False: 20.0k]
  ------------------
  285|  23.1M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 23.1M, False: 4.65k]
  ------------------
  286|  23.1M|        *oit = old_base;
  287|  23.1M|        ++oit;
  288|  23.1M|        ++num_decoded_points_;
  289|  23.1M|      }
  290|  4.65k|      continue;
  291|  4.65k|    }
  292|       |
  293|  20.0k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  20.0k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.55k, False: 18.5k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.55k|      axes_[0] = axis;
  300|  4.01k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.46k, False: 1.55k]
  ------------------
  301|  2.46k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.46k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 639, False: 1.82k]
  |  |  ------------------
  ------------------
  302|  2.46k|      }
  303|  4.24k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.71k, False: 1.53k]
  ------------------
  304|  9.63k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 6.95k, False: 2.68k]
  ------------------
  305|  6.95k|          p_[axes_[j]] = 0;
  306|  6.95k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  6.95k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 4.41k, False: 2.54k]
  ------------------
  308|  4.41k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 25, False: 4.38k]
  ------------------
  309|  4.41k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     25|              return false;
  311|     25|            }
  312|  4.41k|          }
  313|  6.92k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  6.92k|        }
  315|  2.68k|        *oit = p_;
  316|  2.68k|        ++oit;
  317|  2.68k|        ++num_decoded_points_;
  318|  2.68k|      }
  319|  1.53k|      continue;
  320|  1.55k|    }
  321|       |
  322|  18.5k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 18.5k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  18.5k|    const int num_remaining_bits = bit_length_ - level;
  327|  18.5k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  18.5k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  18.5k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  18.5k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  18.5k|    uint32_t number = 0;
  334|  18.5k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  18.5k|    uint32_t first_half = num_remaining_points / 2;
  337|  18.5k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 48, False: 18.4k]
  ------------------
  338|       |      // Invalid |number|.
  339|     48|      return false;
  340|     48|    }
  341|  18.4k|    first_half -= number;
  342|  18.4k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  18.4k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 15.5k, False: 2.89k]
  ------------------
  345|  15.5k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 12.7k, False: 2.86k]
  ------------------
  346|  12.7k|        std::swap(first_half, second_half);
  347|  12.7k|      }
  348|  15.5k|    }
  349|       |
  350|  18.4k|    levels_stack_[stack_pos][axis] += 1;
  351|  18.4k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  18.4k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 16.5k, False: 1.89k]
  ------------------
  353|  16.5k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  16.5k|    }
  355|  18.4k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 8.89k, False: 9.58k]
  ------------------
  356|  8.89k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  8.89k|    }
  358|  18.4k|  }
  359|      6|  return true;
  360|     79|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  134|  4.23M|        : num_remaining_points(num_remaining_points_),
  135|  4.23M|          last_axis(last_axis_),
  136|  4.23M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  4.23M|    uint32_t last_axis) {
  232|  4.23M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 4.23M, Folded]
  ------------------
  233|  4.23M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.23M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.20M, False: 3.02M]
  |  |  ------------------
  ------------------
  234|  4.23M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  4.23M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  127|  2.12M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.12M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.12M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  118|     14|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    191|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    191|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 4, False: 187]
  ------------------
  187|      4|    return false;
  188|      4|  }
  189|    187|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 13, False: 174]
  ------------------
  190|     13|    return false;
  191|     13|  }
  192|    174|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 173]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    173|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 30, False: 143]
  ------------------
  196|     30|    return true;
  197|     30|  }
  198|    143|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 22, False: 121]
  ------------------
  199|     22|    return false;
  200|     22|  }
  201|    121|  num_decoded_points_ = 0;
  202|       |
  203|    121|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 17, False: 104]
  ------------------
  204|     17|    return false;
  205|     17|  }
  206|    104|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 103]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|    103|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 101]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|    101|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 100]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|    100|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 33, False: 67]
  ------------------
  217|     33|    return false;
  218|     33|  }
  219|       |
  220|     67|  numbers_decoder_.EndDecoding();
  221|     67|  remaining_bits_decoder_.EndDecoding();
  222|     67|  axis_decoder_.EndDecoding();
  223|     67|  half_decoder_.EndDecoding();
  224|       |
  225|     67|  return true;
  226|    100|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|    100|    uint32_t num_points, OutputIteratorT &oit) {
  254|    100|  typedef DecodingStatus Status;
  255|    100|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|    100|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|    100|  DecodingStatus init_status(num_points, 0, 0);
  258|    100|  std::stack<Status> status_stack;
  259|    100|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.20M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.20M, False: 67]
  ------------------
  263|  2.20M|    const DecodingStatus status = status_stack.top();
  264|  2.20M|    status_stack.pop();
  265|       |
  266|  2.20M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.20M|    const uint32_t last_axis = status.last_axis;
  268|  2.20M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.20M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.20M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.20M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.20M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.20M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.20M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.20M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.20M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.20M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 982k, False: 1.22M]
  ------------------
  285|  91.0M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 90.0M, False: 982k]
  ------------------
  286|  90.0M|        *oit = old_base;
  287|  90.0M|        ++oit;
  288|  90.0M|        ++num_decoded_points_;
  289|  90.0M|      }
  290|   982k|      continue;
  291|   982k|    }
  292|       |
  293|  1.22M|    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.22M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 73.2k, False: 1.15M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  73.2k|      axes_[0] = axis;
  300|   116k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 43.0k, False: 73.2k]
  ------------------
  301|  43.0k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  43.0k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 12.8k, False: 30.1k]
  |  |  ------------------
  ------------------
  302|  43.0k|      }
  303|   187k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 114k, False: 73.1k]
  ------------------
  304|   287k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 173k, False: 114k]
  ------------------
  305|   173k|          p_[axes_[j]] = 0;
  306|   173k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   173k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 149k, False: 24.0k]
  ------------------
  308|   149k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 30, False: 149k]
  ------------------
  309|   149k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     30|              return false;
  311|     30|            }
  312|   149k|          }
  313|   173k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   173k|        }
  315|   114k|        *oit = p_;
  316|   114k|        ++oit;
  317|   114k|        ++num_decoded_points_;
  318|   114k|      }
  319|  73.1k|      continue;
  320|  73.2k|    }
  321|       |
  322|  1.15M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.15M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.15M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.15M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.15M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.15M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.15M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.15M|    uint32_t number = 0;
  334|  1.15M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.15M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.15M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 3, False: 1.15M]
  ------------------
  338|       |      // Invalid |number|.
  339|      3|      return false;
  340|      3|    }
  341|  1.15M|    first_half -= number;
  342|  1.15M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.15M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.09M, False: 56.8k]
  ------------------
  345|  1.09M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.04M, False: 47.6k]
  ------------------
  346|  1.04M|        std::swap(first_half, second_half);
  347|  1.04M|      }
  348|  1.09M|    }
  349|       |
  350|  1.15M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.15M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.15M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.13M, False: 20.2k]
  ------------------
  353|  1.13M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.13M|    }
  355|  1.15M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.07M, False: 76.9k]
  ------------------
  356|  1.07M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.07M|    }
  358|  1.15M|  }
  359|     67|  return true;
  360|    100|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  134|  2.20M|        : num_remaining_points(num_remaining_points_),
  135|  2.20M|          last_axis(last_axis_),
  136|  2.20M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|  1.15M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.15M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.15M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     95|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|    253|      : bit_length_(0),
   87|    253|        num_points_(0),
   88|    253|        num_decoded_points_(0),
   89|    253|        dimension_(dimension),
   90|    253|        p_(dimension, 0),
   91|    253|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    253|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    253|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    202|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    202|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 4, False: 198]
  ------------------
  187|      4|    return false;
  188|      4|  }
  189|    198|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 10, False: 188]
  ------------------
  190|     10|    return false;
  191|     10|  }
  192|    188|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 186]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|    186|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 4, False: 182]
  ------------------
  196|      4|    return true;
  197|      4|  }
  198|    182|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 30, False: 152]
  ------------------
  199|     30|    return false;
  200|     30|  }
  201|    152|  num_decoded_points_ = 0;
  202|       |
  203|    152|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 24, False: 128]
  ------------------
  204|     24|    return false;
  205|     24|  }
  206|    128|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 124]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|    124|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 4, False: 120]
  ------------------
  210|      4|    return false;
  211|      4|  }
  212|    120|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 118]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|    118|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 65, False: 53]
  ------------------
  217|     65|    return false;
  218|     65|  }
  219|       |
  220|     53|  numbers_decoder_.EndDecoding();
  221|     53|  remaining_bits_decoder_.EndDecoding();
  222|     53|  axis_decoder_.EndDecoding();
  223|     53|  half_decoder_.EndDecoding();
  224|       |
  225|     53|  return true;
  226|    118|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|    118|    uint32_t num_points, OutputIteratorT &oit) {
  254|    118|  typedef DecodingStatus Status;
  255|    118|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|    118|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|    118|  DecodingStatus init_status(num_points, 0, 0);
  258|    118|  std::stack<Status> status_stack;
  259|    118|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  3.17M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 3.17M, False: 53]
  ------------------
  263|  3.17M|    const DecodingStatus status = status_stack.top();
  264|  3.17M|    status_stack.pop();
  265|       |
  266|  3.17M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  3.17M|    const uint32_t last_axis = status.last_axis;
  268|  3.17M|    const uint32_t stack_pos = status.stack_pos;
  269|  3.17M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  3.17M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  3.17M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 3.17M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  3.17M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  3.17M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 3.17M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  3.17M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  3.17M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.33M, False: 1.83M]
  ------------------
  285|   152M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 151M, False: 1.33M]
  ------------------
  286|   151M|        *oit = old_base;
  287|   151M|        ++oit;
  288|   151M|        ++num_decoded_points_;
  289|   151M|      }
  290|  1.33M|      continue;
  291|  1.33M|    }
  292|       |
  293|  1.83M|    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.83M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 95.6k, False: 1.74M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  95.6k|      axes_[0] = axis;
  300|   282k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 186k, False: 95.6k]
  ------------------
  301|   186k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   186k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 18.3k, False: 168k]
  |  |  ------------------
  ------------------
  302|   186k|      }
  303|   231k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 135k, False: 95.5k]
  ------------------
  304|   583k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 447k, False: 135k]
  ------------------
  305|   447k|          p_[axes_[j]] = 0;
  306|   447k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   447k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 181k, False: 265k]
  ------------------
  308|   181k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 64, False: 181k]
  ------------------
  309|   181k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     64|              return false;
  311|     64|            }
  312|   181k|          }
  313|   447k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   447k|        }
  315|   135k|        *oit = p_;
  316|   135k|        ++oit;
  317|   135k|        ++num_decoded_points_;
  318|   135k|      }
  319|  95.5k|      continue;
  320|  95.6k|    }
  321|       |
  322|  1.74M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.74M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.74M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.74M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.74M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.74M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.74M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.74M|    uint32_t number = 0;
  334|  1.74M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.74M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.74M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 1, False: 1.74M]
  ------------------
  338|       |      // Invalid |number|.
  339|      1|      return false;
  340|      1|    }
  341|  1.74M|    first_half -= number;
  342|  1.74M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.74M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.71M, False: 26.9k]
  ------------------
  345|  1.71M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.62M, False: 91.6k]
  ------------------
  346|  1.62M|        std::swap(first_half, second_half);
  347|  1.62M|      }
  348|  1.71M|    }
  349|       |
  350|  1.74M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.74M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.74M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.68M, False: 55.2k]
  ------------------
  353|  1.68M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.68M|    }
  355|  1.74M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.48M, False: 253k]
  ------------------
  356|  1.48M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.48M|    }
  358|  1.74M|  }
  359|     53|  return true;
  360|    118|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  134|  3.17M|        : num_remaining_points(num_remaining_points_),
  135|  3.17M|          last_axis(last_axis_),
  136|  3.17M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  3.17M|    uint32_t last_axis) {
  232|  3.17M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 3.17M, Folded]
  ------------------
  233|  3.17M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  3.17M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.10M, False: 2.06M]
  |  |  ------------------
  ------------------
  234|  3.17M|  }
  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.17M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|  1.74M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.74M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.74M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     56|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    164|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    164|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 161]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|    161|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 10, False: 151]
  ------------------
  190|     10|    return false;
  191|     10|  }
  192|    151|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 149]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|    149|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 50, False: 99]
  ------------------
  196|     50|    return true;
  197|     50|  }
  198|     99|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 10, False: 89]
  ------------------
  199|     10|    return false;
  200|     10|  }
  201|     89|  num_decoded_points_ = 0;
  202|       |
  203|     89|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 37, False: 52]
  ------------------
  204|     37|    return false;
  205|     37|  }
  206|     52|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 50]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     50|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 49]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     49|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 47]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     47|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 27, False: 20]
  ------------------
  217|     27|    return false;
  218|     27|  }
  219|       |
  220|     20|  numbers_decoder_.EndDecoding();
  221|     20|  remaining_bits_decoder_.EndDecoding();
  222|     20|  axis_decoder_.EndDecoding();
  223|     20|  half_decoder_.EndDecoding();
  224|       |
  225|     20|  return true;
  226|     47|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     47|    uint32_t num_points, OutputIteratorT &oit) {
  254|     47|  typedef DecodingStatus Status;
  255|     47|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     47|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     47|  DecodingStatus init_status(num_points, 0, 0);
  258|     47|  std::stack<Status> status_stack;
  259|     47|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   135k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 135k, False: 20]
  ------------------
  263|   135k|    const DecodingStatus status = status_stack.top();
  264|   135k|    status_stack.pop();
  265|       |
  266|   135k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   135k|    const uint32_t last_axis = status.last_axis;
  268|   135k|    const uint32_t stack_pos = status.stack_pos;
  269|   135k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   135k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   135k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 135k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   135k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   135k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 7, False: 135k]
  ------------------
  278|      7|      return false;
  279|      7|    }
  280|       |
  281|   135k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   135k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 110, False: 134k]
  ------------------
  285|  2.16M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 2.16M, False: 110]
  ------------------
  286|  2.16M|        *oit = old_base;
  287|  2.16M|        ++oit;
  288|  2.16M|        ++num_decoded_points_;
  289|  2.16M|      }
  290|    110|      continue;
  291|    110|    }
  292|       |
  293|   134k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   134k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 186, False: 134k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    186|      axes_[0] = axis;
  300|  11.0k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 10.8k, False: 186]
  ------------------
  301|  10.8k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  10.8k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 163, False: 10.6k]
  |  |  ------------------
  ------------------
  302|  10.8k|      }
  303|    431|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 257, False: 174]
  ------------------
  304|  14.5k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 14.2k, False: 245]
  ------------------
  305|  14.2k|          p_[axes_[j]] = 0;
  306|  14.2k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  14.2k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 13.6k, False: 600]
  ------------------
  308|  13.6k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 12, False: 13.6k]
  ------------------
  309|  13.6k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     12|              return false;
  311|     12|            }
  312|  13.6k|          }
  313|  14.2k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  14.2k|        }
  315|    245|        *oit = p_;
  316|    245|        ++oit;
  317|    245|        ++num_decoded_points_;
  318|    245|      }
  319|    174|      continue;
  320|    186|    }
  321|       |
  322|   134k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 134k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   134k|    const int num_remaining_bits = bit_length_ - level;
  327|   134k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   134k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   134k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   134k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   134k|    uint32_t number = 0;
  334|   134k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   134k|    uint32_t first_half = num_remaining_points / 2;
  337|   134k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 8, False: 134k]
  ------------------
  338|       |      // Invalid |number|.
  339|      8|      return false;
  340|      8|    }
  341|   134k|    first_half -= number;
  342|   134k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   134k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 134k, False: 23]
  ------------------
  345|   134k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 108k, False: 26.2k]
  ------------------
  346|   108k|        std::swap(first_half, second_half);
  347|   108k|      }
  348|   134k|    }
  349|       |
  350|   134k|    levels_stack_[stack_pos][axis] += 1;
  351|   134k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   134k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 108k, False: 26.1k]
  ------------------
  353|   108k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   108k|    }
  355|   134k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 26.4k, False: 108k]
  ------------------
  356|  26.4k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  26.4k|    }
  358|   134k|  }
  359|     20|  return true;
  360|     47|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  134|   135k|        : num_remaining_points(num_remaining_points_),
  135|   135k|          last_axis(last_axis_),
  136|   135k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|   134k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   134k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   134k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     69|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|    179|      : bit_length_(0),
   87|    179|        num_points_(0),
   88|    179|        num_decoded_points_(0),
   89|    179|        dimension_(dimension),
   90|    179|        p_(dimension, 0),
   91|    179|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    179|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    179|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|    117|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    117|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    117|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|    299|      : bit_length_(0),
   87|    299|        num_points_(0),
   88|    299|        num_decoded_points_(0),
   89|    299|        dimension_(dimension),
   90|    299|        p_(dimension, 0),
   91|    299|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    299|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    299|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|    128|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    128|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    128|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|    136|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    136|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    136|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|    281|      : bit_length_(0),
   87|    281|        num_points_(0),
   88|    281|        num_decoded_points_(0),
   89|    281|        dimension_(dimension),
   90|    281|        p_(dimension, 0),
   91|    281|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    281|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    281|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|    102|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    102|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    102|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      8|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      8|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      8|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|    235|      : bit_length_(0),
   87|    235|        num_points_(0),
   88|    235|        num_decoded_points_(0),
   89|    235|        dimension_(dimension),
   90|    235|        p_(dimension, 0),
   91|    235|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    235|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    235|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      3|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      3|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      3|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      4|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      4|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      4|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  5.08M|    uint32_t last_axis) {
  232|  5.08M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 5.08M, Folded]
  ------------------
  233|  5.08M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  5.08M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 4.45M, False: 628k]
  |  |  ------------------
  ------------------
  234|  5.08M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  5.08M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  4.24M|    uint32_t last_axis) {
  232|  4.24M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 4.24M, Folded]
  ------------------
  233|  4.24M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.24M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.21M, False: 3.03M]
  |  |  ------------------
  ------------------
  234|  4.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|  4.24M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.20M|    uint32_t last_axis) {
  232|  2.20M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.20M, Folded]
  ------------------
  233|  2.20M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.20M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.97M, False: 234k]
  |  |  ------------------
  ------------------
  234|  2.20M|  }
  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.20M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   135k|    uint32_t last_axis) {
  232|   135k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded, False: 135k]
  ------------------
  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|   135k|  uint32_t best_axis = 0;
  237|   135k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 135k, False: 87]
  ------------------
  238|  17.7M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 17.6M, False: 135k]
  ------------------
  239|  17.6M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 133k, False: 17.5M]
  ------------------
  240|   133k|        best_axis = axis;
  241|   133k|      }
  242|  17.6M|    }
  243|   135k|  } else {
  244|     87|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|     87|  }
  246|       |
  247|   135k|  return best_axis;
  248|   135k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|    118|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    118|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    118|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|    118|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    118|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 3, False: 115]
  ------------------
  187|      3|    return false;
  188|      3|  }
  189|    115|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 14, False: 101]
  ------------------
  190|     14|    return false;
  191|     14|  }
  192|    101|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 100]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    100|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 2, False: 98]
  ------------------
  196|      2|    return true;
  197|      2|  }
  198|     98|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 98]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     98|  num_decoded_points_ = 0;
  202|       |
  203|     98|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 25, False: 73]
  ------------------
  204|     25|    return false;
  205|     25|  }
  206|     73|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 69]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     69|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 67]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     67|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 65]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     65|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 49, False: 16]
  ------------------
  217|     49|    return false;
  218|     49|  }
  219|       |
  220|     16|  numbers_decoder_.EndDecoding();
  221|     16|  remaining_bits_decoder_.EndDecoding();
  222|     16|  axis_decoder_.EndDecoding();
  223|     16|  half_decoder_.EndDecoding();
  224|       |
  225|     16|  return true;
  226|     65|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     65|    uint32_t num_points, OutputIteratorT &oit) {
  254|     65|  typedef DecodingStatus Status;
  255|     65|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     65|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     65|  DecodingStatus init_status(num_points, 0, 0);
  258|     65|  std::stack<Status> status_stack;
  259|     65|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   863k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 863k, False: 16]
  ------------------
  263|   863k|    const DecodingStatus status = status_stack.top();
  264|   863k|    status_stack.pop();
  265|       |
  266|   863k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   863k|    const uint32_t last_axis = status.last_axis;
  268|   863k|    const uint32_t stack_pos = status.stack_pos;
  269|   863k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   863k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   863k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 863k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   863k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   863k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 863k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   863k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   863k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 430k, False: 432k]
  ------------------
  285|  94.7M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 94.2M, False: 430k]
  ------------------
  286|  94.2M|        *oit = old_base;
  287|  94.2M|        ++oit;
  288|  94.2M|        ++num_decoded_points_;
  289|  94.2M|      }
  290|   430k|      continue;
  291|   430k|    }
  292|       |
  293|   432k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   432k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 653, False: 431k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    653|      axes_[0] = axis;
  300|  1.95k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.30k, False: 653]
  ------------------
  301|  1.30k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.30k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 280, False: 1.02k]
  |  |  ------------------
  ------------------
  302|  1.30k|      }
  303|  1.71k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.08k, False: 622]
  ------------------
  304|  4.27k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 3.21k, False: 1.05k]
  ------------------
  305|  3.21k|          p_[axes_[j]] = 0;
  306|  3.21k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  3.21k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.91k, False: 1.30k]
  ------------------
  308|  1.91k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 31, False: 1.88k]
  ------------------
  309|  1.91k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     31|              return false;
  311|     31|            }
  312|  1.91k|          }
  313|  3.18k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  3.18k|        }
  315|  1.05k|        *oit = p_;
  316|  1.05k|        ++oit;
  317|  1.05k|        ++num_decoded_points_;
  318|  1.05k|      }
  319|    622|      continue;
  320|    653|    }
  321|       |
  322|   431k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 431k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   431k|    const int num_remaining_bits = bit_length_ - level;
  327|   431k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   431k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   431k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   431k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   431k|    uint32_t number = 0;
  334|   431k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   431k|    uint32_t first_half = num_remaining_points / 2;
  337|   431k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 18, False: 431k]
  ------------------
  338|       |      // Invalid |number|.
  339|     18|      return false;
  340|     18|    }
  341|   431k|    first_half -= number;
  342|   431k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   431k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 225k, False: 206k]
  ------------------
  345|   225k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 224k, False: 843]
  ------------------
  346|   224k|        std::swap(first_half, second_half);
  347|   224k|      }
  348|   225k|    }
  349|       |
  350|   431k|    levels_stack_[stack_pos][axis] += 1;
  351|   431k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   431k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 431k, False: 54]
  ------------------
  353|   431k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   431k|    }
  355|   431k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 431k, False: 94]
  ------------------
  356|   431k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   431k|    }
  358|   431k|  }
  359|     16|  return true;
  360|     65|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     93|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     93|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     93|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     93|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     93|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 92]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     92|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 12, False: 80]
  ------------------
  190|     12|    return false;
  191|     12|  }
  192|     80|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 79]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     79|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 78]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     78|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 78]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     78|  num_decoded_points_ = 0;
  202|       |
  203|     78|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 17, False: 61]
  ------------------
  204|     17|    return false;
  205|     17|  }
  206|     61|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 59]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     59|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 56]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     56|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 55]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     55|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 41, False: 14]
  ------------------
  217|     41|    return false;
  218|     41|  }
  219|       |
  220|     14|  numbers_decoder_.EndDecoding();
  221|     14|  remaining_bits_decoder_.EndDecoding();
  222|     14|  axis_decoder_.EndDecoding();
  223|     14|  half_decoder_.EndDecoding();
  224|       |
  225|     14|  return true;
  226|     55|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     55|    uint32_t num_points, OutputIteratorT &oit) {
  254|     55|  typedef DecodingStatus Status;
  255|     55|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     55|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     55|  DecodingStatus init_status(num_points, 0, 0);
  258|     55|  std::stack<Status> status_stack;
  259|     55|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  1.63M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.63M, False: 14]
  ------------------
  263|  1.63M|    const DecodingStatus status = status_stack.top();
  264|  1.63M|    status_stack.pop();
  265|       |
  266|  1.63M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.63M|    const uint32_t last_axis = status.last_axis;
  268|  1.63M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.63M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.63M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.63M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.63M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.63M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.63M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.63M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.63M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.63M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 818k, False: 820k]
  ------------------
  285|  40.2M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 39.4M, False: 818k]
  ------------------
  286|  39.4M|        *oit = old_base;
  287|  39.4M|        ++oit;
  288|  39.4M|        ++num_decoded_points_;
  289|  39.4M|      }
  290|   818k|      continue;
  291|   818k|    }
  292|       |
  293|   820k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   820k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 918, False: 819k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    918|      axes_[0] = axis;
  300|  2.75k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.83k, False: 918]
  ------------------
  301|  1.83k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.83k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 304, False: 1.53k]
  |  |  ------------------
  ------------------
  302|  1.83k|      }
  303|  2.40k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.51k, False: 889]
  ------------------
  304|  5.98k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 4.49k, False: 1.48k]
  ------------------
  305|  4.49k|          p_[axes_[j]] = 0;
  306|  4.49k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  4.49k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.47k, False: 2.02k]
  ------------------
  308|  2.47k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 29, False: 2.44k]
  ------------------
  309|  2.47k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     29|              return false;
  311|     29|            }
  312|  2.47k|          }
  313|  4.47k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  4.47k|        }
  315|  1.48k|        *oit = p_;
  316|  1.48k|        ++oit;
  317|  1.48k|        ++num_decoded_points_;
  318|  1.48k|      }
  319|    889|      continue;
  320|    918|    }
  321|       |
  322|   819k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 819k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   819k|    const int num_remaining_bits = bit_length_ - level;
  327|   819k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   819k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   819k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   819k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   819k|    uint32_t number = 0;
  334|   819k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   819k|    uint32_t first_half = num_remaining_points / 2;
  337|   819k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 12, False: 819k]
  ------------------
  338|       |      // Invalid |number|.
  339|     12|      return false;
  340|     12|    }
  341|   819k|    first_half -= number;
  342|   819k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   819k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 440k, False: 379k]
  ------------------
  345|   440k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 439k, False: 454]
  ------------------
  346|   439k|        std::swap(first_half, second_half);
  347|   439k|      }
  348|   440k|    }
  349|       |
  350|   819k|    levels_stack_[stack_pos][axis] += 1;
  351|   819k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   819k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 819k, False: 15]
  ------------------
  353|   819k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   819k|    }
  355|   819k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 819k, False: 50]
  ------------------
  356|   819k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   819k|    }
  358|   819k|  }
  359|     14|  return true;
  360|     55|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|    104|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    104|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    104|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|    104|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    104|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 103]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    103|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 5, False: 98]
  ------------------
  190|      5|    return false;
  191|      5|  }
  192|     98|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 97]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     97|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 96]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     96|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 96]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     96|  num_decoded_points_ = 0;
  202|       |
  203|     96|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 36, False: 60]
  ------------------
  204|     36|    return false;
  205|     36|  }
  206|     60|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 57]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     57|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 56]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     56|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 55]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     55|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 52, False: 3]
  ------------------
  217|     52|    return false;
  218|     52|  }
  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|     55|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     55|    uint32_t num_points, OutputIteratorT &oit) {
  254|     55|  typedef DecodingStatus Status;
  255|     55|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     55|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     55|  DecodingStatus init_status(num_points, 0, 0);
  258|     55|  std::stack<Status> status_stack;
  259|     55|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  4.21M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 4.21M, False: 3]
  ------------------
  263|  4.21M|    const DecodingStatus status = status_stack.top();
  264|  4.21M|    status_stack.pop();
  265|       |
  266|  4.21M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  4.21M|    const uint32_t last_axis = status.last_axis;
  268|  4.21M|    const uint32_t stack_pos = status.stack_pos;
  269|  4.21M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  4.21M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  4.21M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 4.21M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  4.21M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  4.21M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 4.21M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  4.21M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  4.21M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.10M, False: 2.10M]
  ------------------
  285|  10.9M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 8.81M, False: 2.10M]
  ------------------
  286|  8.81M|        *oit = old_base;
  287|  8.81M|        ++oit;
  288|  8.81M|        ++num_decoded_points_;
  289|  8.81M|      }
  290|  2.10M|      continue;
  291|  2.10M|    }
  292|       |
  293|  2.10M|    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.10M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 399, False: 2.10M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    399|      axes_[0] = axis;
  300|  1.19k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 798, False: 399]
  ------------------
  301|    798|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|    798|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 157, False: 641]
  |  |  ------------------
  ------------------
  302|    798|      }
  303|  1.07k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 686, False: 387]
  ------------------
  304|  2.71k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 2.04k, False: 674]
  ------------------
  305|  2.04k|          p_[axes_[j]] = 0;
  306|  2.04k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  2.04k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.34k, False: 699]
  ------------------
  308|  1.34k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 12, False: 1.33k]
  ------------------
  309|  1.34k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     12|              return false;
  311|     12|            }
  312|  1.34k|          }
  313|  2.03k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  2.03k|        }
  315|    674|        *oit = p_;
  316|    674|        ++oit;
  317|    674|        ++num_decoded_points_;
  318|    674|      }
  319|    387|      continue;
  320|    399|    }
  321|       |
  322|  2.10M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 2.10M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  2.10M|    const int num_remaining_bits = bit_length_ - level;
  327|  2.10M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  2.10M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  2.10M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  2.10M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  2.10M|    uint32_t number = 0;
  334|  2.10M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  2.10M|    uint32_t first_half = num_remaining_points / 2;
  337|  2.10M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 40, False: 2.10M]
  ------------------
  338|       |      // Invalid |number|.
  339|     40|      return false;
  340|     40|    }
  341|  2.10M|    first_half -= number;
  342|  2.10M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  2.10M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 724k, False: 1.38M]
  ------------------
  345|   724k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 723k, False: 1.35k]
  ------------------
  346|   723k|        std::swap(first_half, second_half);
  347|   723k|      }
  348|   724k|    }
  349|       |
  350|  2.10M|    levels_stack_[stack_pos][axis] += 1;
  351|  2.10M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  2.10M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 2.10M, False: 63]
  ------------------
  353|  2.10M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  2.10M|    }
  355|  2.10M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.10M, False: 89]
  ------------------
  356|  2.10M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.10M|    }
  358|  2.10M|  }
  359|      3|  return true;
  360|     55|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|    126|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    126|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    126|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|    126|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    126|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 125]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    125|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 16, False: 109]
  ------------------
  190|     16|    return false;
  191|     16|  }
  192|    109|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 2, False: 107]
  ------------------
  193|      2|    return false;
  194|      2|  }
  195|    107|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 106]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|    106|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 106]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|    106|  num_decoded_points_ = 0;
  202|       |
  203|    106|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 38, False: 68]
  ------------------
  204|     38|    return false;
  205|     38|  }
  206|     68|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 65]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     65|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 63]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     63|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 62]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     62|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 59, False: 3]
  ------------------
  217|     59|    return false;
  218|     59|  }
  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|     62|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     62|    uint32_t num_points, OutputIteratorT &oit) {
  254|     62|  typedef DecodingStatus Status;
  255|     62|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     62|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     62|  DecodingStatus init_status(num_points, 0, 0);
  258|     62|  std::stack<Status> status_stack;
  259|     62|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  4.21M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 4.21M, False: 3]
  ------------------
  263|  4.21M|    const DecodingStatus status = status_stack.top();
  264|  4.21M|    status_stack.pop();
  265|       |
  266|  4.21M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  4.21M|    const uint32_t last_axis = status.last_axis;
  268|  4.21M|    const uint32_t stack_pos = status.stack_pos;
  269|  4.21M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  4.21M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  4.21M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 4.21M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  4.21M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  4.21M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 4.21M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  4.21M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  4.21M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.10M, False: 2.10M]
  ------------------
  285|  15.5M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 13.4M, False: 2.10M]
  ------------------
  286|  13.4M|        *oit = old_base;
  287|  13.4M|        ++oit;
  288|  13.4M|        ++num_decoded_points_;
  289|  13.4M|      }
  290|  2.10M|      continue;
  291|  2.10M|    }
  292|       |
  293|  2.10M|    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.10M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.03k, False: 2.10M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.03k|      axes_[0] = axis;
  300|  3.09k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.06k, False: 1.03k]
  ------------------
  301|  2.06k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.06k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 611, False: 1.45k]
  |  |  ------------------
  ------------------
  302|  2.06k|      }
  303|  2.78k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.77k, False: 1.01k]
  ------------------
  304|  7.04k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 5.28k, False: 1.75k]
  ------------------
  305|  5.28k|          p_[axes_[j]] = 0;
  306|  5.28k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  5.28k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 4.51k, False: 771]
  ------------------
  308|  4.51k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 15, False: 4.50k]
  ------------------
  309|  4.51k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     15|              return false;
  311|     15|            }
  312|  4.51k|          }
  313|  5.27k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  5.27k|        }
  315|  1.75k|        *oit = p_;
  316|  1.75k|        ++oit;
  317|  1.75k|        ++num_decoded_points_;
  318|  1.75k|      }
  319|  1.01k|      continue;
  320|  1.03k|    }
  321|       |
  322|  2.10M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 2.10M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  2.10M|    const int num_remaining_bits = bit_length_ - level;
  327|  2.10M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  2.10M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  2.10M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  2.10M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  2.10M|    uint32_t number = 0;
  334|  2.10M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  2.10M|    uint32_t first_half = num_remaining_points / 2;
  337|  2.10M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 44, False: 2.10M]
  ------------------
  338|       |      // Invalid |number|.
  339|     44|      return false;
  340|     44|    }
  341|  2.10M|    first_half -= number;
  342|  2.10M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  2.10M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 725k, False: 1.38M]
  ------------------
  345|   725k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 724k, False: 1.07k]
  ------------------
  346|   724k|        std::swap(first_half, second_half);
  347|   724k|      }
  348|   725k|    }
  349|       |
  350|  2.10M|    levels_stack_[stack_pos][axis] += 1;
  351|  2.10M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  2.10M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 2.10M, False: 32]
  ------------------
  353|  2.10M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  2.10M|    }
  355|  2.10M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.10M, False: 78]
  ------------------
  356|  2.10M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.10M|    }
  358|  2.10M|  }
  359|      3|  return true;
  360|     62|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     62|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     62|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     62|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     62|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     62|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 61]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     61|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 12, False: 49]
  ------------------
  190|     12|    return false;
  191|     12|  }
  192|     49|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 49]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     49|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 11, False: 38]
  ------------------
  196|     11|    return true;
  197|     11|  }
  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: 38, False: 0]
  ------------------
  204|     38|    return false;
  205|     38|  }
  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|     33|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     33|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     33|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_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: 1, False: 32]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     32|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 8, False: 24]
  ------------------
  190|      8|    return false;
  191|      8|  }
  192|     24|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 23]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     23|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 22]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     22|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 22]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     22|  num_decoded_points_ = 0;
  202|       |
  203|     22|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 22, False: 0]
  ------------------
  204|     22|    return false;
  205|     22|  }
  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|     15|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     15|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     15|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_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: 1, False: 14]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|     14|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 2, False: 12]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|     12|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 11]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|     11|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 10]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     10|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 10]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     10|  num_decoded_points_ = 0;
  202|       |
  203|     10|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 10, False: 0]
  ------------------
  204|     10|    return false;
  205|     10|  }
  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|    634|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|    634|  qinfo_.quantization_bits = 0;
   67|    634|  qinfo_.range = 0;
   68|    634|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|    593|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|    593|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 1, False: 592]
  ------------------
   73|      1|    return false;
   74|      1|  }
   75|    592|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 2, False: 590]
  ------------------
   76|      2|    return false;
   77|      2|  }
   78|    590|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 1, False: 589]
  ------------------
   79|      1|    return false;
   80|      1|  }
   81|    589|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 1, False: 588]
  ------------------
   82|      1|    return false;
   83|      1|  }
   84|    588|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 48, False: 540]
  |  Branch (84:38): [True: 26, False: 22]
  ------------------
   85|     26|    return false;
   86|     26|  }
   87|    562|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 2, False: 560]
  ------------------
   88|      2|    return false;
   89|      2|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|    560|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 8, False: 552]
  ------------------
   93|      8|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|      8|#define DRACO_LOGE printf
  ------------------
   94|      8|               compression_level_);
   95|      8|    return false;
   96|      8|  }
   97|       |
   98|    552|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|    552|      std::back_inserter(*qpoints);
  100|    552|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|    552|                           Converter>
  102|    552|      oit(oit_qpoints);
  103|    552|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 551, False: 1]
  ------------------
  104|    551|    qpoints->reserve(num_points_);
  105|    551|    switch (compression_level_) {
  106|    118|      case 0: {
  ------------------
  |  Branch (106:7): [True: 118, False: 433]
  ------------------
  107|    118|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|    118|        qpoints_decoder.DecodePoints(buffer, oit);
  109|    118|        break;
  110|      0|      }
  111|     93|      case 1: {
  ------------------
  |  Branch (111:7): [True: 93, False: 458]
  ------------------
  112|     93|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|     93|        qpoints_decoder.DecodePoints(buffer, oit);
  114|     93|        break;
  115|      0|      }
  116|    104|      case 2: {
  ------------------
  |  Branch (116:7): [True: 104, False: 447]
  ------------------
  117|    104|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|    104|        qpoints_decoder.DecodePoints(buffer, oit);
  119|    104|        break;
  120|      0|      }
  121|    126|      case 3: {
  ------------------
  |  Branch (121:7): [True: 126, False: 425]
  ------------------
  122|    126|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|    126|        qpoints_decoder.DecodePoints(buffer, oit);
  124|    126|        break;
  125|      0|      }
  126|     62|      case 4: {
  ------------------
  |  Branch (126:7): [True: 62, False: 489]
  ------------------
  127|     62|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     62|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     62|        break;
  130|      0|      }
  131|     33|      case 5: {
  ------------------
  |  Branch (131:7): [True: 33, False: 518]
  ------------------
  132|     33|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|     33|        qpoints_decoder.DecodePoints(buffer, oit);
  134|     33|        break;
  135|      0|      }
  136|     15|      case 6: {
  ------------------
  |  Branch (136:7): [True: 15, False: 536]
  ------------------
  137|     15|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|     15|        qpoints_decoder.DecodePoints(buffer, oit);
  139|     15|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 551]
  ------------------
  142|      0|        return false;
  143|    551|    }
  144|    551|  }
  145|       |
  146|    552|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 541, False: 11]
  ------------------
  147|    541|    return false;
  148|    541|  }
  149|     11|  return true;
  150|    552|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|    552|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|   156M|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|   156M|  const Self &operator=(const SourceType &source) {
   56|   156M|    *oit_ = Converter()(source);
   57|   156M|    return *this;
   58|   156M|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|   156M|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|   156M|    return Point3ui(v[0], v[1], v[2]);
   31|   156M|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|   156M|  const Self &operator++() {
   46|   156M|    ++oit_;
   47|   156M|    return *this;
   48|   156M|  }

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

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

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

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

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

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

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

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

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

_ZN5draco20DataBufferDescriptorC2Ev:
   28|  56.4k|  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|   513M|  void Write(int64_t byte_pos, const void *in_data, size_t data_size) {
   54|   513M|    memcpy(const_cast<uint8_t *>(data()) + byte_pos, in_data, data_size);
   55|   513M|  }
_ZNK5draco10DataBuffer12update_countEv:
   67|  22.1k|  int64_t update_count() const { return descriptor_.buffer_update_count; }
_ZNK5draco10DataBuffer9data_sizeEv:
   68|  45.5M|  size_t data_size() const { return data_.size(); }
_ZNK5draco10DataBuffer4dataEv:
   69|  20.3M|  const uint8_t *data() const { return data_.data(); }
_ZN5draco10DataBuffer4dataEv:
   70|   574M|  uint8_t *data() { return data_.data(); }
_ZNK5draco10DataBuffer9buffer_idEv:
   71|  22.1k|  int64_t buffer_id() const { return descriptor_.buffer_id; }

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  11.5M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  11.5M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 11.5M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  11.5M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  11.5M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|  1.20G|  bool Decode(void *out_data, size_t size_to_decode) {
   77|  1.20G|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 392, False: 1.20G]
  ------------------
   78|    392|      return false;  // Buffer overflow.
   79|    392|    }
   80|  1.20G|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|  1.20G|    pos_ += size_to_decode;
   82|  1.20G|    return true;
   83|  1.20G|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  38.2k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  16.6k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  53.5k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   235k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  7.15k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  11.5M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  2.10M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  8.25k|    inline void reset(const void *b, size_t s) {
  131|  8.25k|      bit_offset_ = 0;
  132|  8.25k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  8.25k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  8.25k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  6.95k|    inline uint64_t BitsDecoded() const {
  138|  6.95k|      return static_cast<uint64_t>(bit_offset_);
  139|  6.95k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  11.5M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  11.5M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 0, False: 11.5M]
  ------------------
  162|      0|        return false;
  163|      0|      }
  164|  11.5M|      uint32_t value = 0;
  165|  25.6M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 14.0M, False: 11.5M]
  ------------------
  166|  14.0M|        value |= GetBit() << bit;
  167|  14.0M|      }
  168|  11.5M|      *x = value;
  169|  11.5M|      return true;
  170|  11.5M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  14.0M|    inline int GetBit() {
  176|  14.0M|      const size_t off = bit_offset_;
  177|  14.0M|      const size_t byte_offset = off >> 3;
  178|  14.0M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  14.0M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 13.4M, False: 601k]
  ------------------
  180|  13.4M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  13.4M|        bit_offset_ = off + 1;
  182|  13.4M|        return bit;
  183|  13.4M|      }
  184|   601k|      return 0;
  185|  14.0M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  6.97M|  bool Decode(T *out_val) {
   69|  6.97M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 4.65k, False: 6.96M]
  ------------------
   70|  4.65k|      return false;
   71|  4.65k|    }
   72|  6.96M|    pos_ += sizeof(T);
   73|  6.96M|    return true;
   74|  6.97M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  6.97M|  bool Peek(T *out_val) {
   88|  6.97M|    const size_t size_to_decode = sizeof(T);
   89|  6.97M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 4.65k, False: 6.96M]
  ------------------
   90|  4.65k|      return false;  // Buffer overflow.
   91|  4.65k|    }
   92|  6.96M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  6.96M|    return true;
   94|  6.97M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  14.8k|  bool Decode(T *out_val) {
   69|  14.8k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 158, False: 14.6k]
  ------------------
   70|    158|      return false;
   71|    158|    }
   72|  14.6k|    pos_ += sizeof(T);
   73|  14.6k|    return true;
   74|  14.8k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   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: 158, False: 14.6k]
  ------------------
   90|    158|      return false;  // Buffer overflow.
   91|    158|    }
   92|  14.6k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  14.6k|    return true;
   94|  14.8k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   248k|  bool Decode(T *out_val) {
   69|   248k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 481, False: 248k]
  ------------------
   70|    481|      return false;
   71|    481|    }
   72|   248k|    pos_ += sizeof(T);
   73|   248k|    return true;
   74|   248k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   248k|  bool Peek(T *out_val) {
   88|   248k|    const size_t size_to_decode = sizeof(T);
   89|   248k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 481, False: 248k]
  ------------------
   90|    481|      return false;  // Buffer overflow.
   91|    481|    }
   92|   248k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   248k|    return true;
   94|   248k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  21.7k|  bool Decode(T *out_val) {
   69|  21.7k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 132, False: 21.5k]
  ------------------
   70|    132|      return false;
   71|    132|    }
   72|  21.5k|    pos_ += sizeof(T);
   73|  21.5k|    return true;
   74|  21.7k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  21.7k|  bool Peek(T *out_val) {
   88|  21.7k|    const size_t size_to_decode = sizeof(T);
   89|  21.7k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 132, False: 21.5k]
  ------------------
   90|    132|      return false;  // Buffer overflow.
   91|    132|    }
   92|  21.5k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  21.5k|    return true;
   94|  21.7k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   656k|  bool Decode(T *out_val) {
   69|   656k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 118, False: 656k]
  ------------------
   70|    118|      return false;
   71|    118|    }
   72|   656k|    pos_ += sizeof(T);
   73|   656k|    return true;
   74|   656k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   656k|  bool Peek(T *out_val) {
   88|   656k|    const size_t size_to_decode = sizeof(T);
   89|   656k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 118, False: 656k]
  ------------------
   90|    118|      return false;  // Buffer overflow.
   91|    118|    }
   92|   656k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   656k|    return true;
   94|   656k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|   145k|  bool Decode(T *out_val) {
   69|   145k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 34, False: 145k]
  ------------------
   70|     34|      return false;
   71|     34|    }
   72|   145k|    pos_ += sizeof(T);
   73|   145k|    return true;
   74|   145k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|   145k|  bool Peek(T *out_val) {
   88|   145k|    const size_t size_to_decode = sizeof(T);
   89|   145k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 34, False: 145k]
  ------------------
   90|     34|      return false;  // Buffer overflow.
   91|     34|    }
   92|   145k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   145k|    return true;
   94|   145k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  1.72k|  bool Decode(T *out_val) {
   69|  1.72k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 48, False: 1.67k]
  ------------------
   70|     48|      return false;
   71|     48|    }
   72|  1.67k|    pos_ += sizeof(T);
   73|  1.67k|    return true;
   74|  1.72k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  1.72k|  bool Peek(T *out_val) {
   88|  1.72k|    const size_t size_to_decode = sizeof(T);
   89|  1.72k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 48, False: 1.67k]
  ------------------
   90|     48|      return false;  // Buffer overflow.
   91|     48|    }
   92|  1.67k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.67k|    return true;
   94|  1.72k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    808|  bool Decode(T *out_val) {
   69|    808|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 8, False: 800]
  ------------------
   70|      8|      return false;
   71|      8|    }
   72|    800|    pos_ += sizeof(T);
   73|    800|    return true;
   74|    808|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    808|  bool Peek(T *out_val) {
   88|    808|    const size_t size_to_decode = sizeof(T);
   89|    808|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 8, False: 800]
  ------------------
   90|      8|      return false;  // Buffer overflow.
   91|      8|    }
   92|    800|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    800|    return true;
   94|    808|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   425M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|  5.71G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  12.9M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  12.9M|    return value_ >= val;
  100|  12.9M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   277M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  3.37G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  30.0M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|   127M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   127M|    value_ = i.value_;
  153|   127M|    return *this;
  154|   127M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|  2.00G|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  2.00G|    value_ = i.value_;
  153|  2.00G|    return *this;
  154|  2.00G|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  30.0M|  inline ThisIndexType &operator++() {
  103|  30.0M|    ++value_;
  104|  30.0M|    return *this;
  105|  30.0M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  2.53G|  constexpr bool operator==(const IndexType &i) const {
   76|  2.53G|    return value_ == i.value_;
   77|  2.53G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   938M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  4.61k|  constexpr bool operator<(const IndexType &i) const {
   88|  4.61k|    return value_ < i.value_;
   89|  4.61k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   142M|  constexpr bool operator==(const IndexType &i) const {
   76|   142M|    return value_ == i.value_;
   77|   142M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   230M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   230M|    return ThisIndexType(value_ - val);
  133|   230M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   702M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   702M|    return ThisIndexType(value_ + val);
  127|   702M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  25.6M|  constexpr bool operator==(const IndexType &i) const {
   76|  25.6M|    return value_ == i.value_;
   77|  25.6M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   230M|  constexpr bool operator!=(const IndexType &i) const {
   82|   230M|    return value_ != i.value_;
   83|   230M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   394M|  constexpr bool operator!=(const IndexType &i) const {
   82|   394M|    return value_ != i.value_;
   83|   394M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   546M|  inline ThisIndexType &operator++() {
  103|   546M|    ++value_;
  104|   546M|    return *this;
  105|   546M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   404M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   404M|    value_ = i.value_;
  153|   404M|    return *this;
  154|   404M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|  1.01G|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  1.01G|    value_ = i.value_;
  153|  1.01G|    return *this;
  154|  1.01G|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  51.2M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  51.2M|    return value_ >= val;
  100|  51.2M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  13.1M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|  1.13G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  20.5G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   204M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  15.3G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   217M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  10.8M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  10.8M|    return ThisIndexType(value_ + val);
  127|  10.8M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   149M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  38.9M|  constexpr bool operator<(const IndexType &i) const {
   88|  38.9M|    return value_ < i.value_;
   89|  38.9M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|  5.86G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|  2.00G|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  83.9M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|  5.68G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   655M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  7.22M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  7.22M|    value_ = i.value_;
  153|  7.22M|    return *this;
  154|  7.22M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  13.1M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  13.1M|    value_ += val;
  141|  13.1M|    return *this;
  142|  13.1M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  38.9M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  38.9M|    value_ = val;
  157|  38.9M|    return *this;
  158|  38.9M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|  1.96G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  8.52M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  8.51M|  inline ThisIndexType &operator++() {
  103|  8.51M|    ++value_;
  104|  8.51M|    return *this;
  105|  8.51M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  31.1M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|  20.3M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|  5.61G|  inline ThisIndexType &operator++() {
  103|  5.61G|    ++value_;
  104|  5.61G|    return *this;
  105|  5.61G|  }
_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|  5.58G|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  5.58G|    return value_ >= val;
  100|  5.58G|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  46.2M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  46.2M|    return vector_[index.value()];
   75|  46.2M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  31.1M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  13.8k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  18.8k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  82.3M|  inline reference operator[](const IndexTypeT &index) {
   71|  82.3M|    return vector_[index.value()];
   72|  82.3M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  38.6k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  25.8M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  4.17k|  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|  12.9M|  inline reference operator[](const IndexTypeT &index) {
   71|  12.9M|    return vector_[index.value()];
   72|  12.9M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  30.9M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  30.9M|    return vector_[index.value()];
   75|  30.9M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   173M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  15.1M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   351M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   351M|    return vector_[index.value()];
   75|   351M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   816M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   816M|    return vector_[index.value()];
   75|   816M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   357M|  inline reference operator[](const IndexTypeT &index) {
   71|   357M|    return vector_[index.value()];
   72|   357M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  60.1M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  60.1M|    return vector_[index.value()];
   75|  60.1M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   304M|  inline reference operator[](const IndexTypeT &index) {
   71|   304M|    return vector_[index.value()];
   72|   304M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  84.2M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   192M|  inline reference operator[](const IndexTypeT &index) {
   71|   192M|    return vector_[index.value()];
   72|   192M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  2.43k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   174M|  inline reference operator[](const IndexTypeT &index) {
   71|   174M|    return vector_[index.value()];
   72|   174M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  66.8k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  2.76M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  63.2k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  7.98k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  7.98k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  7.98k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  7.98k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  15.5k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  15.5k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  15.5k|    vector_.swap(arg.vector_);
   57|  15.5k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  15.5k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  15.5k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  15.5k|    vector_.swap(arg.vector_);
   57|  15.5k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  7.98k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  7.98k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  7.98k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  14.1k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  33.5k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  66.5k|int32_t DataTypeLength(DataType dt) {
   20|  66.5k|  switch (dt) {
   21|  21.9k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 21.9k, False: 44.6k]
  ------------------
   22|  26.3k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 4.44k, False: 62.1k]
  ------------------
   23|  26.3k|      return 1;
   24|  3.77k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 3.77k, False: 62.7k]
  ------------------
   25|  5.41k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 1.63k, False: 64.9k]
  ------------------
   26|  5.41k|      return 2;
   27|  27.7k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 27.7k, False: 38.8k]
  ------------------
   28|  29.4k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 1.68k, False: 64.8k]
  ------------------
   29|  29.4k|      return 4;
   30|    276|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 276, False: 66.2k]
  ------------------
   31|    666|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 390, False: 66.1k]
  ------------------
   32|    666|      return 8;
   33|  4.38k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 4.38k, False: 62.1k]
  ------------------
   34|  4.38k|      return 4;
   35|    117|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 117, False: 66.4k]
  ------------------
   36|    117|      return 8;
   37|    224|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 224, False: 66.3k]
  ------------------
   38|    224|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 66.5k]
  ------------------
   40|      0|      return -1;
   41|  66.5k|  }
   42|  66.5k|}

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

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  2.51k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|     12|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  14.1k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|     10|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2ERKNS_6StatusE:
   37|     59|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|  16.6k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|  16.7k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE6statusEv:
   43|     59|  const Status &status() const { return status_; }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  15.2k|  StatusOr(const Status &status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|  16.6k|  T &&value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  1.55k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  2.53k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|     12|  const Status &status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  2.51k|  T &&value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  14.1k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|     10|  const Status &status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  14.1k|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   419k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   419k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 419k, Folded]
  ------------------
   65|   419k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 1.72k, False: 417k]
  ------------------
   66|  1.72k|      return false;
   67|  1.72k|    }
   68|   419k|  } 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|   417k|  return true;
   77|   419k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   172k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   172k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   172k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 93, False: 172k]
  ------------------
   33|     93|    return false;
   34|     93|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   172k|  uint8_t in;
   39|   172k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 1.09k, False: 170k]
  ------------------
   40|  1.09k|    return false;
   41|  1.09k|  }
   42|   170k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 24.6k, False: 146k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  24.6k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 674, False: 23.9k]
  ------------------
   45|    674|      return false;
   46|    674|    }
   47|       |    // Append decoded info from this byte.
   48|  23.9k|    *out_val <<= 7;
   49|  23.9k|    *out_val |= in & ((1 << 7) - 1);
   50|   146k|  } else {
   51|       |    // Last byte reached
   52|   146k|    *out_val = in;
   53|   146k|  }
   54|   170k|  return true;
   55|   170k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  9.24k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  9.24k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  9.24k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 2, False: 9.24k]
  ------------------
   33|      2|    return false;
   34|      2|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  9.24k|  uint8_t in;
   39|  9.24k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 36, False: 9.20k]
  ------------------
   40|     36|    return false;
   41|     36|  }
   42|  9.20k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 632, False: 8.57k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    632|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 35, False: 597]
  ------------------
   45|     35|      return false;
   46|     35|    }
   47|       |    // Append decoded info from this byte.
   48|    597|    *out_val <<= 7;
   49|    597|    *out_val |= in & ((1 << 7) - 1);
   50|  8.57k|  } else {
   51|       |    // Last byte reached
   52|  8.57k|    *out_val = in;
   53|  8.57k|  }
   54|  9.17k|  return true;
   55|  9.20k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  8.15k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  8.15k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 8.15k, Folded]
  ------------------
   65|  8.15k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 155, False: 7.99k]
  ------------------
   66|    155|      return false;
   67|    155|    }
   68|  8.15k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|      0|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|      0|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 0]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|      0|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|      0|  }
   76|  7.99k|  return true;
   77|  8.15k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  4.81k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.81k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.81k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 4.81k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.81k|  uint8_t in;
   39|  4.81k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 39, False: 4.77k]
  ------------------
   40|     39|    return false;
   41|     39|  }
   42|  4.77k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 410, False: 4.36k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    410|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 39, False: 371]
  ------------------
   45|     39|      return false;
   46|     39|    }
   47|       |    // Append decoded info from this byte.
   48|    371|    *out_val <<= 7;
   49|    371|    *out_val |= in & ((1 << 7) - 1);
   50|  4.36k|  } else {
   51|       |    // Last byte reached
   52|  4.36k|    *out_val = in;
   53|  4.36k|  }
   54|  4.73k|  return true;
   55|  4.77k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   193k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   193k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   193k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 23, False: 193k]
  ------------------
   33|     23|    return false;
   34|     23|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   193k|  uint8_t in;
   39|   193k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 156, False: 193k]
  ------------------
   40|    156|    return false;
   41|    156|  }
   42|   193k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 5.21k, False: 188k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  5.21k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 145, False: 5.07k]
  ------------------
   45|    145|      return false;
   46|    145|    }
   47|       |    // Append decoded info from this byte.
   48|  5.07k|    *out_val <<= 7;
   49|  5.07k|    *out_val |= in & ((1 << 7) - 1);
   50|   188k|  } else {
   51|       |    // Last byte reached
   52|   188k|    *out_val = in;
   53|   188k|  }
   54|   193k|  return true;
   55|   193k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  7.24k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  7.24k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 7.24k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  7.24k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  7.24k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  7.24k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 83, False: 7.16k]
  ------------------
   72|     83|      return false;
   73|     83|    }
   74|  7.16k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  7.16k|  }
   76|  7.16k|  return true;
   77|  7.24k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  8.09k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  8.09k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  8.09k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 32, False: 8.06k]
  ------------------
   33|     32|    return false;
   34|     32|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  8.06k|  uint8_t in;
   39|  8.06k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 51, False: 8.01k]
  ------------------
   40|     51|    return false;
   41|     51|  }
   42|  8.01k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 847, False: 7.16k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    847|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 176, False: 671]
  ------------------
   45|    176|      return false;
   46|    176|    }
   47|       |    // Append decoded info from this byte.
   48|    671|    *out_val <<= 7;
   49|    671|    *out_val |= in & ((1 << 7) - 1);
   50|  7.16k|  } else {
   51|       |    // Last byte reached
   52|  7.16k|    *out_val = in;
   53|  7.16k|  }
   54|  7.83k|  return true;
   55|  8.01k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  4.18k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.18k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.18k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 6, False: 4.18k]
  ------------------
   33|      6|    return false;
   34|      6|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.18k|  uint8_t in;
   39|  4.18k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 22, False: 4.15k]
  ------------------
   40|     22|    return false;
   41|     22|  }
   42|  4.15k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 853, False: 3.30k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    853|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 39, False: 814]
  ------------------
   45|     39|      return false;
   46|     39|    }
   47|       |    // Append decoded info from this byte.
   48|    814|    *out_val <<= 7;
   49|    814|    *out_val |= in & ((1 << 7) - 1);
   50|  3.30k|  } else {
   51|       |    // Last byte reached
   52|  3.30k|    *out_val = in;
   53|  3.30k|  }
   54|  4.12k|  return true;
   55|  4.15k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  30.1k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  30.1k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  30.1k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 5, False: 30.1k]
  ------------------
   33|      5|    return false;
   34|      5|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  30.1k|  uint8_t in;
   39|  30.1k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 42, False: 30.1k]
  ------------------
   40|     42|    return false;
   41|     42|  }
   42|  30.1k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 608, False: 29.5k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    608|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 35, False: 573]
  ------------------
   45|     35|      return false;
   46|     35|    }
   47|       |    // Append decoded info from this byte.
   48|    573|    *out_val <<= 7;
   49|    573|    *out_val |= in & ((1 << 7) - 1);
   50|  29.5k|  } else {
   51|       |    // Last byte reached
   52|  29.5k|    *out_val = in;
   53|  29.5k|  }
   54|  30.0k|  return true;
   55|  30.1k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  10.6k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  10.6k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  10.6k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 68, False: 10.5k]
  ------------------
   33|     68|    return false;
   34|     68|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  10.5k|  uint8_t in;
   39|  10.5k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 104, False: 10.4k]
  ------------------
   40|    104|    return false;
   41|    104|  }
   42|  10.4k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.67k, False: 7.77k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.67k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 390, False: 2.28k]
  ------------------
   45|    390|      return false;
   46|    390|    }
   47|       |    // Append decoded info from this byte.
   48|  2.28k|    *out_val <<= 7;
   49|  2.28k|    *out_val |= in & ((1 << 7) - 1);
   50|  7.77k|  } else {
   51|       |    // Last byte reached
   52|  7.77k|    *out_val = in;
   53|  7.77k|  }
   54|  10.0k|  return true;
   55|  10.4k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  8.63k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  8.63k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  8.63k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 38, False: 8.59k]
  ------------------
   33|     38|    return false;
   34|     38|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  8.59k|  uint8_t in;
   39|  8.59k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 77, False: 8.51k]
  ------------------
   40|     77|    return false;
   41|     77|  }
   42|  8.51k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 4.88k, False: 3.63k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  4.88k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 459, False: 4.42k]
  ------------------
   45|    459|      return false;
   46|    459|    }
   47|       |    // Append decoded info from this byte.
   48|  4.42k|    *out_val <<= 7;
   49|  4.42k|    *out_val |= in & ((1 << 7) - 1);
   50|  4.42k|  } else {
   51|       |    // Last byte reached
   52|  3.63k|    *out_val = in;
   53|  3.63k|  }
   54|  8.05k|  return true;
   55|  8.51k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  37.7k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  37.7k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  37.7k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 9, False: 37.7k]
  ------------------
   33|      9|    return false;
   34|      9|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  37.7k|  uint8_t in;
   39|  37.7k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 70, False: 37.6k]
  ------------------
   40|     70|    return false;
   41|     70|  }
   42|  37.6k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 3.70k, False: 33.9k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  3.70k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 72, False: 3.62k]
  ------------------
   45|     72|      return false;
   46|     72|    }
   47|       |    // Append decoded info from this byte.
   48|  3.62k|    *out_val <<= 7;
   49|  3.62k|    *out_val |= in & ((1 << 7) - 1);
   50|  33.9k|  } else {
   51|       |    // Last byte reached
   52|  33.9k|    *out_val = in;
   53|  33.9k|  }
   54|  37.6k|  return true;
   55|  37.6k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|   102k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|   127k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  10.6k|  Self operator-(const Self &o) const {
  138|  10.6k|    Self ret;
  139|  42.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 31.8k, False: 10.6k]
  ------------------
  140|  31.8k|      ret[i] = (*this)[i] - o[i];
  141|  31.8k|    }
  142|  10.6k|    return ret;
  143|  10.6k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  26.2k|  VectorD() {
   41|   105k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 78.8k, False: 26.2k]
  ------------------
   42|  78.8k|      (*this)[i] = Scalar(0);
   43|  78.8k|    }
   44|  26.2k|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|  1.03G|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIfLi3EEC2ERKfS3_S3_:
   59|     41|      : v_({{c0, c1, c2}}) {
   60|     41|    DRACO_DCHECK_EQ(dimension, 3);
   61|     41|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|   149M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  12.3M|  Self operator-(const Self &o) const {
  138|  12.3M|    Self ret;
  139|  49.5M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 37.1M, False: 12.3M]
  ------------------
  140|  37.1M|      ret[i] = (*this)[i] - o[i];
  141|  37.1M|    }
  142|  12.3M|    return ret;
  143|  12.3M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  6.17M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  6.17M|  static_assert(std::is_signed<ScalarT>::value,
  321|  6.17M|                "ScalarT must be a signed type. ");
  322|  6.17M|  VectorD<ScalarT, 3> r;
  323|  6.17M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  6.17M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  6.17M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  6.17M|  return r;
  327|  6.17M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  6.17M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  6.17M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  2.70M|  Scalar AbsSum() const {
  238|  2.70M|    Scalar result(0);
  239|  10.8M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 8.12M, False: 2.69M]
  ------------------
  240|  8.12M|      Scalar next_value = std::abs(v_[i]);
  241|  8.12M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 12.5k, False: 8.11M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  12.5k|        return std::numeric_limits<Scalar>::max();
  244|  12.5k|      }
  245|  8.11M|      result += next_value;
  246|  8.11M|    }
  247|  2.69M|    return result;
  248|  2.70M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   237k|  Self operator/(const Scalar &o) const {
  183|   237k|    Self ret;
  184|   951k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 713k, False: 237k]
  ------------------
  185|   713k|      ret[i] = (*this)[i] / o;
  186|   713k|    }
  187|   237k|    return ret;
  188|   237k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   189M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  13.8M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  8.12M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  2.31M|  Self operator-() const {
  121|  2.31M|    Self ret;
  122|  9.24M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 6.93M, False: 2.31M]
  ------------------
  123|  6.93M|      ret[i] = -(*this)[i];
  124|  6.93M|    }
  125|  2.31M|    return ret;
  126|  2.31M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  6.93M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|  1.17M|  Self operator-(const Self &o) const {
  138|  1.17M|    Self ret;
  139|  3.52M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.34M, False: 1.17M]
  ------------------
  140|  2.34M|      ret[i] = (*this)[i] - o[i];
  141|  2.34M|    }
  142|  1.17M|    return ret;
  143|  1.17M|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  14.0M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  21.1M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  40.1M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  2.34M|  Self operator+(const Self &o) const {
  130|  2.34M|    Self ret;
  131|  7.04M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 4.69M, False: 2.34M]
  ------------------
  132|  4.69M|      ret[i] = (*this)[i] + o[i];
  133|  4.69M|    }
  134|  2.34M|    return ret;
  135|  2.34M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  38.0M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|   992k|  Self operator-(const Self &o) const {
  138|   992k|    Self ret;
  139|  2.97M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.98M, False: 992k]
  ------------------
  140|  1.98M|      ret[i] = (*this)[i] - o[i];
  141|  1.98M|    }
  142|   992k|    return ret;
  143|   992k|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|   992k|  Self operator+(const Self &o) const {
  130|   992k|    Self ret;
  131|  2.97M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.98M, False: 992k]
  ------------------
  132|  1.98M|      ret[i] = (*this)[i] + o[i];
  133|  1.98M|    }
  134|   992k|    return ret;
  135|   992k|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   448k|  bool operator==(const Self &o) const {
  207|  1.33M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 893k, False: 443k]
  ------------------
  208|   893k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 5.03k, False: 888k]
  ------------------
  209|  5.03k|        return false;
  210|  5.03k|      }
  211|   893k|    }
  212|   443k|    return true;
  213|   448k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  5.38M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  5.59k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  6.15k|  Scalar Dot(const Self &o) const {
  251|  6.15k|    Scalar ret(0);
  252|  24.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 18.4k, False: 6.15k]
  ------------------
  253|  18.4k|      ret += (*this)[i] * o[i];
  254|  18.4k|    }
  255|  6.15k|    return ret;
  256|  6.15k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    563|  Self operator*(const Scalar &o) const {
  175|    563|    Self ret;
  176|  2.25k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 1.68k, False: 563]
  ------------------
  177|  1.68k|      ret[i] = (*this)[i] * o;
  178|  1.68k|    }
  179|    563|    return ret;
  180|    563|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  5.03k|  Self operator-(const Self &o) const {
  138|  5.03k|    Self ret;
  139|  15.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 10.0k, False: 5.03k]
  ------------------
  140|  10.0k|      ret[i] = (*this)[i] - o[i];
  141|  10.0k|    }
  142|  5.03k|    return ret;
  143|  5.03k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  10.0k|  VectorD() {
   41|  30.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 20.1k, False: 10.0k]
  ------------------
   42|  20.1k|      (*this)[i] = Scalar(0);
   43|  20.1k|    }
   44|  10.0k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   902k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   902k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   902k|    v_[0] = c0;
   55|   902k|    v_[1] = c1;
   56|   902k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  40.1k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   693k|  bool operator==(const Self &o) const {
  207|  2.01M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 1.35M, False: 660k]
  ------------------
  208|  1.35M|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 33.0k, False: 1.32M]
  ------------------
  209|  33.0k|        return false;
  210|  33.0k|      }
  211|  1.35M|    }
  212|   660k|    return true;
  213|   693k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  4.10M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  36.6M|  VectorD() {
   41|   146M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 110M, False: 36.6M]
  ------------------
   42|   110M|      (*this)[i] = Scalar(0);
   43|   110M|    }
   44|  36.6M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  36.0k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  39.0k|  Scalar Dot(const Self &o) const {
  251|  39.0k|    Scalar ret(0);
  252|   156k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 117k, False: 39.0k]
  ------------------
  253|   117k|      ret += (*this)[i] * o[i];
  254|   117k|    }
  255|  39.0k|    return ret;
  256|  39.0k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  3.04k|  Self operator-(const Self &o) const {
  138|  3.04k|    Self ret;
  139|  9.12k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 6.08k, False: 3.04k]
  ------------------
  140|  6.08k|      ret[i] = (*this)[i] - o[i];
  141|  6.08k|    }
  142|  3.04k|    return ret;
  143|  3.04k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  8.79k|  Self operator*(const Scalar &o) const {
  175|  8.79k|    Self ret;
  176|  26.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 17.5k, False: 8.79k]
  ------------------
  177|  17.5k|      ret[i] = (*this)[i] * o;
  178|  17.5k|    }
  179|  8.79k|    return ret;
  180|  8.79k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  2.93k|  Self operator+(const Self &o) const {
  130|  2.93k|    Self ret;
  131|  8.81k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 5.87k, False: 2.93k]
  ------------------
  132|  5.87k|      ret[i] = (*this)[i] + o[i];
  133|  5.87k|    }
  134|  2.93k|    return ret;
  135|  2.93k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.93k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.93k|  return v * o;
  294|  2.93k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  2.92k|  Self operator+(const Self &o) const {
  130|  2.92k|    Self ret;
  131|  11.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 8.76k, False: 2.92k]
  ------------------
  132|  8.76k|      ret[i] = (*this)[i] + o[i];
  133|  8.76k|    }
  134|  2.92k|    return ret;
  135|  2.92k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.92k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.92k|  return v * o;
  294|  2.92k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  2.92k|  Self operator*(const Scalar &o) const {
  175|  2.92k|    Self ret;
  176|  11.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 8.76k, False: 2.92k]
  ------------------
  177|  8.76k|      ret[i] = (*this)[i] * o;
  178|  8.76k|    }
  179|  2.92k|    return ret;
  180|  2.92k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|  1.39M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  1.39M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  1.39M|    v_[0] = c0;
   55|  1.39M|    v_[1] = c1;
   56|  1.39M|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  20.6k|  VectorD() {
   41|  61.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 41.2k, False: 20.6k]
  ------------------
   42|  41.2k|      (*this)[i] = Scalar(0);
   43|  41.2k|    }
   44|  20.6k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  5.82k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  17.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 11.6k, False: 5.82k]
  ------------------
  104|  11.6k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 11.6k, False: 0]
  ------------------
  105|  11.6k|        v_[i] = Scalar(src_vector[i]);
  106|  11.6k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  11.6k|    }
  110|  5.82k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|    816|  Self operator+(const Self &o) const {
  130|    816|    Self ret;
  131|  2.44k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.63k, False: 816]
  ------------------
  132|  1.63k|      ret[i] = (*this)[i] + o[i];
  133|  1.63k|    }
  134|    816|    return ret;
  135|    816|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  2.91k|  VectorD() {
   41|  8.74k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 5.82k, False: 2.91k]
  ------------------
   42|  5.82k|      (*this)[i] = Scalar(0);
   43|  5.82k|    }
   44|  2.91k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  17.4k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  11.6k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  2.91k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  8.74k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 5.82k, False: 2.91k]
  ------------------
  104|  5.82k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 5.82k, False: 0]
  ------------------
  105|  5.82k|        v_[i] = Scalar(src_vector[i]);
  106|  5.82k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  5.82k|    }
  110|  2.91k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  2.91k|  Self operator/(const Scalar &o) const {
  183|  2.91k|    Self ret;
  184|  8.74k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 5.82k, False: 2.91k]
  ------------------
  185|  5.82k|      ret[i] = (*this)[i] / o;
  186|  5.82k|    }
  187|  2.91k|    return ret;
  188|  2.91k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  2.09k|  Self operator-(const Self &o) const {
  138|  2.09k|    Self ret;
  139|  6.29k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 4.19k, False: 2.09k]
  ------------------
  140|  4.19k|      ret[i] = (*this)[i] - o[i];
  141|  4.19k|    }
  142|  2.09k|    return ret;
  143|  2.09k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  82.4k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  2.31M|  VectorD() {
   41|  9.25M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 6.93M, False: 2.31M]
  ------------------
   42|  6.93M|      (*this)[i] = Scalar(0);
   43|  6.93M|    }
   44|  2.31M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  8.05M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  8.05M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  8.05M|    v_[0] = c0;
   55|  8.05M|    v_[1] = c1;
   56|  8.05M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  7.04M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  21.1M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 14.0M, False: 7.04M]
  ------------------
  104|  14.0M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 14.0M, False: 0]
  ------------------
  105|  14.0M|        v_[i] = Scalar(src_vector[i]);
  106|  14.0M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  14.0M|    }
  110|  7.04M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  3.52M|  VectorD() {
   41|  10.5M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 7.04M, False: 3.52M]
  ------------------
   42|  7.04M|      (*this)[i] = Scalar(0);
   43|  7.04M|    }
   44|  3.52M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  3.52M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  10.5M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 7.04M, False: 3.52M]
  ------------------
  104|  7.04M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 7.04M, False: 0]
  ------------------
  105|  7.04M|        v_[i] = Scalar(src_vector[i]);
  106|  7.04M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  7.04M|    }
  110|  3.52M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  4.71M|  VectorD(const Self &o) {
   89|  14.1M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 9.43M, False: 4.71M]
  ------------------
   90|  9.43M|      (*this)[i] = o[i];
   91|  9.43M|    }
   92|  4.71M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  1.98M|  VectorD() {
   41|  5.95M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.97M, False: 1.98M]
  ------------------
   42|  3.97M|      (*this)[i] = Scalar(0);
   43|  3.97M|    }
   44|  1.98M|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|   345M|  VectorD(const Self &o) {
   89|  1.38G|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 1.03G, False: 345M]
  ------------------
   90|  1.03G|      (*this)[i] = o[i];
   91|  1.03G|    }
   92|   345M|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|  1.03G|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|   156M|      : v_({{c0, c1, c2}}) {
   60|   156M|    DRACO_DCHECK_EQ(dimension, 3);
   61|   156M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|  88.7M|  inline int num_vertices() const {
   74|  88.7M|    return static_cast<int>(vertex_corners_.size());
   75|  88.7M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  13.1M|  inline int num_corners() const {
   77|  13.1M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  13.1M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  1.99M|  inline int num_faces() const {
   80|  1.99M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  1.99M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   351M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   351M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 351M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   351M|    return opposite_corners_[corner];
   88|   351M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   561M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   561M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 14.7M, False: 546M]
  ------------------
   91|  14.7M|      return corner;
   92|  14.7M|    }
   93|   546M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 483M, False: 63.7M]
  ------------------
   94|   561M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   507M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   507M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 5.70M, False: 501M]
  ------------------
   97|  5.70M|      return corner;
   98|  5.70M|    }
   99|   501M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 167M, False: 334M]
  ------------------
  100|   507M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   816M|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|   816M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 816M]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|   816M|    return ConfidentVertex(corner);
  106|   816M|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|   816M|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|   816M|    DRACO_DCHECK_GE(corner.value(), 0);
  109|   816M|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|   816M|    return corner_to_vertex_map_[corner];
  111|   816M|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  52.1M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  52.1M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 52.1M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  52.1M|    return FaceIndex(corner.value() / 3);
  117|  52.1M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|  1.04G|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  60.1M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  60.1M|    return vertex_corners_[v];
  152|  60.1M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|  1.72M|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|  1.72M|    const CornerIndex corner = LeftMostCorner(vert);
  187|  1.72M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 40.5k, False: 1.68M]
  ------------------
  188|  40.5k|      return true;
  189|  40.5k|    }
  190|  1.68M|    return false;
  191|  1.72M|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  97.7M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  97.7M|    return Previous(Opposite(Previous(corner)));
  202|  97.7M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  19.1M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  19.1M|    return Next(Opposite(Next(corner)));
  207|  19.1M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  4.49M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  4.49M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 4.49M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  4.49M|    return Opposite(Previous(corner_id));
  222|  4.49M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  6.17M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  6.17M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 6.17M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  6.17M|    return Opposite(Next(corner_id));
  228|  6.17M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   304M|                                CornerIndex opp_corner_id) {
  249|   304M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   304M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   304M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   357M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   357M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   357M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   357M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|  84.2M|  VertexIndex AddNewVertex() {
  271|  84.2M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|  84.2M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|  84.2M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|  84.2M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   192M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   192M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   192M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 192M, False: 0]
  ------------------
  295|   192M|      vertex_corners_[vert] = corner;
  296|   192M|    }
  297|   192M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|   635k|  void MakeVertexIsolated(VertexIndex vert) {
  329|   635k|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|   635k|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|   635k|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  3.81k|      : corner_table_(table),
  229|  3.81k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  3.81k|        corner_(start_corner_),
  231|  3.81k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  3.90M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  13.2k|  VertexCornersIterator &operator++() {
  268|  13.2k|    Next();
  269|  13.2k|    return *this;
  270|  13.2k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.33M|  void Next() {
  248|  3.33M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.31M, False: 25.0k]
  ------------------
  249|  3.31M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.31M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 21.5k, False: 3.29M]
  ------------------
  251|       |        // Open boundary reached.
  252|  21.5k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  21.5k|        left_traversal_ = false;
  254|  3.29M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 548k, False: 2.74M]
  ------------------
  255|       |        // End reached.
  256|   548k|        corner_ = kInvalidCornerIndex;
  257|   548k|      }
  258|  3.31M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  25.0k|      corner_ = corner_table_->SwingRight(corner_);
  262|  25.0k|    }
  263|  3.33M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  6.66M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  4.99M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  5.69M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  2.84M|  void Next() {
  248|  2.84M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 2.81M, False: 31.1k]
  ------------------
  249|  2.81M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  2.81M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 2.01M, False: 805k]
  ------------------
  251|       |        // Open boundary reached.
  252|  2.01M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  2.01M|        left_traversal_ = false;
  254|  2.01M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 130k, False: 674k]
  ------------------
  255|       |        // End reached.
  256|   130k|        corner_ = kInvalidCornerIndex;
  257|   130k|      }
  258|  2.81M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  31.1k|      corner_ = corner_table_->SwingRight(corner_);
  262|  31.1k|    }
  263|  2.84M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  2.14M|      : corner_table_(table),
  236|  2.14M|        start_corner_(corner_id),
  237|  2.14M|        corner_(start_corner_),
  238|  2.14M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   566k|      : corner_table_(table),
  236|   566k|        start_corner_(corner_id),
  237|   566k|        corner_(start_corner_),
  238|   566k|        left_traversal_(true) {}

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

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

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

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

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

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

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

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

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

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

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

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

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

