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

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

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

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

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

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

_ZN5draco17GeometryAttributeC2Ev:
   20|  34.1k|    : buffer_(nullptr),
   21|  34.1k|      num_components_(1),
   22|  34.1k|      data_type_(DT_FLOAT32),
   23|  34.1k|      byte_stride_(0),
   24|  34.1k|      byte_offset_(0),
   25|  34.1k|      attribute_type_(INVALID),
   26|  34.1k|      unique_id_(0) {}
_ZN5draco17GeometryAttribute4InitENS0_4TypeEPNS_10DataBufferEhNS_8DataTypeEbll:
   31|  34.1k|                             int64_t byte_stride, int64_t byte_offset) {
   32|  34.1k|  buffer_ = buffer;
   33|  34.1k|  if (buffer) {
  ------------------
  |  Branch (33:7): [True: 0, False: 34.1k]
  ------------------
   34|      0|    buffer_descriptor_.buffer_id = buffer->buffer_id();
   35|      0|    buffer_descriptor_.buffer_update_count = buffer->update_count();
   36|      0|  }
   37|  34.1k|  num_components_ = num_components;
   38|  34.1k|  data_type_ = data_type;
   39|  34.1k|  normalized_ = normalized;
   40|  34.1k|  byte_stride_ = byte_stride;
   41|  34.1k|  byte_offset_ = byte_offset;
   42|  34.1k|  attribute_type_ = attribute_type;
   43|  34.1k|}
_ZN5draco17GeometryAttribute11ResetBufferEPNS_10DataBufferEll:
  102|  19.0k|                                    int64_t byte_offset) {
  103|  19.0k|  buffer_ = buffer;
  104|  19.0k|  buffer_descriptor_.buffer_id = buffer->buffer_id();
  105|  19.0k|  buffer_descriptor_.buffer_update_count = buffer->update_count();
  106|  19.0k|  byte_stride_ = byte_stride;
  107|  19.0k|  byte_offset_ = byte_offset;
  108|  19.0k|}

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

_ZN5draco14PointAttributeC2ERKNS_17GeometryAttributeE:
   31|  34.1k|    : GeometryAttribute(att),
   32|  34.1k|      num_unique_entries_(0),
   33|  34.1k|      identity_mapping_(false) {}
_ZN5draco14PointAttribute5ResetEm:
   66|  19.0k|bool PointAttribute::Reset(size_t num_attribute_values) {
   67|  19.0k|  if (attribute_buffer_ == nullptr) {
  ------------------
  |  Branch (67:7): [True: 19.0k, False: 0]
  ------------------
   68|  19.0k|    attribute_buffer_ = std::unique_ptr<DataBuffer>(new DataBuffer());
   69|  19.0k|  }
   70|  19.0k|  const int64_t entry_size = DataTypeLength(data_type()) * num_components();
   71|  19.0k|  if (!attribute_buffer_->Update(nullptr, num_attribute_values * entry_size)) {
  ------------------
  |  Branch (71:7): [True: 0, False: 19.0k]
  ------------------
   72|      0|    return false;
   73|      0|  }
   74|       |  // Assign the new buffer to the parent attribute.
   75|  19.0k|  ResetBuffer(attribute_buffer_.get(), entry_size, 0);
   76|  19.0k|  num_unique_entries_ = static_cast<uint32_t>(num_attribute_values);
   77|  19.0k|  return true;
   78|  19.0k|}

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  2.44k|      : quantization_bits_(-1),
   54|  2.44k|        max_quantized_value_(-1),
   55|  2.44k|        max_value_(-1),
   56|  2.44k|        dequantization_scale_(1.f),
   57|  2.44k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  2.21k|  bool SetQuantizationBits(int32_t q) {
   60|  2.21k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 633, False: 1.58k]
  |  Branch (60:18): [True: 123, False: 1.46k]
  ------------------
   61|    756|      return false;
   62|    756|    }
   63|  1.46k|    quantization_bits_ = q;
   64|  1.46k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.46k|    max_value_ = max_quantized_value_ - 1;
   66|  1.46k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.46k|    center_value_ = max_value_ / 2;
   68|  1.46k|    return true;
   69|  2.21k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  2.07M|                                           int32_t *out_t) const {
   77|  2.07M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 2.81k, False: 2.06M]
  |  Branch (77:20): [True: 0, False: 2.81k]
  |  Branch (77:32): [True: 2.81k, False: 2.06M]
  |  Branch (77:42): [True: 0, False: 2.81k]
  ------------------
   78|  2.07M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 1.72M, False: 341k]
  |  Branch (78:29): [True: 7.04k, False: 1.72M]
  ------------------
   79|  7.04k|      s = max_value_;
   80|  7.04k|      t = max_value_;
   81|  2.06M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 2.81k, False: 2.06M]
  |  Branch (81:26): [True: 774, False: 2.04k]
  ------------------
   82|    774|      t = center_value_ - (t - center_value_);
   83|  2.06M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 1.72M, False: 340k]
  |  Branch (83:35): [True: 7.03k, False: 1.71M]
  ------------------
   84|  7.03k|      t = center_value_ + (center_value_ - t);
   85|  2.05M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 1.71M, False: 339k]
  |  Branch (85:35): [True: 298, False: 1.71M]
  ------------------
   86|    298|      s = center_value_ + (center_value_ - s);
   87|  2.05M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 3.32k, False: 2.05M]
  |  Branch (87:26): [True: 1.32k, False: 1.99k]
  ------------------
   88|  1.32k|      s = center_value_ - (s - center_value_);
   89|  1.32k|    }
   90|       |
   91|  2.07M|    *out_s = s;
   92|  2.07M|    *out_t = t;
   93|  2.07M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  2.07M|                                                       int32_t *out_t) const {
  100|  2.07M|    DRACO_DCHECK_EQ(
  101|  2.07M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  2.07M|        center_value_);
  103|  2.07M|    int32_t s, t;
  104|  2.07M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 741k, False: 1.32M]
  ------------------
  105|       |      // Right hemisphere.
  106|   741k|      s = (int_vec[1] + center_value_);
  107|   741k|      t = (int_vec[2] + center_value_);
  108|  1.32M|    } else {
  109|       |      // Left hemisphere.
  110|  1.32M|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 41.2k, False: 1.28M]
  ------------------
  111|  41.2k|        s = std::abs(int_vec[2]);
  112|  1.28M|      } else {
  113|  1.28M|        s = (max_value_ - std::abs(int_vec[2]));
  114|  1.28M|      }
  115|  1.32M|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 43.7k, False: 1.28M]
  ------------------
  116|  43.7k|        t = std::abs(int_vec[1]);
  117|  1.28M|      } else {
  118|  1.28M|        t = (max_value_ - std::abs(int_vec[1]));
  119|  1.28M|      }
  120|  1.32M|    }
  121|  2.07M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  2.07M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|  9.49M|                                                    float *out_vector) const {
  199|  9.49M|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|  9.49M|                                 in_t * dequantization_scale_ - 1.f,
  201|  9.49M|                                 out_vector);
  202|  9.49M|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  40.0M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  40.0M|    DRACO_DCHECK_LE(s, center_value_);
  208|  40.0M|    DRACO_DCHECK_LE(t, center_value_);
  209|  40.0M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  40.0M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  40.0M|    const uint32_t st =
  212|  40.0M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  40.0M|    return st <= center_value_;
  214|  40.0M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  52.1M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  52.1M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  52.1M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  52.1M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  52.1M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  52.1M|    int32_t sign_s = 0;
  223|  52.1M|    int32_t sign_t = 0;
  224|  52.1M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 42.9M, False: 9.23M]
  |  Branch (224:20): [True: 39.6M, False: 3.23M]
  ------------------
  225|  39.6M|      sign_s = 1;
  226|  39.6M|      sign_t = 1;
  227|  39.6M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 10.2M, False: 2.16M]
  |  Branch (227:27): [True: 3.26M, False: 7.03M]
  ------------------
  228|  3.26M|      sign_s = -1;
  229|  3.26M|      sign_t = -1;
  230|  9.19M|    } else {
  231|  9.19M|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 2.16M, False: 7.03M]
  ------------------
  232|  9.19M|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 7.03M, False: 2.16M]
  ------------------
  233|  9.19M|    }
  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|  52.1M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  52.1M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  52.1M|    uint32_t us = *s;
  241|  52.1M|    uint32_t ut = *t;
  242|  52.1M|    us = us + us - corner_point_s;
  243|  52.1M|    ut = ut + ut - corner_point_t;
  244|  52.1M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 42.9M, False: 9.19M]
  ------------------
  245|  42.9M|      uint32_t temp = us;
  246|  42.9M|      us = -ut;
  247|  42.9M|      ut = -temp;
  248|  42.9M|    } else {
  249|  9.19M|      std::swap(us, ut);
  250|  9.19M|    }
  251|  52.1M|    us = us + corner_point_s;
  252|  52.1M|    ut = ut + corner_point_t;
  253|       |
  254|  52.1M|    *s = us;
  255|  52.1M|    *t = ut;
  256|  52.1M|    *s /= 2;
  257|  52.1M|    *t /= 2;
  258|  52.1M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  80.0M|  int32_t ModMax(int32_t x) const {
  273|  80.0M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 12.0k, False: 80.0M]
  ------------------
  274|  12.0k|      return x - this->max_quantized_value();
  275|  12.0k|    }
  276|  80.0M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 1.54k, False: 80.0M]
  ------------------
  277|  1.54k|      return x + this->max_quantized_value();
  278|  1.54k|    }
  279|  80.0M|    return x;
  280|  80.0M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.40k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  13.6k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|   240M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|  9.49M|                                           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|  9.49M|    float y = in_s_scaled;
  329|  9.49M|    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|  9.49M|    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|  9.49M|    float x_offset = -x;
  342|  9.49M|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 17.2k, False: 9.47M]
  ------------------
  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|  9.49M|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 376k, False: 9.11M]
  ------------------
  348|  9.49M|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 387k, False: 9.10M]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|  9.49M|    const float norm_squared = x * x + y * y + z * z;
  352|  9.49M|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 9.49M]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|  9.49M|    } else {
  357|  9.49M|      const float d = 1.0f / std::sqrt(norm_squared);
  358|  9.49M|      out_vector[0] = x * d;
  359|  9.49M|      out_vector[1] = y * d;
  360|  9.49M|      out_vector[2] = z * d;
  361|  9.49M|    }
  362|  9.49M|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  2.07M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  2.07M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  2.07M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  2.07M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  2.07M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  2.07M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  2.07M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 1.85M, False: 214k]
  ------------------
  181|  1.85M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  1.85M|    } else {
  183|   214k|      vec[0] =
  184|   214k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   214k|          abs_sum;
  186|   214k|      vec[1] =
  187|   214k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   214k|          abs_sum;
  189|   214k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 114k, False: 100k]
  ------------------
  190|   114k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   114k|      } else {
  192|   100k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   100k|      }
  194|   214k|    }
  195|  2.07M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    351|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    351|            attribute, transform, mesh_data),
   52|    351|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    337|                                                                *buffer) {
  194|    337|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    337|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    337|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 10, False: 327]
  ------------------
  196|       |    // Decode prediction mode.
  197|     10|    uint8_t mode;
  198|     10|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 10]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|     10|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 9, False: 1]
  ------------------
  203|       |      // Unsupported mode.
  204|      9|      return false;
  205|      9|    }
  206|     10|  }
  207|    328|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.48k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.22k, False: 259]
  ------------------
  211|  1.22k|    uint32_t num_flags;
  212|  1.22k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 13, False: 1.21k]
  ------------------
  213|     13|      return false;
  214|     13|    }
  215|  1.21k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 34, False: 1.17k]
  ------------------
  216|     34|      return false;
  217|     34|    }
  218|  1.17k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 542, False: 637]
  ------------------
  219|    542|      is_crease_edge_[i].resize(num_flags);
  220|    542|      RAnsBitDecoder decoder;
  221|    542|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 22, False: 520]
  ------------------
  222|     22|        return false;
  223|     22|      }
  224|   837k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 836k, False: 520]
  ------------------
  225|   836k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|   836k|      }
  227|    520|      decoder.EndDecoding();
  228|    520|    }
  229|  1.17k|  }
  230|    259|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    259|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    328|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    237|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    237|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    237|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.18k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 948, False: 237]
  ------------------
   93|    948|    pred_vals[i].resize(num_components, 0);
   94|    948|  }
   95|    237|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    237|                                         out_data);
   97|       |
   98|    237|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    237|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    237|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    237|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    237|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    237|  const int corner_map_size =
  109|    237|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   376k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 376k, False: 157]
  ------------------
  111|   376k|    const CornerIndex start_corner_id =
  112|   376k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   376k|    CornerIndex corner_id(start_corner_id);
  115|   376k|    int num_parallelograms = 0;
  116|   376k|    bool first_pass = true;
  117|   909k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 566k, False: 343k]
  ------------------
  118|   566k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 72.1k, False: 494k]
  ------------------
  119|   566k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   566k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  72.1k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  72.1k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 598, False: 71.5k]
  ------------------
  127|    598|          break;
  128|    598|        }
  129|  72.1k|      }
  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|   565k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 556k, False: 8.54k]
  ------------------
  134|   556k|        corner_id = table->SwingLeft(corner_id);
  135|   556k|      } else {
  136|  8.54k|        corner_id = table->SwingRight(corner_id);
  137|  8.54k|      }
  138|   565k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 32.9k, False: 532k]
  ------------------
  139|  32.9k|        break;
  140|  32.9k|      }
  141|   532k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 347k, False: 185k]
  |  Branch (141:47): [True: 343k, False: 4.43k]
  ------------------
  142|   343k|        first_pass = false;
  143|   343k|        corner_id = table->SwingRight(start_corner_id);
  144|   343k|      }
  145|   532k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   376k|    int num_used_parallelograms = 0;
  150|   376k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 39.3k, False: 337k]
  ------------------
  151|  3.19M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 3.15M, False: 39.3k]
  ------------------
  152|  3.15M|        multi_pred_vals[i] = 0;
  153|  3.15M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   111k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 72.0k, False: 39.3k]
  ------------------
  156|  72.0k|        const int context = num_parallelograms - 1;
  157|  72.0k|        const int pos = is_crease_edge_pos[context]++;
  158|  72.0k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 80, False: 72.0k]
  ------------------
  159|     80|          return false;
  160|     80|        }
  161|  72.0k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  72.0k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 7.90k, False: 64.0k]
  ------------------
  163|  7.90k|          ++num_used_parallelograms;
  164|   688k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 680k, False: 7.90k]
  ------------------
  165|   680k|            multi_pred_vals[j] =
  166|   680k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|   680k|          }
  168|  7.90k|        }
  169|  72.0k|      }
  170|  39.3k|    }
  171|   376k|    const int dst_offset = p * num_components;
  172|   376k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 372k, False: 3.65k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   372k|      const int src_offset = (p - 1) * num_components;
  176|   372k|      this->transform().ComputeOriginalValue(
  177|   372k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   372k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   311k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 307k, False: 3.65k]
  ------------------
  181|   307k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   307k|      }
  183|  3.65k|      this->transform().ComputeOriginalValue(
  184|  3.65k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  3.65k|    }
  186|   376k|  }
  187|    157|  return true;
  188|    237|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    363|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    363|            attribute, transform, mesh_data),
   52|    363|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    357|                                                                *buffer) {
  194|    357|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    357|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    357|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 3, False: 354]
  ------------------
  196|       |    // Decode prediction mode.
  197|      3|    uint8_t mode;
  198|      3|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 3]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|      3|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 2, False: 1]
  ------------------
  203|       |      // Unsupported mode.
  204|      2|      return false;
  205|      2|    }
  206|      3|  }
  207|    355|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.64k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.34k, False: 298]
  ------------------
  211|  1.34k|    uint32_t num_flags;
  212|  1.34k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 7, False: 1.34k]
  ------------------
  213|      7|      return false;
  214|      7|    }
  215|  1.34k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 29, False: 1.31k]
  ------------------
  216|     29|      return false;
  217|     29|    }
  218|  1.31k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 558, False: 753]
  ------------------
  219|    558|      is_crease_edge_[i].resize(num_flags);
  220|    558|      RAnsBitDecoder decoder;
  221|    558|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 21, False: 537]
  ------------------
  222|     21|        return false;
  223|     21|      }
  224|  1.03M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.03M, False: 537]
  ------------------
  225|  1.03M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.03M|      }
  227|    537|      decoder.EndDecoding();
  228|    537|    }
  229|  1.31k|  }
  230|    298|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    298|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    355|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    267|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    267|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    267|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.33k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.06k, False: 267]
  ------------------
   93|  1.06k|    pred_vals[i].resize(num_components, 0);
   94|  1.06k|  }
   95|    267|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    267|                                         out_data);
   97|       |
   98|    267|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    267|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    267|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    267|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    267|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    267|  const int corner_map_size =
  109|    267|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   113k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 113k, False: 154]
  ------------------
  111|   113k|    const CornerIndex start_corner_id =
  112|   113k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   113k|    CornerIndex corner_id(start_corner_id);
  115|   113k|    int num_parallelograms = 0;
  116|   113k|    bool first_pass = true;
  117|   701k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 687k, False: 14.1k]
  ------------------
  118|   687k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 207k, False: 480k]
  ------------------
  119|   687k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   687k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   207k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   207k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 634, False: 206k]
  ------------------
  127|    634|          break;
  128|    634|        }
  129|   207k|      }
  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|   687k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 673k, False: 13.7k]
  ------------------
  134|   673k|        corner_id = table->SwingLeft(corner_id);
  135|   673k|      } else {
  136|  13.7k|        corner_id = table->SwingRight(corner_id);
  137|  13.7k|      }
  138|   687k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 98.3k, False: 588k]
  ------------------
  139|  98.3k|        break;
  140|  98.3k|      }
  141|   588k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 25.4k, False: 563k]
  |  Branch (141:47): [True: 14.1k, False: 11.2k]
  ------------------
  142|  14.1k|        first_pass = false;
  143|  14.1k|        corner_id = table->SwingRight(start_corner_id);
  144|  14.1k|      }
  145|   588k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   113k|    int num_used_parallelograms = 0;
  150|   113k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 110k, False: 3.02k]
  ------------------
  151|  15.0M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 14.9M, False: 110k]
  ------------------
  152|  14.9M|        multi_pred_vals[i] = 0;
  153|  14.9M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   317k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 207k, False: 110k]
  ------------------
  156|   207k|        const int context = num_parallelograms - 1;
  157|   207k|        const int pos = is_crease_edge_pos[context]++;
  158|   207k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 113, False: 207k]
  ------------------
  159|    113|          return false;
  160|    113|        }
  161|   207k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   207k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 11.7k, False: 195k]
  ------------------
  163|  11.7k|          ++num_used_parallelograms;
  164|  1.90M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 1.89M, False: 11.7k]
  ------------------
  165|  1.89M|            multi_pred_vals[j] =
  166|  1.89M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  1.89M|          }
  168|  11.7k|        }
  169|   207k|      }
  170|   110k|    }
  171|   113k|    const int dst_offset = p * num_components;
  172|   113k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 107k, False: 5.38k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   107k|      const int src_offset = (p - 1) * num_components;
  176|   107k|      this->transform().ComputeOriginalValue(
  177|   107k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   107k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   743k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 737k, False: 5.38k]
  ------------------
  181|   737k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   737k|      }
  183|  5.38k|      this->transform().ComputeOriginalValue(
  184|  5.38k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  5.38k|    }
  186|   113k|  }
  187|    154|  return true;
  188|    267|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  1.98k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  1.98k|    mesh_ = mesh;
   39|  1.98k|    corner_table_ = table;
   40|  1.98k|    data_to_corner_map_ = data_to_corner_map;
   41|  1.98k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  1.98k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  11.1M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  7.67M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  7.67M|    return vertex_to_data_map_;
   48|  7.67M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  4.31M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  4.31M|    return data_to_corner_map_;
   51|  4.31M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  2.28k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  2.28k|    mesh_ = mesh;
   39|  2.28k|    corner_table_ = table;
   40|  2.28k|    data_to_corner_map_ = data_to_corner_map;
   41|  2.28k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  2.28k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  9.45M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  8.33M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  8.33M|    return vertex_to_data_map_;
   48|  8.33M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  2.09M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  2.09M|    return data_to_corner_map_;
   51|  2.09M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  1.98k|      : mesh_(nullptr),
   31|  1.98k|        corner_table_(nullptr),
   32|  1.98k|        vertex_to_data_map_(nullptr),
   33|  1.98k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  2.28k|      : mesh_(nullptr),
   31|  2.28k|        corner_table_(nullptr),
   32|  2.28k|        vertex_to_data_map_(nullptr),
   33|  2.28k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   913k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   195k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   164k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   230k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.61k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.61k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  7.37M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.99k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.99k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  2.32M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    174|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    174|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    134|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    134|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    183|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    183|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    147|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    147|        mesh_data_(mesh_data) {}

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

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    218|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    218|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 42, False: 176]
  ------------------
  105|     42|      this->normal_prediction_mode_ = mode;
  106|     42|      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|    218|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   913k|                             DataTypeT *prediction) override {
   42|   913k|    DRACO_DCHECK(this->IsInitialized());
   43|   913k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   913k|    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|   913k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   913k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   913k|    VectorD<int64_t, 3> normal;
   53|   913k|    CornerIndex c_next, c_prev;
   54|  2.11M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.20M, False: 913k]
  ------------------
   55|       |      // Getting corners.
   56|  1.20M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 252, False: 1.20M]
  ------------------
   57|    252|        c_next = corner_table->Next(corner_id);
   58|    252|        c_prev = corner_table->Previous(corner_id);
   59|  1.20M|      } else {
   60|  1.20M|        c_next = corner_table->Next(cit.Corner());
   61|  1.20M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.20M|      }
   63|  1.20M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.20M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.20M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.20M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.20M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.20M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.20M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.20M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.20M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.20M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.20M|      cit.Next();
   81|  1.20M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   913k|    constexpr int64_t upper_bound = 1 << 29;
   85|   913k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 196, False: 913k]
  ------------------
   86|    196|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    196|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 45, False: 151]
  ------------------
   88|     45|        const int64_t quotient = abs_sum / upper_bound;
   89|     45|        normal = normal / quotient;
   90|     45|      }
   91|   913k|    } else {
   92|   913k|      const int64_t abs_sum = normal.AbsSum();
   93|   913k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.49k, False: 911k]
  ------------------
   94|  1.49k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.49k|        normal = normal / quotient;
   96|  1.49k|      }
   97|   913k|    }
   98|   913k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   913k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   913k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   913k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   913k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    157|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    157|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 21, False: 136]
  ------------------
  105|     21|      this->normal_prediction_mode_ = mode;
  106|     21|      return true;
  107|    136|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 136, False: 0]
  ------------------
  108|    136|      this->normal_prediction_mode_ = mode;
  109|    136|      return true;
  110|    136|    }
  111|      0|    return false;
  112|    157|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   195k|                             DataTypeT *prediction) override {
   42|   195k|    DRACO_DCHECK(this->IsInitialized());
   43|   195k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   195k|    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|   195k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   195k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   195k|    VectorD<int64_t, 3> normal;
   53|   195k|    CornerIndex c_next, c_prev;
   54|  1.36M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.16M, False: 195k]
  ------------------
   55|       |      // Getting corners.
   56|  1.16M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 120, False: 1.16M]
  ------------------
   57|    120|        c_next = corner_table->Next(corner_id);
   58|    120|        c_prev = corner_table->Previous(corner_id);
   59|  1.16M|      } else {
   60|  1.16M|        c_next = corner_table->Next(cit.Corner());
   61|  1.16M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.16M|      }
   63|  1.16M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.16M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.16M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.16M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.16M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.16M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.16M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.16M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.16M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.16M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.16M|      cit.Next();
   81|  1.16M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   195k|    constexpr int64_t upper_bound = 1 << 29;
   85|   195k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 80, False: 195k]
  ------------------
   86|     80|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     80|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 23, False: 57]
  ------------------
   88|     23|        const int64_t quotient = abs_sum / upper_bound;
   89|     23|        normal = normal / quotient;
   90|     23|      }
   91|   195k|    } else {
   92|   195k|      const int64_t abs_sum = normal.AbsSum();
   93|   195k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 69.6k, False: 125k]
  ------------------
   94|  69.6k|        const int64_t quotient = abs_sum / upper_bound;
   95|  69.6k|        normal = normal / quotient;
   96|  69.6k|      }
   97|   195k|    }
   98|   195k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   195k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   195k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   195k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   195k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    220|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    220|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 35, False: 185]
  ------------------
  105|     35|      this->normal_prediction_mode_ = mode;
  106|     35|      return true;
  107|    185|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 185, False: 0]
  ------------------
  108|    185|      this->normal_prediction_mode_ = mode;
  109|    185|      return true;
  110|    185|    }
  111|      0|    return false;
  112|    220|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   164k|                             DataTypeT *prediction) override {
   42|   164k|    DRACO_DCHECK(this->IsInitialized());
   43|   164k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   164k|    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|   164k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   164k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   164k|    VectorD<int64_t, 3> normal;
   53|   164k|    CornerIndex c_next, c_prev;
   54|   381k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 217k, False: 164k]
  ------------------
   55|       |      // Getting corners.
   56|   217k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 204, False: 217k]
  ------------------
   57|    204|        c_next = corner_table->Next(corner_id);
   58|    204|        c_prev = corner_table->Previous(corner_id);
   59|   217k|      } else {
   60|   217k|        c_next = corner_table->Next(cit.Corner());
   61|   217k|        c_prev = corner_table->Previous(cit.Corner());
   62|   217k|      }
   63|   217k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   217k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   217k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   217k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   217k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   217k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   217k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   217k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   217k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   217k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   217k|      cit.Next();
   81|   217k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   164k|    constexpr int64_t upper_bound = 1 << 29;
   85|   164k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 136, False: 163k]
  ------------------
   86|    136|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    136|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 41, False: 95]
  ------------------
   88|     41|        const int64_t quotient = abs_sum / upper_bound;
   89|     41|        normal = normal / quotient;
   90|     41|      }
   91|   163k|    } else {
   92|   163k|      const int64_t abs_sum = normal.AbsSum();
   93|   163k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.87k, False: 162k]
  ------------------
   94|  1.87k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.87k|        normal = normal / quotient;
   96|  1.87k|      }
   97|   163k|    }
   98|   164k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   164k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   164k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   164k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   164k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    166|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    166|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 18, False: 148]
  ------------------
  105|     18|      this->normal_prediction_mode_ = mode;
  106|     18|      return true;
  107|    148|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 148, False: 0]
  ------------------
  108|    148|      this->normal_prediction_mode_ = mode;
  109|    148|      return true;
  110|    148|    }
  111|      0|    return false;
  112|    166|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   230k|                             DataTypeT *prediction) override {
   42|   230k|    DRACO_DCHECK(this->IsInitialized());
   43|   230k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   230k|    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|   230k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   230k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   230k|    VectorD<int64_t, 3> normal;
   53|   230k|    CornerIndex c_next, c_prev;
   54|  1.60M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.37M, False: 230k]
  ------------------
   55|       |      // Getting corners.
   56|  1.37M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 102, False: 1.37M]
  ------------------
   57|    102|        c_next = corner_table->Next(corner_id);
   58|    102|        c_prev = corner_table->Previous(corner_id);
   59|  1.37M|      } else {
   60|  1.37M|        c_next = corner_table->Next(cit.Corner());
   61|  1.37M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.37M|      }
   63|  1.37M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.37M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.37M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.37M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.37M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.37M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.37M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.37M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.37M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.37M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.37M|      cit.Next();
   81|  1.37M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   230k|    constexpr int64_t upper_bound = 1 << 29;
   85|   230k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 68, False: 230k]
  ------------------
   86|     68|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     68|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 31, False: 37]
  ------------------
   88|     31|        const int64_t quotient = abs_sum / upper_bound;
   89|     31|        normal = normal / quotient;
   90|     31|      }
   91|   230k|    } else {
   92|   230k|      const int64_t abs_sum = normal.AbsSum();
   93|   230k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 119k, False: 110k]
  ------------------
   94|   119k|        const int64_t quotient = abs_sum / upper_bound;
   95|   119k|        normal = normal / quotient;
   96|   119k|      }
   97|   230k|    }
   98|   230k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   230k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   230k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   230k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   230k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    172|      : Base(md) {
   35|    172|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    172|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    210|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    210|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 36, False: 174]
  ------------------
  105|     36|      this->normal_prediction_mode_ = mode;
  106|     36|      return true;
  107|    174|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 174, False: 0]
  ------------------
  108|    174|      this->normal_prediction_mode_ = mode;
  109|    174|      return true;
  110|    174|    }
  111|      0|    return false;
  112|    210|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   378k|                             DataTypeT *prediction) override {
   42|   378k|    DRACO_DCHECK(this->IsInitialized());
   43|   378k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   378k|    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|   378k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   378k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   378k|    VectorD<int64_t, 3> normal;
   53|   378k|    CornerIndex c_next, c_prev;
   54|  1.05M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 671k, False: 378k]
  ------------------
   55|       |      // Getting corners.
   56|   671k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 167k, False: 504k]
  ------------------
   57|   167k|        c_next = corner_table->Next(corner_id);
   58|   167k|        c_prev = corner_table->Previous(corner_id);
   59|   504k|      } else {
   60|   504k|        c_next = corner_table->Next(cit.Corner());
   61|   504k|        c_prev = corner_table->Previous(cit.Corner());
   62|   504k|      }
   63|   671k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   671k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   671k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   671k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   671k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   671k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   671k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   671k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   671k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   671k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   671k|      cit.Next();
   81|   671k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   378k|    constexpr int64_t upper_bound = 1 << 29;
   85|   378k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 28.2k, False: 350k]
  ------------------
   86|  28.2k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  28.2k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 70, False: 28.1k]
  ------------------
   88|     70|        const int64_t quotient = abs_sum / upper_bound;
   89|     70|        normal = normal / quotient;
   90|     70|      }
   91|   350k|    } else {
   92|   350k|      const int64_t abs_sum = normal.AbsSum();
   93|   350k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.52k, False: 348k]
  ------------------
   94|  1.52k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.52k|        normal = normal / quotient;
   96|  1.52k|      }
   97|   350k|    }
   98|   378k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   378k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   378k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   378k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   378k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    425|      : Base(md) {
   35|    425|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    425|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    537|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    537|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 110, False: 427]
  ------------------
  105|    110|      this->normal_prediction_mode_ = mode;
  106|    110|      return true;
  107|    427|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 427, False: 0]
  ------------------
  108|    427|      this->normal_prediction_mode_ = mode;
  109|    427|      return true;
  110|    427|    }
  111|      0|    return false;
  112|    537|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   188k|                             DataTypeT *prediction) override {
   42|   188k|    DRACO_DCHECK(this->IsInitialized());
   43|   188k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   188k|    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|   188k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   188k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   188k|    VectorD<int64_t, 3> normal;
   53|   188k|    CornerIndex c_next, c_prev;
   54|  1.26M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.07M, False: 188k]
  ------------------
   55|       |      // Getting corners.
   56|  1.07M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 389k, False: 683k]
  ------------------
   57|   389k|        c_next = corner_table->Next(corner_id);
   58|   389k|        c_prev = corner_table->Previous(corner_id);
   59|   683k|      } else {
   60|   683k|        c_next = corner_table->Next(cit.Corner());
   61|   683k|        c_prev = corner_table->Previous(cit.Corner());
   62|   683k|      }
   63|  1.07M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.07M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.07M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.07M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.07M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.07M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.07M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.07M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.07M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.07M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.07M|      cit.Next();
   81|  1.07M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   188k|    constexpr int64_t upper_bound = 1 << 29;
   85|   188k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 66.6k, False: 122k]
  ------------------
   86|  66.6k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  66.6k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 325, False: 66.2k]
  ------------------
   88|    325|        const int64_t quotient = abs_sum / upper_bound;
   89|    325|        normal = normal / quotient;
   90|    325|      }
   91|   122k|    } else {
   92|   122k|      const int64_t abs_sum = normal.AbsSum();
   93|   122k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 9.51k, False: 112k]
  ------------------
   94|  9.51k|        const int64_t quotient = abs_sum / upper_bound;
   95|  9.51k|        normal = normal / quotient;
   96|  9.51k|      }
   97|   122k|    }
   98|   188k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   188k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   188k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   188k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   188k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    174|      : Base(md) {
   35|    174|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    174|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    134|      : Base(md) {
   35|    134|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    134|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    183|      : Base(md) {
   35|    183|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    183|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    147|      : Base(md) {
   35|    147|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    147|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.32M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.32M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.32M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.32M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.32M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.32M|    return GetPositionForDataId(data_id);
   77|  3.32M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  3.32M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.32M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.32M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.32M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.32M|    VectorD<int64_t, 3> pos;
   68|  3.32M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.32M|    return pos;
   70|  3.32M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    173|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    173|    pos_attribute_ = &position_attribute;
   43|    173|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    160|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    160|    entry_to_point_id_map_ = map;
   46|    160|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.52M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.52M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.52M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.52M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.52M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.52M|    return GetPositionForDataId(data_id);
   77|  2.52M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.52M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.52M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.52M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.52M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.52M|    VectorD<int64_t, 3> pos;
   68|  2.52M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.52M|    return pos;
   70|  2.52M|  }
_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|    122|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    122|    entry_to_point_id_map_ = map;
   46|    122|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|   599k|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|   599k|    DRACO_DCHECK(this->IsInitialized());
   73|   599k|    const auto corner_table = mesh_data_.corner_table();
   74|   599k|    const auto vert_id = corner_table->Vertex(ci).value();
   75|   599k|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|   599k|    return GetPositionForDataId(data_id);
   77|   599k|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|   599k|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|   599k|    DRACO_DCHECK(this->IsInitialized());
   65|   599k|    const auto point_id = entry_to_point_id_map_[data_id];
   66|   599k|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|   599k|    VectorD<int64_t, 3> pos;
   68|   599k|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|   599k|    return pos;
   70|   599k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    182|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    182|    pos_attribute_ = &position_attribute;
   43|    182|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    151|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    151|    entry_to_point_id_map_ = map;
   46|    151|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.97M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.97M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.97M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.97M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.97M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.97M|    return GetPositionForDataId(data_id);
   77|  2.97M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.97M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.97M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.97M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.97M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.97M|    VectorD<int64_t, 3> pos;
   68|  2.97M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.97M|    return pos;
   70|  2.97M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    145|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    145|    pos_attribute_ = &position_attribute;
   43|    145|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    134|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    134|    entry_to_point_id_map_ = map;
   46|    134|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    172|      : pos_attribute_(nullptr),
   36|    172|        entry_to_point_id_map_(nullptr),
   37|    172|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    172|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.72M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.72M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.72M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.72M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.72M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.72M|    return GetPositionForDataId(data_id);
   77|  1.72M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.72M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.72M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.72M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.72M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.72M|    VectorD<int64_t, 3> pos;
   68|  1.72M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.72M|    return pos;
   70|  1.72M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    169|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    169|    pos_attribute_ = &position_attribute;
   43|    169|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    136|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    136|    entry_to_point_id_map_ = map;
   46|    136|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    425|      : pos_attribute_(nullptr),
   36|    425|        entry_to_point_id_map_(nullptr),
   37|    425|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    425|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.33M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.33M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.33M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.33M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.33M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.33M|    return GetPositionForDataId(data_id);
   77|  2.33M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.33M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.33M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.33M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.33M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.33M|    VectorD<int64_t, 3> pos;
   68|  2.33M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.33M|    return pos;
   70|  2.33M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    424|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    424|    pos_attribute_ = &position_attribute;
   43|    424|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    378|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    378|    entry_to_point_id_map_ = map;
   46|    378|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    174|      : pos_attribute_(nullptr),
   36|    174|        entry_to_point_id_map_(nullptr),
   37|    174|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    174|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    134|      : pos_attribute_(nullptr),
   36|    134|        entry_to_point_id_map_(nullptr),
   37|    134|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    134|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    183|      : pos_attribute_(nullptr),
   36|    183|        entry_to_point_id_map_(nullptr),
   37|    183|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    183|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    147|      : pos_attribute_(nullptr),
   36|    147|        entry_to_point_id_map_(nullptr),
   37|    147|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    147|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    288|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    288|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    273|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    273|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    273|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    273|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    273|      new DataTypeT[num_components]());
   70|       |
   71|    273|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    273|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    273|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    273|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    273|  const int corner_map_size =
   78|    273|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   557k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 557k, False: 273]
  ------------------
   80|   557k|    const CornerIndex start_corner_id =
   81|   557k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   557k|    CornerIndex corner_id(start_corner_id);
   84|   557k|    int num_parallelograms = 0;
   85|  23.9M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 23.3M, False: 557k]
  ------------------
   86|  23.3M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  23.3M|    }
   88|  1.53M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 979k, False: 557k]
  ------------------
   89|   979k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 175k, False: 804k]
  ------------------
   90|   979k|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|   979k|              num_components, parallelogram_pred_vals.get())) {
   92|  8.14M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 7.97M, False: 175k]
  ------------------
   93|  7.97M|          pred_vals[c] =
   94|  7.97M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  7.97M|        }
   96|   175k|        ++num_parallelograms;
   97|   175k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|   979k|      corner_id = table->SwingRight(corner_id);
  101|   979k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 83.0k, False: 896k]
  ------------------
  102|  83.0k|        corner_id = kInvalidCornerIndex;
  103|  83.0k|      }
  104|   979k|    }
  105|       |
  106|   557k|    const int dst_offset = p * num_components;
  107|   557k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 463k, False: 93.9k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|   463k|      const int src_offset = (p - 1) * num_components;
  111|   463k|      this->transform().ComputeOriginalValue(
  112|   463k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   463k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  4.63M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 4.53M, False: 93.9k]
  ------------------
  116|  4.53M|        pred_vals[c] /= num_parallelograms;
  117|  4.53M|      }
  118|  93.9k|      this->transform().ComputeOriginalValue(
  119|  93.9k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|  93.9k|    }
  121|   557k|  }
  122|    273|  return true;
  123|    273|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    391|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    391|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    369|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    369|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    369|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    369|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    369|      new DataTypeT[num_components]());
   70|       |
   71|    369|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    369|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    369|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    369|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    369|  const int corner_map_size =
   78|    369|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   738k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 738k, False: 369]
  ------------------
   80|   738k|    const CornerIndex start_corner_id =
   81|   738k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   738k|    CornerIndex corner_id(start_corner_id);
   84|   738k|    int num_parallelograms = 0;
   85|  24.5M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 23.8M, False: 738k]
  ------------------
   86|  23.8M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  23.8M|    }
   88|  5.10M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 4.37M, False: 738k]
  ------------------
   89|  4.37M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 1.43M, False: 2.93M]
  ------------------
   90|  4.37M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  4.37M|              num_components, parallelogram_pred_vals.get())) {
   92|  47.7M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 46.2M, False: 1.43M]
  ------------------
   93|  46.2M|          pred_vals[c] =
   94|  46.2M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  46.2M|        }
   96|  1.43M|        ++num_parallelograms;
   97|  1.43M|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  4.37M|      corner_id = table->SwingRight(corner_id);
  101|  4.37M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 724k, False: 3.64M]
  ------------------
  102|   724k|        corner_id = kInvalidCornerIndex;
  103|   724k|      }
  104|  4.37M|    }
  105|       |
  106|   738k|    const int dst_offset = p * num_components;
  107|   738k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 1.66k, False: 736k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  1.66k|      const int src_offset = (p - 1) * num_components;
  111|  1.66k|      this->transform().ComputeOriginalValue(
  112|  1.66k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   736k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  24.4M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 23.7M, False: 736k]
  ------------------
  116|  23.7M|        pred_vals[c] /= num_parallelograms;
  117|  23.7M|      }
  118|   736k|      this->transform().ComputeOriginalValue(
  119|   736k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   736k|    }
  121|   738k|  }
  122|    369|  return true;
  123|    369|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  2.45M|    int num_components, DataTypeT *out_prediction) {
   49|  2.45M|  const CornerIndex oci = table->Opposite(ci);
   50|  2.45M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 1.66M, False: 788k]
  ------------------
   51|  1.66M|    return false;
   52|  1.66M|  }
   53|   788k|  int vert_opp, vert_next, vert_prev;
   54|   788k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   788k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   788k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 419k, False: 369k]
  |  Branch (56:35): [True: 314k, False: 104k]
  ------------------
   57|   314k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 305k, False: 9.82k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   305k|    const int v_opp_off = vert_opp * num_components;
   60|   305k|    const int v_next_off = vert_next * num_components;
   61|   305k|    const int v_prev_off = vert_prev * num_components;
   62|  16.0M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 15.7M, False: 305k]
  ------------------
   63|  15.7M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  15.7M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  15.7M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  15.7M|      const int64_t result =
   67|  15.7M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  15.7M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  15.7M|    }
   71|   305k|    return true;
   72|   305k|  }
   73|   483k|  return false;  // Not all data is available for prediction
   74|   788k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   788k|    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|   788k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   788k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   788k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   788k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  5.43M|    int num_components, DataTypeT *out_prediction) {
   49|  5.43M|  const CornerIndex oci = table->Opposite(ci);
   50|  5.43M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 60.8k, False: 5.37M]
  ------------------
   51|  60.8k|    return false;
   52|  60.8k|  }
   53|  5.37M|  int vert_opp, vert_next, vert_prev;
   54|  5.37M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  5.37M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  5.37M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 2.84M, False: 2.52M]
  |  Branch (56:35): [True: 2.21M, False: 629k]
  ------------------
   57|  2.21M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 2.00M, False: 208k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  2.00M|    const int v_opp_off = vert_opp * num_components;
   60|  2.00M|    const int v_next_off = vert_next * num_components;
   61|  2.00M|    const int v_prev_off = vert_prev * num_components;
   62|  91.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 89.7M, False: 2.00M]
  ------------------
   63|  89.7M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  89.7M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  89.7M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  89.7M|      const int64_t result =
   67|  89.7M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  89.7M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  89.7M|    }
   71|  2.00M|    return true;
   72|  2.00M|  }
   73|  3.36M|  return false;  // Not all data is available for prediction
   74|  5.37M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  5.37M|    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.37M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  5.37M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  5.37M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  5.37M|}

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

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

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

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    111|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    403|  bool AreCorrectionsPositive() override {
   71|    403|    return transform_.AreCorrectionsPositive();
   72|    403|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     98|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     98|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 13, False: 85]
  ------------------
   50|     13|      return false;
   51|     13|    }
   52|     85|    return true;
   53|     98|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|  30.7M|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    146|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    456|  bool AreCorrectionsPositive() override {
   71|    456|    return transform_.AreCorrectionsPositive();
   72|    456|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    130|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    130|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 17, False: 113]
  ------------------
   50|     17|      return false;
   51|     17|    }
   52|    113|    return true;
   53|    130|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  9.29M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  3.90k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  2.65k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  3.74k|  bool AreCorrectionsPositive() override {
   71|  3.74k|    return transform_.AreCorrectionsPositive();
   72|  3.74k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  2.95k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  2.95k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 205, False: 2.75k]
  ------------------
   50|    205|      return false;
   51|    205|    }
   52|  2.75k|    return true;
   53|  2.95k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  6.44M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    419|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    476|      : attribute_(attribute), transform_(transform) {}

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

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

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    417|    uint16_t bitstream_version) {
   38|    417|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    417|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 417, False: 0]
  ------------------
   40|    417|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 6, False: 411]
  ------------------
   41|    411|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 12, False: 399]
  ------------------
   42|    399|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 399]
  ------------------
   43|    399|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 26, False: 373]
  ------------------
   44|    373|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 308, False: 65]
  ------------------
   45|    355|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 3, False: 62]
  ------------------
   46|    355|    const CornerTable *const ct = source->GetCornerTable();
   47|    355|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    355|        source->GetAttributeEncodingData(att_id);
   49|    355|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 38, False: 317]
  |  Branch (49:26): [True: 0, False: 317]
  ------------------
   50|       |      // No connectivity data found.
   51|     38|      return nullptr;
   52|     38|    }
   53|       |    // Connectivity data exists.
   54|    317|    const MeshAttributeCornerTable *const att_ct =
   55|    317|        source->GetAttributeCornerTable(att_id);
   56|    317|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 179, False: 138]
  ------------------
   57|    179|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    179|      MeshData md;
   59|    179|      md.Set(source->mesh(), att_ct,
   60|    179|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    179|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    179|      MeshPredictionSchemeFactoryT factory;
   63|    179|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    179|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 174, False: 5]
  ------------------
   65|    174|        return ret;
   66|    174|      }
   67|    179|    } else {
   68|    138|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    138|      MeshData md;
   70|    138|      md.Set(source->mesh(), ct,
   71|    138|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    138|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    138|      MeshPredictionSchemeFactoryT factory;
   74|    138|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    138|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 134, False: 4]
  ------------------
   76|    134|        return ret;
   77|    134|      }
   78|    138|    }
   79|    317|  }
   80|     71|  return nullptr;
   81|    417|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    476|    uint16_t bitstream_version) {
   38|    476|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    476|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 476, False: 0]
  ------------------
   40|    476|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 15, False: 461]
  ------------------
   41|    461|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 26, False: 435]
  ------------------
   42|    435|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 12, False: 423]
  ------------------
   43|    423|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 3, False: 420]
  ------------------
   44|    420|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 330, False: 90]
  ------------------
   45|    388|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 2, False: 88]
  ------------------
   46|    388|    const CornerTable *const ct = source->GetCornerTable();
   47|    388|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    388|        source->GetAttributeEncodingData(att_id);
   49|    388|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 48, False: 340]
  |  Branch (49:26): [True: 0, False: 340]
  ------------------
   50|       |      // No connectivity data found.
   51|     48|      return nullptr;
   52|     48|    }
   53|       |    // Connectivity data exists.
   54|    340|    const MeshAttributeCornerTable *const att_ct =
   55|    340|        source->GetAttributeCornerTable(att_id);
   56|    340|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 188, False: 152]
  ------------------
   57|    188|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    188|      MeshData md;
   59|    188|      md.Set(source->mesh(), att_ct,
   60|    188|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    188|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    188|      MeshPredictionSchemeFactoryT factory;
   63|    188|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    188|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 183, False: 5]
  ------------------
   65|    183|        return ret;
   66|    183|      }
   67|    188|    } else {
   68|    152|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    152|      MeshData md;
   70|    152|      md.Set(source->mesh(), ct,
   71|    152|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    152|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    152|      MeshPredictionSchemeFactoryT factory;
   74|    152|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    152|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 147, False: 5]
  ------------------
   76|    147|        return ret;
   77|    147|      }
   78|    152|    }
   79|    340|  }
   80|     98|  return nullptr;
   81|    476|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  3.88k|    uint16_t bitstream_version) {
   38|  3.88k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  3.88k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 3.88k, False: 0]
  ------------------
   40|  3.88k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 986, False: 2.89k]
  ------------------
   41|  2.89k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 687, False: 2.20k]
  ------------------
   42|  2.20k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 726, False: 1.48k]
  ------------------
   43|  1.48k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 379, False: 1.10k]
  ------------------
   44|  1.10k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 599, False: 505]
  ------------------
   45|  3.65k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 278, False: 227]
  ------------------
   46|  3.65k|    const CornerTable *const ct = source->GetCornerTable();
   47|  3.65k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  3.65k|        source->GetAttributeEncodingData(att_id);
   49|  3.65k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 47, False: 3.60k]
  |  Branch (49:26): [True: 0, False: 3.60k]
  ------------------
   50|       |      // No connectivity data found.
   51|     47|      return nullptr;
   52|     47|    }
   53|       |    // Connectivity data exists.
   54|  3.60k|    const MeshAttributeCornerTable *const att_ct =
   55|  3.60k|        source->GetAttributeCornerTable(att_id);
   56|  3.60k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 1.61k, False: 1.99k]
  ------------------
   57|  1.61k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  1.61k|      MeshData md;
   59|  1.61k|      md.Set(source->mesh(), att_ct,
   60|  1.61k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  1.61k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  1.61k|      MeshPredictionSchemeFactoryT factory;
   63|  1.61k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  1.61k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 1.61k, False: 0]
  ------------------
   65|  1.61k|        return ret;
   66|  1.61k|      }
   67|  1.99k|    } else {
   68|  1.99k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  1.99k|      MeshData md;
   70|  1.99k|      md.Set(source->mesh(), ct,
   71|  1.99k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  1.99k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  1.99k|      MeshPredictionSchemeFactoryT factory;
   74|  1.99k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  1.99k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 1.99k, False: 0]
  ------------------
   76|  1.99k|        return ret;
   77|  1.99k|      }
   78|  1.99k|    }
   79|  3.60k|  }
   80|    227|  return nullptr;
   81|  3.88k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  9.29M|  bool IsInBottomLeft(const Point2 &p) const {
   93|  9.29M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 2.46M, False: 6.83M]
  |  Branch (93:22): [True: 1.03M, False: 1.43M]
  ------------------
   94|  1.03M|      return true;
   95|  1.03M|    }
   96|  8.26M|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 1.52M, False: 6.74M]
  |  Branch (96:25): [True: 409k, False: 1.11M]
  ------------------
   97|  9.29M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  9.29M|  int32_t GetRotationCount(Point2 pred) const {
   51|  9.29M|    const DataType sign_x = pred[0];
   52|  9.29M|    const DataType sign_y = pred[1];
   53|       |
   54|  9.29M|    int32_t rotation_count = 0;
   55|  9.29M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 2.46M, False: 6.83M]
  ------------------
   56|  2.46M|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 1.03M, False: 1.43M]
  ------------------
   57|  1.03M|        rotation_count = 0;
   58|  1.43M|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 367k, False: 1.06M]
  ------------------
   59|   367k|        rotation_count = 3;
   60|  1.06M|      } else {
   61|  1.06M|        rotation_count = 1;
   62|  1.06M|      }
   63|  6.83M|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 5.31M, False: 1.52M]
  ------------------
   64|  5.31M|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 4.58M, False: 730k]
  ------------------
   65|  4.58M|        rotation_count = 2;
   66|  4.58M|      } else {
   67|   730k|        rotation_count = 1;
   68|   730k|      }
   69|  5.31M|    } else {
   70|  1.52M|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 409k, False: 1.11M]
  ------------------
   71|   409k|        rotation_count = 0;
   72|  1.11M|      } else {
   73|  1.11M|        rotation_count = 3;
   74|  1.11M|      }
   75|  1.52M|    }
   76|  9.29M|    return rotation_count;
   77|  9.29M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|  15.7M|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|  15.7M|    switch (rotation_count) {
   81|  3.27M|      case 1:
  ------------------
  |  Branch (81:7): [True: 3.27M, False: 12.4M]
  ------------------
   82|  3.27M|        return Point2(p[1], -p[0]);
   83|  9.16M|      case 2:
  ------------------
  |  Branch (83:7): [True: 9.16M, False: 6.55M]
  ------------------
   84|  9.16M|        return Point2(-p[0], -p[1]);
   85|  3.27M|      case 3:
  ------------------
  |  Branch (85:7): [True: 3.27M, False: 12.4M]
  ------------------
   86|  3.27M|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 15.7M]
  ------------------
   88|      0|        return p;
   89|  15.7M|    }
   90|  15.7M|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    476|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

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

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

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  6.54k|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|  5.09M|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  4.79k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  24.2k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  7.50k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  7.50k|    portable_attribute_ = std::move(att);
   71|  7.50k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  25.9k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  14.6k|  virtual ~SequentialAttributeDecoder() = default;

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

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

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

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

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

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

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

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

_ZN5draco16DirectBitDecoder28DecodeLeastSignificantBits32EiPj:
   50|  4.13M|  bool DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   51|  4.13M|    DRACO_DCHECK_EQ(true, nbits <= 32);
   52|  4.13M|    DRACO_DCHECK_EQ(true, nbits > 0);
   53|  4.13M|    const int remaining = 32 - num_used_bits_;
   54|  4.13M|    if (nbits <= remaining) {
  ------------------
  |  Branch (54:9): [True: 3.92M, False: 210k]
  ------------------
   55|  3.92M|      if (pos_ == bits_.end()) {
  ------------------
  |  Branch (55:11): [True: 3.53M, False: 384k]
  ------------------
   56|  3.53M|        return false;
   57|  3.53M|      }
   58|   384k|      *value = (*pos_ << num_used_bits_) >> (32 - nbits);
   59|   384k|      num_used_bits_ += nbits;
   60|   384k|      if (num_used_bits_ == 32) {
  ------------------
  |  Branch (60:11): [True: 13.1k, False: 371k]
  ------------------
   61|  13.1k|        ++pos_;
   62|  13.1k|        num_used_bits_ = 0;
   63|  13.1k|      }
   64|   384k|    } else {
   65|   210k|      if (pos_ + 1 == bits_.end()) {
  ------------------
  |  Branch (65:11): [True: 199k, False: 11.4k]
  ------------------
   66|   199k|        return false;
   67|   199k|      }
   68|  11.4k|      const uint32_t value_l = ((*pos_) << num_used_bits_);
   69|  11.4k|      num_used_bits_ = nbits - remaining;
   70|  11.4k|      ++pos_;
   71|  11.4k|      const uint32_t value_r = (*pos_) >> (32 - num_used_bits_);
   72|  11.4k|      *value = (value_l >> (32 - num_used_bits_ - remaining)) | value_r;
   73|  11.4k|    }
   74|   396k|    return true;
   75|  4.13M|  }
_ZN5draco16DirectBitDecoder13DecodeNextBitEv:
   34|  5.80M|  bool DecodeNextBit() {
   35|  5.80M|    const uint32_t selector = 1 << (31 - num_used_bits_);
   36|  5.80M|    if (pos_ == bits_.end()) {
  ------------------
  |  Branch (36:9): [True: 5.36M, False: 441k]
  ------------------
   37|  5.36M|      return false;
   38|  5.36M|    }
   39|   441k|    const bool bit = *pos_ & selector;
   40|   441k|    ++num_used_bits_;
   41|   441k|    if (num_used_bits_ == 32) {
  ------------------
  |  Branch (41:9): [True: 13.6k, False: 427k]
  ------------------
   42|  13.6k|      ++pos_;
   43|  13.6k|      num_used_bits_ = 0;
   44|  13.6k|    }
   45|   441k|    return bit;
   46|  5.80M|  }
_ZN5draco16DirectBitDecoder11EndDecodingEv:
   77|    562|  void EndDecoding() {}

_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEED2Ev:
   30|    468|  ~FoldedBit32Decoder() {}
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE13StartDecodingEPNS_13DecoderBufferE:
   33|    370|  bool StartDecoding(DecoderBuffer *source_buffer) {
   34|  9.70k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (34:21): [True: 9.43k, False: 270]
  ------------------
   35|  9.43k|      if (!folded_number_decoders_[i].StartDecoding(source_buffer)) {
  ------------------
  |  Branch (35:11): [True: 100, False: 9.33k]
  ------------------
   36|    100|        return false;
   37|    100|      }
   38|  9.43k|    }
   39|    270|    return bit_decoder_.StartDecoding(source_buffer);
   40|    370|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE28DecodeLeastSignificantBits32EiPj:
   47|  2.77M|  void DecodeLeastSignificantBits32(int nbits, uint32_t *value) {
   48|  2.77M|    uint32_t result = 0;
   49|  17.4M|    for (int i = 0; i < nbits; ++i) {
  ------------------
  |  Branch (49:21): [True: 14.6M, False: 2.77M]
  ------------------
   50|  14.6M|      const bool bit = folded_number_decoders_[i].DecodeNextBit();
   51|  14.6M|      result = (result << 1) + bit;
   52|  14.6M|    }
   53|  2.77M|    *value = result;
   54|  2.77M|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEE11EndDecodingEv:
   56|     73|  void EndDecoding() {
   57|  2.40k|    for (int i = 0; i < 32; i++) {
  ------------------
  |  Branch (57:21): [True: 2.33k, False: 73]
  ------------------
   58|  2.33k|      folded_number_decoders_[i].EndDecoding();
   59|  2.33k|    }
   60|     73|    bit_decoder_.EndDecoding();
   61|     73|  }
_ZN5draco18FoldedBit32DecoderINS_14RAnsBitDecoderEEC2Ev:
   29|    468|  FoldedBit32Decoder() {}

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

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

_ZNK5draco12DracoOptionsINS_17GeometryAttribute4TypeEE16GetAttributeBoolERKS2_RKNSt3__112basic_stringIcNS6_11char_traitsIcEENS6_9allocatorIcEEEEb:
  195|  2.40k|                                                   bool default_val) const {
  196|  2.40k|  const Options *const att_options = FindAttributeOptions(att_key);
  197|  2.40k|  if (att_options && att_options->IsOptionSet(name)) {
  ------------------
  |  Branch (197:7): [True: 0, False: 2.40k]
  |  Branch (197:22): [True: 0, False: 0]
  ------------------
  198|      0|    return att_options->GetBool(name, default_val);
  199|      0|  }
  200|  2.40k|  return global_options_.GetBool(name, default_val);
  201|  2.40k|}
_ZNK5draco12DracoOptionsINS_17GeometryAttribute4TypeEE20FindAttributeOptionsERKS2_:
  137|  2.40k|    const AttributeKeyT &att_key) const {
  138|  2.40k|  auto it = attribute_options_.find(att_key);
  139|  2.40k|  if (it == attribute_options_.end()) {
  ------------------
  |  Branch (139:7): [True: 2.40k, False: 0]
  ------------------
  140|  2.40k|    return nullptr;
  141|  2.40k|  }
  142|      0|  return &it->second;
  143|  2.40k|}

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

_ZN5draco10AnsDecoderC2Ev:
   56|  40.2k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  26.3k|                                const uint8_t *const buf, int offset) {
  301|  26.3k|  unsigned x;
  302|  26.3k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 33, False: 26.3k]
  ------------------
  303|     33|    return 1;
  304|     33|  }
  305|  26.3k|  ans->buf = buf;
  306|  26.3k|  x = buf[offset - 1] >> 6;
  307|  26.3k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 23.3k, False: 3.01k]
  ------------------
  308|  23.3k|    ans->buf_offset = offset - 1;
  309|  23.3k|    ans->state = buf[offset - 1] & 0x3F;
  310|  23.3k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 2.69k, False: 326]
  ------------------
  311|  2.69k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 4, False: 2.68k]
  ------------------
  312|      4|      return 1;
  313|      4|    }
  314|  2.68k|    ans->buf_offset = offset - 2;
  315|  2.68k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  2.68k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 323, False: 3]
  ------------------
  317|    323|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 2, False: 321]
  ------------------
  318|      2|      return 1;
  319|      2|    }
  320|    321|    ans->buf_offset = offset - 3;
  321|    321|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    321|  } else {
  323|      3|    return 1;
  324|      3|  }
  325|  26.3k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  26.3k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  26.3k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  26.3k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  26.3k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 5, False: 26.3k]
  ------------------
  327|      5|    return 1;
  328|      5|  }
  329|  26.3k|  return 0;
  330|  26.3k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  2.68k|static uint32_t mem_get_le16(const void *vmem) {
   68|  2.68k|  uint32_t val;
   69|  2.68k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  2.68k|  val = mem[1] << 8;
   72|  2.68k|  val |= mem[0];
   73|  2.68k|  return val;
   74|  2.68k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    321|static uint32_t mem_get_le24(const void *vmem) {
   77|    321|  uint32_t val;
   78|    321|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    321|  val = mem[2] << 16;
   81|    321|  val |= mem[1] << 8;
   82|    321|  val |= mem[0];
   83|    321|  return val;
   84|    321|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  10.9G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  10.9G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  10.9G|  unsigned quot, rem, x, xn;
  172|  10.9G|#endif
  173|  10.9G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  10.9G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  10.9G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  21.8G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 10.0G, False: 927M]
  |  Branch (174:40): [True: 86.1k, False: 9.99G]
  ------------------
  175|  86.1k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|  86.1k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|  86.1k|  }
  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|  10.9G|  x = ans->state;
  184|  10.9G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  10.9G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  10.9G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  10.9G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  10.9G|  xn = quot * p;
  187|  10.9G|  val = rem < p;
  188|  10.9G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  21.8G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 10.0G, False: 923M]
  |  |  ------------------
  ------------------
  189|  10.0G|    ans->state = xn + rem;
  190|  10.0G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   923M|    ans->state = x - xn - p;
  193|   923M|  }
  194|  10.9G|#endif
  195|  10.9G|  return val;
  196|  10.9G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  61.3k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  61.3k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  61.3k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  61.3k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  3.10k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|  1.79k|                                       uint32_t num_symbols) {
  482|  1.79k|    lut_table_.resize(rans_precision);
  483|  1.79k|    probability_table_.resize(num_symbols);
  484|  1.79k|    uint32_t cum_prob = 0;
  485|  1.79k|    uint32_t act_prob = 0;
  486|  15.1k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 13.4k, False: 1.64k]
  ------------------
  487|  13.4k|      probability_table_[i].prob = token_probs[i];
  488|  13.4k|      probability_table_[i].cum_prob = cum_prob;
  489|  13.4k|      cum_prob += token_probs[i];
  490|  13.4k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 146, False: 13.3k]
  ------------------
  491|    146|        return false;
  492|    146|      }
  493|  6.28M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 6.27M, False: 13.3k]
  ------------------
  494|  6.27M|        lut_table_[j] = i;
  495|  6.27M|      }
  496|  13.3k|      act_prob = cum_prob;
  497|  13.3k|    }
  498|  1.64k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 160, False: 1.48k]
  ------------------
  499|    160|      return false;
  500|    160|    }
  501|  1.48k|    return true;
  502|  1.64k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.36k|  inline int read_init(const uint8_t *const buf, int offset) {
  422|  1.36k|    unsigned x;
  423|  1.36k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 90, False: 1.27k]
  ------------------
  424|     90|      return 1;
  425|     90|    }
  426|  1.27k|    ans_.buf = buf;
  427|  1.27k|    x = buf[offset - 1] >> 6;
  428|  1.27k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 782, False: 489]
  ------------------
  429|    782|      ans_.buf_offset = offset - 1;
  430|    782|      ans_.state = buf[offset - 1] & 0x3F;
  431|    782|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 176, False: 313]
  ------------------
  432|    176|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 34, False: 142]
  ------------------
  433|     34|        return 1;
  434|     34|      }
  435|    142|      ans_.buf_offset = offset - 2;
  436|    142|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    313|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 218, False: 95]
  ------------------
  438|    218|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 36, False: 182]
  ------------------
  439|     36|        return 1;
  440|     36|      }
  441|    182|      ans_.buf_offset = offset - 3;
  442|    182|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    182|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 95, False: 0]
  ------------------
  444|     95|      ans_.buf_offset = offset - 4;
  445|     95|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     95|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|  1.20k|    ans_.state += l_rans_base;
  450|  1.20k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.20k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 97, False: 1.10k]
  ------------------
  451|     97|      return 1;
  452|     97|    }
  453|  1.10k|    return 0;
  454|  1.20k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    254|static uint32_t mem_get_le16(const void *vmem) {
   68|    254|  uint32_t val;
   69|    254|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    254|  val = mem[1] << 8;
   72|    254|  val |= mem[0];
   73|    254|  return val;
   74|    254|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    267|static uint32_t mem_get_le24(const void *vmem) {
   77|    267|  uint32_t val;
   78|    267|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    267|  val = mem[2] << 16;
   81|    267|  val |= mem[1] << 8;
   82|    267|  val |= mem[0];
   83|    267|  return val;
   84|    267|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    293|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    293|  uint32_t val;
   88|    293|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    293|  val = mem[3] << 24;
   91|    293|  val |= mem[2] << 16;
   92|    293|  val |= mem[1] << 8;
   93|    293|  val |= mem[0];
   94|    293|  return val;
   95|    293|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|   297M|  inline int rans_read() {
  463|   297M|    unsigned rem;
  464|   297M|    unsigned quo;
  465|   297M|    struct rans_dec_sym sym;
  466|   297M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 266M, False: 30.9M]
  |  Branch (466:40): [True: 22.9k, False: 266M]
  ------------------
  467|  22.9k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  22.9k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  22.9k|    }
  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|   297M|    quo = ans_.state / rans_precision;
  472|   297M|    rem = ans_.state % rans_precision;
  473|   297M|    fetch_sym(&sym, rem);
  474|   297M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   297M|    return sym.val;
  476|   297M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|   297M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   297M|    uint32_t symbol = lut_table_[rem];
  507|   297M|    out->val = symbol;
  508|   297M|    out->prob = probability_table_[symbol].prob;
  509|   297M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   297M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|  1.05k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    267|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|    173|                                       uint32_t num_symbols) {
  482|    173|    lut_table_.resize(rans_precision);
  483|    173|    probability_table_.resize(num_symbols);
  484|    173|    uint32_t cum_prob = 0;
  485|    173|    uint32_t act_prob = 0;
  486|  4.39k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 4.23k, False: 156]
  ------------------
  487|  4.23k|      probability_table_[i].prob = token_probs[i];
  488|  4.23k|      probability_table_[i].cum_prob = cum_prob;
  489|  4.23k|      cum_prob += token_probs[i];
  490|  4.23k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 17, False: 4.21k]
  ------------------
  491|     17|        return false;
  492|     17|      }
  493|  1.23M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.23M, False: 4.21k]
  ------------------
  494|  1.23M|        lut_table_[j] = i;
  495|  1.23M|      }
  496|  4.21k|      act_prob = cum_prob;
  497|  4.21k|    }
  498|    156|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 17, False: 139]
  ------------------
  499|     17|      return false;
  500|     17|    }
  501|    139|    return true;
  502|    156|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|    111|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    111|    unsigned x;
  423|    111|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 7, False: 104]
  ------------------
  424|      7|      return 1;
  425|      7|    }
  426|    104|    ans_.buf = buf;
  427|    104|    x = buf[offset - 1] >> 6;
  428|    104|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 67, False: 37]
  ------------------
  429|     67|      ans_.buf_offset = offset - 1;
  430|     67|      ans_.state = buf[offset - 1] & 0x3F;
  431|     67|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 13, False: 24]
  ------------------
  432|     13|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 1, False: 12]
  ------------------
  433|      1|        return 1;
  434|      1|      }
  435|     12|      ans_.buf_offset = offset - 2;
  436|     12|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     24|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 8, False: 16]
  ------------------
  438|      8|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 7]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|      7|      ans_.buf_offset = offset - 3;
  442|      7|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     16|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 16, False: 0]
  ------------------
  444|     16|      ans_.buf_offset = offset - 4;
  445|     16|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     16|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    102|    ans_.state += l_rans_base;
  450|    102|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    102|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 14, False: 88]
  ------------------
  451|     14|      return 1;
  452|     14|    }
  453|     88|    return 0;
  454|    102|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|  6.38M|  inline int rans_read() {
  463|  6.38M|    unsigned rem;
  464|  6.38M|    unsigned quo;
  465|  6.38M|    struct rans_dec_sym sym;
  466|  6.38M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 6.35M, False: 25.0k]
  |  Branch (466:40): [True: 2.23k, False: 6.35M]
  ------------------
  467|  2.23k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  2.23k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  2.23k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  6.38M|    quo = ans_.state / rans_precision;
  472|  6.38M|    rem = ans_.state % rans_precision;
  473|  6.38M|    fetch_sym(&sym, rem);
  474|  6.38M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  6.38M|    return sym.val;
  476|  6.38M|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|  6.38M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  6.38M|    uint32_t symbol = lut_table_[rem];
  507|  6.38M|    out->val = symbol;
  508|  6.38M|    out->prob = probability_table_[symbol].prob;
  509|  6.38M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  6.38M|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|     88|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    233|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|    154|                                       uint32_t num_symbols) {
  482|    154|    lut_table_.resize(rans_precision);
  483|    154|    probability_table_.resize(num_symbols);
  484|    154|    uint32_t cum_prob = 0;
  485|    154|    uint32_t act_prob = 0;
  486|  2.71k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 2.57k, False: 135]
  ------------------
  487|  2.57k|      probability_table_[i].prob = token_probs[i];
  488|  2.57k|      probability_table_[i].cum_prob = cum_prob;
  489|  2.57k|      cum_prob += token_probs[i];
  490|  2.57k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 19, False: 2.55k]
  ------------------
  491|     19|        return false;
  492|     19|      }
  493|  4.03M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 4.02M, False: 2.55k]
  ------------------
  494|  4.02M|        lut_table_[j] = i;
  495|  4.02M|      }
  496|  2.55k|      act_prob = cum_prob;
  497|  2.55k|    }
  498|    135|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 18, False: 117]
  ------------------
  499|     18|      return false;
  500|     18|    }
  501|    117|    return true;
  502|    135|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|     83|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     83|    unsigned x;
  423|     83|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 9, False: 74]
  ------------------
  424|      9|      return 1;
  425|      9|    }
  426|     74|    ans_.buf = buf;
  427|     74|    x = buf[offset - 1] >> 6;
  428|     74|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 18, False: 56]
  ------------------
  429|     18|      ans_.buf_offset = offset - 1;
  430|     18|      ans_.state = buf[offset - 1] & 0x3F;
  431|     56|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 21, False: 35]
  ------------------
  432|     21|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 7, False: 14]
  ------------------
  433|      7|        return 1;
  434|      7|      }
  435|     14|      ans_.buf_offset = offset - 2;
  436|     14|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     35|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 14, False: 21]
  ------------------
  438|     14|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 3, False: 11]
  ------------------
  439|      3|        return 1;
  440|      3|      }
  441|     11|      ans_.buf_offset = offset - 3;
  442|     11|      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|     64|    ans_.state += l_rans_base;
  450|     64|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     64|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 20, False: 44]
  ------------------
  451|     20|      return 1;
  452|     20|    }
  453|     44|    return 0;
  454|     64|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|   332k|  inline int rans_read() {
  463|   332k|    unsigned rem;
  464|   332k|    unsigned quo;
  465|   332k|    struct rans_dec_sym sym;
  466|   338k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 287k, False: 51.0k]
  |  Branch (466:40): [True: 6.27k, False: 281k]
  ------------------
  467|  6.27k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  6.27k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  6.27k|    }
  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|   332k|    quo = ans_.state / rans_precision;
  472|   332k|    rem = ans_.state % rans_precision;
  473|   332k|    fetch_sym(&sym, rem);
  474|   332k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   332k|    return sym.val;
  476|   332k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|   332k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   332k|    uint32_t symbol = lut_table_[rem];
  507|   332k|    out->val = symbol;
  508|   332k|    out->prob = probability_table_[symbol].prob;
  509|   332k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   332k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     44|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    233|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|    122|                                       uint32_t num_symbols) {
  482|    122|    lut_table_.resize(rans_precision);
  483|    122|    probability_table_.resize(num_symbols);
  484|    122|    uint32_t cum_prob = 0;
  485|    122|    uint32_t act_prob = 0;
  486|  6.72k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 6.62k, False: 100]
  ------------------
  487|  6.62k|      probability_table_[i].prob = token_probs[i];
  488|  6.62k|      probability_table_[i].cum_prob = cum_prob;
  489|  6.62k|      cum_prob += token_probs[i];
  490|  6.62k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 22, False: 6.60k]
  ------------------
  491|     22|        return false;
  492|     22|      }
  493|  6.28M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 6.28M, False: 6.60k]
  ------------------
  494|  6.28M|        lut_table_[j] = i;
  495|  6.28M|      }
  496|  6.60k|      act_prob = cum_prob;
  497|  6.60k|    }
  498|    100|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 28, False: 72]
  ------------------
  499|     28|      return false;
  500|     28|    }
  501|     72|    return true;
  502|    100|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     52|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     52|    unsigned x;
  423|     52|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 5, False: 47]
  ------------------
  424|      5|      return 1;
  425|      5|    }
  426|     47|    ans_.buf = buf;
  427|     47|    x = buf[offset - 1] >> 6;
  428|     47|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 22, False: 25]
  ------------------
  429|     22|      ans_.buf_offset = offset - 1;
  430|     22|      ans_.state = buf[offset - 1] & 0x3F;
  431|     25|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 8, False: 17]
  ------------------
  432|      8|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 8]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      8|      ans_.buf_offset = offset - 2;
  436|      8|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     17|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 3, False: 14]
  ------------------
  438|      3|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 3]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      3|      ans_.buf_offset = offset - 3;
  442|      3|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     14|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 14, False: 0]
  ------------------
  444|     14|      ans_.buf_offset = offset - 4;
  445|     14|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     14|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     47|    ans_.state += l_rans_base;
  450|     47|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     47|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 13, False: 34]
  ------------------
  451|     13|      return 1;
  452|     13|    }
  453|     34|    return 0;
  454|     47|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|   220k|  inline int rans_read() {
  463|   220k|    unsigned rem;
  464|   220k|    unsigned quo;
  465|   220k|    struct rans_dec_sym sym;
  466|   220k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 140k, False: 80.3k]
  |  Branch (466:40): [True: 524, False: 139k]
  ------------------
  467|    524|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    524|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    524|    }
  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|   220k|    quo = ans_.state / rans_precision;
  472|   220k|    rem = ans_.state % rans_precision;
  473|   220k|    fetch_sym(&sym, rem);
  474|   220k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   220k|    return sym.val;
  476|   220k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|   220k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   220k|    uint32_t symbol = lut_table_[rem];
  507|   220k|    out->val = symbol;
  508|   220k|    out->prob = probability_table_[symbol].prob;
  509|   220k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   220k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|     34|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    215|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|    133|                                       uint32_t num_symbols) {
  482|    133|    lut_table_.resize(rans_precision);
  483|    133|    probability_table_.resize(num_symbols);
  484|    133|    uint32_t cum_prob = 0;
  485|    133|    uint32_t act_prob = 0;
  486|  3.15k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 3.03k, False: 128]
  ------------------
  487|  3.03k|      probability_table_[i].prob = token_probs[i];
  488|  3.03k|      probability_table_[i].cum_prob = cum_prob;
  489|  3.03k|      cum_prob += token_probs[i];
  490|  3.03k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 5, False: 3.02k]
  ------------------
  491|      5|        return false;
  492|      5|      }
  493|  28.1M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 28.1M, False: 3.02k]
  ------------------
  494|  28.1M|        lut_table_[j] = i;
  495|  28.1M|      }
  496|  3.02k|      act_prob = cum_prob;
  497|  3.02k|    }
  498|    128|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 34, False: 94]
  ------------------
  499|     34|      return false;
  500|     34|    }
  501|     94|    return true;
  502|    128|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     62|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     62|    unsigned x;
  423|     62|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 8, False: 54]
  ------------------
  424|      8|      return 1;
  425|      8|    }
  426|     54|    ans_.buf = buf;
  427|     54|    x = buf[offset - 1] >> 6;
  428|     54|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 18, False: 36]
  ------------------
  429|     18|      ans_.buf_offset = offset - 1;
  430|     18|      ans_.state = buf[offset - 1] & 0x3F;
  431|     36|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 13, False: 23]
  ------------------
  432|     13|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 10, False: 3]
  ------------------
  433|     10|        return 1;
  434|     10|      }
  435|      3|      ans_.buf_offset = offset - 2;
  436|      3|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     23|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 6, False: 17]
  ------------------
  438|      6|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 6]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      6|      ans_.buf_offset = offset - 3;
  442|      6|      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|     44|    ans_.state += l_rans_base;
  450|     44|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     44|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 5, False: 39]
  ------------------
  451|      5|      return 1;
  452|      5|    }
  453|     39|    return 0;
  454|     44|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|  47.9k|  inline int rans_read() {
  463|  47.9k|    unsigned rem;
  464|  47.9k|    unsigned quo;
  465|  47.9k|    struct rans_dec_sym sym;
  466|  48.1k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 45.1k, False: 2.93k]
  |  Branch (466:40): [True: 223, False: 44.9k]
  ------------------
  467|    223|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    223|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    223|    }
  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|  47.9k|    quo = ans_.state / rans_precision;
  472|  47.9k|    rem = ans_.state % rans_precision;
  473|  47.9k|    fetch_sym(&sym, rem);
  474|  47.9k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  47.9k|    return sym.val;
  476|  47.9k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|  47.9k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  47.9k|    uint32_t symbol = lut_table_[rem];
  507|  47.9k|    out->val = symbol;
  508|  47.9k|    out->prob = probability_table_[symbol].prob;
  509|  47.9k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  47.9k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|     39|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    198|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|    111|                                       uint32_t num_symbols) {
  482|    111|    lut_table_.resize(rans_precision);
  483|    111|    probability_table_.resize(num_symbols);
  484|    111|    uint32_t cum_prob = 0;
  485|    111|    uint32_t act_prob = 0;
  486|  11.6k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 11.5k, False: 93]
  ------------------
  487|  11.5k|      probability_table_[i].prob = token_probs[i];
  488|  11.5k|      probability_table_[i].cum_prob = cum_prob;
  489|  11.5k|      cum_prob += token_probs[i];
  490|  11.5k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 18, False: 11.5k]
  ------------------
  491|     18|        return false;
  492|     18|      }
  493|  40.3M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 40.3M, False: 11.5k]
  ------------------
  494|  40.3M|        lut_table_[j] = i;
  495|  40.3M|      }
  496|  11.5k|      act_prob = cum_prob;
  497|  11.5k|    }
  498|     93|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 23, False: 70]
  ------------------
  499|     23|      return false;
  500|     23|    }
  501|     70|    return true;
  502|     93|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     51|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     51|    unsigned x;
  423|     51|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 1, False: 50]
  ------------------
  424|      1|      return 1;
  425|      1|    }
  426|     50|    ans_.buf = buf;
  427|     50|    x = buf[offset - 1] >> 6;
  428|     50|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 17, False: 33]
  ------------------
  429|     17|      ans_.buf_offset = offset - 1;
  430|     17|      ans_.state = buf[offset - 1] & 0x3F;
  431|     33|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 8, False: 25]
  ------------------
  432|      8|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 8]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      8|      ans_.buf_offset = offset - 2;
  436|      8|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     25|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 10, False: 15]
  ------------------
  438|     10|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 4, False: 6]
  ------------------
  439|      4|        return 1;
  440|      4|      }
  441|      6|      ans_.buf_offset = offset - 3;
  442|      6|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     15|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 15, False: 0]
  ------------------
  444|     15|      ans_.buf_offset = offset - 4;
  445|     15|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     15|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     46|    ans_.state += l_rans_base;
  450|     46|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     46|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 5, False: 41]
  ------------------
  451|      5|      return 1;
  452|      5|    }
  453|     41|    return 0;
  454|     46|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|   151k|  inline int rans_read() {
  463|   151k|    unsigned rem;
  464|   151k|    unsigned quo;
  465|   151k|    struct rans_dec_sym sym;
  466|   152k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 52.3k, False: 99.9k]
  |  Branch (466:40): [True: 289, False: 52.0k]
  ------------------
  467|    289|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    289|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    289|    }
  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|   151k|    quo = ans_.state / rans_precision;
  472|   151k|    rem = ans_.state % rans_precision;
  473|   151k|    fetch_sym(&sym, rem);
  474|   151k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   151k|    return sym.val;
  476|   151k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|   151k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   151k|    uint32_t symbol = lut_table_[rem];
  507|   151k|    out->val = symbol;
  508|   151k|    out->prob = probability_table_[symbol].prob;
  509|   151k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   151k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     41|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.21k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|    777|                                       uint32_t num_symbols) {
  482|    777|    lut_table_.resize(rans_precision);
  483|    777|    probability_table_.resize(num_symbols);
  484|    777|    uint32_t cum_prob = 0;
  485|    777|    uint32_t act_prob = 0;
  486|  16.3k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 15.6k, False: 719]
  ------------------
  487|  15.6k|      probability_table_[i].prob = token_probs[i];
  488|  15.6k|      probability_table_[i].cum_prob = cum_prob;
  489|  15.6k|      cum_prob += token_probs[i];
  490|  15.6k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 58, False: 15.5k]
  ------------------
  491|     58|        return false;
  492|     58|      }
  493|   717M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 717M, False: 15.5k]
  ------------------
  494|   717M|        lut_table_[j] = i;
  495|   717M|      }
  496|  15.5k|      act_prob = cum_prob;
  497|  15.5k|    }
  498|    719|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 59, False: 660]
  ------------------
  499|     59|      return false;
  500|     59|    }
  501|    660|    return true;
  502|    719|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    395|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    395|    unsigned x;
  423|    395|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 28, False: 367]
  ------------------
  424|     28|      return 1;
  425|     28|    }
  426|    367|    ans_.buf = buf;
  427|    367|    x = buf[offset - 1] >> 6;
  428|    367|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 96, False: 271]
  ------------------
  429|     96|      ans_.buf_offset = offset - 1;
  430|     96|      ans_.state = buf[offset - 1] & 0x3F;
  431|    271|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 84, False: 187]
  ------------------
  432|     84|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 17, False: 67]
  ------------------
  433|     17|        return 1;
  434|     17|      }
  435|     67|      ans_.buf_offset = offset - 2;
  436|     67|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    187|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 72, False: 115]
  ------------------
  438|     72|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 20, False: 52]
  ------------------
  439|     20|        return 1;
  440|     20|      }
  441|     52|      ans_.buf_offset = offset - 3;
  442|     52|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    115|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 115, False: 0]
  ------------------
  444|    115|      ans_.buf_offset = offset - 4;
  445|    115|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    115|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    330|    ans_.state += l_rans_base;
  450|    330|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    330|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 47, False: 283]
  ------------------
  451|     47|      return 1;
  452|     47|    }
  453|    283|    return 0;
  454|    330|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|  33.6M|  inline int rans_read() {
  463|  33.6M|    unsigned rem;
  464|  33.6M|    unsigned quo;
  465|  33.6M|    struct rans_dec_sym sym;
  466|  33.6M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 27.6M, False: 5.97M]
  |  Branch (466:40): [True: 7.08k, False: 27.6M]
  ------------------
  467|  7.08k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  7.08k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  7.08k|    }
  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|  33.6M|    quo = ans_.state / rans_precision;
  472|  33.6M|    rem = ans_.state % rans_precision;
  473|  33.6M|    fetch_sym(&sym, rem);
  474|  33.6M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  33.6M|    return sym.val;
  476|  33.6M|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|  33.6M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  33.6M|    uint32_t symbol = lut_table_[rem];
  507|  33.6M|    out->val = symbol;
  508|  33.6M|    out->prob = probability_table_[symbol].prob;
  509|  33.6M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  33.6M|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    283|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|    962|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|    962|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    962|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 962]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    962|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    962|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    962|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 58, False: 904]
  ------------------
   67|     58|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 7, False: 51]
  ------------------
   68|      7|      return false;
   69|      7|    }
   70|       |
   71|     58|  } else
   72|    904|#endif
   73|    904|  {
   74|    904|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 18, False: 886]
  ------------------
   75|     18|      return false;
   76|     18|    }
   77|    904|  }
   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|    937|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 55, False: 882]
  ------------------
   83|     55|    return false;
   84|     55|  }
   85|    882|  probability_table_.resize(num_symbols_);
   86|    882|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 333, False: 549]
  ------------------
   87|    333|    return true;
   88|    333|  }
   89|       |  // Decode the table.
   90|   607k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 607k, False: 335]
  ------------------
   91|   607k|    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|   607k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 607k]
  ------------------
   95|     36|      return false;
   96|     36|    }
   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|   607k|    const int token = prob_data & 3;
  102|   607k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 16.3k, False: 590k]
  ------------------
  103|  16.3k|      const uint32_t offset = prob_data >> 2;
  104|  16.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 153, False: 16.1k]
  ------------------
  105|    153|        return false;
  106|    153|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   648k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 632k, False: 16.1k]
  ------------------
  109|   632k|        probability_table_[i + j] = 0;
  110|   632k|      }
  111|  16.1k|      i += offset;
  112|   590k|    } else {
  113|   590k|      const int extra_bytes = token;
  114|   590k|      uint32_t prob = prob_data >> 2;
  115|   603k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 12.5k, False: 590k]
  ------------------
  116|  12.5k|        uint8_t eb;
  117|  12.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 25, False: 12.4k]
  ------------------
  118|     25|          return false;
  119|     25|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  12.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  12.4k|      }
  124|   590k|      probability_table_[i] = prob;
  125|   590k|    }
  126|   607k|  }
  127|    335|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 121, False: 214]
  ------------------
  128|    121|    return false;
  129|    121|  }
  130|    214|  return true;
  131|    335|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    446|    DecoderBuffer *buffer) {
  136|    446|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    446|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    446|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    446|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 29, False: 417]
  ------------------
  140|     29|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 27]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     29|  } else
  145|    417|#endif
  146|    417|  {
  147|    417|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 16, False: 401]
  ------------------
  148|     16|      return false;
  149|     16|    }
  150|    417|  }
  151|    428|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 65, False: 363]
  ------------------
  152|     65|    return false;
  153|     65|  }
  154|    363|  const uint8_t *const data_head =
  155|    363|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    363|  buffer->Advance(bytes_encoded);
  158|    363|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 104, False: 259]
  ------------------
  159|    104|    return false;
  160|    104|  }
  161|    259|  return true;
  162|    363|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    366|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  7.67M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    205|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    205|  ans_.read_end();
  167|    205|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    406|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    406|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    406|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 406]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    406|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    406|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    406|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 42, False: 364]
  ------------------
   67|     42|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 5, False: 37]
  ------------------
   68|      5|      return false;
   69|      5|    }
   70|       |
   71|     42|  } else
   72|    364|#endif
   73|    364|  {
   74|    364|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 355]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    364|  }
   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|    392|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 32, False: 360]
  ------------------
   83|     32|    return false;
   84|     32|  }
   85|    360|  probability_table_.resize(num_symbols_);
   86|    360|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 351]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|   848k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 848k, False: 262]
  ------------------
   91|   848k|    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|   848k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 27, False: 848k]
  ------------------
   95|     27|      return false;
   96|     27|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   848k|    const int token = prob_data & 3;
  102|   848k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 471k, False: 376k]
  ------------------
  103|   471k|      const uint32_t offset = prob_data >> 2;
  104|   471k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 46, False: 471k]
  ------------------
  105|     46|        return false;
  106|     46|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  27.9M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 27.4M, False: 471k]
  ------------------
  109|  27.4M|        probability_table_[i + j] = 0;
  110|  27.4M|      }
  111|   471k|      i += offset;
  112|   471k|    } else {
  113|   376k|      const int extra_bytes = token;
  114|   376k|      uint32_t prob = prob_data >> 2;
  115|   500k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 123k, False: 376k]
  ------------------
  116|   123k|        uint8_t eb;
  117|   123k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 123k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   123k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   123k|      }
  124|   376k|      probability_table_[i] = prob;
  125|   376k|    }
  126|   848k|  }
  127|    262|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 92, False: 170]
  ------------------
  128|     92|    return false;
  129|     92|  }
  130|    170|  return true;
  131|    262|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    179|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    170|    DecoderBuffer *buffer) {
  136|    170|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    170|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    170|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    170|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 3, False: 167]
  ------------------
  140|      3|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 3]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      3|  } else
  145|    167|#endif
  146|    167|  {
  147|    167|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 17, False: 150]
  ------------------
  148|     17|      return false;
  149|     17|    }
  150|    167|  }
  151|    153|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 7, False: 146]
  ------------------
  152|      7|    return false;
  153|      7|  }
  154|    146|  const uint8_t *const data_head =
  155|    146|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    146|  buffer->Advance(bytes_encoded);
  158|    146|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 13, False: 133]
  ------------------
  159|     13|    return false;
  160|     13|  }
  161|    133|  return true;
  162|    146|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|   122M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    133|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    133|  ans_.read_end();
  167|    133|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    332|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    332|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    332|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 332]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    332|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    332|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    332|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 50, False: 282]
  ------------------
   67|     50|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 50]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     50|  } else
   72|    282|#endif
   73|    282|  {
   74|    282|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 282]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    282|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    332|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 17, False: 315]
  ------------------
   83|     17|    return false;
   84|     17|  }
   85|    315|  probability_table_.resize(num_symbols_);
   86|    315|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 312]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|   391k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 391k, False: 227]
  ------------------
   91|   391k|    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|   391k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 38, False: 391k]
  ------------------
   95|     38|      return false;
   96|     38|    }
   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|   391k|    const int token = prob_data & 3;
  102|   391k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 39.9k, False: 351k]
  ------------------
  103|  39.9k|      const uint32_t offset = prob_data >> 2;
  104|  39.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 39.9k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   744k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 704k, False: 39.9k]
  ------------------
  109|   704k|        probability_table_[i + j] = 0;
  110|   704k|      }
  111|  39.9k|      i += offset;
  112|   351k|    } else {
  113|   351k|      const int extra_bytes = token;
  114|   351k|      uint32_t prob = prob_data >> 2;
  115|   601k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 250k, False: 351k]
  ------------------
  116|   250k|        uint8_t eb;
  117|   250k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 18, False: 250k]
  ------------------
  118|     18|          return false;
  119|     18|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   250k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   250k|      }
  124|   351k|      probability_table_[i] = prob;
  125|   351k|    }
  126|   391k|  }
  127|    227|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 26, False: 201]
  ------------------
  128|     26|    return false;
  129|     26|  }
  130|    201|  return true;
  131|    227|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    204|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    201|    DecoderBuffer *buffer) {
  136|    201|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    201|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    201|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    201|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 21, False: 180]
  ------------------
  140|     21|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 21]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     21|  } else
  145|    180|#endif
  146|    180|  {
  147|    180|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 179]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    180|  }
  151|    200|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 48, False: 152]
  ------------------
  152|     48|    return false;
  153|     48|  }
  154|    152|  const uint8_t *const data_head =
  155|    152|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    152|  buffer->Advance(bytes_encoded);
  158|    152|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 24, False: 128]
  ------------------
  159|     24|    return false;
  160|     24|  }
  161|    128|  return true;
  162|    152|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  91.8M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    128|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    128|  ans_.read_end();
  167|    128|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    358|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    358|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    358|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 358]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    358|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    358|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    358|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 59, False: 299]
  ------------------
   67|     59|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 58]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     59|  } else
   72|    299|#endif
   73|    299|  {
   74|    299|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 296]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    299|  }
   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|    354|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 8, False: 346]
  ------------------
   83|      8|    return false;
   84|      8|  }
   85|    346|  probability_table_.resize(num_symbols_);
   86|    346|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 345]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  27.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 26.7k, False: 275]
  ------------------
   91|  26.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|  26.7k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 26, False: 26.7k]
  ------------------
   95|     26|      return false;
   96|     26|    }
   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|  26.7k|    const int token = prob_data & 3;
  102|  26.7k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.17k, False: 20.5k]
  ------------------
  103|  6.17k|      const uint32_t offset = prob_data >> 2;
  104|  6.17k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 6.14k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   187k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 181k, False: 6.14k]
  ------------------
  109|   181k|        probability_table_[i + j] = 0;
  110|   181k|      }
  111|  6.14k|      i += offset;
  112|  20.5k|    } else {
  113|  20.5k|      const int extra_bytes = token;
  114|  20.5k|      uint32_t prob = prob_data >> 2;
  115|  38.0k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 17.5k, False: 20.5k]
  ------------------
  116|  17.5k|        uint8_t eb;
  117|  17.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 17.4k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  17.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  17.4k|      }
  124|  20.5k|      probability_table_[i] = prob;
  125|  20.5k|    }
  126|  26.7k|  }
  127|    275|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 5, False: 270]
  ------------------
  128|      5|    return false;
  129|      5|  }
  130|    270|  return true;
  131|    275|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    271|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    270|    DecoderBuffer *buffer) {
  136|    270|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    270|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    270|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    270|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 48, False: 222]
  ------------------
  140|     48|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 47]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     48|  } else
  145|    222|#endif
  146|    222|  {
  147|    222|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 219]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    222|  }
  151|    266|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 57, False: 209]
  ------------------
  152|     57|    return false;
  153|     57|  }
  154|    209|  const uint8_t *const data_head =
  155|    209|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    209|  buffer->Advance(bytes_encoded);
  158|    209|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 20, False: 189]
  ------------------
  159|     20|    return false;
  160|     20|  }
  161|    189|  return true;
  162|    209|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  25.8M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    189|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    189|  ans_.read_end();
  167|    189|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    234|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    234|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    234|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 234]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    234|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    234|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    234|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 12, False: 222]
  ------------------
   67|     12|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 11]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     12|  } else
   72|    222|#endif
   73|    222|  {
   74|    222|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 217]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    222|  }
   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|    228|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 13, False: 215]
  ------------------
   83|     13|    return false;
   84|     13|  }
   85|    215|  probability_table_.resize(num_symbols_);
   86|    215|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 213]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  17.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 16.8k, False: 164]
  ------------------
   91|  16.8k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  16.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 30, False: 16.8k]
  ------------------
   95|     30|      return false;
   96|     30|    }
   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|  16.8k|    const int token = prob_data & 3;
  102|  16.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.78k, False: 11.0k]
  ------------------
  103|  5.78k|      const uint32_t offset = prob_data >> 2;
  104|  5.78k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 10, False: 5.77k]
  ------------------
  105|     10|        return false;
  106|     10|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   232k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 226k, False: 5.77k]
  ------------------
  109|   226k|        probability_table_[i + j] = 0;
  110|   226k|      }
  111|  5.77k|      i += offset;
  112|  11.0k|    } else {
  113|  11.0k|      const int extra_bytes = token;
  114|  11.0k|      uint32_t prob = prob_data >> 2;
  115|  17.6k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 6.67k, False: 11.0k]
  ------------------
  116|  6.67k|        uint8_t eb;
  117|  6.67k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 9, False: 6.66k]
  ------------------
  118|      9|          return false;
  119|      9|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  6.66k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  6.66k|      }
  124|  11.0k|      probability_table_[i] = prob;
  125|  11.0k|    }
  126|  16.8k|  }
  127|    164|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 17, False: 147]
  ------------------
  128|     17|    return false;
  129|     17|  }
  130|    147|  return true;
  131|    164|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    149|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_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: 2, False: 145]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    147|  }
  151|    145|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 3, False: 142]
  ------------------
  152|      3|    return false;
  153|      3|  }
  154|    142|  const uint8_t *const data_head =
  155|    142|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    142|  buffer->Advance(bytes_encoded);
  158|    142|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 10, False: 132]
  ------------------
  159|     10|    return false;
  160|     10|  }
  161|    132|  return true;
  162|    142|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  3.86M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|    132|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    132|  ans_.read_end();
  167|    132|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    250|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    250|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    250|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 250]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    250|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    250|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    250|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 43, False: 207]
  ------------------
   67|     43|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 43]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     43|  } else
   72|    207|#endif
   73|    207|  {
   74|    207|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 202]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    207|  }
   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|    245|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 230]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    230|  probability_table_.resize(num_symbols_);
   86|    230|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 228]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  23.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 23.3k, False: 172]
  ------------------
   91|  23.3k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  23.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 24, False: 23.3k]
  ------------------
   95|     24|      return false;
   96|     24|    }
   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|  23.3k|    const int token = prob_data & 3;
  102|  23.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 12.9k, False: 10.4k]
  ------------------
  103|  12.9k|      const uint32_t offset = prob_data >> 2;
  104|  12.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 25, False: 12.9k]
  ------------------
  105|     25|        return false;
  106|     25|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   168k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 155k, False: 12.9k]
  ------------------
  109|   155k|        probability_table_[i + j] = 0;
  110|   155k|      }
  111|  12.9k|      i += offset;
  112|  12.9k|    } else {
  113|  10.4k|      const int extra_bytes = token;
  114|  10.4k|      uint32_t prob = prob_data >> 2;
  115|  17.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 7.33k, False: 10.3k]
  ------------------
  116|  7.33k|        uint8_t eb;
  117|  7.33k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 7.32k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  7.32k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  7.32k|      }
  124|  10.3k|      probability_table_[i] = prob;
  125|  10.3k|    }
  126|  23.3k|  }
  127|    172|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 19, False: 153]
  ------------------
  128|     19|    return false;
  129|     19|  }
  130|    153|  return true;
  131|    172|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    155|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    153|    DecoderBuffer *buffer) {
  136|    153|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    153|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    153|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    153|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 30, False: 123]
  ------------------
  140|     30|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 29]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     30|  } else
  145|    123|#endif
  146|    123|  {
  147|    123|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 123]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    123|  }
  151|    152|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 38, False: 114]
  ------------------
  152|     38|    return false;
  153|     38|  }
  154|    114|  const uint8_t *const data_head =
  155|    114|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    114|  buffer->Advance(bytes_encoded);
  158|    114|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 33, False: 81]
  ------------------
  159|     33|    return false;
  160|     33|  }
  161|     81|  return true;
  162|    114|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  19.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|     81|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     81|  ans_.read_end();
  167|     81|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    311|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    311|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    311|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 311]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    311|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    311|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    311|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 46, False: 265]
  ------------------
   67|     46|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 46]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     46|  } else
   72|    265|#endif
   73|    265|  {
   74|    265|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 265]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    265|  }
   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|    311|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 14, False: 297]
  ------------------
   83|     14|    return false;
   84|     14|  }
   85|    297|  probability_table_.resize(num_symbols_);
   86|    297|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 297]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   543k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 543k, False: 200]
  ------------------
   91|   543k|    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|   543k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 47, False: 543k]
  ------------------
   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|   543k|    const int token = prob_data & 3;
  102|   543k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 206k, False: 336k]
  ------------------
  103|   206k|      const uint32_t offset = prob_data >> 2;
  104|   206k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 206k]
  ------------------
  105|     24|        return false;
  106|     24|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  8.09M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 7.88M, False: 206k]
  ------------------
  109|  7.88M|        probability_table_[i + j] = 0;
  110|  7.88M|      }
  111|   206k|      i += offset;
  112|   336k|    } else {
  113|   336k|      const int extra_bytes = token;
  114|   336k|      uint32_t prob = prob_data >> 2;
  115|   632k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 295k, False: 336k]
  ------------------
  116|   295k|        uint8_t eb;
  117|   295k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 26, False: 295k]
  ------------------
  118|     26|          return false;
  119|     26|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   295k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   295k|      }
  124|   336k|      probability_table_[i] = prob;
  125|   336k|    }
  126|   543k|  }
  127|    200|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 14, False: 186]
  ------------------
  128|     14|    return false;
  129|     14|  }
  130|    186|  return true;
  131|    200|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    186|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    186|    DecoderBuffer *buffer) {
  136|    186|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    186|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    186|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    186|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 23, False: 163]
  ------------------
  140|     23|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 21]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     23|  } else
  145|    163|#endif
  146|    163|  {
  147|    163|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 158]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|    163|  }
  151|    179|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 21, False: 158]
  ------------------
  152|     21|    return false;
  153|     21|  }
  154|    158|  const uint8_t *const data_head =
  155|    158|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    158|  buffer->Advance(bytes_encoded);
  158|    158|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 133]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|    133|  return true;
  162|    158|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  12.8M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|    133|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    133|  ans_.read_end();
  167|    133|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    254|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    254|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    254|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 254]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    254|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    254|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    254|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 53, False: 201]
  ------------------
   67|     53|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 53]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     53|  } else
   72|    201|#endif
   73|    201|  {
   74|    201|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 190]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    201|  }
   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|    243|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 8, False: 235]
  ------------------
   83|      8|    return false;
   84|      8|  }
   85|    235|  probability_table_.resize(num_symbols_);
   86|    235|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 234]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   933k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 933k, False: 160]
  ------------------
   91|   933k|    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|   933k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 26, False: 933k]
  ------------------
   95|     26|      return false;
   96|     26|    }
   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|   933k|    const int token = prob_data & 3;
  102|   933k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 143k, False: 789k]
  ------------------
  103|   143k|      const uint32_t offset = prob_data >> 2;
  104|   143k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 143k]
  ------------------
  105|     24|        return false;
  106|     24|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.60M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.46M, False: 143k]
  ------------------
  109|  4.46M|        probability_table_[i + j] = 0;
  110|  4.46M|      }
  111|   143k|      i += offset;
  112|   789k|    } else {
  113|   789k|      const int extra_bytes = token;
  114|   789k|      uint32_t prob = prob_data >> 2;
  115|  1.55M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 760k, False: 789k]
  ------------------
  116|   760k|        uint8_t eb;
  117|   760k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 24, False: 760k]
  ------------------
  118|     24|          return false;
  119|     24|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   760k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   760k|      }
  124|   789k|      probability_table_[i] = prob;
  125|   789k|    }
  126|   933k|  }
  127|    160|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 12, False: 148]
  ------------------
  128|     12|    return false;
  129|     12|  }
  130|    148|  return true;
  131|    160|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    149|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|    148|    DecoderBuffer *buffer) {
  136|    148|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    148|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    148|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    148|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 36, False: 112]
  ------------------
  140|     36|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 35]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     36|  } else
  145|    112|#endif
  146|    112|  {
  147|    112|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 102]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    112|  }
  151|    137|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 60, False: 77]
  ------------------
  152|     60|    return false;
  153|     60|  }
  154|     77|  const uint8_t *const data_head =
  155|     77|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     77|  buffer->Advance(bytes_encoded);
  158|     77|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 28, False: 49]
  ------------------
  159|     28|    return false;
  160|     28|  }
  161|     49|  return true;
  162|     77|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  12.9M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     49|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     49|  ans_.read_end();
  167|     49|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    267|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    267|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    267|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 267]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    267|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    267|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    267|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 28, False: 239]
  ------------------
   67|     28|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 28]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     28|  } else
   72|    239|#endif
   73|    239|  {
   74|    239|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 234]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    239|  }
   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|    262|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 10, False: 252]
  ------------------
   83|     10|    return false;
   84|     10|  }
   85|    252|  probability_table_.resize(num_symbols_);
   86|    252|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 250]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|   226k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 226k, False: 173]
  ------------------
   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: 26, False: 226k]
  ------------------
   95|     26|      return false;
   96|     26|    }
   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: 23.4k, False: 202k]
  ------------------
  103|  23.4k|      const uint32_t offset = prob_data >> 2;
  104|  23.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 34, False: 23.3k]
  ------------------
  105|     34|        return false;
  106|     34|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   693k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 670k, False: 23.3k]
  ------------------
  109|   670k|        probability_table_[i + j] = 0;
  110|   670k|      }
  111|  23.3k|      i += offset;
  112|   202k|    } else {
  113|   202k|      const int extra_bytes = token;
  114|   202k|      uint32_t prob = prob_data >> 2;
  115|   258k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 56.1k, False: 202k]
  ------------------
  116|  56.1k|        uint8_t eb;
  117|  56.1k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 56.1k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  56.1k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  56.1k|      }
  124|   202k|      probability_table_[i] = prob;
  125|   202k|    }
  126|   226k|  }
  127|    173|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 34, False: 139]
  ------------------
  128|     34|    return false;
  129|     34|  }
  130|    139|  return true;
  131|    173|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    141|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|    139|    DecoderBuffer *buffer) {
  136|    139|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    139|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    139|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    139|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 9, False: 130]
  ------------------
  140|      9|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 9]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      9|  } else
  145|    130|#endif
  146|    130|  {
  147|    130|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 130]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    130|  }
  151|    139|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 28, False: 111]
  ------------------
  152|     28|    return false;
  153|     28|  }
  154|    111|  const uint8_t *const data_head =
  155|    111|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    111|  buffer->Advance(bytes_encoded);
  158|    111|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 23, False: 88]
  ------------------
  159|     23|    return false;
  160|     23|  }
  161|     88|  return true;
  162|    111|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|  6.38M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     88|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     88|  ans_.read_end();
  167|     88|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    233|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    233|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    233|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 233]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    233|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    233|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    233|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 42, False: 191]
  ------------------
   67|     42|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 41]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     42|  } else
   72|    191|#endif
   73|    191|  {
   74|    191|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 189]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    191|  }
   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|    230|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 2, False: 228]
  ------------------
   83|      2|    return false;
   84|      2|  }
   85|    228|  probability_table_.resize(num_symbols_);
   86|    228|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 225]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|   732k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 732k, False: 154]
  ------------------
   91|   732k|    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|   732k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 30, False: 732k]
  ------------------
   95|     30|      return false;
   96|     30|    }
   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|   732k|    const int token = prob_data & 3;
  102|   732k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 89.8k, False: 642k]
  ------------------
  103|  89.8k|      const uint32_t offset = prob_data >> 2;
  104|  89.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 20, False: 89.8k]
  ------------------
  105|     20|        return false;
  106|     20|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.99M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.90M, False: 89.8k]
  ------------------
  109|  1.90M|        probability_table_[i + j] = 0;
  110|  1.90M|      }
  111|  89.8k|      i += offset;
  112|   642k|    } else {
  113|   642k|      const int extra_bytes = token;
  114|   642k|      uint32_t prob = prob_data >> 2;
  115|  1.21M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 575k, False: 642k]
  ------------------
  116|   575k|        uint8_t eb;
  117|   575k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 575k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   575k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   575k|      }
  124|   642k|      probability_table_[i] = prob;
  125|   642k|    }
  126|   732k|  }
  127|    154|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 37, False: 117]
  ------------------
  128|     37|    return false;
  129|     37|  }
  130|    117|  return true;
  131|    154|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    120|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    117|    DecoderBuffer *buffer) {
  136|    117|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    117|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    117|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    117|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 23, False: 94]
  ------------------
  140|     23|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 22]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     23|  } else
  145|     94|#endif
  146|     94|  {
  147|     94|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 94]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     94|  }
  151|    116|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 33, False: 83]
  ------------------
  152|     33|    return false;
  153|     33|  }
  154|     83|  const uint8_t *const data_head =
  155|     83|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     83|  buffer->Advance(bytes_encoded);
  158|     83|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 39, False: 44]
  ------------------
  159|     39|    return false;
  160|     39|  }
  161|     44|  return true;
  162|     83|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   332k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     44|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     44|  ans_.read_end();
  167|     44|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    233|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    233|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    233|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 233]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    233|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    233|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    233|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 40, False: 193]
  ------------------
   67|     40|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 37]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     40|  } else
   72|    193|#endif
   73|    193|  {
   74|    193|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 187]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    193|  }
   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|    224|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 21, False: 203]
  ------------------
   83|     21|    return false;
   84|     21|  }
   85|    203|  probability_table_.resize(num_symbols_);
   86|    203|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 198]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|  87.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 87.1k, False: 122]
  ------------------
   91|  87.1k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  87.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 25, False: 87.1k]
  ------------------
   95|     25|      return false;
   96|     25|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  87.1k|    const int token = prob_data & 3;
  102|  87.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 15.5k, False: 71.5k]
  ------------------
  103|  15.5k|      const uint32_t offset = prob_data >> 2;
  104|  15.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 15.5k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   559k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 543k, False: 15.5k]
  ------------------
  109|   543k|        probability_table_[i + j] = 0;
  110|   543k|      }
  111|  15.5k|      i += offset;
  112|  71.5k|    } else {
  113|  71.5k|      const int extra_bytes = token;
  114|  71.5k|      uint32_t prob = prob_data >> 2;
  115|   139k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 67.6k, False: 71.5k]
  ------------------
  116|  67.6k|        uint8_t eb;
  117|  67.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 67.6k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  67.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  67.6k|      }
  124|  71.5k|      probability_table_[i] = prob;
  125|  71.5k|    }
  126|  87.1k|  }
  127|    122|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 50, False: 72]
  ------------------
  128|     50|    return false;
  129|     50|  }
  130|     72|  return true;
  131|    122|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|     77|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|     72|    DecoderBuffer *buffer) {
  136|     72|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     72|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     72|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     72|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 72]
  ------------------
  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|     72|#endif
  146|     72|  {
  147|     72|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 72]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     72|  }
  151|     72|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 20, False: 52]
  ------------------
  152|     20|    return false;
  153|     20|  }
  154|     52|  const uint8_t *const data_head =
  155|     52|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     52|  buffer->Advance(bytes_encoded);
  158|     52|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 18, False: 34]
  ------------------
  159|     18|    return false;
  160|     18|  }
  161|     34|  return true;
  162|     52|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|   220k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     34|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     34|  ans_.read_end();
  167|     34|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    215|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    215|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    215|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 215]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    215|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    215|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    215|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 15, False: 200]
  ------------------
   67|     15|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 15]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     15|  } else
   72|    200|#endif
   73|    200|  {
   74|    200|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 198]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    200|  }
   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|    213|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 3, False: 210]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|    210|  probability_table_.resize(num_symbols_);
   86|    210|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 201]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  90.4k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 90.3k, False: 133]
  ------------------
   91|  90.3k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  90.3k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 38, False: 90.2k]
  ------------------
   95|     38|      return false;
   96|     38|    }
   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|  90.2k|    const int token = prob_data & 3;
  102|  90.2k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 22.3k, False: 67.9k]
  ------------------
  103|  22.3k|      const uint32_t offset = prob_data >> 2;
  104|  22.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 15, False: 22.3k]
  ------------------
  105|     15|        return false;
  106|     15|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   824k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 802k, False: 22.3k]
  ------------------
  109|   802k|        probability_table_[i + j] = 0;
  110|   802k|      }
  111|  22.3k|      i += offset;
  112|  67.9k|    } else {
  113|  67.9k|      const int extra_bytes = token;
  114|  67.9k|      uint32_t prob = prob_data >> 2;
  115|   134k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 66.6k, False: 67.9k]
  ------------------
  116|  66.6k|        uint8_t eb;
  117|  66.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 15, False: 66.6k]
  ------------------
  118|     15|          return false;
  119|     15|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  66.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  66.6k|      }
  124|  67.9k|      probability_table_[i] = prob;
  125|  67.9k|    }
  126|  90.2k|  }
  127|    133|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 39, False: 94]
  ------------------
  128|     39|    return false;
  129|     39|  }
  130|     94|  return true;
  131|    133|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    103|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|     94|    DecoderBuffer *buffer) {
  136|     94|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     94|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     94|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     94|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 14, False: 80]
  ------------------
  140|     14|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 14]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     14|  } else
  145|     80|#endif
  146|     80|  {
  147|     80|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 79]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|     80|  }
  151|     93|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 31, False: 62]
  ------------------
  152|     31|    return false;
  153|     31|  }
  154|     62|  const uint8_t *const data_head =
  155|     62|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     62|  buffer->Advance(bytes_encoded);
  158|     62|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 23, False: 39]
  ------------------
  159|     23|    return false;
  160|     23|  }
  161|     39|  return true;
  162|     62|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|  47.9k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     39|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     39|  ans_.read_end();
  167|     39|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    198|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    198|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    198|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 198]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    198|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    198|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    198|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 6, False: 192]
  ------------------
   67|      6|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 6]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      6|  } else
   72|    192|#endif
   73|    192|  {
   74|    192|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 188]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    192|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    194|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 182]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    182|  probability_table_.resize(num_symbols_);
   86|    182|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 182]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   796k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 796k, False: 111]
  ------------------
   91|   796k|    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|   796k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 26, False: 796k]
  ------------------
   95|     26|      return false;
   96|     26|    }
   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|   796k|    const int token = prob_data & 3;
  102|   796k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 401k, False: 394k]
  ------------------
  103|   401k|      const uint32_t offset = prob_data >> 2;
  104|   401k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 26, False: 401k]
  ------------------
  105|     26|        return false;
  106|     26|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  13.4M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 13.0M, False: 401k]
  ------------------
  109|  13.0M|        probability_table_[i + j] = 0;
  110|  13.0M|      }
  111|   401k|      i += offset;
  112|   401k|    } else {
  113|   394k|      const int extra_bytes = token;
  114|   394k|      uint32_t prob = prob_data >> 2;
  115|   613k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 219k, False: 394k]
  ------------------
  116|   219k|        uint8_t eb;
  117|   219k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 19, False: 219k]
  ------------------
  118|     19|          return false;
  119|     19|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   219k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   219k|      }
  124|   394k|      probability_table_[i] = prob;
  125|   394k|    }
  126|   796k|  }
  127|    111|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 41, False: 70]
  ------------------
  128|     41|    return false;
  129|     41|  }
  130|     70|  return true;
  131|    111|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|     70|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|     70|    DecoderBuffer *buffer) {
  136|     70|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     70|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     70|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     70|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 70]
  ------------------
  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|     70|#endif
  146|     70|  {
  147|     70|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 69]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|     70|  }
  151|     69|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 18, False: 51]
  ------------------
  152|     18|    return false;
  153|     18|  }
  154|     51|  const uint8_t *const data_head =
  155|     51|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     51|  buffer->Advance(bytes_encoded);
  158|     51|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 10, False: 41]
  ------------------
  159|     10|    return false;
  160|     10|  }
  161|     41|  return true;
  162|     51|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   151k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     41|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     41|  ans_.read_end();
  167|     41|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    235|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    235|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    235|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 235]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    235|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    235|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    235|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 41, False: 194]
  ------------------
   67|     41|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 38]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     41|  } else
   72|    194|#endif
   73|    194|  {
   74|    194|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 187]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    194|  }
   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|    225|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 210]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    210|  probability_table_.resize(num_symbols_);
   86|    210|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 208]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|   113k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 113k, False: 138]
  ------------------
   91|   113k|    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|   113k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 30, False: 113k]
  ------------------
   95|     30|      return false;
   96|     30|    }
   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|   113k|    const int token = prob_data & 3;
  102|   113k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 54.8k, False: 58.6k]
  ------------------
  103|  54.8k|      const uint32_t offset = prob_data >> 2;
  104|  54.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 26, False: 54.8k]
  ------------------
  105|     26|        return false;
  106|     26|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.86M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.80M, False: 54.8k]
  ------------------
  109|  2.80M|        probability_table_[i + j] = 0;
  110|  2.80M|      }
  111|  54.8k|      i += offset;
  112|  58.6k|    } else {
  113|  58.6k|      const int extra_bytes = token;
  114|  58.6k|      uint32_t prob = prob_data >> 2;
  115|   139k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 81.3k, False: 58.6k]
  ------------------
  116|  81.3k|        uint8_t eb;
  117|  81.3k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 14, False: 81.2k]
  ------------------
  118|     14|          return false;
  119|     14|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  81.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  81.2k|      }
  124|  58.6k|      probability_table_[i] = prob;
  125|  58.6k|    }
  126|   113k|  }
  127|    138|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 25, False: 113]
  ------------------
  128|     25|    return false;
  129|     25|  }
  130|    113|  return true;
  131|    138|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    115|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    113|    DecoderBuffer *buffer) {
  136|    113|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    113|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    113|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    113|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 11, False: 102]
  ------------------
  140|     11|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 9]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     11|  } else
  145|    102|#endif
  146|    102|  {
  147|    102|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 101]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    102|  }
  151|    110|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 36, False: 74]
  ------------------
  152|     36|    return false;
  153|     36|  }
  154|     74|  const uint8_t *const data_head =
  155|     74|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     74|  buffer->Advance(bytes_encoded);
  158|     74|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 18, False: 56]
  ------------------
  159|     18|    return false;
  160|     18|  }
  161|     56|  return true;
  162|     74|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|   146k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     56|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     56|  ans_.read_end();
  167|     56|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    214|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    214|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    214|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 214]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    214|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    214|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    214|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 41, False: 173]
  ------------------
   67|     41|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 41]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     41|  } else
   72|    173|#endif
   73|    173|  {
   74|    173|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 168]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    173|  }
   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|    209|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 17, False: 192]
  ------------------
   83|     17|    return false;
   84|     17|  }
   85|    192|  probability_table_.resize(num_symbols_);
   86|    192|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 192]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   484k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 484k, False: 122]
  ------------------
   91|   484k|    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|   484k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 33, False: 484k]
  ------------------
   95|     33|      return false;
   96|     33|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   484k|    const int token = prob_data & 3;
  102|   484k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 77.0k, False: 407k]
  ------------------
  103|  77.0k|      const uint32_t offset = prob_data >> 2;
  104|  77.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 26, False: 76.9k]
  ------------------
  105|     26|        return false;
  106|     26|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.27M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.20M, False: 76.9k]
  ------------------
  109|  2.20M|        probability_table_[i + j] = 0;
  110|  2.20M|      }
  111|  76.9k|      i += offset;
  112|   407k|    } else {
  113|   407k|      const int extra_bytes = token;
  114|   407k|      uint32_t prob = prob_data >> 2;
  115|   566k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 158k, False: 407k]
  ------------------
  116|   158k|        uint8_t eb;
  117|   158k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 158k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   158k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   158k|      }
  124|   407k|      probability_table_[i] = prob;
  125|   407k|    }
  126|   484k|  }
  127|    122|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 13, False: 109]
  ------------------
  128|     13|    return false;
  129|     13|  }
  130|    109|  return true;
  131|    122|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    109|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|    109|    DecoderBuffer *buffer) {
  136|    109|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    109|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    109|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    109|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 21, False: 88]
  ------------------
  140|     21|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 21]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     21|  } else
  145|     88|#endif
  146|     88|  {
  147|     88|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 88]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     88|  }
  151|    109|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 35, False: 74]
  ------------------
  152|     35|    return false;
  153|     35|  }
  154|     74|  const uint8_t *const data_head =
  155|     74|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     74|  buffer->Advance(bytes_encoded);
  158|     74|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 28, False: 46]
  ------------------
  159|     28|    return false;
  160|     28|  }
  161|     46|  return true;
  162|     74|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|  4.60M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     46|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     46|  ans_.read_end();
  167|     46|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    248|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    248|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    248|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 248]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    248|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    248|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    248|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 14, False: 234]
  ------------------
   67|     14|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 14]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     14|  } else
   72|    234|#endif
   73|    234|  {
   74|    234|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 2, False: 232]
  ------------------
   75|      2|      return false;
   76|      2|    }
   77|    234|  }
   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|    246|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 14, False: 232]
  ------------------
   83|     14|    return false;
   84|     14|  }
   85|    232|  probability_table_.resize(num_symbols_);
   86|    232|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 229]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|  13.8k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 13.6k, False: 168]
  ------------------
   91|  13.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|  13.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 24, False: 13.6k]
  ------------------
   95|     24|      return false;
   96|     24|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  13.6k|    const int token = prob_data & 3;
  102|  13.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.86k, False: 8.74k]
  ------------------
  103|  4.86k|      const uint32_t offset = prob_data >> 2;
  104|  4.86k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 18, False: 4.84k]
  ------------------
  105|     18|        return false;
  106|     18|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   188k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 183k, False: 4.84k]
  ------------------
  109|   183k|        probability_table_[i + j] = 0;
  110|   183k|      }
  111|  4.84k|      i += offset;
  112|  8.74k|    } else {
  113|  8.74k|      const int extra_bytes = token;
  114|  8.74k|      uint32_t prob = prob_data >> 2;
  115|  15.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 7.01k, False: 8.72k]
  ------------------
  116|  7.01k|        uint8_t eb;
  117|  7.01k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 19, False: 6.99k]
  ------------------
  118|     19|          return false;
  119|     19|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  6.99k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  6.99k|      }
  124|  8.72k|      probability_table_[i] = prob;
  125|  8.72k|    }
  126|  13.6k|  }
  127|    168|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 30, False: 138]
  ------------------
  128|     30|    return false;
  129|     30|  }
  130|    138|  return true;
  131|    168|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    141|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    138|    DecoderBuffer *buffer) {
  136|    138|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    138|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    138|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    138|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 137]
  ------------------
  140|      1|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 1]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      1|  } else
  145|    137|#endif
  146|    137|  {
  147|    137|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 14, False: 123]
  ------------------
  148|     14|      return false;
  149|     14|    }
  150|    137|  }
  151|    124|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 38, False: 86]
  ------------------
  152|     38|    return false;
  153|     38|  }
  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: 27, False: 59]
  ------------------
  159|     27|    return false;
  160|     27|  }
  161|     59|  return true;
  162|     86|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  19.0M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     59|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     59|  ans_.read_end();
  167|     59|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    248|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    248|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    248|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 248]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    248|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    248|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    248|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 18, False: 230]
  ------------------
   67|     18|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 18]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     18|  } else
   72|    230|#endif
   73|    230|  {
   74|    230|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 223]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    230|  }
   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|    241|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 18, False: 223]
  ------------------
   83|     18|    return false;
   84|     18|  }
   85|    223|  probability_table_.resize(num_symbols_);
   86|    223|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 220]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|   130k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 130k, False: 152]
  ------------------
   91|   130k|    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|   130k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 28, False: 130k]
  ------------------
   95|     28|      return false;
   96|     28|    }
   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|   130k|    const int token = prob_data & 3;
  102|   130k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 96.6k, False: 33.8k]
  ------------------
  103|  96.6k|      const uint32_t offset = prob_data >> 2;
  104|  96.6k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 23, False: 96.6k]
  ------------------
  105|     23|        return false;
  106|     23|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  4.69M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 4.59M, False: 96.6k]
  ------------------
  109|  4.59M|        probability_table_[i + j] = 0;
  110|  4.59M|      }
  111|  96.6k|      i += offset;
  112|  96.6k|    } else {
  113|  33.8k|      const int extra_bytes = token;
  114|  33.8k|      uint32_t prob = prob_data >> 2;
  115|  49.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 15.9k, False: 33.8k]
  ------------------
  116|  15.9k|        uint8_t eb;
  117|  15.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 15.9k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  15.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  15.9k|      }
  124|  33.8k|      probability_table_[i] = prob;
  125|  33.8k|    }
  126|   130k|  }
  127|    152|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 16, False: 136]
  ------------------
  128|     16|    return false;
  129|     16|  }
  130|    136|  return true;
  131|    152|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    139|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    136|    DecoderBuffer *buffer) {
  136|    136|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    136|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    136|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    136|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 8, False: 128]
  ------------------
  140|      8|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 8]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      8|  } else
  145|    128|#endif
  146|    128|  {
  147|    128|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 123]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|    128|  }
  151|    131|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 48, False: 83]
  ------------------
  152|     48|    return false;
  153|     48|  }
  154|     83|  const uint8_t *const data_head =
  155|     83|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     83|  buffer->Advance(bytes_encoded);
  158|     83|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 18, False: 65]
  ------------------
  159|     18|    return false;
  160|     18|  }
  161|     65|  return true;
  162|     83|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|  9.65M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     65|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     65|  ans_.read_end();
  167|     65|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    271|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    271|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    271|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 271]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    271|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    271|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    271|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 47, False: 224]
  ------------------
   67|     47|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 46]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     47|  } else
   72|    224|#endif
   73|    224|  {
   74|    224|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 221]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    224|  }
   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|    267|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 6, False: 261]
  ------------------
   83|      6|    return false;
   84|      6|  }
   85|    261|  probability_table_.resize(num_symbols_);
   86|    261|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 261]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  8.58k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 8.38k, False: 197]
  ------------------
   91|  8.38k|    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.38k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 32, False: 8.35k]
  ------------------
   95|     32|      return false;
   96|     32|    }
   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.35k|    const int token = prob_data & 3;
  102|  8.35k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 3.89k, False: 4.45k]
  ------------------
  103|  3.89k|      const uint32_t offset = prob_data >> 2;
  104|  3.89k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 17, False: 3.87k]
  ------------------
  105|     17|        return false;
  106|     17|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   146k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 142k, False: 3.87k]
  ------------------
  109|   142k|        probability_table_[i + j] = 0;
  110|   142k|      }
  111|  3.87k|      i += offset;
  112|  4.45k|    } else {
  113|  4.45k|      const int extra_bytes = token;
  114|  4.45k|      uint32_t prob = prob_data >> 2;
  115|  7.98k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 3.54k, False: 4.44k]
  ------------------
  116|  3.54k|        uint8_t eb;
  117|  3.54k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 15, False: 3.53k]
  ------------------
  118|     15|          return false;
  119|     15|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  3.53k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  3.53k|      }
  124|  4.44k|      probability_table_[i] = prob;
  125|  4.44k|    }
  126|  8.35k|  }
  127|    197|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 33, False: 164]
  ------------------
  128|     33|    return false;
  129|     33|  }
  130|    164|  return true;
  131|    197|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    164|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    164|    DecoderBuffer *buffer) {
  136|    164|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    164|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    164|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    164|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 33, False: 131]
  ------------------
  140|     33|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 31]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     33|  } else
  145|    131|#endif
  146|    131|  {
  147|    131|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 12, False: 119]
  ------------------
  148|     12|      return false;
  149|     12|    }
  150|    131|  }
  151|    150|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 72, False: 78]
  ------------------
  152|     72|    return false;
  153|     72|  }
  154|     78|  const uint8_t *const data_head =
  155|     78|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     78|  buffer->Advance(bytes_encoded);
  158|     78|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 21, False: 57]
  ------------------
  159|     21|    return false;
  160|     21|  }
  161|     57|  return true;
  162|     78|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|   125k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     57|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     57|  ans_.read_end();
  167|     57|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  8.17k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  8.17k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 0, False: 8.17k]
  ------------------
   35|      0|    return true;
   36|      0|  }
   37|       |  // Decode which scheme to use.
   38|  8.17k|  uint8_t scheme;
   39|  8.17k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 76, False: 8.10k]
  ------------------
   40|     76|    return false;
   41|     76|  }
   42|  8.10k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 768, False: 7.33k]
  ------------------
   43|    768|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|    768|                                                  src_buffer, out_values);
   45|  7.33k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 4.97k, False: 2.35k]
  ------------------
   46|  4.97k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  4.97k|                                               out_values);
   48|  4.97k|  }
   49|  2.35k|  return false;
   50|  8.10k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|    768|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|    768|  SymbolDecoderT<5> tag_decoder;
   57|    768|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 395, False: 373]
  ------------------
   58|    395|    return false;
   59|    395|  }
   60|       |
   61|    373|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 181, False: 192]
  ------------------
   62|    181|    return false;
   63|    181|  }
   64|       |
   65|    192|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 192, False: 0]
  |  Branch (65:25): [True: 52, False: 140]
  ------------------
   66|     52|    return false;  // Wrong number of symbols.
   67|     52|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    140|  src_buffer->StartBitDecoding(false, nullptr);
   72|    140|  int value_id = 0;
   73|   655k|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 655k, False: 138]
  ------------------
   74|       |    // Decode the tag.
   75|   655k|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  1.32M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 665k, False: 655k]
  ------------------
   78|   665k|      uint32_t val;
   79|   665k|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 2, False: 665k]
  ------------------
   80|      2|        return false;
   81|      2|      }
   82|   665k|      out_values[value_id++] = val;
   83|   665k|    }
   84|   655k|  }
   85|    138|  tag_decoder.EndDecoding();
   86|    138|  src_buffer->EndBitDecoding();
   87|    138|  return true;
   88|    140|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  4.97k|                      uint32_t *out_values) {
  117|  4.97k|  uint8_t max_bit_length;
  118|  4.97k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 27, False: 4.95k]
  ------------------
  119|     27|    return false;
  120|     27|  }
  121|  4.95k|  switch (max_bit_length) {
  122|    406|    case 1:
  ------------------
  |  Branch (122:5): [True: 406, False: 4.54k]
  ------------------
  123|    406|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    406|                                                         out_values);
  125|    332|    case 2:
  ------------------
  |  Branch (125:5): [True: 332, False: 4.62k]
  ------------------
  126|    332|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    332|                                                         out_values);
  128|    358|    case 3:
  ------------------
  |  Branch (128:5): [True: 358, False: 4.59k]
  ------------------
  129|    358|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    358|                                                         out_values);
  131|    234|    case 4:
  ------------------
  |  Branch (131:5): [True: 234, False: 4.71k]
  ------------------
  132|    234|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    234|                                                         out_values);
  134|    194|    case 5:
  ------------------
  |  Branch (134:5): [True: 194, False: 4.75k]
  ------------------
  135|    194|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    194|                                                         out_values);
  137|    250|    case 6:
  ------------------
  |  Branch (137:5): [True: 250, False: 4.70k]
  ------------------
  138|    250|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    250|                                                         out_values);
  140|    311|    case 7:
  ------------------
  |  Branch (140:5): [True: 311, False: 4.64k]
  ------------------
  141|    311|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    311|                                                         out_values);
  143|    254|    case 8:
  ------------------
  |  Branch (143:5): [True: 254, False: 4.69k]
  ------------------
  144|    254|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    254|                                                         out_values);
  146|    267|    case 9:
  ------------------
  |  Branch (146:5): [True: 267, False: 4.68k]
  ------------------
  147|    267|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    267|                                                         out_values);
  149|    233|    case 10:
  ------------------
  |  Branch (149:5): [True: 233, False: 4.71k]
  ------------------
  150|    233|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    233|          num_values, src_buffer, out_values);
  152|    233|    case 11:
  ------------------
  |  Branch (152:5): [True: 233, False: 4.71k]
  ------------------
  153|    233|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    233|          num_values, src_buffer, out_values);
  155|    215|    case 12:
  ------------------
  |  Branch (155:5): [True: 215, False: 4.73k]
  ------------------
  156|    215|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    215|          num_values, src_buffer, out_values);
  158|    198|    case 13:
  ------------------
  |  Branch (158:5): [True: 198, False: 4.75k]
  ------------------
  159|    198|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    198|          num_values, src_buffer, out_values);
  161|    235|    case 14:
  ------------------
  |  Branch (161:5): [True: 235, False: 4.71k]
  ------------------
  162|    235|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    235|          num_values, src_buffer, out_values);
  164|    214|    case 15:
  ------------------
  |  Branch (164:5): [True: 214, False: 4.73k]
  ------------------
  165|    214|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    214|          num_values, src_buffer, out_values);
  167|    248|    case 16:
  ------------------
  |  Branch (167:5): [True: 248, False: 4.70k]
  ------------------
  168|    248|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    248|          num_values, src_buffer, out_values);
  170|    248|    case 17:
  ------------------
  |  Branch (170:5): [True: 248, False: 4.70k]
  ------------------
  171|    248|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    248|          num_values, src_buffer, out_values);
  173|    271|    case 18:
  ------------------
  |  Branch (173:5): [True: 271, False: 4.68k]
  ------------------
  174|    271|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    271|          num_values, src_buffer, out_values);
  176|    251|    default:
  ------------------
  |  Branch (176:5): [True: 251, False: 4.70k]
  ------------------
  177|    251|      return false;
  178|  4.95k|  }
  179|  4.95k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    406|                              uint32_t *out_values) {
   93|    406|  SymbolDecoderT decoder;
   94|    406|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 227, False: 179]
  ------------------
   95|    227|    return false;
   96|    227|  }
   97|       |
   98|    179|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 179, False: 0]
  |  Branch (98:25): [True: 9, False: 170]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    170|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 37, False: 133]
  ------------------
  103|     37|    return false;
  104|     37|  }
  105|   122M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 122M, False: 133]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   122M|    const uint32_t value = decoder.DecodeSymbol();
  108|   122M|    out_values[i] = value;
  109|   122M|  }
  110|    133|  decoder.EndDecoding();
  111|    133|  return true;
  112|    170|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    332|                              uint32_t *out_values) {
   93|    332|  SymbolDecoderT decoder;
   94|    332|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 128, False: 204]
  ------------------
   95|    128|    return false;
   96|    128|  }
   97|       |
   98|    204|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 204, False: 0]
  |  Branch (98:25): [True: 3, False: 201]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|    201|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 73, False: 128]
  ------------------
  103|     73|    return false;
  104|     73|  }
  105|  91.8M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 91.8M, False: 128]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  91.8M|    const uint32_t value = decoder.DecodeSymbol();
  108|  91.8M|    out_values[i] = value;
  109|  91.8M|  }
  110|    128|  decoder.EndDecoding();
  111|    128|  return true;
  112|    201|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    358|                              uint32_t *out_values) {
   93|    358|  SymbolDecoderT decoder;
   94|    358|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 87, False: 271]
  ------------------
   95|     87|    return false;
   96|     87|  }
   97|       |
   98|    271|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 271, False: 0]
  |  Branch (98:25): [True: 1, False: 270]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    270|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 81, False: 189]
  ------------------
  103|     81|    return false;
  104|     81|  }
  105|  25.8M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 25.8M, False: 189]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  25.8M|    const uint32_t value = decoder.DecodeSymbol();
  108|  25.8M|    out_values[i] = value;
  109|  25.8M|  }
  110|    189|  decoder.EndDecoding();
  111|    189|  return true;
  112|    270|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    234|                              uint32_t *out_values) {
   93|    234|  SymbolDecoderT decoder;
   94|    234|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 85, False: 149]
  ------------------
   95|     85|    return false;
   96|     85|  }
   97|       |
   98|    149|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 149, False: 0]
  |  Branch (98:25): [True: 2, False: 147]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    147|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 15, False: 132]
  ------------------
  103|     15|    return false;
  104|     15|  }
  105|  3.86M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 3.86M, False: 132]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  3.86M|    const uint32_t value = decoder.DecodeSymbol();
  108|  3.86M|    out_values[i] = value;
  109|  3.86M|  }
  110|    132|  decoder.EndDecoding();
  111|    132|  return true;
  112|    147|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    194|                              uint32_t *out_values) {
   93|    194|  SymbolDecoderT decoder;
   94|    194|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 20, False: 174]
  ------------------
   95|     20|    return false;
   96|     20|  }
   97|       |
   98|    174|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 174, False: 0]
  |  Branch (98:25): [True: 101, False: 73]
  ------------------
   99|    101|    return false;  // Wrong number of symbols.
  100|    101|  }
  101|       |
  102|     73|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 6, False: 67]
  ------------------
  103|      6|    return false;
  104|      6|  }
  105|  7.02M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 7.02M, False: 67]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  7.02M|    const uint32_t value = decoder.DecodeSymbol();
  108|  7.02M|    out_values[i] = value;
  109|  7.02M|  }
  110|     67|  decoder.EndDecoding();
  111|     67|  return true;
  112|     73|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    250|                              uint32_t *out_values) {
   93|    250|  SymbolDecoderT decoder;
   94|    250|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 95, False: 155]
  ------------------
   95|     95|    return false;
   96|     95|  }
   97|       |
   98|    155|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 155, False: 0]
  |  Branch (98:25): [True: 2, False: 153]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    153|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 72, False: 81]
  ------------------
  103|     72|    return false;
  104|     72|  }
  105|  19.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 19.5M, False: 81]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  19.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  19.5M|    out_values[i] = value;
  109|  19.5M|  }
  110|     81|  decoder.EndDecoding();
  111|     81|  return true;
  112|    153|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    311|                              uint32_t *out_values) {
   93|    311|  SymbolDecoderT decoder;
   94|    311|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 125, False: 186]
  ------------------
   95|    125|    return false;
   96|    125|  }
   97|       |
   98|    186|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 186, False: 0]
  |  Branch (98:25): [True: 0, False: 186]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    186|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 53, False: 133]
  ------------------
  103|     53|    return false;
  104|     53|  }
  105|  12.8M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.8M, False: 133]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.8M|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.8M|    out_values[i] = value;
  109|  12.8M|  }
  110|    133|  decoder.EndDecoding();
  111|    133|  return true;
  112|    186|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    254|                              uint32_t *out_values) {
   93|    254|  SymbolDecoderT decoder;
   94|    254|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 105, False: 149]
  ------------------
   95|    105|    return false;
   96|    105|  }
   97|       |
   98|    149|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 149, False: 0]
  |  Branch (98:25): [True: 1, False: 148]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|    148|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 99, False: 49]
  ------------------
  103|     99|    return false;
  104|     99|  }
  105|  12.9M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.9M, False: 49]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.9M|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.9M|    out_values[i] = value;
  109|  12.9M|  }
  110|     49|  decoder.EndDecoding();
  111|     49|  return true;
  112|    148|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    267|                              uint32_t *out_values) {
   93|    267|  SymbolDecoderT decoder;
   94|    267|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 126, False: 141]
  ------------------
   95|    126|    return false;
   96|    126|  }
   97|       |
   98|    141|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 141, False: 0]
  |  Branch (98:25): [True: 2, False: 139]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    139|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 51, False: 88]
  ------------------
  103|     51|    return false;
  104|     51|  }
  105|  6.38M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.38M, False: 88]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.38M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.38M|    out_values[i] = value;
  109|  6.38M|  }
  110|     88|  decoder.EndDecoding();
  111|     88|  return true;
  112|    139|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    233|                              uint32_t *out_values) {
   93|    233|  SymbolDecoderT decoder;
   94|    233|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 113, False: 120]
  ------------------
   95|    113|    return false;
   96|    113|  }
   97|       |
   98|    120|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 120, False: 0]
  |  Branch (98:25): [True: 3, False: 117]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|    117|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 73, False: 44]
  ------------------
  103|     73|    return false;
  104|     73|  }
  105|   332k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 332k, False: 44]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   332k|    const uint32_t value = decoder.DecodeSymbol();
  108|   332k|    out_values[i] = value;
  109|   332k|  }
  110|     44|  decoder.EndDecoding();
  111|     44|  return true;
  112|    117|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    233|                              uint32_t *out_values) {
   93|    233|  SymbolDecoderT decoder;
   94|    233|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 156, False: 77]
  ------------------
   95|    156|    return false;
   96|    156|  }
   97|       |
   98|     77|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 77, False: 0]
  |  Branch (98:25): [True: 5, False: 72]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|     72|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 38, False: 34]
  ------------------
  103|     38|    return false;
  104|     38|  }
  105|   220k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 220k, False: 34]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   220k|    const uint32_t value = decoder.DecodeSymbol();
  108|   220k|    out_values[i] = value;
  109|   220k|  }
  110|     34|  decoder.EndDecoding();
  111|     34|  return true;
  112|     72|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    215|                              uint32_t *out_values) {
   93|    215|  SymbolDecoderT decoder;
   94|    215|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 112, False: 103]
  ------------------
   95|    112|    return false;
   96|    112|  }
   97|       |
   98|    103|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 103, False: 0]
  |  Branch (98:25): [True: 9, False: 94]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|     94|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 55, False: 39]
  ------------------
  103|     55|    return false;
  104|     55|  }
  105|  47.9k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 47.9k, False: 39]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  47.9k|    const uint32_t value = decoder.DecodeSymbol();
  108|  47.9k|    out_values[i] = value;
  109|  47.9k|  }
  110|     39|  decoder.EndDecoding();
  111|     39|  return true;
  112|     94|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    198|                              uint32_t *out_values) {
   93|    198|  SymbolDecoderT decoder;
   94|    198|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 128, False: 70]
  ------------------
   95|    128|    return false;
   96|    128|  }
   97|       |
   98|     70|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 70, False: 0]
  |  Branch (98:25): [True: 0, False: 70]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     70|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 29, False: 41]
  ------------------
  103|     29|    return false;
  104|     29|  }
  105|   152k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 151k, False: 41]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   151k|    const uint32_t value = decoder.DecodeSymbol();
  108|   151k|    out_values[i] = value;
  109|   151k|  }
  110|     41|  decoder.EndDecoding();
  111|     41|  return true;
  112|     70|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    235|                              uint32_t *out_values) {
   93|    235|  SymbolDecoderT decoder;
   94|    235|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 120, False: 115]
  ------------------
   95|    120|    return false;
   96|    120|  }
   97|       |
   98|    115|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 115, False: 0]
  |  Branch (98:25): [True: 2, False: 113]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    113|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 57, False: 56]
  ------------------
  103|     57|    return false;
  104|     57|  }
  105|   146k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 146k, False: 56]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   146k|    const uint32_t value = decoder.DecodeSymbol();
  108|   146k|    out_values[i] = value;
  109|   146k|  }
  110|     56|  decoder.EndDecoding();
  111|     56|  return true;
  112|    113|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    214|                              uint32_t *out_values) {
   93|    214|  SymbolDecoderT decoder;
   94|    214|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 105, False: 109]
  ------------------
   95|    105|    return false;
   96|    105|  }
   97|       |
   98|    109|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 109, False: 0]
  |  Branch (98:25): [True: 0, False: 109]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    109|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 63, False: 46]
  ------------------
  103|     63|    return false;
  104|     63|  }
  105|  4.60M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.60M, False: 46]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.60M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.60M|    out_values[i] = value;
  109|  4.60M|  }
  110|     46|  decoder.EndDecoding();
  111|     46|  return true;
  112|    109|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    248|                              uint32_t *out_values) {
   93|    248|  SymbolDecoderT decoder;
   94|    248|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 107, False: 141]
  ------------------
   95|    107|    return false;
   96|    107|  }
   97|       |
   98|    141|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 141, False: 0]
  |  Branch (98:25): [True: 3, False: 138]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|    138|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 79, False: 59]
  ------------------
  103|     79|    return false;
  104|     79|  }
  105|  19.0M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 19.0M, False: 59]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  19.0M|    const uint32_t value = decoder.DecodeSymbol();
  108|  19.0M|    out_values[i] = value;
  109|  19.0M|  }
  110|     59|  decoder.EndDecoding();
  111|     59|  return true;
  112|    138|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    248|                              uint32_t *out_values) {
   93|    248|  SymbolDecoderT decoder;
   94|    248|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 109, False: 139]
  ------------------
   95|    109|    return false;
   96|    109|  }
   97|       |
   98|    139|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 139, False: 0]
  |  Branch (98:25): [True: 3, False: 136]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|    136|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 71, False: 65]
  ------------------
  103|     71|    return false;
  104|     71|  }
  105|  9.65M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 9.65M, False: 65]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  9.65M|    const uint32_t value = decoder.DecodeSymbol();
  108|  9.65M|    out_values[i] = value;
  109|  9.65M|  }
  110|     65|  decoder.EndDecoding();
  111|     65|  return true;
  112|    136|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    271|                              uint32_t *out_values) {
   93|    271|  SymbolDecoderT decoder;
   94|    271|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 107, False: 164]
  ------------------
   95|    107|    return false;
   96|    107|  }
   97|       |
   98|    164|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 164, False: 0]
  |  Branch (98:25): [True: 0, False: 164]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    164|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 107, False: 57]
  ------------------
  103|    107|    return false;
  104|    107|  }
  105|   125k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 125k, False: 57]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   125k|    const uint32_t value = decoder.DecodeSymbol();
  108|   125k|    out_values[i] = value;
  109|   125k|  }
  110|     57|  decoder.EndDecoding();
  111|     57|  return true;
  112|    164|}

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

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

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

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

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

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  6.56k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  2.52k|  const CornerTable *GetCornerTable() const override {
   67|  2.52k|    return corner_table_.get();
   68|  2.52k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  2.77M|                       int *out_encoder_split_symbol_id) {
   87|  2.77M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 2.48M, False: 289k]
  ------------------
   88|  2.48M|      return false;
   89|  2.48M|    }
   90|   289k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 9, False: 289k]
  ------------------
   91|   289k|        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|      9|      *out_encoder_split_symbol_id = -1;
   98|      9|      return true;
   99|      9|    }
  100|   289k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 288k, False: 1.11k]
  ------------------
  101|   288k|      return false;
  102|   288k|    }
  103|  1.11k|    *out_face_edge =
  104|  1.11k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.11k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.11k|    topology_split_data_.pop_back();
  108|  1.11k|    return true;
  109|   289k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  11.4M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  11.4M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  11.4M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  11.4M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  9.45k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  4.14k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  2.87k|  const CornerTable *GetCornerTable() const override {
   67|  2.87k|    return corner_table_.get();
   68|  2.87k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  18.9M|                       int *out_encoder_split_symbol_id) {
   87|  18.9M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 16.6M, False: 2.37M]
  ------------------
   88|  16.6M|      return false;
   89|  16.6M|    }
   90|  2.37M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 37, False: 2.37M]
  ------------------
   91|  2.37M|        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|  2.37M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 2.37M, False: 1.09k]
  ------------------
  101|  2.37M|      return false;
  102|  2.37M|    }
  103|  1.09k|    *out_face_edge =
  104|  1.09k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.09k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.09k|    topology_split_data_.pop_back();
  108|  1.09k|    return true;
  109|  2.37M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  56.4M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  56.4M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  56.4M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  56.4M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  4.15k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  9.01k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  1.85k|  const CornerTable *GetCornerTable() const override {
   67|  1.85k|    return corner_table_.get();
   68|  1.85k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  64.5M|                       int *out_encoder_split_symbol_id) {
   87|  64.5M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 64.0M, False: 471k]
  ------------------
   88|  64.0M|      return false;
   89|  64.0M|    }
   90|   471k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 30, False: 470k]
  ------------------
   91|   471k|        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|     30|      *out_encoder_split_symbol_id = -1;
   98|     30|      return true;
   99|     30|    }
  100|   470k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 469k, False: 1.02k]
  ------------------
  101|   469k|      return false;
  102|   469k|    }
  103|  1.02k|    *out_face_edge =
  104|  1.02k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.02k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.02k|    topology_split_data_.pop_back();
  108|  1.02k|    return true;
  109|   470k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  74.0M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  74.0M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  74.0M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  74.0M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  2.22k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

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

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

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

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

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.08k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.06M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.06M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 2.00M, False: 58.9k]
  ------------------
   61|  2.00M|      return true;  // Already traversed.
   62|  2.00M|    }
   63|       |
   64|  58.9k|    corner_traversal_stack_.clear();
   65|  58.9k|    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|  58.9k|    const VertexIndex next_vert =
   69|  58.9k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  58.9k|    const VertexIndex prev_vert =
   71|  58.9k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  58.9k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 58.9k]
  |  Branch (72:45): [True: 0, False: 58.9k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  58.9k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 58.1k, False: 755]
  ------------------
   76|  58.1k|      this->MarkVertexVisited(next_vert);
   77|  58.1k|      this->traversal_observer().OnNewVertexVisited(
   78|  58.1k|          next_vert, this->corner_table()->Next(corner_id));
   79|  58.1k|    }
   80|  58.9k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 3.75k, False: 55.1k]
  ------------------
   81|  3.75k|      this->MarkVertexVisited(prev_vert);
   82|  3.75k|      this->traversal_observer().OnNewVertexVisited(
   83|  3.75k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  3.75k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|   130k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 71.7k, False: 58.9k]
  ------------------
   88|       |      // Currently processed corner.
   89|  71.7k|      corner_id = corner_traversal_stack_.back();
   90|  71.7k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  71.7k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 71.7k]
  |  Branch (92:47): [True: 697, False: 71.0k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    697|        corner_traversal_stack_.pop_back();
   95|    697|        continue;
   96|    697|      }
   97|  2.06M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 2.06M, Folded]
  ------------------
   98|  2.06M|        this->MarkFaceVisited(face_id);
   99|  2.06M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.06M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.06M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.06M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.06M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.01M, False: 1.04M]
  ------------------
  105|  1.01M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.01M|          this->MarkVertexVisited(vert_id);
  107|  1.01M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.01M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 989k, False: 28.1k]
  ------------------
  109|   989k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   989k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   989k|            continue;
  112|   989k|          }
  113|  1.01M|        }
  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.07M|        const CornerIndex right_corner_id =
  118|  1.07M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.07M|        const CornerIndex left_corner_id =
  120|  1.07M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.07M|        const FaceIndex right_face_id(
  122|  1.07M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 20.3k, False: 1.05M]
  ------------------
  123|  1.07M|                 ? kInvalidFaceIndex
  124|  1.07M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.07M|        const FaceIndex left_face_id(
  126|  1.07M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 65.6k, False: 1.00M]
  ------------------
  127|  1.07M|                 ? kInvalidFaceIndex
  128|  1.07M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.07M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.01M, False: 57.7k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.01M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 64.6k, False: 953k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  64.6k|            corner_traversal_stack_.pop_back();
  134|  64.6k|            break;  // Break from the while (true) loop.
  135|   953k|          } else {
  136|       |            // Go to the left face.
  137|   953k|            corner_id = left_corner_id;
  138|   953k|            face_id = left_face_id;
  139|   953k|          }
  140|  1.01M|        } else {
  141|       |          // Right face was not visited.
  142|  57.7k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 51.3k, False: 6.38k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  51.3k|            corner_id = right_corner_id;
  145|  51.3k|            face_id = right_face_id;
  146|  51.3k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  6.38k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  6.38k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  6.38k|            break;
  159|  6.38k|          }
  160|  57.7k|        }
  161|  1.07M|      }
  162|  71.0k|    }
  163|  58.9k|    return true;
  164|  58.9k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.08k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.27k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.53k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.96M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.96M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.07M, False: 1.88M]
  ------------------
   61|  1.07M|      return true;  // Already traversed.
   62|  1.07M|    }
   63|       |
   64|  1.88M|    corner_traversal_stack_.clear();
   65|  1.88M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  1.88M|    const VertexIndex next_vert =
   69|  1.88M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  1.88M|    const VertexIndex prev_vert =
   71|  1.88M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  1.88M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 1.88M]
  |  Branch (72:45): [True: 0, False: 1.88M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  1.88M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 1.88M, False: 943]
  ------------------
   76|  1.88M|      this->MarkVertexVisited(next_vert);
   77|  1.88M|      this->traversal_observer().OnNewVertexVisited(
   78|  1.88M|          next_vert, this->corner_table()->Next(corner_id));
   79|  1.88M|    }
   80|  1.88M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 1.85M, False: 29.7k]
  ------------------
   81|  1.85M|      this->MarkVertexVisited(prev_vert);
   82|  1.85M|      this->traversal_observer().OnNewVertexVisited(
   83|  1.85M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  1.85M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  3.82M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 1.93M, False: 1.88M]
  ------------------
   88|       |      // Currently processed corner.
   89|  1.93M|      corner_id = corner_traversal_stack_.back();
   90|  1.93M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  1.93M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 1.93M]
  |  Branch (92:47): [True: 3.66k, False: 1.93M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  3.66k|        corner_traversal_stack_.pop_back();
   95|  3.66k|        continue;
   96|  3.66k|      }
   97|  2.96M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 2.96M, Folded]
  ------------------
   98|  2.96M|        this->MarkFaceVisited(face_id);
   99|  2.96M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.96M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.96M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.96M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.96M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 2.41M, False: 545k]
  ------------------
  105|  2.41M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  2.41M|          this->MarkVertexVisited(vert_id);
  107|  2.41M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  2.41M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 507k, False: 1.90M]
  ------------------
  109|   507k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   507k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   507k|            continue;
  112|   507k|          }
  113|  2.41M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  2.45M|        const CornerIndex right_corner_id =
  118|  2.45M|            this->corner_table()->GetRightCorner(corner_id);
  119|  2.45M|        const CornerIndex left_corner_id =
  120|  2.45M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  2.45M|        const FaceIndex right_face_id(
  122|  2.45M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 1.88M, False: 567k]
  ------------------
  123|  2.45M|                 ? kInvalidFaceIndex
  124|  2.45M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  2.45M|        const FaceIndex left_face_id(
  126|  2.45M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 1.90M, False: 546k]
  ------------------
  127|  2.45M|                 ? kInvalidFaceIndex
  128|  2.45M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  2.45M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 2.38M, False: 66.5k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  2.38M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 1.90M, False: 478k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  1.90M|            corner_traversal_stack_.pop_back();
  134|  1.90M|            break;  // Break from the while (true) loop.
  135|  1.90M|          } else {
  136|       |            // Go to the left face.
  137|   478k|            corner_id = left_corner_id;
  138|   478k|            face_id = left_face_id;
  139|   478k|          }
  140|  2.38M|        } else {
  141|       |          // Right face was not visited.
  142|  66.5k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 40.5k, False: 25.9k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  40.5k|            corner_id = right_corner_id;
  145|  40.5k|            face_id = right_face_id;
  146|  40.5k|          } 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|  25.9k|            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|  25.9k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  25.9k|            break;
  159|  25.9k|          }
  160|  66.5k|        }
  161|  2.45M|      }
  162|  1.93M|    }
  163|  1.88M|    return true;
  164|  1.88M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.53k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  3.16k|  DepthFirstTraverser() {}

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

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    441|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|    828|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|    828|    const auto *corner_table = traverser_.corner_table();
   50|    828|    attribute->SetExplicitMapping(mesh_->num_points());
   51|    828|    const size_t num_faces = mesh_->num_faces();
   52|    828|    const size_t num_points = mesh_->num_points();
   53|  4.01M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 4.01M, False: 828]
  ------------------
   54|  4.01M|      const auto &face = mesh_->face(f);
   55|  16.0M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 12.0M, False: 4.01M]
  ------------------
   56|  12.0M|        const PointIndex point_id = face[p];
   57|  12.0M|        const VertexIndex vert_id =
   58|  12.0M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  12.0M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 12.0M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  12.0M|        const AttributeValueIndex att_entry_id(
   63|  12.0M|            encoding_data_
   64|  12.0M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  12.0M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 12.0M]
  |  Branch (65:13): [True: 0, False: 12.0M]
  |  Branch (65:39): [True: 0, False: 12.0M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  12.0M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  12.0M|      }
   71|  4.01M|    }
   72|    828|    return true;
   73|    828|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    407|  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|    407|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    407|    traverser_.OnTraversalStart();
   82|    407|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 407]
  ------------------
   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|    407|    } else {
   89|    407|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.24M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.24M, False: 407]
  ------------------
   91|  2.24M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.24M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.24M|      }
   95|    407|    }
   96|    407|    traverser_.OnTraversalEnd();
   97|    407|    return true;
   98|    407|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.24M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.24M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.24M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    441|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.13k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  5.64k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  5.64k|    const auto *corner_table = traverser_.corner_table();
   50|  5.64k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  5.64k|    const size_t num_faces = mesh_->num_faces();
   52|  5.64k|    const size_t num_points = mesh_->num_points();
   53|  3.65M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 3.65M, False: 5.64k]
  ------------------
   54|  3.65M|      const auto &face = mesh_->face(f);
   55|  14.6M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 10.9M, False: 3.65M]
  ------------------
   56|  10.9M|        const PointIndex point_id = face[p];
   57|  10.9M|        const VertexIndex vert_id =
   58|  10.9M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  10.9M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 10.9M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  10.9M|        const AttributeValueIndex att_entry_id(
   63|  10.9M|            encoding_data_
   64|  10.9M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  10.9M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 10.9M]
  |  Branch (65:13): [True: 0, False: 10.9M]
  |  Branch (65:39): [True: 0, False: 10.9M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  10.9M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  10.9M|      }
   71|  3.65M|    }
   72|  5.64k|    return true;
   73|  5.64k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.08k|  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.08k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.08k|    traverser_.OnTraversalStart();
   82|  1.08k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.08k]
  ------------------
   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.08k|    } else {
   89|  1.08k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.06M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.06M, False: 1.08k]
  ------------------
   91|  2.06M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.06M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.06M|      }
   95|  1.08k|    }
   96|  1.08k|    traverser_.OnTraversalEnd();
   97|  1.08k|    return true;
   98|  1.08k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.06M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.06M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.06M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.13k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.58k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  5.18k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  5.18k|    const auto *corner_table = traverser_.corner_table();
   50|  5.18k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  5.18k|    const size_t num_faces = mesh_->num_faces();
   52|  5.18k|    const size_t num_points = mesh_->num_points();
   53|  5.04M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 5.03M, False: 5.17k]
  ------------------
   54|  5.03M|      const auto &face = mesh_->face(f);
   55|  20.1M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 15.1M, False: 5.03M]
  ------------------
   56|  15.1M|        const PointIndex point_id = face[p];
   57|  15.1M|        const VertexIndex vert_id =
   58|  15.1M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  15.1M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 15.1M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  15.1M|        const AttributeValueIndex att_entry_id(
   63|  15.1M|            encoding_data_
   64|  15.1M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  15.1M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 15.1M]
  |  Branch (65:13): [True: 1, False: 15.1M]
  |  Branch (65:39): [True: 1, False: 15.1M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      1|          return false;
   68|      1|        }
   69|  15.1M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  15.1M|      }
   71|  5.03M|    }
   72|  5.17k|    return true;
   73|  5.18k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.53k|  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.53k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.53k|    traverser_.OnTraversalStart();
   82|  1.53k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.53k]
  ------------------
   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.53k|    } else {
   89|  1.53k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.96M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.96M, False: 1.53k]
  ------------------
   91|  2.96M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.96M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.96M|      }
   95|  1.53k|    }
   96|  1.53k|    traverser_.OnTraversalEnd();
   97|  1.53k|    return true;
   98|  1.53k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.96M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.96M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.96M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.58k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.16k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  27.8M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  14.4M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  14.4M|    return is_vertex_visited_[vert_id.value()];
   65|  14.4M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  2.22M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  2.22M|    is_vertex_visited_[vert_id.value()] = true;
   68|  2.22M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  6.53M|  inline TraversalObserverT &traversal_observer() {
   75|  6.53M|    return traversal_observer_;
   76|  6.53M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  11.1M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  11.1M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 131k, False: 10.9M]
  ------------------
   47|   131k|      return true;  // Invalid faces are always considered as visited.
   48|   131k|    }
   49|  10.9M|    return is_face_visited_[face_id.value()];
   50|  11.1M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  4.30M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  4.30M|    is_face_visited_[face_id.value()] = true;
   62|  4.30M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.15k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.15k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.57k|                    TraversalObserver traversal_observer) {
   37|  1.57k|    corner_table_ = corner_table;
   38|  1.57k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.57k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.57k|    traversal_observer_ = traversal_observer;
   41|  1.57k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.06M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.06M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.06M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.06M|    return is_face_visited_[corner_id.value() / 3];
   58|  2.06M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  22.0M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.96M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.96M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.96M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.96M|    return is_face_visited_[corner_id.value() / 3];
   58|  2.96M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  6.73M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  6.73M|    return is_vertex_visited_[vert_id.value()];
   65|  6.73M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  6.15M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  6.15M|    is_vertex_visited_[vert_id.value()] = true;
   68|  6.15M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  9.12M|  inline TraversalObserverT &traversal_observer() {
   75|  9.12M|    return traversal_observer_;
   76|  9.12M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  6.84M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  6.84M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 3.79M, False: 3.05M]
  ------------------
   47|  3.79M|      return true;  // Invalid faces are always considered as visited.
   48|  3.79M|    }
   49|  3.05M|    return is_face_visited_[face_id.value()];
   50|  6.84M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  2.96M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  2.96M|    is_face_visited_[face_id.value()] = true;
   62|  2.96M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.16k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.58k|                    TraversalObserver traversal_observer) {
   37|  1.58k|    corner_table_ = corner_table;
   38|  1.58k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.58k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.58k|    traversal_observer_ = traversal_observer;
   41|  1.58k|  }

_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    194|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    194|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 10, False: 184]
  ------------------
  187|     10|    return false;
  188|     10|  }
  189|    184|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 11, False: 173]
  ------------------
  190|     11|    return false;
  191|     11|  }
  192|    173|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 3, False: 170]
  ------------------
  193|      3|    return false;
  194|      3|  }
  195|    170|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 81, False: 89]
  ------------------
  196|     81|    return true;
  197|     81|  }
  198|     89|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 6, False: 83]
  ------------------
  199|      6|    return false;
  200|      6|  }
  201|     83|  num_decoded_points_ = 0;
  202|       |
  203|     83|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 6, False: 77]
  ------------------
  204|      6|    return false;
  205|      6|  }
  206|     77|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 74]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     74|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 72]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     72|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 71]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     71|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 54, False: 17]
  ------------------
  217|     54|    return false;
  218|     54|  }
  219|       |
  220|     17|  numbers_decoder_.EndDecoding();
  221|     17|  remaining_bits_decoder_.EndDecoding();
  222|     17|  axis_decoder_.EndDecoding();
  223|     17|  half_decoder_.EndDecoding();
  224|       |
  225|     17|  return true;
  226|     71|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     71|    uint32_t num_points, OutputIteratorT &oit) {
  254|     71|  typedef DecodingStatus Status;
  255|     71|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     71|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     71|  DecodingStatus init_status(num_points, 0, 0);
  258|     71|  std::stack<Status> status_stack;
  259|     71|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   569k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 569k, False: 17]
  ------------------
  263|   569k|    const DecodingStatus status = status_stack.top();
  264|   569k|    status_stack.pop();
  265|       |
  266|   569k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   569k|    const uint32_t last_axis = status.last_axis;
  268|   569k|    const uint32_t stack_pos = status.stack_pos;
  269|   569k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   569k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   569k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 569k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   569k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   569k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 569k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|   569k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   569k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 281k, False: 287k]
  ------------------
  285|   109M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 109M, False: 281k]
  ------------------
  286|   109M|        *oit = old_base;
  287|   109M|        ++oit;
  288|   109M|        ++num_decoded_points_;
  289|   109M|      }
  290|   281k|      continue;
  291|   281k|    }
  292|       |
  293|   287k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   287k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 2.53k, False: 285k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  2.53k|      axes_[0] = axis;
  300|  8.04k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 5.50k, False: 2.53k]
  ------------------
  301|  5.50k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  5.50k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.39k, False: 4.11k]
  |  |  ------------------
  ------------------
  302|  5.50k|      }
  303|  6.73k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 4.22k, False: 2.51k]
  ------------------
  304|  16.9k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 12.7k, False: 4.20k]
  ------------------
  305|  12.7k|          p_[axes_[j]] = 0;
  306|  12.7k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  12.7k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 10.5k, False: 2.17k]
  ------------------
  308|  10.5k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 23, False: 10.5k]
  ------------------
  309|  10.5k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     23|              return false;
  311|     23|            }
  312|  10.5k|          }
  313|  12.7k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  12.7k|        }
  315|  4.20k|        *oit = p_;
  316|  4.20k|        ++oit;
  317|  4.20k|        ++num_decoded_points_;
  318|  4.20k|      }
  319|  2.51k|      continue;
  320|  2.53k|    }
  321|       |
  322|   285k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 285k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   285k|    const int num_remaining_bits = bit_length_ - level;
  327|   285k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   285k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   285k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   285k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   285k|    uint32_t number = 0;
  334|   285k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   285k|    uint32_t first_half = num_remaining_points / 2;
  337|   285k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 31, False: 285k]
  ------------------
  338|       |      // Invalid |number|.
  339|     31|      return false;
  340|     31|    }
  341|   285k|    first_half -= number;
  342|   285k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   285k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 172k, False: 112k]
  ------------------
  345|   172k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 170k, False: 1.46k]
  ------------------
  346|   170k|        std::swap(first_half, second_half);
  347|   170k|      }
  348|   172k|    }
  349|       |
  350|   285k|    levels_stack_[stack_pos][axis] += 1;
  351|   285k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   285k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 284k, False: 92]
  ------------------
  353|   284k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   284k|    }
  355|   285k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 284k, False: 223]
  ------------------
  356|   284k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   284k|    }
  358|   285k|  }
  359|     17|  return true;
  360|     71|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodingStatusC2Ejjj:
  134|  2.49M|        : num_remaining_points(num_remaining_points_),
  135|  2.49M|          last_axis(last_axis_),
  136|  2.49M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodeNumberEiPj:
  127|  1.24M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.24M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.24M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi0EE18num_decoded_pointsEv:
  118|     77|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EEC2Ej:
   86|    290|      : bit_length_(0),
   87|    290|        num_points_(0),
   88|    290|        num_decoded_points_(0),
   89|    290|        dimension_(dimension),
   90|    290|        p_(dimension, 0),
   91|    290|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    290|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    290|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    132|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    132|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 2, False: 130]
  ------------------
  187|      2|    return false;
  188|      2|  }
  189|    130|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 127]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|    127|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 126]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    126|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 25, False: 101]
  ------------------
  196|     25|    return true;
  197|     25|  }
  198|    101|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 5, False: 96]
  ------------------
  199|      5|    return false;
  200|      5|  }
  201|     96|  num_decoded_points_ = 0;
  202|       |
  203|     96|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 6, False: 90]
  ------------------
  204|      6|    return false;
  205|      6|  }
  206|     90|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 86]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     86|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 83]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     83|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 82]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     82|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 59, False: 23]
  ------------------
  217|     59|    return false;
  218|     59|  }
  219|       |
  220|     23|  numbers_decoder_.EndDecoding();
  221|     23|  remaining_bits_decoder_.EndDecoding();
  222|     23|  axis_decoder_.EndDecoding();
  223|     23|  half_decoder_.EndDecoding();
  224|       |
  225|     23|  return true;
  226|     82|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     82|    uint32_t num_points, OutputIteratorT &oit) {
  254|     82|  typedef DecodingStatus Status;
  255|     82|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     82|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     82|  DecodingStatus init_status(num_points, 0, 0);
  258|     82|  std::stack<Status> status_stack;
  259|     82|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.11M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.11M, False: 23]
  ------------------
  263|  2.11M|    const DecodingStatus status = status_stack.top();
  264|  2.11M|    status_stack.pop();
  265|       |
  266|  2.11M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.11M|    const uint32_t last_axis = status.last_axis;
  268|  2.11M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.11M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.11M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.11M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.11M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.11M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.11M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.11M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.11M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.11M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.05M, False: 1.05M]
  ------------------
  285|   313M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 312M, False: 1.05M]
  ------------------
  286|   312M|        *oit = old_base;
  287|   312M|        ++oit;
  288|   312M|        ++num_decoded_points_;
  289|   312M|      }
  290|  1.05M|      continue;
  291|  1.05M|    }
  292|       |
  293|  1.05M|    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.05M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.53k, False: 1.05M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.53k|      axes_[0] = axis;
  300|  9.11k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 7.57k, False: 1.53k]
  ------------------
  301|  7.57k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  7.57k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 490, False: 7.08k]
  |  |  ------------------
  ------------------
  302|  7.57k|      }
  303|  4.19k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.69k, False: 1.50k]
  ------------------
  304|  16.8k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 14.1k, False: 2.66k]
  ------------------
  305|  14.1k|          p_[axes_[j]] = 0;
  306|  14.1k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  14.1k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 6.15k, False: 7.99k]
  ------------------
  308|  6.15k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 31, False: 6.12k]
  ------------------
  309|  6.15k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     31|              return false;
  311|     31|            }
  312|  6.15k|          }
  313|  14.1k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  14.1k|        }
  315|  2.66k|        *oit = p_;
  316|  2.66k|        ++oit;
  317|  2.66k|        ++num_decoded_points_;
  318|  2.66k|      }
  319|  1.50k|      continue;
  320|  1.53k|    }
  321|       |
  322|  1.05M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.05M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.05M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.05M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.05M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.05M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.05M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.05M|    uint32_t number = 0;
  334|  1.05M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.05M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.05M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 28, False: 1.05M]
  ------------------
  338|       |      // Invalid |number|.
  339|     28|      return false;
  340|     28|    }
  341|  1.05M|    first_half -= number;
  342|  1.05M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.05M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 540k, False: 516k]
  ------------------
  345|   540k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 536k, False: 4.33k]
  ------------------
  346|   536k|        std::swap(first_half, second_half);
  347|   536k|      }
  348|   540k|    }
  349|       |
  350|  1.05M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.05M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.05M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.05M, False: 73]
  ------------------
  353|  1.05M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.05M|    }
  355|  1.05M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.05M, False: 174]
  ------------------
  356|  1.05M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.05M|    }
  358|  1.05M|  }
  359|     23|  return true;
  360|     82|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE14DecodingStatusC2Ejjj:
  134|  5.00M|        : num_remaining_points(num_remaining_points_),
  135|  5.00M|          last_axis(last_axis_),
  136|  5.00M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  5.00M|    uint32_t last_axis) {
  232|  5.00M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 5.00M, Folded]
  ------------------
  233|  5.00M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  5.00M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.17M, False: 2.82M]
  |  |  ------------------
  ------------------
  234|  5.00M|  }
  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.00M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodeNumberEiPj:
  127|  2.50M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  2.50M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  2.50M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi1EE18num_decoded_pointsEv:
  118|     22|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    125|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    125|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 2, False: 123]
  ------------------
  187|      2|    return false;
  188|      2|  }
  189|    123|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 7, False: 116]
  ------------------
  190|      7|    return false;
  191|      7|  }
  192|    116|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 116]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    116|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 15, False: 101]
  ------------------
  196|     15|    return true;
  197|     15|  }
  198|    101|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 7, False: 94]
  ------------------
  199|      7|    return false;
  200|      7|  }
  201|     94|  num_decoded_points_ = 0;
  202|       |
  203|     94|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 7, False: 87]
  ------------------
  204|      7|    return false;
  205|      7|  }
  206|     87|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 83]
  ------------------
  207|      4|    return false;
  208|      4|  }
  209|     83|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 82]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     82|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 80]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     80|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 76, False: 4]
  ------------------
  217|     76|    return false;
  218|     76|  }
  219|       |
  220|      4|  numbers_decoder_.EndDecoding();
  221|      4|  remaining_bits_decoder_.EndDecoding();
  222|      4|  axis_decoder_.EndDecoding();
  223|      4|  half_decoder_.EndDecoding();
  224|       |
  225|      4|  return true;
  226|     80|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     80|    uint32_t num_points, OutputIteratorT &oit) {
  254|     80|  typedef DecodingStatus Status;
  255|     80|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     80|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     80|  DecodingStatus init_status(num_points, 0, 0);
  258|     80|  std::stack<Status> status_stack;
  259|     80|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  33.9k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 33.9k, False: 4]
  ------------------
  263|  33.9k|    const DecodingStatus status = status_stack.top();
  264|  33.9k|    status_stack.pop();
  265|       |
  266|  33.9k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  33.9k|    const uint32_t last_axis = status.last_axis;
  268|  33.9k|    const uint32_t stack_pos = status.stack_pos;
  269|  33.9k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  33.9k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  33.9k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 33.9k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  33.9k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  33.9k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 33.9k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  33.9k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  33.9k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 5.63k, False: 28.3k]
  ------------------
  285|  8.83M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 8.82M, False: 5.63k]
  ------------------
  286|  8.82M|        *oit = old_base;
  287|  8.82M|        ++oit;
  288|  8.82M|        ++num_decoded_points_;
  289|  8.82M|      }
  290|  5.63k|      continue;
  291|  5.63k|    }
  292|       |
  293|  28.3k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  28.3k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 564, False: 27.7k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    564|      axes_[0] = axis;
  300|  1.65k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 1.08k, False: 564]
  ------------------
  301|  1.08k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  1.08k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 127, False: 959]
  |  |  ------------------
  ------------------
  302|  1.08k|      }
  303|  1.50k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 960, False: 544]
  ------------------
  304|  3.20k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 2.26k, False: 940]
  ------------------
  305|  2.26k|          p_[axes_[j]] = 0;
  306|  2.26k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  2.26k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 1.63k, False: 632]
  ------------------
  308|  1.63k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 20, False: 1.61k]
  ------------------
  309|  1.63k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     20|              return false;
  311|     20|            }
  312|  1.63k|          }
  313|  2.24k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  2.24k|        }
  315|    940|        *oit = p_;
  316|    940|        ++oit;
  317|    940|        ++num_decoded_points_;
  318|    940|      }
  319|    544|      continue;
  320|    564|    }
  321|       |
  322|  27.7k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 27.7k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  27.7k|    const int num_remaining_bits = bit_length_ - level;
  327|  27.7k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  27.7k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  27.7k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  27.7k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  27.7k|    uint32_t number = 0;
  334|  27.7k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  27.7k|    uint32_t first_half = num_remaining_points / 2;
  337|  27.7k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 56, False: 27.6k]
  ------------------
  338|       |      // Invalid |number|.
  339|     56|      return false;
  340|     56|    }
  341|  27.6k|    first_half -= number;
  342|  27.6k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  27.6k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 24.5k, False: 3.08k]
  ------------------
  345|  24.5k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 21.5k, False: 3.08k]
  ------------------
  346|  21.5k|        std::swap(first_half, second_half);
  347|  21.5k|      }
  348|  24.5k|    }
  349|       |
  350|  27.6k|    levels_stack_[stack_pos][axis] += 1;
  351|  27.6k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  27.6k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 25.3k, False: 2.31k]
  ------------------
  353|  25.3k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  25.3k|    }
  355|  27.6k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 8.93k, False: 18.7k]
  ------------------
  356|  8.93k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  8.93k|    }
  358|  27.6k|  }
  359|      4|  return true;
  360|     80|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodingStatusC2Ejjj:
  134|  4.25M|        : num_remaining_points(num_remaining_points_),
  135|  4.25M|          last_axis(last_axis_),
  136|  4.25M|          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|     18|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EEC2Ej:
   86|    216|      : bit_length_(0),
   87|    216|        num_points_(0),
   88|    216|        num_decoded_points_(0),
   89|    216|        dimension_(dimension),
   90|    216|        p_(dimension, 0),
   91|    216|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    216|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    216|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    129|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    129|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 1, False: 128]
  ------------------
  187|      1|    return false;
  188|      1|  }
  189|    128|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 15, False: 113]
  ------------------
  190|     15|    return false;
  191|     15|  }
  192|    113|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 1, False: 112]
  ------------------
  193|      1|    return false;
  194|      1|  }
  195|    112|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 11, False: 101]
  ------------------
  196|     11|    return true;
  197|     11|  }
  198|    101|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 4, False: 97]
  ------------------
  199|      4|    return false;
  200|      4|  }
  201|     97|  num_decoded_points_ = 0;
  202|       |
  203|     97|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 2, False: 95]
  ------------------
  204|      2|    return false;
  205|      2|  }
  206|     95|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 2, False: 93]
  ------------------
  207|      2|    return false;
  208|      2|  }
  209|     93|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 92]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     92|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 91]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     91|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 81, False: 10]
  ------------------
  217|     81|    return false;
  218|     81|  }
  219|       |
  220|     10|  numbers_decoder_.EndDecoding();
  221|     10|  remaining_bits_decoder_.EndDecoding();
  222|     10|  axis_decoder_.EndDecoding();
  223|     10|  half_decoder_.EndDecoding();
  224|       |
  225|     10|  return true;
  226|     91|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     91|    uint32_t num_points, OutputIteratorT &oit) {
  254|     91|  typedef DecodingStatus Status;
  255|     91|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     91|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     91|  DecodingStatus init_status(num_points, 0, 0);
  258|     91|  std::stack<Status> status_stack;
  259|     91|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  35.0k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 35.0k, False: 10]
  ------------------
  263|  35.0k|    const DecodingStatus status = status_stack.top();
  264|  35.0k|    status_stack.pop();
  265|       |
  266|  35.0k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  35.0k|    const uint32_t last_axis = status.last_axis;
  268|  35.0k|    const uint32_t stack_pos = status.stack_pos;
  269|  35.0k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  35.0k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  35.0k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 35.0k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  35.0k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  35.0k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 35.0k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  35.0k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  35.0k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 6.29k, False: 28.7k]
  ------------------
  285|  54.8M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 54.8M, False: 6.29k]
  ------------------
  286|  54.8M|        *oit = old_base;
  287|  54.8M|        ++oit;
  288|  54.8M|        ++num_decoded_points_;
  289|  54.8M|      }
  290|  6.29k|      continue;
  291|  6.29k|    }
  292|       |
  293|  28.7k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  28.7k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.88k, False: 26.8k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.88k|      axes_[0] = axis;
  300|  4.66k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.78k, False: 1.88k]
  ------------------
  301|  2.78k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.78k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 601, False: 2.17k]
  |  |  ------------------
  ------------------
  302|  2.78k|      }
  303|  4.91k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 3.04k, False: 1.86k]
  ------------------
  304|  10.5k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 7.48k, False: 3.03k]
  ------------------
  305|  7.48k|          p_[axes_[j]] = 0;
  306|  7.48k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  7.48k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 5.43k, False: 2.05k]
  ------------------
  308|  5.43k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 17, False: 5.41k]
  ------------------
  309|  5.43k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     17|              return false;
  311|     17|            }
  312|  5.43k|          }
  313|  7.46k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  7.46k|        }
  315|  3.03k|        *oit = p_;
  316|  3.03k|        ++oit;
  317|  3.03k|        ++num_decoded_points_;
  318|  3.03k|      }
  319|  1.86k|      continue;
  320|  1.88k|    }
  321|       |
  322|  26.8k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 26.8k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  26.8k|    const int num_remaining_bits = bit_length_ - level;
  327|  26.8k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  26.8k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  26.8k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  26.8k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  26.8k|    uint32_t number = 0;
  334|  26.8k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  26.8k|    uint32_t first_half = num_remaining_points / 2;
  337|  26.8k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 64, False: 26.7k]
  ------------------
  338|       |      // Invalid |number|.
  339|     64|      return false;
  340|     64|    }
  341|  26.7k|    first_half -= number;
  342|  26.7k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  26.7k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 21.4k, False: 5.34k]
  ------------------
  345|  21.4k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 19.0k, False: 2.38k]
  ------------------
  346|  19.0k|        std::swap(first_half, second_half);
  347|  19.0k|      }
  348|  21.4k|    }
  349|       |
  350|  26.7k|    levels_stack_[stack_pos][axis] += 1;
  351|  26.7k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  26.7k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 24.9k, False: 1.83k]
  ------------------
  353|  24.9k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  24.9k|    }
  355|  26.7k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 10.5k, False: 16.2k]
  ------------------
  356|  10.5k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  10.5k|    }
  358|  26.7k|  }
  359|     10|  return true;
  360|     91|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodingStatusC2Ejjj:
  134|  70.0k|        : num_remaining_points(num_remaining_points_),
  135|  70.0k|          last_axis(last_axis_),
  136|  70.0k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  68.3k|    uint32_t last_axis) {
  232|  68.3k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 68.3k, Folded]
  ------------------
  233|  68.3k|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  68.3k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 17.4k, False: 50.9k]
  |  |  ------------------
  ------------------
  234|  68.3k|  }
  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|  68.3k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodeNumberEiPj:
  127|  44.1k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  44.1k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  44.1k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi3EE18num_decoded_pointsEv:
  118|     15|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_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: 2, False: 123]
  ------------------
  190|      2|    return false;
  191|      2|  }
  192|    123|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 123]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    123|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 23, False: 100]
  ------------------
  196|     23|    return true;
  197|     23|  }
  198|    100|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 9, False: 91]
  ------------------
  199|      9|    return false;
  200|      9|  }
  201|     91|  num_decoded_points_ = 0;
  202|       |
  203|     91|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 10, False: 81]
  ------------------
  204|     10|    return false;
  205|     10|  }
  206|     81|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 80]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     80|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 6, False: 74]
  ------------------
  210|      6|    return false;
  211|      6|  }
  212|     74|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 73]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     73|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 51, False: 22]
  ------------------
  217|     51|    return false;
  218|     51|  }
  219|       |
  220|     22|  numbers_decoder_.EndDecoding();
  221|     22|  remaining_bits_decoder_.EndDecoding();
  222|     22|  axis_decoder_.EndDecoding();
  223|     22|  half_decoder_.EndDecoding();
  224|       |
  225|     22|  return true;
  226|     73|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     73|    uint32_t num_points, OutputIteratorT &oit) {
  254|     73|  typedef DecodingStatus Status;
  255|     73|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     73|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     73|  DecodingStatus init_status(num_points, 0, 0);
  258|     73|  std::stack<Status> status_stack;
  259|     73|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.42M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.42M, False: 22]
  ------------------
  263|  2.42M|    const DecodingStatus status = status_stack.top();
  264|  2.42M|    status_stack.pop();
  265|       |
  266|  2.42M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.42M|    const uint32_t last_axis = status.last_axis;
  268|  2.42M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.42M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.42M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.42M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.42M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.42M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.42M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.42M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.42M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.42M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.13M, False: 1.28M]
  ------------------
  285|  56.6M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 55.4M, False: 1.13M]
  ------------------
  286|  55.4M|        *oit = old_base;
  287|  55.4M|        ++oit;
  288|  55.4M|        ++num_decoded_points_;
  289|  55.4M|      }
  290|  1.13M|      continue;
  291|  1.13M|    }
  292|       |
  293|  1.28M|    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.28M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 59.0k, False: 1.22M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  59.0k|      axes_[0] = axis;
  300|  97.4k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 38.4k, False: 59.0k]
  ------------------
  301|  38.4k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  38.4k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 13.8k, False: 24.6k]
  |  |  ------------------
  ------------------
  302|  38.4k|      }
  303|   149k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 90.0k, False: 58.9k]
  ------------------
  304|   232k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 142k, False: 90.0k]
  ------------------
  305|   142k|          p_[axes_[j]] = 0;
  306|   142k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   142k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 125k, False: 16.4k]
  ------------------
  308|   125k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 40, False: 125k]
  ------------------
  309|   125k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     40|              return false;
  311|     40|            }
  312|   125k|          }
  313|   142k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   142k|        }
  315|  90.0k|        *oit = p_;
  316|  90.0k|        ++oit;
  317|  90.0k|        ++num_decoded_points_;
  318|  90.0k|      }
  319|  58.9k|      continue;
  320|  59.0k|    }
  321|       |
  322|  1.22M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.22M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.22M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.22M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.22M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.22M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.22M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.22M|    uint32_t number = 0;
  334|  1.22M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.22M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.22M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 11, False: 1.22M]
  ------------------
  338|       |      // Invalid |number|.
  339|     11|      return false;
  340|     11|    }
  341|  1.22M|    first_half -= number;
  342|  1.22M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.22M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.18M, False: 37.7k]
  ------------------
  345|  1.18M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.16M, False: 26.6k]
  ------------------
  346|  1.16M|        std::swap(first_half, second_half);
  347|  1.16M|      }
  348|  1.18M|    }
  349|       |
  350|  1.22M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.22M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.22M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.21M, False: 10.7k]
  ------------------
  353|  1.21M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.21M|    }
  355|  1.22M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.20M, False: 19.8k]
  ------------------
  356|  1.20M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.20M|    }
  358|  1.22M|  }
  359|     22|  return true;
  360|     73|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE14DecodingStatusC2Ejjj:
  134|  2.42M|        : num_remaining_points(num_remaining_points_),
  135|  2.42M|          last_axis(last_axis_),
  136|  2.42M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodeNumberEiPj:
  127|  1.22M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.22M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.22M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi4EE18num_decoded_pointsEv:
  118|     45|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EEC2Ej:
   86|    172|      : bit_length_(0),
   87|    172|        num_points_(0),
   88|    172|        num_decoded_points_(0),
   89|    172|        dimension_(dimension),
   90|    172|        p_(dimension, 0),
   91|    172|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    172|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    172|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    145|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    145|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 145]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|    145|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 0, False: 145]
  ------------------
  190|      0|    return false;
  191|      0|  }
  192|    145|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 145]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    145|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 3, False: 142]
  ------------------
  196|      3|    return true;
  197|      3|  }
  198|    142|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 8, False: 134]
  ------------------
  199|      8|    return false;
  200|      8|  }
  201|    134|  num_decoded_points_ = 0;
  202|       |
  203|    134|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 30, False: 104]
  ------------------
  204|     30|    return false;
  205|     30|  }
  206|    104|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 5, False: 99]
  ------------------
  207|      5|    return false;
  208|      5|  }
  209|     99|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 6, False: 93]
  ------------------
  210|      6|    return false;
  211|      6|  }
  212|     93|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 2, False: 91]
  ------------------
  213|      2|    return false;
  214|      2|  }
  215|       |
  216|     91|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 54, False: 37]
  ------------------
  217|     54|    return false;
  218|     54|  }
  219|       |
  220|     37|  numbers_decoder_.EndDecoding();
  221|     37|  remaining_bits_decoder_.EndDecoding();
  222|     37|  axis_decoder_.EndDecoding();
  223|     37|  half_decoder_.EndDecoding();
  224|       |
  225|     37|  return true;
  226|     91|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     91|    uint32_t num_points, OutputIteratorT &oit) {
  254|     91|  typedef DecodingStatus Status;
  255|     91|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     91|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     91|  DecodingStatus init_status(num_points, 0, 0);
  258|     91|  std::stack<Status> status_stack;
  259|     91|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  2.70M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.70M, False: 37]
  ------------------
  263|  2.70M|    const DecodingStatus status = status_stack.top();
  264|  2.70M|    status_stack.pop();
  265|       |
  266|  2.70M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.70M|    const uint32_t last_axis = status.last_axis;
  268|  2.70M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.70M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.70M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.70M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.70M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.70M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.70M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.70M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.70M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.70M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.26M, False: 1.44M]
  ------------------
  285|   109M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 107M, False: 1.26M]
  ------------------
  286|   107M|        *oit = old_base;
  287|   107M|        ++oit;
  288|   107M|        ++num_decoded_points_;
  289|   107M|      }
  290|  1.26M|      continue;
  291|  1.26M|    }
  292|       |
  293|  1.44M|    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.44M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 75.8k, False: 1.36M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  75.8k|      axes_[0] = axis;
  300|   231k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 155k, False: 75.8k]
  ------------------
  301|   155k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|   155k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 20.2k, False: 135k]
  |  |  ------------------
  ------------------
  302|   155k|      }
  303|   190k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 114k, False: 75.7k]
  ------------------
  304|   482k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 368k, False: 114k]
  ------------------
  305|   368k|          p_[axes_[j]] = 0;
  306|   368k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|   368k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 168k, False: 199k]
  ------------------
  308|   168k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 51, False: 168k]
  ------------------
  309|   168k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     51|              return false;
  311|     51|            }
  312|   168k|          }
  313|   368k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|   368k|        }
  315|   114k|        *oit = p_;
  316|   114k|        ++oit;
  317|   114k|        ++num_decoded_points_;
  318|   114k|      }
  319|  75.7k|      continue;
  320|  75.8k|    }
  321|       |
  322|  1.36M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.36M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.36M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.36M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.36M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.36M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.36M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.36M|    uint32_t number = 0;
  334|  1.36M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.36M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.36M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 3, False: 1.36M]
  ------------------
  338|       |      // Invalid |number|.
  339|      3|      return false;
  340|      3|    }
  341|  1.36M|    first_half -= number;
  342|  1.36M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.36M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 1.31M, False: 46.1k]
  ------------------
  345|  1.31M|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 1.27M, False: 40.9k]
  ------------------
  346|  1.27M|        std::swap(first_half, second_half);
  347|  1.27M|      }
  348|  1.31M|    }
  349|       |
  350|  1.36M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.36M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.36M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.35M, False: 11.7k]
  ------------------
  353|  1.35M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.35M|    }
  355|  1.36M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.34M, False: 17.3k]
  ------------------
  356|  1.34M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.34M|    }
  358|  1.36M|  }
  359|     37|  return true;
  360|     91|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE14DecodingStatusC2Ejjj:
  134|  2.70M|        : num_remaining_points(num_remaining_points_),
  135|  2.70M|          last_axis(last_axis_),
  136|  2.70M|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.70M|    uint32_t last_axis) {
  232|  2.70M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.70M, Folded]
  ------------------
  233|  2.70M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.70M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.37M, False: 1.32M]
  |  |  ------------------
  ------------------
  234|  2.70M|  }
  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.70M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodeNumberEiPj:
  127|  1.36M|  void DecodeNumber(int nbits, uint32_t *value) {
  128|  1.36M|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|  1.36M|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi5EE18num_decoded_pointsEv:
  118|     40|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_j:
  185|    118|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    118|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 4, False: 114]
  ------------------
  187|      4|    return false;
  188|      4|  }
  189|    114|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 113]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|    113|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 113]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|    113|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 21, False: 92]
  ------------------
  196|     21|    return true;
  197|     21|  }
  198|     92|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 4, False: 88]
  ------------------
  199|      4|    return false;
  200|      4|  }
  201|     88|  num_decoded_points_ = 0;
  202|       |
  203|     88|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 4, False: 84]
  ------------------
  204|      4|    return false;
  205|      4|  }
  206|     84|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 1, False: 83]
  ------------------
  207|      1|    return false;
  208|      1|  }
  209|     83|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 2, False: 81]
  ------------------
  210|      2|    return false;
  211|      2|  }
  212|     81|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 78]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|       |
  216|     78|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 64, False: 14]
  ------------------
  217|     64|    return false;
  218|     64|  }
  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|     78|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodeInternalINS_34PointAttributeVectorOutputIteratorIjEEEEbjRT_:
  253|     78|    uint32_t num_points, OutputIteratorT &oit) {
  254|     78|  typedef DecodingStatus Status;
  255|     78|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     78|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     78|  DecodingStatus init_status(num_points, 0, 0);
  258|     78|  std::stack<Status> status_stack;
  259|     78|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|   180k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 180k, False: 14]
  ------------------
  263|   180k|    const DecodingStatus status = status_stack.top();
  264|   180k|    status_stack.pop();
  265|       |
  266|   180k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|   180k|    const uint32_t last_axis = status.last_axis;
  268|   180k|    const uint32_t stack_pos = status.stack_pos;
  269|   180k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|   180k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|   180k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 180k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|   180k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|   180k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 7, False: 180k]
  ------------------
  278|      7|      return false;
  279|      7|    }
  280|       |
  281|   180k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|   180k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 477, False: 179k]
  ------------------
  285|  63.1k|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 62.6k, False: 477]
  ------------------
  286|  62.6k|        *oit = old_base;
  287|  62.6k|        ++oit;
  288|  62.6k|        ++num_decoded_points_;
  289|  62.6k|      }
  290|    477|      continue;
  291|    477|    }
  292|       |
  293|   179k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   179k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 615, False: 179k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|    615|      axes_[0] = axis;
  300|  44.2k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 43.6k, False: 615]
  ------------------
  301|  43.6k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  43.6k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 593, False: 43.0k]
  |  |  ------------------
  ------------------
  302|  43.6k|      }
  303|  1.38k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 807, False: 576]
  ------------------
  304|  54.7k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 53.9k, False: 768]
  ------------------
  305|  53.9k|          p_[axes_[j]] = 0;
  306|  53.9k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  53.9k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 53.8k, False: 184]
  ------------------
  308|  53.8k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 39, False: 53.7k]
  ------------------
  309|  53.8k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     39|              return false;
  311|     39|            }
  312|  53.8k|          }
  313|  53.9k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  53.9k|        }
  315|    768|        *oit = p_;
  316|    768|        ++oit;
  317|    768|        ++num_decoded_points_;
  318|    768|      }
  319|    576|      continue;
  320|    615|    }
  321|       |
  322|   179k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 179k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   179k|    const int num_remaining_bits = bit_length_ - level;
  327|   179k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   179k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   179k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   179k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   179k|    uint32_t number = 0;
  334|   179k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   179k|    uint32_t first_half = num_remaining_points / 2;
  337|   179k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 18, False: 178k]
  ------------------
  338|       |      // Invalid |number|.
  339|     18|      return false;
  340|     18|    }
  341|   178k|    first_half -= number;
  342|   178k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   178k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 178k, False: 69]
  ------------------
  345|   178k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 132k, False: 46.0k]
  ------------------
  346|   132k|        std::swap(first_half, second_half);
  347|   132k|      }
  348|   178k|    }
  349|       |
  350|   178k|    levels_stack_[stack_pos][axis] += 1;
  351|   178k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   178k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 133k, False: 45.6k]
  ------------------
  353|   133k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   133k|    }
  355|   178k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 46.8k, False: 132k]
  ------------------
  356|  46.8k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  46.8k|    }
  358|   178k|  }
  359|     14|  return true;
  360|     78|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE14DecodingStatusC2Ejjj:
  134|   180k|        : num_remaining_points(num_remaining_points_),
  135|   180k|          last_axis(last_axis_),
  136|   180k|          stack_pos(stack_pos_) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodeNumberEiPj:
  127|   179k|  void DecodeNumber(int nbits, uint32_t *value) {
  128|   179k|    numbers_decoder_.DecodeLeastSignificantBits32(nbits, value);
  129|   179k|  }
_ZNK5draco33DynamicIntegerPointsKdTreeDecoderILi6EE18num_decoded_pointsEv:
  118|     33|  uint32_t num_decoded_points() const { return num_decoded_points_; }
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EEC2Ej:
   86|    134|      : bit_length_(0),
   87|    134|        num_points_(0),
   88|    134|        num_decoded_points_(0),
   89|    134|        dimension_(dimension),
   90|    134|        p_(dimension, 0),
   91|    134|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    134|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    134|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     90|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     90|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     90|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EEC2Ej:
   86|    219|      : bit_length_(0),
   87|    219|        num_points_(0),
   88|    219|        num_decoded_points_(0),
   89|    219|        dimension_(dimension),
   90|    219|        p_(dimension, 0),
   91|    219|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    219|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    219|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     98|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     98|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     98|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     32|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     32|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     32|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EEC2Ej:
   86|    236|      : bit_length_(0),
   87|    236|        num_points_(0),
   88|    236|        num_decoded_points_(0),
   89|    236|        dimension_(dimension),
   90|    236|        p_(dimension, 0),
   91|    236|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    236|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    236|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|     43|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     43|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     43|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      5|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      5|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      5|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EEC2Ej:
   86|    162|      : bit_length_(0),
   87|    162|        num_points_(0),
   88|    162|        num_decoded_points_(0),
   89|    162|        dimension_(dimension),
   90|    162|        p_(dimension, 0),
   91|    162|        axes_(dimension, 0),
   92|       |        // Init the stack with the maximum depth of the tree.
   93|       |        // +1 for a second leaf.
   94|    162|        base_stack_(32 * dimension + 1, VectorUint32(dimension, 0)),
   95|    162|        levels_stack_(32 * dimension + 1, VectorUint32(dimension, 0)) {}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_34PointAttributeVectorOutputIteratorIjEEEEbPNS_13DecoderBufferERT_:
  178|      3|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|      3|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|      3|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.49M|    uint32_t last_axis) {
  232|  2.49M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.49M, Folded]
  ------------------
  233|  2.49M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.49M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 716k, False: 1.77M]
  |  |  ------------------
  ------------------
  234|  2.49M|  }
  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.49M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  4.25M|    uint32_t last_axis) {
  232|  4.25M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 4.25M, Folded]
  ------------------
  233|  4.25M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  4.25M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 1.21M, False: 3.04M]
  |  |  ------------------
  ------------------
  234|  4.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|  4.25M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|  2.42M|    uint32_t last_axis) {
  232|  2.42M|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [True: 2.42M, Folded]
  ------------------
  233|  2.42M|    return DRACO_INCREMENT_MOD(last_axis, dimension_);
  ------------------
  |  |   24|  2.42M|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 2.31M, False: 109k]
  |  |  ------------------
  ------------------
  234|  2.42M|  }
  235|       |
  236|      0|  uint32_t best_axis = 0;
  237|      0|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 0, False: 0]
  ------------------
  239|      0|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 0, False: 0]
  ------------------
  240|      0|        best_axis = axis;
  241|      0|      }
  242|      0|    }
  243|      0|  } else {
  244|      0|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|      0|  }
  246|       |
  247|      0|  return best_axis;
  248|  2.42M|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE7GetAxisEjRKNSt3__16vectorIjNS2_9allocatorIjEEEEj:
  231|   180k|    uint32_t last_axis) {
  232|   180k|  if (!Policy::select_axis) {
  ------------------
  |  Branch (232:7): [Folded, False: 180k]
  ------------------
  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|   180k|  uint32_t best_axis = 0;
  237|   180k|  if (num_remaining_points < 64) {
  ------------------
  |  Branch (237:7): [True: 179k, False: 595]
  ------------------
  238|  21.8M|    for (uint32_t axis = 1; axis < dimension_; ++axis) {
  ------------------
  |  Branch (238:29): [True: 21.6M, False: 179k]
  ------------------
  239|  21.6M|      if (levels[best_axis] > levels[axis]) {
  ------------------
  |  Branch (239:11): [True: 214k, False: 21.4M]
  ------------------
  240|   214k|        best_axis = axis;
  241|   214k|      }
  242|  21.6M|    }
  243|   179k|  } else {
  244|    595|    axis_decoder_.DecodeLeastSignificantBits32(4, &best_axis);
  245|    595|  }
  246|       |
  247|   180k|  return best_axis;
  248|   180k|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     96|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     96|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     96|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     96|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     96|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 96]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     96|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 6, False: 90]
  ------------------
  190|      6|    return false;
  191|      6|  }
  192|     90|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 90]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     90|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 90]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     90|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 90]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     90|  num_decoded_points_ = 0;
  202|       |
  203|     90|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 17, False: 73]
  ------------------
  204|     17|    return false;
  205|     17|  }
  206|     73|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 7, False: 66]
  ------------------
  207|      7|    return false;
  208|      7|  }
  209|     66|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 65]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     65|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 3, False: 62]
  ------------------
  213|      3|    return false;
  214|      3|  }
  215|       |
  216|     62|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 44, False: 18]
  ------------------
  217|     44|    return false;
  218|     44|  }
  219|       |
  220|     18|  numbers_decoder_.EndDecoding();
  221|     18|  remaining_bits_decoder_.EndDecoding();
  222|     18|  axis_decoder_.EndDecoding();
  223|     18|  half_decoder_.EndDecoding();
  224|       |
  225|     18|  return true;
  226|     62|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi0EE14DecodeInternalINS_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|  1.92M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 1.92M, False: 18]
  ------------------
  263|  1.92M|    const DecodingStatus status = status_stack.top();
  264|  1.92M|    status_stack.pop();
  265|       |
  266|  1.92M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  1.92M|    const uint32_t last_axis = status.last_axis;
  268|  1.92M|    const uint32_t stack_pos = status.stack_pos;
  269|  1.92M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  1.92M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  1.92M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 1.92M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  1.92M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  1.92M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 1.92M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  1.92M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  1.92M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 959k, False: 963k]
  ------------------
  285|   184M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 183M, False: 959k]
  ------------------
  286|   183M|        *oit = old_base;
  287|   183M|        ++oit;
  288|   183M|        ++num_decoded_points_;
  289|   183M|      }
  290|   959k|      continue;
  291|   959k|    }
  292|       |
  293|   963k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|   963k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.40k, False: 961k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.40k|      axes_[0] = axis;
  300|  4.21k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.80k, False: 1.40k]
  ------------------
  301|  2.80k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.80k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 355, False: 2.45k]
  |  |  ------------------
  ------------------
  302|  2.80k|      }
  303|  3.86k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.48k, False: 1.37k]
  ------------------
  304|  9.88k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 7.42k, False: 2.46k]
  ------------------
  305|  7.42k|          p_[axes_[j]] = 0;
  306|  7.42k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  7.42k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.67k, False: 3.75k]
  ------------------
  308|  3.67k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 25, False: 3.64k]
  ------------------
  309|  3.67k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     25|              return false;
  311|     25|            }
  312|  3.67k|          }
  313|  7.39k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  7.39k|        }
  315|  2.46k|        *oit = p_;
  316|  2.46k|        ++oit;
  317|  2.46k|        ++num_decoded_points_;
  318|  2.46k|      }
  319|  1.37k|      continue;
  320|  1.40k|    }
  321|       |
  322|   961k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 961k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|   961k|    const int num_remaining_bits = bit_length_ - level;
  327|   961k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|   961k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|   961k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|   961k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|   961k|    uint32_t number = 0;
  334|   961k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|   961k|    uint32_t first_half = num_remaining_points / 2;
  337|   961k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 19, False: 961k]
  ------------------
  338|       |      // Invalid |number|.
  339|     19|      return false;
  340|     19|    }
  341|   961k|    first_half -= number;
  342|   961k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|   961k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 458k, False: 503k]
  ------------------
  345|   458k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 420k, False: 38.1k]
  ------------------
  346|   420k|        std::swap(first_half, second_half);
  347|   420k|      }
  348|   458k|    }
  349|       |
  350|   961k|    levels_stack_[stack_pos][axis] += 1;
  351|   961k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|   961k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 961k, False: 76]
  ------------------
  353|   961k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|   961k|    }
  355|   961k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 961k, False: 150]
  ------------------
  356|   961k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|   961k|    }
  358|   961k|  }
  359|     18|  return true;
  360|     62|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     87|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     87|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     87|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi1EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     87|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     87|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 87]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     87|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 6, False: 81]
  ------------------
  190|      6|    return false;
  191|      6|  }
  192|     81|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 81]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     81|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 80]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     80|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 80]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     80|  num_decoded_points_ = 0;
  202|       |
  203|     80|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 19, False: 61]
  ------------------
  204|     19|    return false;
  205|     19|  }
  206|     61|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 4, False: 57]
  ------------------
  207|      4|    return false;
  208|      4|  }
  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: 43, False: 12]
  ------------------
  217|     43|    return false;
  218|     43|  }
  219|       |
  220|     12|  numbers_decoder_.EndDecoding();
  221|     12|  remaining_bits_decoder_.EndDecoding();
  222|     12|  axis_decoder_.EndDecoding();
  223|     12|  half_decoder_.EndDecoding();
  224|       |
  225|     12|  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|  2.88M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 2.88M, False: 12]
  ------------------
  263|  2.88M|    const DecodingStatus status = status_stack.top();
  264|  2.88M|    status_stack.pop();
  265|       |
  266|  2.88M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  2.88M|    const uint32_t last_axis = status.last_axis;
  268|  2.88M|    const uint32_t stack_pos = status.stack_pos;
  269|  2.88M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  2.88M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  2.88M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 2.88M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  2.88M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  2.88M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 2.88M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  2.88M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  2.88M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 1.44M, False: 1.44M]
  ------------------
  285|   111M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 110M, False: 1.44M]
  ------------------
  286|   110M|        *oit = old_base;
  287|   110M|        ++oit;
  288|   110M|        ++num_decoded_points_;
  289|   110M|      }
  290|  1.44M|      continue;
  291|  1.44M|    }
  292|       |
  293|  1.44M|    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.44M|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.48k, False: 1.44M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.48k|      axes_[0] = axis;
  300|  4.46k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.97k, False: 1.48k]
  ------------------
  301|  2.97k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.97k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 439, False: 2.53k]
  |  |  ------------------
  ------------------
  302|  2.97k|      }
  303|  4.10k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.64k, False: 1.46k]
  ------------------
  304|  10.5k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 7.89k, False: 2.61k]
  ------------------
  305|  7.89k|          p_[axes_[j]] = 0;
  306|  7.89k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  7.89k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 3.96k, False: 3.93k]
  ------------------
  308|  3.96k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 29, False: 3.93k]
  ------------------
  309|  3.96k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     29|              return false;
  311|     29|            }
  312|  3.96k|          }
  313|  7.86k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  7.86k|        }
  315|  2.61k|        *oit = p_;
  316|  2.61k|        ++oit;
  317|  2.61k|        ++num_decoded_points_;
  318|  2.61k|      }
  319|  1.46k|      continue;
  320|  1.48k|    }
  321|       |
  322|  1.44M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 1.44M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  1.44M|    const int num_remaining_bits = bit_length_ - level;
  327|  1.44M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  1.44M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  1.44M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  1.44M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  1.44M|    uint32_t number = 0;
  334|  1.44M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  1.44M|    uint32_t first_half = num_remaining_points / 2;
  337|  1.44M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 14, False: 1.44M]
  ------------------
  338|       |      // Invalid |number|.
  339|     14|      return false;
  340|     14|    }
  341|  1.44M|    first_half -= number;
  342|  1.44M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  1.44M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 901k, False: 543k]
  ------------------
  345|   901k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 898k, False: 2.30k]
  ------------------
  346|   898k|        std::swap(first_half, second_half);
  347|   898k|      }
  348|   901k|    }
  349|       |
  350|  1.44M|    levels_stack_[stack_pos][axis] += 1;
  351|  1.44M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  1.44M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 1.44M, False: 139]
  ------------------
  353|  1.44M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  1.44M|    }
  355|  1.44M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 1.44M, False: 83]
  ------------------
  356|  1.44M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  1.44M|    }
  358|  1.44M|  }
  359|     12|  return true;
  360|     55|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     91|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     91|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     91|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     91|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     91|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 91]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     91|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 90]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     90|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 90]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     90|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 90]
  ------------------
  196|      0|    return true;
  197|      0|  }
  198|     90|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 90]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     90|  num_decoded_points_ = 0;
  202|       |
  203|     90|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 25, False: 65]
  ------------------
  204|     25|    return false;
  205|     25|  }
  206|     65|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 62]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     62|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 1, False: 61]
  ------------------
  210|      1|    return false;
  211|      1|  }
  212|     61|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 60]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     60|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 55, False: 5]
  ------------------
  217|     55|    return false;
  218|     55|  }
  219|       |
  220|      5|  numbers_decoder_.EndDecoding();
  221|      5|  remaining_bits_decoder_.EndDecoding();
  222|      5|  axis_decoder_.EndDecoding();
  223|      5|  half_decoder_.EndDecoding();
  224|       |
  225|      5|  return true;
  226|     60|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi2EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     60|    uint32_t num_points, OutputIteratorT &oit) {
  254|     60|  typedef DecodingStatus Status;
  255|     60|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     60|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     60|  DecodingStatus init_status(num_points, 0, 0);
  258|     60|  std::stack<Status> status_stack;
  259|     60|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  4.22M|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 4.22M, False: 5]
  ------------------
  263|  4.22M|    const DecodingStatus status = status_stack.top();
  264|  4.22M|    status_stack.pop();
  265|       |
  266|  4.22M|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  4.22M|    const uint32_t last_axis = status.last_axis;
  268|  4.22M|    const uint32_t stack_pos = status.stack_pos;
  269|  4.22M|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  4.22M|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  4.22M|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 4.22M]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  4.22M|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  4.22M|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 4.22M]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  4.22M|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  4.22M|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 2.10M, False: 2.11M]
  ------------------
  285|  34.5M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 32.4M, False: 2.10M]
  ------------------
  286|  32.4M|        *oit = old_base;
  287|  32.4M|        ++oit;
  288|  32.4M|        ++num_decoded_points_;
  289|  32.4M|      }
  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.07k, False: 2.11M]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.07k|      axes_[0] = axis;
  300|  3.21k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.14k, False: 1.07k]
  ------------------
  301|  2.14k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.14k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 257, False: 1.88k]
  |  |  ------------------
  ------------------
  302|  2.14k|      }
  303|  2.87k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 1.81k, False: 1.06k]
  ------------------
  304|  7.23k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 5.43k, False: 1.80k]
  ------------------
  305|  5.43k|          p_[axes_[j]] = 0;
  306|  5.43k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  5.43k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 2.64k, False: 2.78k]
  ------------------
  308|  2.64k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 13, False: 2.63k]
  ------------------
  309|  2.64k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     13|              return false;
  311|     13|            }
  312|  2.64k|          }
  313|  5.42k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  5.42k|        }
  315|  1.80k|        *oit = p_;
  316|  1.80k|        ++oit;
  317|  1.80k|        ++num_decoded_points_;
  318|  1.80k|      }
  319|  1.06k|      continue;
  320|  1.07k|    }
  321|       |
  322|  2.11M|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 2.11M]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  2.11M|    const int num_remaining_bits = bit_length_ - level;
  327|  2.11M|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  2.11M|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  2.11M|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  2.11M|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  2.11M|    uint32_t number = 0;
  334|  2.11M|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  2.11M|    uint32_t first_half = num_remaining_points / 2;
  337|  2.11M|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 42, False: 2.11M]
  ------------------
  338|       |      // Invalid |number|.
  339|     42|      return false;
  340|     42|    }
  341|  2.11M|    first_half -= number;
  342|  2.11M|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  2.11M|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 991k, False: 1.12M]
  ------------------
  345|   991k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 987k, False: 4.04k]
  ------------------
  346|   987k|        std::swap(first_half, second_half);
  347|   987k|      }
  348|   991k|    }
  349|       |
  350|  2.11M|    levels_stack_[stack_pos][axis] += 1;
  351|  2.11M|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  2.11M|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 2.11M, False: 94]
  ------------------
  353|  2.11M|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  2.11M|    }
  355|  2.11M|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 2.11M, False: 133]
  ------------------
  356|  2.11M|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  2.11M|    }
  358|  2.11M|  }
  359|      5|  return true;
  360|     60|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|    107|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|    107|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|    107|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|    107|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|    107|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 107]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|    107|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 7, False: 100]
  ------------------
  190|      7|    return false;
  191|      7|  }
  192|    100|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 100]
  ------------------
  193|      0|    return false;
  194|      0|  }
  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: 28, False: 70]
  ------------------
  204|     28|    return false;
  205|     28|  }
  206|     70|  if (!remaining_bits_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (206:7): [True: 3, False: 67]
  ------------------
  207|      3|    return false;
  208|      3|  }
  209|     67|  if (!axis_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (209:7): [True: 3, False: 64]
  ------------------
  210|      3|    return false;
  211|      3|  }
  212|     64|  if (!half_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (212:7): [True: 1, False: 63]
  ------------------
  213|      1|    return false;
  214|      1|  }
  215|       |
  216|     63|  if (!DecodeInternal(num_points_, oit)) {
  ------------------
  |  Branch (216:7): [True: 61, False: 2]
  ------------------
  217|     61|    return false;
  218|     61|  }
  219|       |
  220|      2|  numbers_decoder_.EndDecoding();
  221|      2|  remaining_bits_decoder_.EndDecoding();
  222|      2|  axis_decoder_.EndDecoding();
  223|      2|  half_decoder_.EndDecoding();
  224|       |
  225|      2|  return true;
  226|     63|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi3EE14DecodeInternalINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbjRT_:
  253|     63|    uint32_t num_points, OutputIteratorT &oit) {
  254|     63|  typedef DecodingStatus Status;
  255|     63|  base_stack_[0] = VectorUint32(dimension_, 0);
  256|     63|  levels_stack_[0] = VectorUint32(dimension_, 0);
  257|     63|  DecodingStatus init_status(num_points, 0, 0);
  258|     63|  std::stack<Status> status_stack;
  259|     63|  status_stack.push(init_status);
  260|       |
  261|       |  // TODO(b/199760123): Use preallocated vector instead of stack.
  262|  33.3k|  while (!status_stack.empty()) {
  ------------------
  |  Branch (262:10): [True: 33.3k, False: 2]
  ------------------
  263|  33.3k|    const DecodingStatus status = status_stack.top();
  264|  33.3k|    status_stack.pop();
  265|       |
  266|  33.3k|    const uint32_t num_remaining_points = status.num_remaining_points;
  267|  33.3k|    const uint32_t last_axis = status.last_axis;
  268|  33.3k|    const uint32_t stack_pos = status.stack_pos;
  269|  33.3k|    const VectorUint32 &old_base = base_stack_[stack_pos];
  270|  33.3k|    const VectorUint32 &levels = levels_stack_[stack_pos];
  271|       |
  272|  33.3k|    if (num_remaining_points > num_points) {
  ------------------
  |  Branch (272:9): [True: 0, False: 33.3k]
  ------------------
  273|      0|      return false;
  274|      0|    }
  275|       |
  276|  33.3k|    const uint32_t axis = GetAxis(num_remaining_points, levels, last_axis);
  277|  33.3k|    if (axis >= dimension_) {
  ------------------
  |  Branch (277:9): [True: 0, False: 33.3k]
  ------------------
  278|      0|      return false;
  279|      0|    }
  280|       |
  281|  33.3k|    const uint32_t level = levels[axis];
  282|       |
  283|       |    // All axes have been fully subdivided, just output points.
  284|  33.3k|    if ((bit_length_ - level) == 0) {
  ------------------
  |  Branch (284:9): [True: 14.5k, False: 18.8k]
  ------------------
  285|  9.04M|      for (uint32_t i = 0; i < num_remaining_points; i++) {
  ------------------
  |  Branch (285:28): [True: 9.03M, False: 14.5k]
  ------------------
  286|  9.03M|        *oit = old_base;
  287|  9.03M|        ++oit;
  288|  9.03M|        ++num_decoded_points_;
  289|  9.03M|      }
  290|  14.5k|      continue;
  291|  14.5k|    }
  292|       |
  293|  18.8k|    DRACO_DCHECK_EQ(true, num_remaining_points != 0);
  294|       |
  295|       |    // Fast decoding of remaining bits if number of points is 1 or 2.
  296|  18.8k|    if (num_remaining_points <= 2) {
  ------------------
  |  Branch (296:9): [True: 1.47k, False: 17.3k]
  ------------------
  297|       |      // TODO(b/199760123): |axes_| not necessary, remove would change
  298|       |      // bitstream!
  299|  1.47k|      axes_[0] = axis;
  300|  4.42k|      for (uint32_t i = 1; i < dimension_; i++) {
  ------------------
  |  Branch (300:28): [True: 2.94k, False: 1.47k]
  ------------------
  301|  2.94k|        axes_[i] = DRACO_INCREMENT_MOD(axes_[i - 1], dimension_);
  ------------------
  |  |   24|  2.94k|#define DRACO_INCREMENT_MOD(I, M) (((I) == ((M)-1)) ? 0 : ((I) + 1))
  |  |  ------------------
  |  |  |  Branch (24:36): [True: 503, False: 2.44k]
  |  |  ------------------
  ------------------
  302|  2.94k|      }
  303|  4.02k|      for (uint32_t i = 0; i < num_remaining_points; ++i) {
  ------------------
  |  Branch (303:28): [True: 2.57k, False: 1.45k]
  ------------------
  304|  10.2k|        for (uint32_t j = 0; j < dimension_; j++) {
  ------------------
  |  Branch (304:30): [True: 7.69k, False: 2.55k]
  ------------------
  305|  7.69k|          p_[axes_[j]] = 0;
  306|  7.69k|          const uint32_t num_remaining_bits = bit_length_ - levels[axes_[j]];
  307|  7.69k|          if (num_remaining_bits) {
  ------------------
  |  Branch (307:15): [True: 5.12k, False: 2.57k]
  ------------------
  308|  5.12k|            if (!remaining_bits_decoder_.DecodeLeastSignificantBits32(
  ------------------
  |  Branch (308:17): [True: 16, False: 5.11k]
  ------------------
  309|  5.12k|                    num_remaining_bits, &p_[axes_[j]])) {
  310|     16|              return false;
  311|     16|            }
  312|  5.12k|          }
  313|  7.68k|          p_[axes_[j]] = old_base[axes_[j]] | p_[axes_[j]];
  314|  7.68k|        }
  315|  2.55k|        *oit = p_;
  316|  2.55k|        ++oit;
  317|  2.55k|        ++num_decoded_points_;
  318|  2.55k|      }
  319|  1.45k|      continue;
  320|  1.47k|    }
  321|       |
  322|  17.3k|    if (num_decoded_points_ > num_points_) {
  ------------------
  |  Branch (322:9): [True: 0, False: 17.3k]
  ------------------
  323|      0|      return false;
  324|      0|    }
  325|       |
  326|  17.3k|    const int num_remaining_bits = bit_length_ - level;
  327|  17.3k|    const uint32_t modifier = 1 << (num_remaining_bits - 1);
  328|  17.3k|    base_stack_[stack_pos + 1] = old_base;         // copy
  329|  17.3k|    base_stack_[stack_pos + 1][axis] += modifier;  // new base
  330|       |
  331|  17.3k|    const int incoming_bits = MostSignificantBit(num_remaining_points);
  332|       |
  333|  17.3k|    uint32_t number = 0;
  334|  17.3k|    DecodeNumber(incoming_bits, &number);
  335|       |
  336|  17.3k|    uint32_t first_half = num_remaining_points / 2;
  337|  17.3k|    if (first_half < number) {
  ------------------
  |  Branch (337:9): [True: 45, False: 17.2k]
  ------------------
  338|       |      // Invalid |number|.
  339|     45|      return false;
  340|     45|    }
  341|  17.2k|    first_half -= number;
  342|  17.2k|    uint32_t second_half = num_remaining_points - first_half;
  343|       |
  344|  17.2k|    if (first_half != second_half) {
  ------------------
  |  Branch (344:9): [True: 10.4k, False: 6.81k]
  ------------------
  345|  10.4k|      if (!half_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (345:11): [True: 7.22k, False: 3.24k]
  ------------------
  346|  7.22k|        std::swap(first_half, second_half);
  347|  7.22k|      }
  348|  10.4k|    }
  349|       |
  350|  17.2k|    levels_stack_[stack_pos][axis] += 1;
  351|  17.2k|    levels_stack_[stack_pos + 1] = levels_stack_[stack_pos];  // copy
  352|  17.2k|    if (first_half) {
  ------------------
  |  Branch (352:9): [True: 17.2k, False: 68]
  ------------------
  353|  17.2k|      status_stack.push(DecodingStatus(first_half, axis, stack_pos));
  354|  17.2k|    }
  355|  17.2k|    if (second_half) {
  ------------------
  |  Branch (355:9): [True: 17.1k, False: 148]
  ------------------
  356|  17.1k|      status_stack.push(DecodingStatus(second_half, axis, stack_pos + 1));
  357|  17.1k|    }
  358|  17.2k|  }
  359|      2|  return true;
  360|     63|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_:
  178|     46|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     46|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     46|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi4EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     46|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     46|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 46]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     46|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 14, False: 32]
  ------------------
  190|     14|    return false;
  191|     14|  }
  192|     32|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 32]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     32|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 2, False: 30]
  ------------------
  196|      2|    return true;
  197|      2|  }
  198|     30|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 30]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     30|  num_decoded_points_ = 0;
  202|       |
  203|     30|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 30, False: 0]
  ------------------
  204|     30|    return false;
  205|     30|  }
  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|     17|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     17|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     17|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi5EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     17|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     17|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 17]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     17|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 1, False: 16]
  ------------------
  190|      1|    return false;
  191|      1|  }
  192|     16|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 16]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     16|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 15]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     15|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 15]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     15|  num_decoded_points_ = 0;
  202|       |
  203|     15|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 15, False: 0]
  ------------------
  204|     15|    return false;
  205|     15|  }
  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|     16|    DecoderBuffer *buffer, OutputIteratorT &oit) {
  179|     16|  return DecodePoints(buffer, oit, std::numeric_limits<uint32_t>::max());
  180|     16|}
_ZN5draco33DynamicIntegerPointsKdTreeDecoderILi6EE12DecodePointsINS_24ConversionOutputIteratorINSt3__120back_insert_iteratorINS4_6vectorINS_7VectorDIjLi3EEENS4_9allocatorIS8_EEEEEENS_9ConverterEEEEEbPNS_13DecoderBufferERT_j:
  185|     16|    DecoderBuffer *buffer, OutputIteratorT &oit, uint32_t oit_max_points) {
  186|     16|  if (!buffer->Decode(&bit_length_)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 16]
  ------------------
  187|      0|    return false;
  188|      0|  }
  189|     16|  if (bit_length_ > 32) {
  ------------------
  |  Branch (189:7): [True: 3, False: 13]
  ------------------
  190|      3|    return false;
  191|      3|  }
  192|     13|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (192:7): [True: 0, False: 13]
  ------------------
  193|      0|    return false;
  194|      0|  }
  195|     13|  if (num_points_ == 0) {
  ------------------
  |  Branch (195:7): [True: 1, False: 12]
  ------------------
  196|      1|    return true;
  197|      1|  }
  198|     12|  if (num_points_ > oit_max_points) {
  ------------------
  |  Branch (198:7): [True: 0, False: 12]
  ------------------
  199|      0|    return false;
  200|      0|  }
  201|     12|  num_decoded_points_ = 0;
  202|       |
  203|     12|  if (!numbers_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (203:7): [True: 12, False: 0]
  ------------------
  204|     12|    return false;
  205|     12|  }
  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|    495|    : num_points_(0), compression_level_(0), num_points_from_header_(0) {
   66|    495|  qinfo_.quantization_bits = 0;
   67|    495|  qinfo_.range = 0;
   68|    495|}
_ZN5draco22FloatPointsTreeDecoder30DecodePointCloudKdTreeInternalEPNS_13DecoderBufferEPNSt3__16vectorINS_7VectorDIjLi3EEENS3_9allocatorIS6_EEEE:
   71|    476|    DecoderBuffer *buffer, std::vector<Point3ui> *qpoints) {
   72|    476|  if (!buffer->Decode(&qinfo_.quantization_bits)) {
  ------------------
  |  Branch (72:7): [True: 0, False: 476]
  ------------------
   73|      0|    return false;
   74|      0|  }
   75|    476|  if (qinfo_.quantization_bits > 31) {
  ------------------
  |  Branch (75:7): [True: 0, False: 476]
  ------------------
   76|      0|    return false;
   77|      0|  }
   78|    476|  if (!buffer->Decode(&qinfo_.range)) {
  ------------------
  |  Branch (78:7): [True: 0, False: 476]
  ------------------
   79|      0|    return false;
   80|      0|  }
   81|    476|  if (!buffer->Decode(&num_points_)) {
  ------------------
  |  Branch (81:7): [True: 0, False: 476]
  ------------------
   82|      0|    return false;
   83|      0|  }
   84|    476|  if (num_points_from_header_ > 0 && num_points_ != num_points_from_header_) {
  ------------------
  |  Branch (84:7): [True: 20, False: 456]
  |  Branch (84:38): [True: 11, False: 9]
  ------------------
   85|     11|    return false;
   86|     11|  }
   87|    465|  if (!buffer->Decode(&compression_level_)) {
  ------------------
  |  Branch (87:7): [True: 0, False: 465]
  ------------------
   88|      0|    return false;
   89|      0|  }
   90|       |
   91|       |  // Only allow compression level in [0..6].
   92|    465|  if (6 < compression_level_) {
  ------------------
  |  Branch (92:7): [True: 5, False: 460]
  ------------------
   93|      5|    DRACO_LOGE("FloatPointsTreeDecoder: compression level %i not supported.\n",
  ------------------
  |  |   31|      5|#define DRACO_LOGE printf
  ------------------
   94|      5|               compression_level_);
   95|      5|    return false;
   96|      5|  }
   97|       |
   98|    460|  std::back_insert_iterator<std::vector<Point3ui>> oit_qpoints =
   99|    460|      std::back_inserter(*qpoints);
  100|    460|  ConversionOutputIterator<std::back_insert_iterator<std::vector<Point3ui>>,
  101|    460|                           Converter>
  102|    460|      oit(oit_qpoints);
  103|    460|  if (num_points_ > 0) {
  ------------------
  |  Branch (103:7): [True: 460, False: 0]
  ------------------
  104|    460|    qpoints->reserve(num_points_);
  105|    460|    switch (compression_level_) {
  106|     96|      case 0: {
  ------------------
  |  Branch (106:7): [True: 96, False: 364]
  ------------------
  107|     96|        DynamicIntegerPointsKdTreeDecoder<0> qpoints_decoder(3);
  108|     96|        qpoints_decoder.DecodePoints(buffer, oit);
  109|     96|        break;
  110|      0|      }
  111|     87|      case 1: {
  ------------------
  |  Branch (111:7): [True: 87, False: 373]
  ------------------
  112|     87|        DynamicIntegerPointsKdTreeDecoder<1> qpoints_decoder(3);
  113|     87|        qpoints_decoder.DecodePoints(buffer, oit);
  114|     87|        break;
  115|      0|      }
  116|     91|      case 2: {
  ------------------
  |  Branch (116:7): [True: 91, False: 369]
  ------------------
  117|     91|        DynamicIntegerPointsKdTreeDecoder<2> qpoints_decoder(3);
  118|     91|        qpoints_decoder.DecodePoints(buffer, oit);
  119|     91|        break;
  120|      0|      }
  121|    107|      case 3: {
  ------------------
  |  Branch (121:7): [True: 107, False: 353]
  ------------------
  122|    107|        DynamicIntegerPointsKdTreeDecoder<3> qpoints_decoder(3);
  123|    107|        qpoints_decoder.DecodePoints(buffer, oit);
  124|    107|        break;
  125|      0|      }
  126|     46|      case 4: {
  ------------------
  |  Branch (126:7): [True: 46, False: 414]
  ------------------
  127|     46|        DynamicIntegerPointsKdTreeDecoder<4> qpoints_decoder(3);
  128|     46|        qpoints_decoder.DecodePoints(buffer, oit);
  129|     46|        break;
  130|      0|      }
  131|     17|      case 5: {
  ------------------
  |  Branch (131:7): [True: 17, False: 443]
  ------------------
  132|     17|        DynamicIntegerPointsKdTreeDecoder<5> qpoints_decoder(3);
  133|     17|        qpoints_decoder.DecodePoints(buffer, oit);
  134|     17|        break;
  135|      0|      }
  136|     16|      case 6: {
  ------------------
  |  Branch (136:7): [True: 16, False: 444]
  ------------------
  137|     16|        DynamicIntegerPointsKdTreeDecoder<6> qpoints_decoder(3);
  138|     16|        qpoints_decoder.DecodePoints(buffer, oit);
  139|     16|        break;
  140|      0|      }
  141|      0|      default:
  ------------------
  |  Branch (141:7): [True: 0, False: 460]
  ------------------
  142|      0|        return false;
  143|    460|    }
  144|    460|  }
  145|       |
  146|    460|  if (qpoints->size() != num_points_) {
  ------------------
  |  Branch (146:7): [True: 453, False: 7]
  ------------------
  147|    453|    return false;
  148|    453|  }
  149|      7|  return true;
  150|    460|}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEC2ES9_:
   43|    460|  explicit ConversionOutputIterator(OutputIterator oit) : oit_(oit) {}
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEdeEv:
   54|   335M|  Self &operator*() { return *this; }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEaSERKNS3_IjNS6_IjEEEE:
   55|   335M|  const Self &operator=(const SourceType &source) {
   56|   335M|    *oit_ = Converter()(source);
   57|   335M|    return *this;
   58|   335M|  }
_ZN5draco9ConverterclERKNSt3__16vectorIjNS1_9allocatorIjEEEE:
   29|   335M|  Point3ui operator()(const std::vector<uint32_t> &v) {
   30|   335M|    return Point3ui(v[0], v[1], v[2]);
   31|   335M|  }
_ZN5draco24ConversionOutputIteratorINSt3__120back_insert_iteratorINS1_6vectorINS_7VectorDIjLi3EEENS1_9allocatorIS5_EEEEEENS_9ConverterEEppEv:
   45|   335M|  const Self &operator++() {
   46|   335M|    ++oit_;
   47|   335M|    return *this;
   48|   335M|  }

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  12.5M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  12.5M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 12.5M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  12.5M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  12.5M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|   475M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|   475M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 386, False: 475M]
  ------------------
   78|    386|      return false;  // Buffer overflow.
   79|    386|    }
   80|   475M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|   475M|    pos_ += size_to_decode;
   82|   475M|    return true;
   83|   475M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  32.8k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  9.12k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  43.9k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   278k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  5.17k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  12.5M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  3.28M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  6.10k|    inline void reset(const void *b, size_t s) {
  131|  6.10k|      bit_offset_ = 0;
  132|  6.10k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  6.10k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  6.10k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  5.31k|    inline uint64_t BitsDecoded() const {
  138|  5.31k|      return static_cast<uint64_t>(bit_offset_);
  139|  5.31k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  12.5M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  12.5M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 2, False: 12.5M]
  ------------------
  162|      2|        return false;
  163|      2|      }
  164|  12.5M|      uint32_t value = 0;
  165|  30.0M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 17.4M, False: 12.5M]
  ------------------
  166|  17.4M|        value |= GetBit() << bit;
  167|  17.4M|      }
  168|  12.5M|      *x = value;
  169|  12.5M|      return true;
  170|  12.5M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  17.4M|    inline int GetBit() {
  176|  17.4M|      const size_t off = bit_offset_;
  177|  17.4M|      const size_t byte_offset = off >> 3;
  178|  17.4M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  17.4M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 15.8M, False: 1.61M]
  ------------------
  180|  15.8M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  15.8M|        bit_offset_ = off + 1;
  182|  15.8M|        return bit;
  183|  15.8M|      }
  184|  1.61M|      return 0;
  185|  17.4M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  9.95M|  bool Decode(T *out_val) {
   69|  9.95M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 2.27k, False: 9.95M]
  ------------------
   70|  2.27k|      return false;
   71|  2.27k|    }
   72|  9.95M|    pos_ += sizeof(T);
   73|  9.95M|    return true;
   74|  9.95M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  9.95M|  bool Peek(T *out_val) {
   88|  9.95M|    const size_t size_to_decode = sizeof(T);
   89|  9.95M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 2.27k, False: 9.95M]
  ------------------
   90|  2.27k|      return false;  // Buffer overflow.
   91|  2.27k|    }
   92|  9.95M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  9.95M|    return true;
   94|  9.95M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  11.5k|  bool Decode(T *out_val) {
   69|  11.5k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 128, False: 11.4k]
  ------------------
   70|    128|      return false;
   71|    128|    }
   72|  11.4k|    pos_ += sizeof(T);
   73|  11.4k|    return true;
   74|  11.5k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  11.5k|  bool Peek(T *out_val) {
   88|  11.5k|    const size_t size_to_decode = sizeof(T);
   89|  11.5k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 128, False: 11.4k]
  ------------------
   90|    128|      return false;  // Buffer overflow.
   91|    128|    }
   92|  11.4k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  11.4k|    return true;
   94|  11.5k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   273k|  bool Decode(T *out_val) {
   69|   273k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 157, False: 273k]
  ------------------
   70|    157|      return false;
   71|    157|    }
   72|   273k|    pos_ += sizeof(T);
   73|   273k|    return true;
   74|   273k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   273k|  bool Peek(T *out_val) {
   88|   273k|    const size_t size_to_decode = sizeof(T);
   89|   273k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 157, False: 273k]
  ------------------
   90|    157|      return false;  // Buffer overflow.
   91|    157|    }
   92|   273k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   273k|    return true;
   94|   273k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  18.9k|  bool Decode(T *out_val) {
   69|  18.9k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 149, False: 18.7k]
  ------------------
   70|    149|      return false;
   71|    149|    }
   72|  18.7k|    pos_ += sizeof(T);
   73|  18.7k|    return true;
   74|  18.9k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  18.9k|  bool Peek(T *out_val) {
   88|  18.9k|    const size_t size_to_decode = sizeof(T);
   89|  18.9k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 149, False: 18.7k]
  ------------------
   90|    149|      return false;  // Buffer overflow.
   91|    149|    }
   92|  18.7k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  18.7k|    return true;
   94|  18.9k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   627k|  bool Decode(T *out_val) {
   69|   627k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 99, False: 627k]
  ------------------
   70|     99|      return false;
   71|     99|    }
   72|   627k|    pos_ += sizeof(T);
   73|   627k|    return true;
   74|   627k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   627k|  bool Peek(T *out_val) {
   88|   627k|    const size_t size_to_decode = sizeof(T);
   89|   627k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 99, False: 627k]
  ------------------
   90|     99|      return false;  // Buffer overflow.
   91|     99|    }
   92|   627k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   627k|    return true;
   94|   627k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  30.0k|  bool Decode(T *out_val) {
   69|  30.0k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 12, False: 30.0k]
  ------------------
   70|     12|      return false;
   71|     12|    }
   72|  30.0k|    pos_ += sizeof(T);
   73|  30.0k|    return true;
   74|  30.0k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  30.0k|  bool Peek(T *out_val) {
   88|  30.0k|    const size_t size_to_decode = sizeof(T);
   89|  30.0k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 12, False: 30.0k]
  ------------------
   90|     12|      return false;  // Buffer overflow.
   91|     12|    }
   92|  30.0k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  30.0k|    return true;
   94|  30.0k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  1.47k|  bool Decode(T *out_val) {
   69|  1.47k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 12, False: 1.46k]
  ------------------
   70|     12|      return false;
   71|     12|    }
   72|  1.46k|    pos_ += sizeof(T);
   73|  1.46k|    return true;
   74|  1.47k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  1.47k|  bool Peek(T *out_val) {
   88|  1.47k|    const size_t size_to_decode = sizeof(T);
   89|  1.47k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 12, False: 1.46k]
  ------------------
   90|     12|      return false;  // Buffer overflow.
   91|     12|    }
   92|  1.46k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.46k|    return true;
   94|  1.47k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    696|  bool Decode(T *out_val) {
   69|    696|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 2, False: 694]
  ------------------
   70|      2|      return false;
   71|      2|    }
   72|    694|    pos_ += sizeof(T);
   73|    694|    return true;
   74|    696|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    696|  bool Peek(T *out_val) {
   88|    696|    const size_t size_to_decode = sizeof(T);
   89|    696|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 2, False: 694]
  ------------------
   90|      2|      return false;  // Buffer overflow.
   91|      2|    }
   92|    694|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    694|    return true;
   94|    696|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   345M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   781M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  8.88M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  8.88M|    return value_ >= val;
  100|  8.88M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   230M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  2.83G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  21.6M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|  78.5M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  78.5M|    value_ = i.value_;
  153|  78.5M|    return *this;
  154|  78.5M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   567M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   567M|    value_ = i.value_;
  153|   567M|    return *this;
  154|   567M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  21.5M|  inline ThisIndexType &operator++() {
  103|  21.5M|    ++value_;
  104|  21.5M|    return *this;
  105|  21.5M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  2.08G|  constexpr bool operator==(const IndexType &i) const {
   76|  2.08G|    return value_ == i.value_;
   77|  2.08G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   873M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  5.76k|  constexpr bool operator<(const IndexType &i) const {
   88|  5.76k|    return value_ < i.value_;
   89|  5.76k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|  99.9M|  constexpr bool operator==(const IndexType &i) const {
   76|  99.9M|    return value_ == i.value_;
   77|  99.9M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   152M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   152M|    return ThisIndexType(value_ - val);
  133|   152M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   642M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   642M|    return ThisIndexType(value_ + val);
  127|   642M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  17.9M|  constexpr bool operator==(const IndexType &i) const {
   76|  17.9M|    return value_ == i.value_;
   77|  17.9M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   233M|  constexpr bool operator!=(const IndexType &i) const {
   82|   233M|    return value_ != i.value_;
   83|   233M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   293M|  constexpr bool operator!=(const IndexType &i) const {
   82|   293M|    return value_ != i.value_;
   83|   293M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   435M|  inline ThisIndexType &operator++() {
  103|   435M|    ++value_;
  104|   435M|    return *this;
  105|   435M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   388M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   388M|    value_ = i.value_;
  153|   388M|    return *this;
  154|   388M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|   965M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   965M|    value_ = i.value_;
  153|   965M|    return *this;
  154|   965M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  38.1M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  38.1M|    return value_ >= val;
  100|  38.1M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  7.63M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|   971M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  14.9G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   171M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  10.5G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   243M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  17.1M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  17.1M|    return ThisIndexType(value_ + val);
  127|  17.1M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   156M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  20.9M|  constexpr bool operator<(const IndexType &i) const {
   88|  20.9M|    return value_ < i.value_;
   89|  20.9M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   885M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   567M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  58.0M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|   753M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   508M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  5.26M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  5.26M|    value_ = i.value_;
  153|  5.26M|    return *this;
  154|  5.26M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  7.63M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  7.63M|    value_ += val;
  141|  7.63M|    return *this;
  142|  7.63M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  26.6M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  26.6M|    value_ = val;
  157|  26.6M|    return *this;
  158|  26.6M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|   540M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  5.88M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  5.88M|  inline ThisIndexType &operator++() {
  103|  5.88M|    ++value_;
  104|  5.88M|    return *this;
  105|  5.88M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  20.0M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEltERKj:
   90|    220|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|   668M|  inline ThisIndexType &operator++() {
  103|   668M|    ++value_;
  104|   668M|    return *this;
  105|   668M|  }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEppEv:
  102|     97|  inline ThisIndexType &operator++() {
  103|     97|    ++value_;
  104|     97|    return *this;
  105|     97|  }
_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEgeERKj:
   98|   689M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|   689M|    return value_ >= val;
  100|   689M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  33.5M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  33.5M|    return vector_[index.value()];
   75|  33.5M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  20.0M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  11.3k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  14.9k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  58.1M|  inline reference operator[](const IndexTypeT &index) {
   71|  58.1M|    return vector_[index.value()];
   72|  58.1M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|  14.8k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  17.7M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  3.36k|  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|  8.88M|  inline reference operator[](const IndexTypeT &index) {
   71|  8.88M|    return vector_[index.value()];
   72|  8.88M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  21.0M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  21.0M|    return vector_[index.value()];
   75|  21.0M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   199M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  10.6M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   268M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   268M|    return vector_[index.value()];
   75|   268M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   780M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   780M|    return vector_[index.value()];
   75|   780M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   355M|  inline reference operator[](const IndexTypeT &index) {
   71|   355M|    return vector_[index.value()];
   72|   355M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  44.5M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  44.5M|    return vector_[index.value()];
   75|  44.5M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   284M|  inline reference operator[](const IndexTypeT &index) {
   71|   284M|    return vector_[index.value()];
   72|   284M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|   103M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   211M|  inline reference operator[](const IndexTypeT &index) {
   71|   211M|    return vector_[index.value()];
   72|   211M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  1.94k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   272M|  inline reference operator[](const IndexTypeT &index) {
   71|   272M|    return vector_[index.value()];
   72|   272M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  36.0k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  2.24M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  33.4k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  5.45k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  5.45k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  5.45k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  5.45k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  12.1k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  12.1k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  12.1k|    vector_.swap(arg.vector_);
   57|  12.1k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  12.1k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  12.1k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  12.1k|    vector_.swap(arg.vector_);
   57|  12.1k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  5.45k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  5.45k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  5.45k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  7.53k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  34.1k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  62.4k|int32_t DataTypeLength(DataType dt) {
   20|  62.4k|  switch (dt) {
   21|  16.9k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 16.9k, False: 45.5k]
  ------------------
   22|  20.6k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 3.65k, False: 58.8k]
  ------------------
   23|  20.6k|      return 1;
   24|  3.45k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 3.45k, False: 59.0k]
  ------------------
   25|  10.7k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 7.32k, False: 55.1k]
  ------------------
   26|  10.7k|      return 2;
   27|  23.5k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 23.5k, False: 38.9k]
  ------------------
   28|  25.2k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 1.67k, False: 60.8k]
  ------------------
   29|  25.2k|      return 4;
   30|    640|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 640, False: 61.8k]
  ------------------
   31|  1.00k|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 363, False: 62.1k]
  ------------------
   32|  1.00k|      return 8;
   33|  4.40k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 4.40k, False: 58.0k]
  ------------------
   34|  4.40k|      return 4;
   35|     83|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 83, False: 62.4k]
  ------------------
   36|     83|      return 8;
   37|    420|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 420, False: 62.0k]
  ------------------
   38|    420|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 62.4k]
  ------------------
   40|      0|      return -1;
   41|  62.4k|  }
   42|  62.4k|}

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

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

_ZN5draco7OptionsC2Ev:
   32|  9.12k|  Options() = default;
_ZN5draco7OptionsD2Ev:
   33|  9.12k|  ~Options() = default;

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  1.58k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|      1|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  7.53k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2ERKNS_6StatusE:
   37|      1|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINS_19EncodedGeometryTypeEEC2EOS1_:
   39|  9.12k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE2okEv:
   53|  9.12k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINS_19EncodedGeometryTypeEE6statusEv:
   43|      1|  const Status &status() const { return status_; }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  8.26k|  StatusOr(const Status &status) : status_(status) {}
_ZNO5draco8StatusOrINS_19EncodedGeometryTypeEE5valueEv:
   46|  9.12k|  T &&value() && { return std::move(value_); }
_ZN5draco8StatusOrINSt3__110unique_ptrINS_10PointCloudENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|    859|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  1.58k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|      1|  const Status &status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_17PointCloudDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  1.58k|  T &&value() && { return std::move(value_); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  7.53k|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  7.53k|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   471k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   471k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 471k, Folded]
  ------------------
   65|   471k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 824, False: 470k]
  ------------------
   66|    824|      return false;
   67|    824|    }
   68|   471k|  } 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|   470k|  return true;
   77|   471k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   102k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   102k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   102k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 81, False: 102k]
  ------------------
   33|     81|    return false;
   34|     81|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   102k|  uint8_t in;
   39|   102k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 497, False: 101k]
  ------------------
   40|    497|    return false;
   41|    497|  }
   42|   101k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 15.9k, False: 85.9k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  15.9k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 464, False: 15.5k]
  ------------------
   45|    464|      return false;
   46|    464|    }
   47|       |    // Append decoded info from this byte.
   48|  15.5k|    *out_val <<= 7;
   49|  15.5k|    *out_val |= in & ((1 << 7) - 1);
   50|  85.9k|  } else {
   51|       |    // Last byte reached
   52|  85.9k|    *out_val = in;
   53|  85.9k|  }
   54|   101k|  return true;
   55|   101k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  32.2k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  32.2k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  32.2k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 32.2k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  32.2k|  uint8_t in;
   39|  32.2k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 4, False: 32.2k]
  ------------------
   40|      4|    return false;
   41|      4|  }
   42|  32.2k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 847, False: 31.4k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    847|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 16, False: 831]
  ------------------
   45|     16|      return false;
   46|     16|    }
   47|       |    // Append decoded info from this byte.
   48|    831|    *out_val <<= 7;
   49|    831|    *out_val |= in & ((1 << 7) - 1);
   50|  31.4k|  } else {
   51|       |    // Last byte reached
   52|  31.4k|    *out_val = in;
   53|  31.4k|  }
   54|  32.2k|  return true;
   55|  32.2k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  5.69k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  5.69k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 5.69k, Folded]
  ------------------
   65|  5.69k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 100, False: 5.59k]
  ------------------
   66|    100|      return false;
   67|    100|    }
   68|  5.69k|  } 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|  5.59k|  return true;
   77|  5.69k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  3.17k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.17k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.17k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 3.17k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.17k|  uint8_t in;
   39|  3.17k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 12, False: 3.15k]
  ------------------
   40|     12|    return false;
   41|     12|  }
   42|  3.15k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 36, False: 3.12k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     36|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 36]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|     36|    *out_val <<= 7;
   49|     36|    *out_val |= in & ((1 << 7) - 1);
   50|  3.12k|  } else {
   51|       |    // Last byte reached
   52|  3.12k|    *out_val = in;
   53|  3.12k|  }
   54|  3.15k|  return true;
   55|  3.15k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   286k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   286k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   286k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 11, False: 286k]
  ------------------
   33|     11|    return false;
   34|     11|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   286k|  uint8_t in;
   39|   286k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 71, False: 286k]
  ------------------
   40|     71|    return false;
   41|     71|  }
   42|   286k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.12k, False: 285k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.12k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 76, False: 1.05k]
  ------------------
   45|     76|      return false;
   46|     76|    }
   47|       |    // Append decoded info from this byte.
   48|  1.05k|    *out_val <<= 7;
   49|  1.05k|    *out_val |= in & ((1 << 7) - 1);
   50|   285k|  } else {
   51|       |    // Last byte reached
   52|   285k|    *out_val = in;
   53|   285k|  }
   54|   286k|  return true;
   55|   286k|}
_ZN5draco12DecodeVarintIiEEbPT_PNS_13DecoderBufferE:
   63|  3.28k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  3.28k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [Folded, False: 3.28k]
  ------------------
   65|      0|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 0, False: 0]
  ------------------
   66|      0|      return false;
   67|      0|    }
   68|  3.28k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|  3.28k|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|  3.28k|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 30, False: 3.25k]
  ------------------
   72|     30|      return false;
   73|     30|    }
   74|  3.25k|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|  3.25k|  }
   76|  3.25k|  return true;
   77|  3.28k|}
kd_tree_attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.78k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.78k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.78k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 7, False: 3.77k]
  ------------------
   33|      7|    return false;
   34|      7|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.77k|  uint8_t in;
   39|  3.77k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 23, False: 3.75k]
  ------------------
   40|     23|    return false;
   41|     23|  }
   42|  3.75k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 504, False: 3.25k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    504|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 41, False: 463]
  ------------------
   45|     41|      return false;
   46|     41|    }
   47|       |    // Append decoded info from this byte.
   48|    463|    *out_val <<= 7;
   49|    463|    *out_val |= in & ((1 << 7) - 1);
   50|  3.25k|  } else {
   51|       |    // Last byte reached
   52|  3.25k|    *out_val = in;
   53|  3.25k|  }
   54|  3.71k|  return true;
   55|  3.75k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.32k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.32k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.32k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 3.32k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.32k|  uint8_t in;
   39|  3.32k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 21, False: 3.30k]
  ------------------
   40|     21|    return false;
   41|     21|  }
   42|  3.30k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 498, False: 2.80k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    498|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 10, False: 488]
  ------------------
   45|     10|      return false;
   46|     10|    }
   47|       |    // Append decoded info from this byte.
   48|    488|    *out_val <<= 7;
   49|    488|    *out_val |= in & ((1 << 7) - 1);
   50|  2.80k|  } else {
   51|       |    // Last byte reached
   52|  2.80k|    *out_val = in;
   53|  2.80k|  }
   54|  3.29k|  return true;
   55|  3.30k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  26.0k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  26.0k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  26.0k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 4, False: 26.0k]
  ------------------
   33|      4|    return false;
   34|      4|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  26.0k|  uint8_t in;
   39|  26.0k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 16, False: 26.0k]
  ------------------
   40|     16|    return false;
   41|     16|  }
   42|  26.0k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 610, False: 25.4k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    610|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 21, False: 589]
  ------------------
   45|     21|      return false;
   46|     21|    }
   47|       |    // Append decoded info from this byte.
   48|    589|    *out_val <<= 7;
   49|    589|    *out_val |= in & ((1 << 7) - 1);
   50|  25.4k|  } else {
   51|       |    // Last byte reached
   52|  25.4k|    *out_val = in;
   53|  25.4k|  }
   54|  26.0k|  return true;
   55|  26.0k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  6.41k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  6.41k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  6.41k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 56, False: 6.36k]
  ------------------
   33|     56|    return false;
   34|     56|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  6.36k|  uint8_t in;
   39|  6.36k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 38, False: 6.32k]
  ------------------
   40|     38|    return false;
   41|     38|  }
   42|  6.32k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.60k, False: 4.72k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.60k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 290, False: 1.31k]
  ------------------
   45|    290|      return false;
   46|    290|    }
   47|       |    // Append decoded info from this byte.
   48|  1.31k|    *out_val <<= 7;
   49|  1.31k|    *out_val |= in & ((1 << 7) - 1);
   50|  4.72k|  } else {
   51|       |    // Last byte reached
   52|  4.72k|    *out_val = in;
   53|  4.72k|  }
   54|  6.03k|  return true;
   55|  6.32k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  4.95k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.95k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.95k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 61, False: 4.89k]
  ------------------
   33|     61|    return false;
   34|     61|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.89k|  uint8_t in;
   39|  4.89k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 27, False: 4.86k]
  ------------------
   40|     27|    return false;
   41|     27|  }
   42|  4.86k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.38k, False: 2.47k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.38k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 712, False: 1.67k]
  ------------------
   45|    712|      return false;
   46|    712|    }
   47|       |    // Append decoded info from this byte.
   48|  1.67k|    *out_val <<= 7;
   49|  1.67k|    *out_val |= in & ((1 << 7) - 1);
   50|  2.47k|  } else {
   51|       |    // Last byte reached
   52|  2.47k|    *out_val = in;
   53|  2.47k|  }
   54|  4.15k|  return true;
   55|  4.86k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  38.7k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  38.7k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  38.7k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 38.6k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  38.6k|  uint8_t in;
   39|  38.6k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 18, False: 38.6k]
  ------------------
   40|     18|    return false;
   41|     18|  }
   42|  38.6k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 3.30k, False: 35.3k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  3.30k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 31, False: 3.27k]
  ------------------
   45|     31|      return false;
   46|     31|    }
   47|       |    // Append decoded info from this byte.
   48|  3.27k|    *out_val <<= 7;
   49|  3.27k|    *out_val |= in & ((1 << 7) - 1);
   50|  35.3k|  } else {
   51|       |    // Last byte reached
   52|  35.3k|    *out_val = in;
   53|  35.3k|  }
   54|  38.6k|  return true;
   55|  38.6k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|   252k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|   328k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  27.3k|  Self operator-(const Self &o) const {
  138|  27.3k|    Self ret;
  139|   109k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 82.1k, False: 27.3k]
  ------------------
  140|  82.1k|      ret[i] = (*this)[i] - o[i];
  141|  82.1k|    }
  142|  27.3k|    return ret;
  143|  27.3k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  68.1k|  VectorD() {
   41|   272k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 204k, False: 68.1k]
  ------------------
   42|   204k|      (*this)[i] = Scalar(0);
   43|   204k|    }
   44|  68.1k|  }
_ZN5draco7VectorDIjLi3EEixEi:
  112|  2.36G|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIfLi3EEC2ERKfS3_S3_:
   59|     15|      : v_({{c0, c1, c2}}) {
   60|     15|    DRACO_DCHECK_EQ(dimension, 3);
   61|     15|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|   137M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  11.4M|  Self operator-(const Self &o) const {
  138|  11.4M|    Self ret;
  139|  45.6M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 34.2M, False: 11.4M]
  ------------------
  140|  34.2M|      ret[i] = (*this)[i] - o[i];
  141|  34.2M|    }
  142|  11.4M|    return ret;
  143|  11.4M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  5.70M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  5.70M|  static_assert(std::is_signed<ScalarT>::value,
  321|  5.70M|                "ScalarT must be a signed type. ");
  322|  5.70M|  VectorD<ScalarT, 3> r;
  323|  5.70M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  5.70M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  5.70M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  5.70M|  return r;
  327|  5.70M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  5.70M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  5.70M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  2.07M|  Scalar AbsSum() const {
  238|  2.07M|    Scalar result(0);
  239|  8.26M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 6.20M, False: 2.05M]
  ------------------
  240|  6.20M|      Scalar next_value = std::abs(v_[i]);
  241|  6.20M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 10.7k, False: 6.19M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  10.7k|        return std::numeric_limits<Scalar>::max();
  244|  10.7k|      }
  245|  6.19M|      result += next_value;
  246|  6.19M|    }
  247|  2.05M|    return result;
  248|  2.07M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   207k|  Self operator/(const Scalar &o) const {
  183|   207k|    Self ret;
  184|   831k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 623k, False: 207k]
  ------------------
  185|   623k|      ret[i] = (*this)[i] / o;
  186|   623k|    }
  187|   207k|    return ret;
  188|   207k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   170M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  11.0M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  6.21M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  1.84M|  Self operator-() const {
  121|  1.84M|    Self ret;
  122|  7.37M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 5.52M, False: 1.84M]
  ------------------
  123|  5.52M|      ret[i] = -(*this)[i];
  124|  5.52M|    }
  125|  1.84M|    return ret;
  126|  1.84M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  5.52M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|  30.7M|  Self operator-(const Self &o) const {
  138|  30.7M|    Self ret;
  139|  92.1M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 61.4M, False: 30.7M]
  ------------------
  140|  61.4M|      ret[i] = (*this)[i] - o[i];
  141|  61.4M|    }
  142|  30.7M|    return ret;
  143|  30.7M|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|   368M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|   552M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|   617M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  61.4M|  Self operator+(const Self &o) const {
  130|  61.4M|    Self ret;
  131|   184M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 122M, False: 61.4M]
  ------------------
  132|   122M|      ret[i] = (*this)[i] + o[i];
  133|   122M|    }
  134|  61.4M|    return ret;
  135|  61.4M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|   693M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|  9.29M|  Self operator-(const Self &o) const {
  138|  9.29M|    Self ret;
  139|  27.8M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 18.5M, False: 9.29M]
  ------------------
  140|  18.5M|      ret[i] = (*this)[i] - o[i];
  141|  18.5M|    }
  142|  9.29M|    return ret;
  143|  9.29M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|  9.29M|  Self operator+(const Self &o) const {
  130|  9.29M|    Self ret;
  131|  27.8M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 18.5M, False: 9.29M]
  ------------------
  132|  18.5M|      ret[i] = (*this)[i] + o[i];
  133|  18.5M|    }
  134|  9.29M|    return ret;
  135|  9.29M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   358k|  bool operator==(const Self &o) const {
  207|  1.05M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 704k, False: 345k]
  ------------------
  208|   704k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 13.4k, False: 691k]
  ------------------
  209|  13.4k|        return false;
  210|  13.4k|      }
  211|   704k|    }
  212|   345k|    return true;
  213|   358k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  4.30M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  13.9k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  14.4k|  Scalar Dot(const Self &o) const {
  251|  14.4k|    Scalar ret(0);
  252|  57.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 43.3k, False: 14.4k]
  ------------------
  253|  43.3k|      ret += (*this)[i] * o[i];
  254|  43.3k|    }
  255|  14.4k|    return ret;
  256|  14.4k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    515|  Self operator*(const Scalar &o) const {
  175|    515|    Self ret;
  176|  2.06k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 1.54k, False: 515]
  ------------------
  177|  1.54k|      ret[i] = (*this)[i] * o;
  178|  1.54k|    }
  179|    515|    return ret;
  180|    515|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  13.4k|  Self operator-(const Self &o) const {
  138|  13.4k|    Self ret;
  139|  40.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 26.8k, False: 13.4k]
  ------------------
  140|  26.8k|      ret[i] = (*this)[i] - o[i];
  141|  26.8k|    }
  142|  13.4k|    return ret;
  143|  13.4k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  26.8k|  VectorD() {
   41|  80.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 53.7k, False: 26.8k]
  ------------------
   42|  53.7k|      (*this)[i] = Scalar(0);
   43|  53.7k|    }
   44|  26.8k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   731k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   731k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   731k|    v_[0] = c0;
   55|   731k|    v_[1] = c1;
   56|   731k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|   107k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   278k|  bool operator==(const Self &o) const {
  207|   811k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 545k, False: 266k]
  ------------------
  208|   545k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 12.6k, False: 532k]
  ------------------
  209|  12.6k|        return false;
  210|  12.6k|      }
  211|   545k|    }
  212|   266k|    return true;
  213|   278k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  1.71M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  32.9M|  VectorD() {
   41|   131M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 98.7M, False: 32.9M]
  ------------------
   42|  98.7M|      (*this)[i] = Scalar(0);
   43|  98.7M|    }
   44|  32.9M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  16.1k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  19.6k|  Scalar Dot(const Self &o) const {
  251|  19.6k|    Scalar ret(0);
  252|  78.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 58.9k, False: 19.6k]
  ------------------
  253|  58.9k|      ret += (*this)[i] * o[i];
  254|  58.9k|    }
  255|  19.6k|    return ret;
  256|  19.6k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  3.56k|  Self operator-(const Self &o) const {
  138|  3.56k|    Self ret;
  139|  10.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 7.12k, False: 3.56k]
  ------------------
  140|  7.12k|      ret[i] = (*this)[i] - o[i];
  141|  7.12k|    }
  142|  3.56k|    return ret;
  143|  3.56k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  10.4k|  Self operator*(const Scalar &o) const {
  175|  10.4k|    Self ret;
  176|  31.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 20.9k, False: 10.4k]
  ------------------
  177|  20.9k|      ret[i] = (*this)[i] * o;
  178|  20.9k|    }
  179|  10.4k|    return ret;
  180|  10.4k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  3.50k|  Self operator+(const Self &o) const {
  130|  3.50k|    Self ret;
  131|  10.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 7.00k, False: 3.50k]
  ------------------
  132|  7.00k|      ret[i] = (*this)[i] + o[i];
  133|  7.00k|    }
  134|  3.50k|    return ret;
  135|  3.50k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  3.50k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  3.50k|  return v * o;
  294|  3.50k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  3.48k|  Self operator+(const Self &o) const {
  130|  3.48k|    Self ret;
  131|  13.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 10.4k, False: 3.48k]
  ------------------
  132|  10.4k|      ret[i] = (*this)[i] + o[i];
  133|  10.4k|    }
  134|  3.48k|    return ret;
  135|  3.48k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  3.48k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  3.48k|  return v * o;
  294|  3.48k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  3.48k|  Self operator*(const Scalar &o) const {
  175|  3.48k|    Self ret;
  176|  13.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 10.4k, False: 3.48k]
  ------------------
  177|  10.4k|      ret[i] = (*this)[i] * o;
  178|  10.4k|    }
  179|  3.48k|    return ret;
  180|  3.48k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   560k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   560k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   560k|    v_[0] = c0;
   55|   560k|    v_[1] = c1;
   56|   560k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  24.4k|  VectorD() {
   41|  73.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 48.9k, False: 24.4k]
  ------------------
   42|  48.9k|      (*this)[i] = Scalar(0);
   43|  48.9k|    }
   44|  24.4k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  6.92k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  20.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 13.8k, False: 6.92k]
  ------------------
  104|  13.8k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 13.8k, False: 0]
  ------------------
  105|  13.8k|        v_[i] = Scalar(src_vector[i]);
  106|  13.8k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  13.8k|    }
  110|  6.92k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|  1.52k|  Self operator+(const Self &o) const {
  130|  1.52k|    Self ret;
  131|  4.56k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 3.04k, False: 1.52k]
  ------------------
  132|  3.04k|      ret[i] = (*this)[i] + o[i];
  133|  3.04k|    }
  134|  1.52k|    return ret;
  135|  1.52k|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  3.46k|  VectorD() {
   41|  10.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 6.92k, False: 3.46k]
  ------------------
   42|  6.92k|      (*this)[i] = Scalar(0);
   43|  6.92k|    }
   44|  3.46k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  20.7k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  13.8k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  3.46k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  10.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 6.92k, False: 3.46k]
  ------------------
  104|  6.92k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 6.92k, False: 0]
  ------------------
  105|  6.92k|        v_[i] = Scalar(src_vector[i]);
  106|  6.92k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  6.92k|    }
  110|  3.46k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  3.46k|  Self operator/(const Scalar &o) const {
  183|  3.46k|    Self ret;
  184|  10.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 6.92k, False: 3.46k]
  ------------------
  185|  6.92k|      ret[i] = (*this)[i] / o;
  186|  6.92k|    }
  187|  3.46k|    return ret;
  188|  3.46k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  1.93k|  Self operator-(const Self &o) const {
  138|  1.93k|    Self ret;
  139|  5.81k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 3.87k, False: 1.93k]
  ------------------
  140|  3.87k|      ret[i] = (*this)[i] - o[i];
  141|  3.87k|    }
  142|  1.93k|    return ret;
  143|  1.93k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  97.9k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  1.84M|  VectorD() {
   41|  7.37M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 5.53M, False: 1.84M]
  ------------------
   42|  5.53M|      (*this)[i] = Scalar(0);
   43|  5.53M|    }
   44|  1.84M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|   145M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   145M|    DRACO_DCHECK_EQ(dimension, 2);
   54|   145M|    v_[0] = c0;
   55|   145M|    v_[1] = c1;
   56|   145M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|   184M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|   552M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 368M, False: 184M]
  ------------------
  104|   368M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 368M, False: 0]
  ------------------
  105|   368M|        v_[i] = Scalar(src_vector[i]);
  106|   368M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|   368M|    }
  110|   184M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  92.1M|  VectorD() {
   41|   276M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 184M, False: 92.1M]
  ------------------
   42|   184M|      (*this)[i] = Scalar(0);
   43|   184M|    }
   44|  92.1M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  92.1M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|   276M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 184M, False: 92.1M]
  ------------------
  104|   184M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 184M, False: 0]
  ------------------
  105|   184M|        v_[i] = Scalar(src_vector[i]);
  106|   184M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|   184M|    }
  110|  92.1M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  74.3M|  VectorD(const Self &o) {
   89|   222M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 148M, False: 74.3M]
  ------------------
   90|   148M|      (*this)[i] = o[i];
   91|   148M|    }
   92|  74.3M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  18.5M|  VectorD() {
   41|  55.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 37.1M, False: 18.5M]
  ------------------
   42|  37.1M|      (*this)[i] = Scalar(0);
   43|  37.1M|    }
   44|  18.5M|  }
_ZN5draco7VectorDIjLi3EEC2ERKS1_:
   88|   786M|  VectorD(const Self &o) {
   89|  3.14G|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 2.36G, False: 786M]
  ------------------
   90|  2.36G|      (*this)[i] = o[i];
   91|  2.36G|    }
   92|   786M|  }
_ZNK5draco7VectorDIjLi3EEixEi:
  113|  2.36G|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIjLi3EEC2ERKjS3_S3_:
   59|   335M|      : v_({{c0, c1, c2}}) {
   60|   335M|    DRACO_DCHECK_EQ(dimension, 3);
   61|   335M|  }

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

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

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  5.40k|      : corner_table_(table),
  229|  5.40k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  5.40k|        corner_(start_corner_),
  231|  5.40k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  4.24M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  18.1k|  VertexCornersIterator &operator++() {
  268|  18.1k|    Next();
  269|  18.1k|    return *this;
  270|  18.1k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.62M|  void Next() {
  248|  3.62M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.59M, False: 29.9k]
  ------------------
  249|  3.59M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.59M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 24.6k, False: 3.57M]
  ------------------
  251|       |        // Open boundary reached.
  252|  24.6k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  24.6k|        left_traversal_ = false;
  254|  3.57M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 595k, False: 2.97M]
  ------------------
  255|       |        // End reached.
  256|   595k|        corner_ = kInvalidCornerIndex;
  257|   595k|      }
  258|  3.59M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  29.9k|      corner_ = corner_table_->SwingRight(corner_);
  262|  29.9k|    }
  263|  3.62M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  6.45M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  3.54M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  3.85M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  2.09M|  void Next() {
  248|  2.09M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 2.06M, False: 24.4k]
  ------------------
  249|  2.06M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  2.06M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 1.33M, False: 733k]
  ------------------
  251|       |        // Open boundary reached.
  252|  1.33M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  1.33M|        left_traversal_ = false;
  254|  1.33M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 120k, False: 613k]
  ------------------
  255|       |        // End reached.
  256|   120k|        corner_ = kInvalidCornerIndex;
  257|   120k|      }
  258|  2.06M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  24.4k|      corner_ = corner_table_->SwingRight(corner_);
  262|  24.4k|    }
  263|  2.09M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  1.45M|      : corner_table_(table),
  236|  1.45M|        start_corner_(corner_id),
  237|  1.45M|        corner_(start_corner_),
  238|  1.45M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   614k|      : corner_table_(table),
  236|   614k|        start_corner_(corner_id),
  237|   614k|        corner_(start_corner_),
  238|   614k|        left_traversal_(true) {}

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

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

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

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

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

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

_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|    571|  GeometryMetadata() {}

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

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

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

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

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

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

