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

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

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

_ZN5draco30AttributeQuantizationTransformC2Ev:
   29|    725|  AttributeQuantizationTransform() : quantization_bits_(-1), range_(0.f) {}

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

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

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

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

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

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

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

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

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

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  3.59k|      : quantization_bits_(-1),
   54|  3.59k|        max_quantized_value_(-1),
   55|  3.59k|        max_value_(-1),
   56|  3.59k|        dequantization_scale_(1.f),
   57|  3.59k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  3.23k|  bool SetQuantizationBits(int32_t q) {
   60|  3.23k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 932, False: 2.30k]
  |  Branch (60:18): [True: 224, False: 2.07k]
  ------------------
   61|  1.15k|      return false;
   62|  1.15k|    }
   63|  2.07k|    quantization_bits_ = q;
   64|  2.07k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  2.07k|    max_value_ = max_quantized_value_ - 1;
   66|  2.07k|    dequantization_scale_ = 2.f / max_value_;
   67|  2.07k|    center_value_ = max_value_ / 2;
   68|  2.07k|    return true;
   69|  3.23k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  3.22M|                                           int32_t *out_t) const {
   77|  3.22M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 3.19k, False: 3.22M]
  |  Branch (77:20): [True: 0, False: 3.19k]
  |  Branch (77:32): [True: 3.19k, False: 3.22M]
  |  Branch (77:42): [True: 0, False: 3.19k]
  ------------------
   78|  3.22M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 2.07M, False: 1.15M]
  |  Branch (78:29): [True: 4.89k, False: 2.06M]
  ------------------
   79|  4.89k|      s = max_value_;
   80|  4.89k|      t = max_value_;
   81|  3.22M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 3.19k, False: 3.21M]
  |  Branch (81:26): [True: 907, False: 2.28k]
  ------------------
   82|    907|      t = center_value_ - (t - center_value_);
   83|  3.21M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 2.06M, False: 1.15M]
  |  Branch (83:35): [True: 4.98k, False: 2.06M]
  ------------------
   84|  4.98k|      t = center_value_ + (center_value_ - t);
   85|  3.21M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 2.06M, False: 1.15M]
  |  Branch (85:35): [True: 264, False: 2.06M]
  ------------------
   86|    264|      s = center_value_ + (center_value_ - s);
   87|  3.21M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 4.41k, False: 3.20M]
  |  Branch (87:26): [True: 2.03k, False: 2.38k]
  ------------------
   88|  2.03k|      s = center_value_ - (s - center_value_);
   89|  2.03k|    }
   90|       |
   91|  3.22M|    *out_s = s;
   92|  3.22M|    *out_t = t;
   93|  3.22M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  3.22M|                                                       int32_t *out_t) const {
  100|  3.22M|    DRACO_DCHECK_EQ(
  101|  3.22M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  3.22M|        center_value_);
  103|  3.22M|    int32_t s, t;
  104|  3.22M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 1.62M, False: 1.60M]
  ------------------
  105|       |      // Right hemisphere.
  106|  1.62M|      s = (int_vec[1] + center_value_);
  107|  1.62M|      t = (int_vec[2] + center_value_);
  108|  1.62M|    } else {
  109|       |      // Left hemisphere.
  110|  1.60M|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 57.6k, False: 1.54M]
  ------------------
  111|  57.6k|        s = std::abs(int_vec[2]);
  112|  1.54M|      } else {
  113|  1.54M|        s = (max_value_ - std::abs(int_vec[2]));
  114|  1.54M|      }
  115|  1.60M|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 62.7k, False: 1.54M]
  ------------------
  116|  62.7k|        t = std::abs(int_vec[1]);
  117|  1.54M|      } else {
  118|  1.54M|        t = (max_value_ - std::abs(int_vec[1]));
  119|  1.54M|      }
  120|  1.60M|    }
  121|  3.22M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  3.22M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|   473k|                                                    float *out_vector) const {
  199|   473k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|   473k|                                 in_t * dequantization_scale_ - 1.f,
  201|   473k|                                 out_vector);
  202|   473k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  3.05M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  3.05M|    DRACO_DCHECK_LE(s, center_value_);
  208|  3.05M|    DRACO_DCHECK_LE(t, center_value_);
  209|  3.05M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  3.05M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  3.05M|    const uint32_t st =
  212|  3.05M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  3.05M|    return st <= center_value_;
  214|  3.05M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  3.37M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  3.37M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  3.37M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  3.37M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  3.37M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  3.37M|    int32_t sign_s = 0;
  223|  3.37M|    int32_t sign_t = 0;
  224|  3.37M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 3.05M, False: 320k]
  |  Branch (224:20): [True: 2.76M, False: 288k]
  ------------------
  225|  2.76M|      sign_s = 1;
  226|  2.76M|      sign_t = 1;
  227|  2.76M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 324k, False: 284k]
  |  Branch (227:27): [True: 177k, False: 147k]
  ------------------
  228|   177k|      sign_s = -1;
  229|   177k|      sign_t = -1;
  230|   431k|    } else {
  231|   431k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 284k, False: 147k]
  ------------------
  232|   431k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 147k, False: 284k]
  ------------------
  233|   431k|    }
  234|       |
  235|       |    // Perform the addition and subtraction using unsigned integers to avoid
  236|       |    // signed integer overflows for bad data. Note that the result will be
  237|       |    // unchanged for non-overflowing cases.
  238|  3.37M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  3.37M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  3.37M|    uint32_t us = *s;
  241|  3.37M|    uint32_t ut = *t;
  242|  3.37M|    us = us + us - corner_point_s;
  243|  3.37M|    ut = ut + ut - corner_point_t;
  244|  3.37M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 2.94M, False: 431k]
  ------------------
  245|  2.94M|      uint32_t temp = us;
  246|  2.94M|      us = -ut;
  247|  2.94M|      ut = -temp;
  248|  2.94M|    } else {
  249|   431k|      std::swap(us, ut);
  250|   431k|    }
  251|  3.37M|    us = us + corner_point_s;
  252|  3.37M|    ut = ut + corner_point_t;
  253|       |
  254|  3.37M|    *s = us;
  255|  3.37M|    *t = ut;
  256|  3.37M|    *s /= 2;
  257|  3.37M|    *t /= 2;
  258|  3.37M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  6.11M|  int32_t ModMax(int32_t x) const {
  273|  6.11M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 13.3k, False: 6.10M]
  ------------------
  274|  13.3k|      return x - this->max_quantized_value();
  275|  13.3k|    }
  276|  6.10M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 2.88k, False: 6.10M]
  ------------------
  277|  2.88k|      return x + this->max_quantized_value();
  278|  2.88k|    }
  279|  6.10M|    return x;
  280|  6.10M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.94k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  16.2k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  18.3M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|   473k|                                           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|   473k|    float y = in_s_scaled;
  329|   473k|    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|   473k|    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|   473k|    float x_offset = -x;
  342|   473k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 70.6k, False: 402k]
  ------------------
  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|   473k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 120k, False: 353k]
  ------------------
  348|   473k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 149k, False: 323k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|   473k|    const float norm_squared = x * x + y * y + z * z;
  352|   473k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 473k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|   473k|    } else {
  357|   473k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|   473k|      out_vector[0] = x * d;
  359|   473k|      out_vector[1] = y * d;
  360|   473k|      out_vector[2] = z * d;
  361|   473k|    }
  362|   473k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  3.22M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  3.22M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  3.22M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  3.22M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  3.22M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  3.22M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  3.22M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 2.92M, False: 297k]
  ------------------
  181|  2.92M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  2.92M|    } else {
  183|   297k|      vec[0] =
  184|   297k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   297k|          abs_sum;
  186|   297k|      vec[1] =
  187|   297k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   297k|          abs_sum;
  189|   297k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 157k, False: 140k]
  ------------------
  190|   157k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   157k|      } else {
  192|   140k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   140k|      }
  194|   297k|    }
  195|  3.22M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    464|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    464|            attribute, transform, mesh_data),
   52|    464|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    453|                                                                *buffer) {
  194|    453|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    453|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    453|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 23, False: 430]
  ------------------
  196|       |    // Decode prediction mode.
  197|     23|    uint8_t mode;
  198|     23|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 23]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|     23|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 17, False: 6]
  ------------------
  203|       |      // Unsupported mode.
  204|     17|      return false;
  205|     17|    }
  206|     23|  }
  207|    436|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.92k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.60k, False: 321]
  ------------------
  211|  1.60k|    uint32_t num_flags;
  212|  1.60k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 14, False: 1.58k]
  ------------------
  213|     14|      return false;
  214|     14|    }
  215|  1.58k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 62, False: 1.52k]
  ------------------
  216|     62|      return false;
  217|     62|    }
  218|  1.52k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 654, False: 871]
  ------------------
  219|    654|      is_crease_edge_[i].resize(num_flags);
  220|    654|      RAnsBitDecoder decoder;
  221|    654|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 39, False: 615]
  ------------------
  222|     39|        return false;
  223|     39|      }
  224|  1.41M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.41M, False: 615]
  ------------------
  225|  1.41M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.41M|      }
  227|    615|      decoder.EndDecoding();
  228|    615|    }
  229|  1.52k|  }
  230|    321|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    321|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    436|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    295|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    295|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    295|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.47k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.18k, False: 295]
  ------------------
   93|  1.18k|    pred_vals[i].resize(num_components, 0);
   94|  1.18k|  }
   95|    295|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    295|                                         out_data);
   97|       |
   98|    295|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    295|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    295|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    295|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    295|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    295|  const int corner_map_size =
  109|    295|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  1.12M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 1.12M, False: 157]
  ------------------
  111|  1.12M|    const CornerIndex start_corner_id =
  112|  1.12M|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  1.12M|    CornerIndex corner_id(start_corner_id);
  115|  1.12M|    int num_parallelograms = 0;
  116|  1.12M|    bool first_pass = true;
  117|  2.45M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 1.36M, False: 1.09M]
  ------------------
  118|  1.36M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 88.3k, False: 1.27M]
  ------------------
  119|  1.36M|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  1.36M|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  88.3k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  88.3k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 586, False: 87.7k]
  ------------------
  127|    586|          break;
  128|    586|        }
  129|  88.3k|      }
  130|       |
  131|       |      // Proceed to the next corner attached to the vertex. First swing left
  132|       |      // and if we reach a boundary, swing right from the start corner.
  133|  1.36M|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 1.31M, False: 41.8k]
  ------------------
  134|  1.31M|        corner_id = table->SwingLeft(corner_id);
  135|  1.31M|      } else {
  136|  41.8k|        corner_id = table->SwingRight(corner_id);
  137|  41.8k|      }
  138|  1.36M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 32.2k, False: 1.32M]
  ------------------
  139|  32.2k|        break;
  140|  32.2k|      }
  141|  1.32M|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 1.11M, False: 215k]
  |  Branch (141:47): [True: 1.09M, False: 22.1k]
  ------------------
  142|  1.09M|        first_pass = false;
  143|  1.09M|        corner_id = table->SwingRight(start_corner_id);
  144|  1.09M|      }
  145|  1.32M|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  1.12M|    int num_used_parallelograms = 0;
  150|  1.12M|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 56.2k, False: 1.06M]
  ------------------
  151|  7.97M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 7.92M, False: 56.2k]
  ------------------
  152|  7.92M|        multi_pred_vals[i] = 0;
  153|  7.92M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   144k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 88.2k, False: 56.0k]
  ------------------
  156|  88.2k|        const int context = num_parallelograms - 1;
  157|  88.2k|        const int pos = is_crease_edge_pos[context]++;
  158|  88.2k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 138, False: 88.1k]
  ------------------
  159|    138|          return false;
  160|    138|        }
  161|  88.1k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  88.1k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 12.7k, False: 75.3k]
  ------------------
  163|  12.7k|          ++num_used_parallelograms;
  164|  1.45M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 1.44M, False: 12.7k]
  ------------------
  165|  1.44M|            multi_pred_vals[j] =
  166|  1.44M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  1.44M|          }
  168|  12.7k|        }
  169|  88.1k|      }
  170|  56.2k|    }
  171|  1.12M|    const int dst_offset = p * num_components;
  172|  1.12M|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 1.11M, False: 5.61k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  1.11M|      const int src_offset = (p - 1) * num_components;
  176|  1.11M|      this->transform().ComputeOriginalValue(
  177|  1.11M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  1.11M|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   605k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 599k, False: 5.61k]
  ------------------
  181|   599k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   599k|      }
  183|  5.61k|      this->transform().ComputeOriginalValue(
  184|  5.61k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  5.61k|    }
  186|  1.12M|  }
  187|    157|  return true;
  188|    295|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    499|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    499|            attribute, transform, mesh_data),
   52|    499|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    484|                                                                *buffer) {
  194|    484|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    484|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    484|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 3, False: 481]
  ------------------
  196|       |    // Decode prediction mode.
  197|      3|    uint8_t mode;
  198|      3|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 1, False: 2]
  ------------------
  199|      1|      return false;
  200|      1|    }
  201|       |
  202|      2|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 1, False: 1]
  ------------------
  203|       |      // Unsupported mode.
  204|      1|      return false;
  205|      1|    }
  206|      2|  }
  207|    482|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  2.05k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.70k, False: 352]
  ------------------
  211|  1.70k|    uint32_t num_flags;
  212|  1.70k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 17, False: 1.68k]
  ------------------
  213|     17|      return false;
  214|     17|    }
  215|  1.68k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 80, False: 1.60k]
  ------------------
  216|     80|      return false;
  217|     80|    }
  218|  1.60k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 608, False: 998]
  ------------------
  219|    608|      is_crease_edge_[i].resize(num_flags);
  220|    608|      RAnsBitDecoder decoder;
  221|    608|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 33, False: 575]
  ------------------
  222|     33|        return false;
  223|     33|      }
  224|   881k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 881k, False: 575]
  ------------------
  225|   881k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|   881k|      }
  227|    575|      decoder.EndDecoding();
  228|    575|    }
  229|  1.60k|  }
  230|    352|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    352|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    482|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    309|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    309|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    309|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.54k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.23k, False: 309]
  ------------------
   93|  1.23k|    pred_vals[i].resize(num_components, 0);
   94|  1.23k|  }
   95|    309|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    309|                                         out_data);
   97|       |
   98|    309|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    309|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    309|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    309|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    309|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    309|  const int corner_map_size =
  109|    309|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   138k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 138k, False: 163]
  ------------------
  111|   138k|    const CornerIndex start_corner_id =
  112|   138k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   138k|    CornerIndex corner_id(start_corner_id);
  115|   138k|    int num_parallelograms = 0;
  116|   138k|    bool first_pass = true;
  117|   854k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 825k, False: 29.2k]
  ------------------
  118|   825k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 243k, False: 581k]
  ------------------
  119|   825k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   825k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   243k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   243k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 556, False: 242k]
  ------------------
  127|    556|          break;
  128|    556|        }
  129|   243k|      }
  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|   824k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 752k, False: 72.0k]
  ------------------
  134|   752k|        corner_id = table->SwingLeft(corner_id);
  135|   752k|      } else {
  136|  72.0k|        corner_id = table->SwingRight(corner_id);
  137|  72.0k|      }
  138|   824k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 108k, False: 716k]
  ------------------
  139|   108k|        break;
  140|   108k|      }
  141|   716k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 55.4k, False: 660k]
  |  Branch (141:47): [True: 29.2k, False: 26.2k]
  ------------------
  142|  29.2k|        first_pass = false;
  143|  29.2k|        corner_id = table->SwingRight(start_corner_id);
  144|  29.2k|      }
  145|   716k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   138k|    int num_used_parallelograms = 0;
  150|   138k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 136k, False: 1.80k]
  ------------------
  151|  11.1M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 10.9M, False: 136k]
  ------------------
  152|  10.9M|        multi_pred_vals[i] = 0;
  153|  10.9M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   379k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 243k, False: 136k]
  ------------------
  156|   243k|        const int context = num_parallelograms - 1;
  157|   243k|        const int pos = is_crease_edge_pos[context]++;
  158|   243k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 146, False: 243k]
  ------------------
  159|    146|          return false;
  160|    146|        }
  161|   243k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   243k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 11.2k, False: 232k]
  ------------------
  163|  11.2k|          ++num_used_parallelograms;
  164|  1.09M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 1.07M, False: 11.2k]
  ------------------
  165|  1.07M|            multi_pred_vals[j] =
  166|  1.07M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  1.07M|          }
  168|  11.2k|        }
  169|   243k|      }
  170|   136k|    }
  171|   138k|    const int dst_offset = p * num_components;
  172|   138k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 132k, False: 5.53k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   132k|      const int src_offset = (p - 1) * num_components;
  176|   132k|      this->transform().ComputeOriginalValue(
  177|   132k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   132k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   508k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 502k, False: 5.53k]
  ------------------
  181|   502k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   502k|      }
  183|  5.53k|      this->transform().ComputeOriginalValue(
  184|  5.53k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  5.53k|    }
  186|   138k|  }
  187|    163|  return true;
  188|    309|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  3.10k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  3.10k|    mesh_ = mesh;
   39|  3.10k|    corner_table_ = table;
   40|  3.10k|    data_to_corner_map_ = data_to_corner_map;
   41|  3.10k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  3.10k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  15.8M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  11.0M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  11.0M|    return vertex_to_data_map_;
   48|  11.0M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  6.88M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  6.88M|    return data_to_corner_map_;
   51|  6.88M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  3.04k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  3.04k|    mesh_ = mesh;
   39|  3.04k|    corner_table_ = table;
   40|  3.04k|    data_to_corner_map_ = data_to_corner_map;
   41|  3.04k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  3.04k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  12.4M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  10.9M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  10.9M|    return vertex_to_data_map_;
   48|  10.9M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  2.53M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  2.53M|    return data_to_corner_map_;
   51|  2.53M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  3.10k|      : mesh_(nullptr),
   31|  3.10k|        corner_table_(nullptr),
   32|  3.10k|        vertex_to_data_map_(nullptr),
   33|  3.10k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  3.04k|      : mesh_(nullptr),
   31|  3.04k|        corner_table_(nullptr),
   32|  3.04k|        vertex_to_data_map_(nullptr),
   33|  3.04k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   927k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   320k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   806k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   257k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.62k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.62k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  8.48M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.66k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.66k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  2.91M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    225|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    225|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    201|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    201|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    224|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    224|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    172|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    172|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    448|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    225|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    225|    DRACO_DCHECK_EQ(i, 0);
   70|    225|    (void)i;
   71|    225|    return GeometryAttribute::POSITION;
   72|    225|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    224|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    224|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 224]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    224|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 223]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    223|    predictor_.SetPositionAttribute(*att);
   82|    223|    return true;
   83|    224|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    223|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    223|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 8, False: 215]
  ------------------
  145|      8|    return false;
  146|      8|  }
  147|       |
  148|    215|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    215|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    215|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 63, False: 152]
  ------------------
  150|     63|    uint8_t prediction_mode;
  151|     63|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 62]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     62|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 4, False: 58]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      4|      return false;
  157|      4|    }
  158|       |
  159|     58|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 58]
  ------------------
  160|     58|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     58|  }
  164|    210|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    210|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 12, False: 198]
  ------------------
  168|     12|    return false;
  169|     12|  }
  170|       |
  171|    198|  return true;
  172|    210|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    198|                                      const PointIndex *entry_to_point_id_map) {
  103|    198|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    198|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    198|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    198|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    198|  const int corner_map_size =
  111|    198|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    198|  VectorD<int32_t, 3> pred_normal_3d;
  114|    198|  int32_t pred_normal_oct[2];
  115|       |
  116|   927k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 926k, False: 198]
  ------------------
  117|   926k|    const CornerIndex corner_id =
  118|   926k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   926k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   926k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   926k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   926k|                    octahedron_tool_box_.center_value());
  125|   926k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 524k, False: 402k]
  ------------------
  126|   524k|      pred_normal_3d = -pred_normal_3d;
  127|   524k|    }
  128|   926k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   926k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   926k|    const int data_offset = data_id * 2;
  132|   926k|    this->transform().ComputeOriginalValue(
  133|   926k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   926k|  }
  135|    198|  flip_normal_bit_decoder_.EndDecoding();
  136|    198|  return true;
  137|    198|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    198|  void SetQuantizationBits(int q) {
   85|    198|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    198|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    397|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    201|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    201|    DRACO_DCHECK_EQ(i, 0);
   70|    201|    (void)i;
   71|    201|    return GeometryAttribute::POSITION;
   72|    201|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    198|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    198|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 198]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    198|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 196]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    196|    predictor_.SetPositionAttribute(*att);
   82|    196|    return true;
   83|    198|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    196|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    196|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 6, False: 190]
  ------------------
  145|      6|    return false;
  146|      6|  }
  147|       |
  148|    190|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    190|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    190|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 25, False: 165]
  ------------------
  150|     25|    uint8_t prediction_mode;
  151|     25|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 24]
  ------------------
  152|      1|      return false;
  153|      1|    }
  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|    188|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    188|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 7, False: 181]
  ------------------
  168|      7|    return false;
  169|      7|  }
  170|       |
  171|    181|  return true;
  172|    188|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    181|                                      const PointIndex *entry_to_point_id_map) {
  103|    181|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    181|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    181|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    181|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    181|  const int corner_map_size =
  111|    181|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    181|  VectorD<int32_t, 3> pred_normal_3d;
  114|    181|  int32_t pred_normal_oct[2];
  115|       |
  116|   320k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 320k, False: 181]
  ------------------
  117|   320k|    const CornerIndex corner_id =
  118|   320k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   320k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   320k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   320k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   320k|                    octahedron_tool_box_.center_value());
  125|   320k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 250k, False: 69.7k]
  ------------------
  126|   250k|      pred_normal_3d = -pred_normal_3d;
  127|   250k|    }
  128|   320k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   320k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   320k|    const int data_offset = data_id * 2;
  132|   320k|    this->transform().ComputeOriginalValue(
  133|   320k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   320k|  }
  135|    181|  flip_normal_bit_decoder_.EndDecoding();
  136|    181|  return true;
  137|    181|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    181|  void SetQuantizationBits(int q) {
   85|    181|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    181|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    447|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    224|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    224|    DRACO_DCHECK_EQ(i, 0);
   70|    224|    (void)i;
   71|    224|    return GeometryAttribute::POSITION;
   72|    224|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    224|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    224|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 224]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    224|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 223]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    223|    predictor_.SetPositionAttribute(*att);
   82|    223|    return true;
   83|    224|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    223|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    223|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 10, False: 213]
  ------------------
  145|     10|    return false;
  146|     10|  }
  147|       |
  148|    213|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    213|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    213|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 56, False: 157]
  ------------------
  150|     56|    uint8_t prediction_mode;
  151|     56|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 55]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     55|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 3, False: 52]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      3|      return false;
  157|      3|    }
  158|       |
  159|     52|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 52]
  ------------------
  160|     52|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     52|  }
  164|    209|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    209|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 6, False: 203]
  ------------------
  168|      6|    return false;
  169|      6|  }
  170|       |
  171|    203|  return true;
  172|    209|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    203|                                      const PointIndex *entry_to_point_id_map) {
  103|    203|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    203|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    203|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    203|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    203|  const int corner_map_size =
  111|    203|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    203|  VectorD<int32_t, 3> pred_normal_3d;
  114|    203|  int32_t pred_normal_oct[2];
  115|       |
  116|   806k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 806k, False: 203]
  ------------------
  117|   806k|    const CornerIndex corner_id =
  118|   806k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   806k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   806k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   806k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   806k|                    octahedron_tool_box_.center_value());
  125|   806k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 446k, False: 359k]
  ------------------
  126|   446k|      pred_normal_3d = -pred_normal_3d;
  127|   446k|    }
  128|   806k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   806k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   806k|    const int data_offset = data_id * 2;
  132|   806k|    this->transform().ComputeOriginalValue(
  133|   806k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   806k|  }
  135|    203|  flip_normal_bit_decoder_.EndDecoding();
  136|    203|  return true;
  137|    203|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    203|  void SetQuantizationBits(int q) {
   85|    203|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    203|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    341|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   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_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    172|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    172|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 172]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    172|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 3, False: 169]
  ------------------
   79|      3|      return false;  // Currently works only for 3 component positions.
   80|      3|    }
   81|    169|    predictor_.SetPositionAttribute(*att);
   82|    169|    return true;
   83|    172|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    167|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    167|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 162]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|       |
  148|    162|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    162|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    162|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 24, False: 138]
  ------------------
  150|     24|    uint8_t prediction_mode;
  151|     24|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 23]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     23|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 22]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     22|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 22]
  ------------------
  160|     22|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     22|  }
  164|    160|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    160|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 4, False: 156]
  ------------------
  168|      4|    return false;
  169|      4|  }
  170|       |
  171|    156|  return true;
  172|    160|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    156|                                      const PointIndex *entry_to_point_id_map) {
  103|    156|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    156|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    156|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    156|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    156|  const int corner_map_size =
  111|    156|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    156|  VectorD<int32_t, 3> pred_normal_3d;
  114|    156|  int32_t pred_normal_oct[2];
  115|       |
  116|   257k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 257k, False: 156]
  ------------------
  117|   257k|    const CornerIndex corner_id =
  118|   257k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   257k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   257k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   257k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   257k|                    octahedron_tool_box_.center_value());
  125|   257k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 215k, False: 41.9k]
  ------------------
  126|   215k|      pred_normal_3d = -pred_normal_3d;
  127|   215k|    }
  128|   257k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   257k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   257k|    const int data_offset = data_id * 2;
  132|   257k|    this->transform().ComputeOriginalValue(
  133|   257k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   257k|  }
  135|    156|  flip_normal_bit_decoder_.EndDecoding();
  136|    156|  return true;
  137|    156|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    156|  void SetQuantizationBits(int q) {
   85|    156|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    156|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    437|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    437|            attribute, transform, mesh_data),
   37|    437|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    871|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    437|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    437|    DRACO_DCHECK_EQ(i, 0);
   70|    437|    (void)i;
   71|    437|    return GeometryAttribute::POSITION;
   72|    437|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    436|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    436|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 436]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    436|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 434]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    434|    predictor_.SetPositionAttribute(*att);
   82|    434|    return true;
   83|    436|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    433|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    433|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 39, False: 394]
  ------------------
  145|     39|    return false;
  146|     39|  }
  147|       |
  148|    394|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    394|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    394|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 183, False: 211]
  ------------------
  150|    183|    uint8_t prediction_mode;
  151|    183|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 182]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|    182|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 3, False: 179]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      3|      return false;
  157|      3|    }
  158|       |
  159|    179|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 179]
  ------------------
  160|    179|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|    179|  }
  164|    390|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    390|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 35, False: 355]
  ------------------
  168|     35|    return false;
  169|     35|  }
  170|       |
  171|    355|  return true;
  172|    390|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    355|                                      const PointIndex *entry_to_point_id_map) {
  103|    355|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    355|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    355|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    355|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    355|  const int corner_map_size =
  111|    355|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    355|  VectorD<int32_t, 3> pred_normal_3d;
  114|    355|  int32_t pred_normal_oct[2];
  115|       |
  116|   699k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 699k, False: 355]
  ------------------
  117|   699k|    const CornerIndex corner_id =
  118|   699k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   699k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   699k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   699k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   699k|                    octahedron_tool_box_.center_value());
  125|   699k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 458k, False: 240k]
  ------------------
  126|   458k|      pred_normal_3d = -pred_normal_3d;
  127|   458k|    }
  128|   699k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   699k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   699k|    const int data_offset = data_id * 2;
  132|   699k|    this->transform().ComputeOriginalValue(
  133|   699k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   699k|  }
  135|    355|  flip_normal_bit_decoder_.EndDecoding();
  136|    355|  return true;
  137|    355|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    355|  void SetQuantizationBits(int q) {
   85|    355|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    355|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    472|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    472|            attribute, transform, mesh_data),
   37|    472|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    940|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    472|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    472|    DRACO_DCHECK_EQ(i, 0);
   70|    472|    (void)i;
   71|    472|    return GeometryAttribute::POSITION;
   72|    472|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    470|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    470|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 470]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    470|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 468]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    468|    predictor_.SetPositionAttribute(*att);
   82|    468|    return true;
   83|    470|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    468|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    468|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 57, False: 411]
  ------------------
  145|     57|    return false;
  146|     57|  }
  147|       |
  148|    411|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    411|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    411|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 145, False: 266]
  ------------------
  150|    145|    uint8_t prediction_mode;
  151|    145|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 144]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|    144|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 143]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|    143|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 143]
  ------------------
  160|    143|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|    143|  }
  164|    409|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    409|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 32, False: 377]
  ------------------
  168|     32|    return false;
  169|     32|  }
  170|       |
  171|    377|  return true;
  172|    409|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    377|                                      const PointIndex *entry_to_point_id_map) {
  103|    377|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    377|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    377|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    377|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    377|  const int corner_map_size =
  111|    377|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    377|  VectorD<int32_t, 3> pred_normal_3d;
  114|    377|  int32_t pred_normal_oct[2];
  115|       |
  116|   215k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 214k, False: 377]
  ------------------
  117|   214k|    const CornerIndex corner_id =
  118|   214k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   214k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   214k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   214k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   214k|                    octahedron_tool_box_.center_value());
  125|   214k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 134k, False: 79.8k]
  ------------------
  126|   134k|      pred_normal_3d = -pred_normal_3d;
  127|   134k|    }
  128|   214k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   214k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   214k|    const int data_offset = data_id * 2;
  132|   214k|    this->transform().ComputeOriginalValue(
  133|   214k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   214k|  }
  135|    377|  flip_normal_bit_decoder_.EndDecoding();
  136|    377|  return true;
  137|    377|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    377|  void SetQuantizationBits(int q) {
   85|    377|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    377|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    225|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    225|            attribute, transform, mesh_data),
   37|    225|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    201|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    201|            attribute, transform, mesh_data),
   37|    201|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    224|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    224|            attribute, transform, mesh_data),
   37|    224|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    172|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    172|            attribute, transform, mesh_data),
   37|    172|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    283|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    283|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 44, False: 239]
  ------------------
  105|     44|      this->normal_prediction_mode_ = mode;
  106|     44|      return true;
  107|    239|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 239, False: 0]
  ------------------
  108|    239|      this->normal_prediction_mode_ = mode;
  109|    239|      return true;
  110|    239|    }
  111|      0|    return false;
  112|    283|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   926k|                             DataTypeT *prediction) override {
   42|   926k|    DRACO_DCHECK(this->IsInitialized());
   43|   926k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   926k|    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|   926k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   926k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   926k|    VectorD<int64_t, 3> normal;
   53|   926k|    CornerIndex c_next, c_prev;
   54|  1.89M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 965k, False: 926k]
  ------------------
   55|       |      // Getting corners.
   56|   965k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 246, False: 965k]
  ------------------
   57|    246|        c_next = corner_table->Next(corner_id);
   58|    246|        c_prev = corner_table->Previous(corner_id);
   59|   965k|      } else {
   60|   965k|        c_next = corner_table->Next(cit.Corner());
   61|   965k|        c_prev = corner_table->Previous(cit.Corner());
   62|   965k|      }
   63|   965k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   965k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   965k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   965k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   965k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   965k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   965k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   965k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   965k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   965k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   965k|      cit.Next();
   81|   965k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   926k|    constexpr int64_t upper_bound = 1 << 29;
   85|   926k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 164, False: 926k]
  ------------------
   86|    164|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    164|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 49, False: 115]
  ------------------
   88|     49|        const int64_t quotient = abs_sum / upper_bound;
   89|     49|        normal = normal / quotient;
   90|     49|      }
   91|   926k|    } else {
   92|   926k|      const int64_t abs_sum = normal.AbsSum();
   93|   926k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 3.17k, False: 923k]
  ------------------
   94|  3.17k|        const int64_t quotient = abs_sum / upper_bound;
   95|  3.17k|        normal = normal / quotient;
   96|  3.17k|      }
   97|   926k|    }
   98|   926k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   926k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   926k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   926k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   926k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    224|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    224|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 21, False: 203]
  ------------------
  105|     21|      this->normal_prediction_mode_ = mode;
  106|     21|      return true;
  107|    203|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 203, False: 0]
  ------------------
  108|    203|      this->normal_prediction_mode_ = mode;
  109|    203|      return true;
  110|    203|    }
  111|      0|    return false;
  112|    224|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   320k|                             DataTypeT *prediction) override {
   42|   320k|    DRACO_DCHECK(this->IsInitialized());
   43|   320k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   320k|    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|   320k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   320k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   320k|    VectorD<int64_t, 3> normal;
   53|   320k|    CornerIndex c_next, c_prev;
   54|  2.22M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.90M, False: 320k]
  ------------------
   55|       |      // Getting corners.
   56|  1.90M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 126, False: 1.90M]
  ------------------
   57|    126|        c_next = corner_table->Next(corner_id);
   58|    126|        c_prev = corner_table->Previous(corner_id);
   59|  1.90M|      } else {
   60|  1.90M|        c_next = corner_table->Next(cit.Corner());
   61|  1.90M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.90M|      }
   63|  1.90M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.90M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.90M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.90M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.90M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.90M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.90M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.90M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.90M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.90M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.90M|      cit.Next();
   81|  1.90M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   320k|    constexpr int64_t upper_bound = 1 << 29;
   85|   320k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 84, False: 320k]
  ------------------
   86|     84|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     84|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 20, False: 64]
  ------------------
   88|     20|        const int64_t quotient = abs_sum / upper_bound;
   89|     20|        normal = normal / quotient;
   90|     20|      }
   91|   320k|    } else {
   92|   320k|      const int64_t abs_sum = normal.AbsSum();
   93|   320k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 131k, False: 188k]
  ------------------
   94|   131k|        const int64_t quotient = abs_sum / upper_bound;
   95|   131k|        normal = normal / quotient;
   96|   131k|      }
   97|   320k|    }
   98|   320k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   320k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   320k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   320k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   320k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    276|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    276|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 51, False: 225]
  ------------------
  105|     51|      this->normal_prediction_mode_ = mode;
  106|     51|      return true;
  107|    225|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 225, False: 0]
  ------------------
  108|    225|      this->normal_prediction_mode_ = mode;
  109|    225|      return true;
  110|    225|    }
  111|      0|    return false;
  112|    276|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   806k|                             DataTypeT *prediction) override {
   42|   806k|    DRACO_DCHECK(this->IsInitialized());
   43|   806k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   806k|    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|   806k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   806k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   806k|    VectorD<int64_t, 3> normal;
   53|   806k|    CornerIndex c_next, c_prev;
   54|  1.64M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 842k, False: 806k]
  ------------------
   55|       |      // Getting corners.
   56|   842k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 300, False: 841k]
  ------------------
   57|    300|        c_next = corner_table->Next(corner_id);
   58|    300|        c_prev = corner_table->Previous(corner_id);
   59|   841k|      } else {
   60|   841k|        c_next = corner_table->Next(cit.Corner());
   61|   841k|        c_prev = corner_table->Previous(cit.Corner());
   62|   841k|      }
   63|   842k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   842k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   842k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   842k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   842k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   842k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   842k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   842k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   842k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   842k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   842k|      cit.Next();
   81|   842k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   806k|    constexpr int64_t upper_bound = 1 << 29;
   85|   806k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 200, False: 806k]
  ------------------
   86|    200|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    200|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 30, False: 170]
  ------------------
   88|     30|        const int64_t quotient = abs_sum / upper_bound;
   89|     30|        normal = normal / quotient;
   90|     30|      }
   91|   806k|    } else {
   92|   806k|      const int64_t abs_sum = normal.AbsSum();
   93|   806k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 3.06k, False: 803k]
  ------------------
   94|  3.06k|        const int64_t quotient = abs_sum / upper_bound;
   95|  3.06k|        normal = normal / quotient;
   96|  3.06k|      }
   97|   806k|    }
   98|   806k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   806k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   806k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   806k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   806k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    194|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    194|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 20, False: 174]
  ------------------
  105|     20|      this->normal_prediction_mode_ = mode;
  106|     20|      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|    194|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   257k|                             DataTypeT *prediction) override {
   42|   257k|    DRACO_DCHECK(this->IsInitialized());
   43|   257k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   257k|    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|   257k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   257k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   257k|    VectorD<int64_t, 3> normal;
   53|   257k|    CornerIndex c_next, c_prev;
   54|  1.79M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.53M, False: 257k]
  ------------------
   55|       |      // Getting corners.
   56|  1.53M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 114, False: 1.53M]
  ------------------
   57|    114|        c_next = corner_table->Next(corner_id);
   58|    114|        c_prev = corner_table->Previous(corner_id);
   59|  1.53M|      } else {
   60|  1.53M|        c_next = corner_table->Next(cit.Corner());
   61|  1.53M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.53M|      }
   63|  1.53M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.53M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.53M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.53M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.53M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.53M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.53M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.53M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.53M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.53M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.53M|      cit.Next();
   81|  1.53M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   257k|    constexpr int64_t upper_bound = 1 << 29;
   85|   257k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 76, False: 257k]
  ------------------
   86|     76|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     76|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 18, False: 58]
  ------------------
   88|     18|        const int64_t quotient = abs_sum / upper_bound;
   89|     18|        normal = normal / quotient;
   90|     18|      }
   91|   257k|    } else {
   92|   257k|      const int64_t abs_sum = normal.AbsSum();
   93|   257k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 132k, False: 124k]
  ------------------
   94|   132k|        const int64_t quotient = abs_sum / upper_bound;
   95|   132k|        normal = normal / quotient;
   96|   132k|      }
   97|   257k|    }
   98|   257k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   257k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   257k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   257k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   257k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    437|      : Base(md) {
   35|    437|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    437|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    616|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    616|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 147, False: 469]
  ------------------
  105|    147|      this->normal_prediction_mode_ = mode;
  106|    147|      return true;
  107|    469|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 469, False: 0]
  ------------------
  108|    469|      this->normal_prediction_mode_ = mode;
  109|    469|      return true;
  110|    469|    }
  111|      0|    return false;
  112|    616|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   699k|                             DataTypeT *prediction) override {
   42|   699k|    DRACO_DCHECK(this->IsInitialized());
   43|   699k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   699k|    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|   699k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   699k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   699k|    VectorD<int64_t, 3> normal;
   53|   699k|    CornerIndex c_next, c_prev;
   54|  2.01M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.32M, False: 699k]
  ------------------
   55|       |      // Getting corners.
   56|  1.32M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 410k, False: 909k]
  ------------------
   57|   410k|        c_next = corner_table->Next(corner_id);
   58|   410k|        c_prev = corner_table->Previous(corner_id);
   59|   909k|      } else {
   60|   909k|        c_next = corner_table->Next(cit.Corner());
   61|   909k|        c_prev = corner_table->Previous(cit.Corner());
   62|   909k|      }
   63|  1.32M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.32M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.32M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.32M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.32M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.32M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.32M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.32M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.32M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.32M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.32M|      cit.Next();
   81|  1.32M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   699k|    constexpr int64_t upper_bound = 1 << 29;
   85|   699k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 69.3k, False: 629k]
  ------------------
   86|  69.3k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  69.3k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 382, False: 69.0k]
  ------------------
   88|    382|        const int64_t quotient = abs_sum / upper_bound;
   89|    382|        normal = normal / quotient;
   90|    382|      }
   91|   629k|    } else {
   92|   629k|      const int64_t abs_sum = normal.AbsSum();
   93|   629k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.96k, False: 627k]
  ------------------
   94|  1.96k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.96k|        normal = normal / quotient;
   96|  1.96k|      }
   97|   629k|    }
   98|   699k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   699k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   699k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   699k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   699k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    472|      : Base(md) {
   35|    472|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    472|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    615|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    615|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 129, False: 486]
  ------------------
  105|    129|      this->normal_prediction_mode_ = mode;
  106|    129|      return true;
  107|    486|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 486, False: 0]
  ------------------
  108|    486|      this->normal_prediction_mode_ = mode;
  109|    486|      return true;
  110|    486|    }
  111|      0|    return false;
  112|    615|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   214k|                             DataTypeT *prediction) override {
   42|   214k|    DRACO_DCHECK(this->IsInitialized());
   43|   214k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   214k|    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|   214k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   214k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   214k|    VectorD<int64_t, 3> normal;
   53|   214k|    CornerIndex c_next, c_prev;
   54|  1.46M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.25M, False: 214k]
  ------------------
   55|       |      // Getting corners.
   56|  1.25M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 356k, False: 895k]
  ------------------
   57|   356k|        c_next = corner_table->Next(corner_id);
   58|   356k|        c_prev = corner_table->Previous(corner_id);
   59|   895k|      } else {
   60|   895k|        c_next = corner_table->Next(cit.Corner());
   61|   895k|        c_prev = corner_table->Previous(cit.Corner());
   62|   895k|      }
   63|  1.25M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.25M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.25M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.25M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.25M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.25M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.25M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.25M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.25M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.25M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.25M|      cit.Next();
   81|  1.25M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   214k|    constexpr int64_t upper_bound = 1 << 29;
   85|   214k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 60.1k, False: 154k]
  ------------------
   86|  60.1k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  60.1k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 355, False: 59.8k]
  ------------------
   88|    355|        const int64_t quotient = abs_sum / upper_bound;
   89|    355|        normal = normal / quotient;
   90|    355|      }
   91|   154k|    } else {
   92|   154k|      const int64_t abs_sum = normal.AbsSum();
   93|   154k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.56k, False: 152k]
  ------------------
   94|  2.56k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.56k|        normal = normal / quotient;
   96|  2.56k|      }
   97|   154k|    }
   98|   214k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   214k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   214k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   214k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   214k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    225|      : Base(md) {
   35|    225|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    225|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    201|      : Base(md) {
   35|    201|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    201|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    224|      : Base(md) {
   35|    224|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    224|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    172|      : Base(md) {
   35|    172|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    172|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.85M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.85M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.85M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.85M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.85M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.85M|    return GetPositionForDataId(data_id);
   77|  2.85M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.85M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.85M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.85M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.85M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.85M|    VectorD<int64_t, 3> pos;
   68|  2.85M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.85M|    return pos;
   70|  2.85M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    223|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    223|    pos_attribute_ = &position_attribute;
   43|    223|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    198|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    198|    entry_to_point_id_map_ = map;
   46|    198|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  4.13M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  4.13M|    DRACO_DCHECK(this->IsInitialized());
   73|  4.13M|    const auto corner_table = mesh_data_.corner_table();
   74|  4.13M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  4.13M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  4.13M|    return GetPositionForDataId(data_id);
   77|  4.13M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  4.13M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  4.13M|    DRACO_DCHECK(this->IsInitialized());
   65|  4.13M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  4.13M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  4.13M|    VectorD<int64_t, 3> pos;
   68|  4.13M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  4.13M|    return pos;
   70|  4.13M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    196|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    196|    pos_attribute_ = &position_attribute;
   43|    196|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    181|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    181|    entry_to_point_id_map_ = map;
   46|    181|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.49M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.49M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.49M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.49M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.49M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.49M|    return GetPositionForDataId(data_id);
   77|  2.49M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.49M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.49M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.49M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.49M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.49M|    VectorD<int64_t, 3> pos;
   68|  2.49M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.49M|    return pos;
   70|  2.49M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    223|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    223|    pos_attribute_ = &position_attribute;
   43|    223|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    203|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    203|    entry_to_point_id_map_ = map;
   46|    203|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_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_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   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_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    169|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    169|    pos_attribute_ = &position_attribute;
   43|    169|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    156|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    156|    entry_to_point_id_map_ = map;
   46|    156|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    437|      : pos_attribute_(nullptr),
   36|    437|        entry_to_point_id_map_(nullptr),
   37|    437|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    437|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.33M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.33M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.33M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.33M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.33M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.33M|    return GetPositionForDataId(data_id);
   77|  3.33M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  3.33M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.33M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.33M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.33M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.33M|    VectorD<int64_t, 3> pos;
   68|  3.33M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.33M|    return pos;
   70|  3.33M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    434|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    434|    pos_attribute_ = &position_attribute;
   43|    434|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    355|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    355|    entry_to_point_id_map_ = map;
   46|    355|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    472|      : pos_attribute_(nullptr),
   36|    472|        entry_to_point_id_map_(nullptr),
   37|    472|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    472|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.71M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.71M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.71M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.71M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.71M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.71M|    return GetPositionForDataId(data_id);
   77|  2.71M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.71M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.71M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.71M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.71M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.71M|    VectorD<int64_t, 3> pos;
   68|  2.71M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.71M|    return pos;
   70|  2.71M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    468|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    468|    pos_attribute_ = &position_attribute;
   43|    468|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    377|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    377|    entry_to_point_id_map_ = map;
   46|    377|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    225|      : pos_attribute_(nullptr),
   36|    225|        entry_to_point_id_map_(nullptr),
   37|    225|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    225|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    201|      : pos_attribute_(nullptr),
   36|    201|        entry_to_point_id_map_(nullptr),
   37|    201|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    201|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    224|      : pos_attribute_(nullptr),
   36|    224|        entry_to_point_id_map_(nullptr),
   37|    224|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    224|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    172|      : pos_attribute_(nullptr),
   36|    172|        entry_to_point_id_map_(nullptr),
   37|    172|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    172|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    336|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    336|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    318|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    318|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    318|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    318|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    318|      new DataTypeT[num_components]());
   70|       |
   71|    318|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    318|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    318|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    318|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    318|  const int corner_map_size =
   78|    318|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   675k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 675k, False: 318]
  ------------------
   80|   675k|    const CornerIndex start_corner_id =
   81|   675k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   675k|    CornerIndex corner_id(start_corner_id);
   84|   675k|    int num_parallelograms = 0;
   85|  26.2M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 25.5M, False: 675k]
  ------------------
   86|  25.5M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  25.5M|    }
   88|  2.11M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 1.44M, False: 675k]
  ------------------
   89|  1.44M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 298k, False: 1.14M]
  ------------------
   90|  1.44M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  1.44M|              num_components, parallelogram_pred_vals.get())) {
   92|  16.8M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 16.5M, False: 298k]
  ------------------
   93|  16.5M|          pred_vals[c] =
   94|  16.5M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  16.5M|        }
   96|   298k|        ++num_parallelograms;
   97|   298k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  1.44M|      corner_id = table->SwingRight(corner_id);
  101|  1.44M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 152k, False: 1.29M]
  ------------------
  102|   152k|        corner_id = kInvalidCornerIndex;
  103|   152k|      }
  104|  1.44M|    }
  105|       |
  106|   675k|    const int dst_offset = p * num_components;
  107|   675k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 516k, False: 159k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|   516k|      const int src_offset = (p - 1) * num_components;
  111|   516k|      this->transform().ComputeOriginalValue(
  112|   516k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   516k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  8.61M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 8.45M, False: 159k]
  ------------------
  116|  8.45M|        pred_vals[c] /= num_parallelograms;
  117|  8.45M|      }
  118|   159k|      this->transform().ComputeOriginalValue(
  119|   159k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   159k|    }
  121|   675k|  }
  122|    318|  return true;
  123|    318|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    612|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    612|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    567|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    567|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    567|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    567|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    567|      new DataTypeT[num_components]());
   70|       |
   71|    567|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    567|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    567|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    567|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    567|  const int corner_map_size =
   78|    567|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   950k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 950k, False: 567]
  ------------------
   80|   950k|    const CornerIndex start_corner_id =
   81|   950k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   950k|    CornerIndex corner_id(start_corner_id);
   84|   950k|    int num_parallelograms = 0;
   85|  30.9M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 29.9M, False: 950k]
  ------------------
   86|  29.9M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  29.9M|    }
   88|  6.56M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 5.61M, False: 950k]
  ------------------
   89|  5.61M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 1.84M, False: 3.76M]
  ------------------
   90|  5.61M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  5.61M|              num_components, parallelogram_pred_vals.get())) {
   92|  60.1M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 58.2M, False: 1.84M]
  ------------------
   93|  58.2M|          pred_vals[c] =
   94|  58.2M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  58.2M|        }
   96|  1.84M|        ++num_parallelograms;
   97|  1.84M|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  5.61M|      corner_id = table->SwingRight(corner_id);
  101|  5.61M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 929k, False: 4.68M]
  ------------------
  102|   929k|        corner_id = kInvalidCornerIndex;
  103|   929k|      }
  104|  5.61M|    }
  105|       |
  106|   950k|    const int dst_offset = p * num_components;
  107|   950k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 3.26k, False: 946k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  3.26k|      const int src_offset = (p - 1) * num_components;
  111|  3.26k|      this->transform().ComputeOriginalValue(
  112|  3.26k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   946k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  30.7M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 29.8M, False: 946k]
  ------------------
  116|  29.8M|        pred_vals[c] /= num_parallelograms;
  117|  29.8M|      }
  118|   946k|      this->transform().ComputeOriginalValue(
  119|   946k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   946k|    }
  121|   950k|  }
  122|    567|  return true;
  123|    567|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  4.26M|    int num_components, DataTypeT *out_prediction) {
   49|  4.26M|  const CornerIndex oci = table->Opposite(ci);
   50|  4.26M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 2.75M, False: 1.51M]
  ------------------
   51|  2.75M|    return false;
   52|  2.75M|  }
   53|  1.51M|  int vert_opp, vert_next, vert_prev;
   54|  1.51M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  1.51M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  1.51M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 904k, False: 607k]
  |  Branch (56:35): [True: 732k, False: 171k]
  ------------------
   57|   732k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 708k, False: 23.5k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   708k|    const int v_opp_off = vert_opp * num_components;
   60|   708k|    const int v_next_off = vert_next * num_components;
   61|   708k|    const int v_prev_off = vert_prev * num_components;
   62|  35.6M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 34.9M, False: 708k]
  ------------------
   63|  34.9M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  34.9M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  34.9M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  34.9M|      const int64_t result =
   67|  34.9M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  34.9M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  34.9M|    }
   71|   708k|    return true;
   72|   708k|  }
   73|   802k|  return false;  // Not all data is available for prediction
   74|  1.51M|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  1.51M|    int *next_entry, int *prev_entry) {
   32|       |  // One vertex of the input |table| correspond to exactly one attribute value
   33|       |  // entry. The |table| can be either CornerTable for per-vertex attributes,
   34|       |  // or MeshAttributeCornerTable for attributes with interior seams.
   35|  1.51M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  1.51M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  1.51M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  1.51M|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  6.71M|    int num_components, DataTypeT *out_prediction) {
   49|  6.71M|  const CornerIndex oci = table->Opposite(ci);
   50|  6.71M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 47.9k, False: 6.67M]
  ------------------
   51|  47.9k|    return false;
   52|  47.9k|  }
   53|  6.67M|  int vert_opp, vert_next, vert_prev;
   54|  6.67M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  6.67M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  6.67M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 3.44M, False: 3.22M]
  |  Branch (56:35): [True: 2.65M, False: 791k]
  ------------------
   57|  2.65M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 2.36M, False: 281k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  2.36M|    const int v_opp_off = vert_opp * num_components;
   60|  2.36M|    const int v_next_off = vert_next * num_components;
   61|  2.36M|    const int v_prev_off = vert_prev * num_components;
   62|  96.2M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 93.8M, False: 2.36M]
  ------------------
   63|  93.8M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  93.8M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  93.8M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  93.8M|      const int64_t result =
   67|  93.8M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  93.8M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  93.8M|    }
   71|  2.36M|    return true;
   72|  2.36M|  }
   73|  4.30M|  return false;  // Not all data is available for prediction
   74|  6.67M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  6.67M|    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|  6.67M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  6.67M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  6.67M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  6.67M|}

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

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

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    261|      : pos_attribute_(nullptr),
   39|    261|        entry_to_point_id_map_(nullptr),
   40|    261|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    258|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    258|    pos_attribute_ = &position_attribute;
   43|    258|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    248|  void ResizeOrientations(int num_orientations) {
   74|    248|    orientations_.resize(num_orientations);
   75|    248|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|  2.00G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    208|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    208|    entry_to_point_id_map_ = map;
   46|    208|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   632k|                                                 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|   632k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   632k|  const CornerIndex prev_corner_id =
   99|   632k|      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|   632k|  int next_data_id, prev_data_id;
  103|       |
  104|   632k|  int next_vert_id, prev_vert_id;
  105|   632k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   632k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   632k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   632k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   632k|  typedef VectorD<int64_t, 2> Vec2;
  112|   632k|  typedef VectorD<int64_t, 3> Vec3;
  113|   632k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   632k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 437k, False: 194k]
  |  Branch (115:33): [True: 242k, False: 194k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   242k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   242k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   242k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 215k, False: 26.4k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   215k|      predicted_value_[0] = p_uv[0];
  122|   215k|      predicted_value_[1] = p_uv[1];
  123|   215k|      return true;
  124|   215k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  26.4k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  26.4k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  26.4k|    const Vec3 prev_pos = GetPositionForEntryId(prev_data_id);
  130|       |    // We use the positions of the above triangle to predict the texture
  131|       |    // coordinate on the tip corner C.
  132|       |    // To convert the triangle into the UV coordinate system we first compute
  133|       |    // position X on the vector |prev_pos - next_pos| that is the projection of
  134|       |    // point C onto vector |prev_pos - next_pos|:
  135|       |    //
  136|       |    //              C
  137|       |    //             /.  \
  138|       |    //            / .     \
  139|       |    //           /  .        \
  140|       |    //          N---X----------P
  141|       |    //
  142|       |    // Where next_pos is point (N), prev_pos is point (P) and tip_pos is the
  143|       |    // position of predicted coordinate (C).
  144|       |    //
  145|  26.4k|    const Vec3 pn = prev_pos - next_pos;
  146|  26.4k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  26.4k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 965, False: 25.5k]
  ------------------
  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|    965|      const Vec3 cn = tip_pos - next_pos;
  153|    965|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|    965|      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|    965|      const int64_t n_uv_absmax_element =
  164|    965|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|    965|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 47, False: 918]
  ------------------
  166|    965|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     47|        return false;
  169|     47|      }
  170|    918|      const int64_t pn_uv_absmax_element =
  171|    918|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|    918|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 26, False: 892]
  ------------------
  173|    918|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     26|        return false;
  176|     26|      }
  177|    892|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|    892|      const int64_t pn_absmax_element =
  179|    892|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|    892|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 14, False: 878]
  ------------------
  181|    892|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|     14|        return false;
  184|     14|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|    878|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|    878|      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|    878|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|    878|      const uint64_t norm_squared =
  207|    878|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|    878|      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|    878|      Vec2 predicted_uv;
  214|    878|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 878]
  ------------------
  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|    878|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|    878|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 3, False: 875]
  ------------------
  233|      3|          return false;
  234|      3|        }
  235|    875|        const bool orientation = orientations_.back();
  236|    875|        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|    875|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 370, False: 505]
  ------------------
  240|    370|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    505|        } else {
  242|    505|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    505|        }
  244|    875|      }
  245|    875|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|    875|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|    875|      return true;
  248|    878|    }
  249|  26.4k|  }
  250|       |  // Else we don't have available textures on both corners or the position data
  251|       |  // is invalid. For such cases we can't use positions for predicting the uv
  252|       |  // value and we resort to delta coding.
  253|   415k|  int data_offset = 0;
  254|   415k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 220k, False: 194k]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|   220k|    data_offset = prev_data_id * kNumComponents;
  257|   220k|  }
  258|   415k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 25.5k, False: 389k]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  25.5k|    data_offset = next_data_id * kNumComponents;
  261|   389k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|   389k|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 389k, False: 208]
  ------------------
  265|   389k|      data_offset = (data_id - 1) * kNumComponents;
  266|   389k|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    624|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 416, False: 208]
  ------------------
  269|    416|        predicted_value_[i] = 0;
  270|    416|      }
  271|    208|      return true;
  272|    208|    }
  273|   389k|  }
  274|  1.24M|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 829k, False: 414k]
  ------------------
  275|   829k|    predicted_value_[i] = data[data_offset + i];
  276|   829k|  }
  277|   414k|  return true;
  278|   415k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   484k|                                            const DataTypeT *data) const {
   59|   484k|    const int data_offset = entry_id * kNumComponents;
   60|   484k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   484k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  79.4k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  79.4k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  79.4k|    VectorD<int64_t, 3> pos;
   52|  79.4k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  79.4k|                                 &pos[0]);
   54|  79.4k|    return pos;
   55|  79.4k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|   631k|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    272|      : pos_attribute_(nullptr),
   39|    272|        entry_to_point_id_map_(nullptr),
   40|    272|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    268|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    268|    pos_attribute_ = &position_attribute;
   43|    268|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    263|  void ResizeOrientations(int num_orientations) {
   74|    263|    orientations_.resize(num_orientations);
   75|    263|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  8.94G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    205|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    205|    entry_to_point_id_map_ = map;
   46|    205|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   213k|                                                 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|   213k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   213k|  const CornerIndex prev_corner_id =
   99|   213k|      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|   213k|  int next_data_id, prev_data_id;
  103|       |
  104|   213k|  int next_vert_id, prev_vert_id;
  105|   213k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   213k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   213k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   213k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   213k|  typedef VectorD<int64_t, 2> Vec2;
  112|   213k|  typedef VectorD<int64_t, 3> Vec3;
  113|   213k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   213k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 212k, False: 308]
  |  Branch (115:33): [True: 212k, False: 320]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   212k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   212k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   212k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 201k, False: 10.8k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   201k|      predicted_value_[0] = p_uv[0];
  122|   201k|      predicted_value_[1] = p_uv[1];
  123|   201k|      return true;
  124|   201k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  10.8k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  10.8k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  10.8k|    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|  10.8k|    const Vec3 pn = prev_pos - next_pos;
  146|  10.8k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  10.8k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.55k, False: 9.30k]
  ------------------
  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.55k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.55k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.55k|      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.55k|      const int64_t n_uv_absmax_element =
  164|  1.55k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.55k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 26, False: 1.52k]
  ------------------
  166|  1.55k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     26|        return false;
  169|     26|      }
  170|  1.52k|      const int64_t pn_uv_absmax_element =
  171|  1.52k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.52k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 31, False: 1.49k]
  ------------------
  173|  1.52k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     31|        return false;
  176|     31|      }
  177|  1.49k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.49k|      const int64_t pn_absmax_element =
  179|  1.49k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.49k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 12, False: 1.48k]
  ------------------
  181|  1.49k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|     12|        return false;
  184|     12|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.48k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.48k|      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.48k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.48k|      const uint64_t norm_squared =
  207|  1.48k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.48k|      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.48k|      Vec2 predicted_uv;
  214|  1.48k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.48k]
  ------------------
  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.48k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.48k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 3, False: 1.47k]
  ------------------
  233|      3|          return false;
  234|      3|        }
  235|  1.47k|        const bool orientation = orientations_.back();
  236|  1.47k|        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.47k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 454, False: 1.02k]
  ------------------
  240|    454|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|  1.02k|        } else {
  242|  1.02k|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|  1.02k|        }
  244|  1.47k|      }
  245|  1.47k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.47k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.47k|      return true;
  248|  1.48k|    }
  249|  10.8k|  }
  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|  9.92k|  int data_offset = 0;
  254|  9.92k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 9.62k, False: 308]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  9.62k|    data_offset = prev_data_id * kNumComponents;
  257|  9.62k|  }
  258|  9.92k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 9.30k, False: 620]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  9.30k|    data_offset = next_data_id * kNumComponents;
  261|  9.30k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|    620|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 415, False: 205]
  ------------------
  265|    415|      data_offset = (data_id - 1) * kNumComponents;
  266|    415|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    615|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 410, False: 205]
  ------------------
  269|    410|        predicted_value_[i] = 0;
  270|    410|      }
  271|    205|      return true;
  272|    205|    }
  273|    620|  }
  274|  29.1k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 19.4k, False: 9.72k]
  ------------------
  275|  19.4k|    predicted_value_[i] = data[data_offset + i];
  276|  19.4k|  }
  277|  9.72k|  return true;
  278|  9.92k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   425k|                                            const DataTypeT *data) const {
   59|   425k|    const int data_offset = entry_id * kNumComponents;
   60|   425k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   425k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|  32.5k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  32.5k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  32.5k|    VectorD<int64_t, 3> pos;
   52|  32.5k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  32.5k|                                 &pos[0]);
   54|  32.5k|    return pos;
   55|  32.5k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   213k|  const DataTypeT *predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    232|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    634|  bool AreCorrectionsPositive() override {
   71|    634|    return transform_.AreCorrectionsPositive();
   72|    634|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    215|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    215|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 40, False: 175]
  ------------------
   50|     40|      return false;
   51|     40|    }
   52|    175|    return true;
   53|    215|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|  1.58M|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    268|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    644|  bool AreCorrectionsPositive() override {
   71|    644|    return transform_.AreCorrectionsPositive();
   72|    644|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    254|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    254|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 26, False: 228]
  ------------------
   50|     26|      return false;
   51|     26|    }
   52|    228|    return true;
   53|    254|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  1.47M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  5.82k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  3.97k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  5.57k|  bool AreCorrectionsPositive() override {
   71|  5.57k|    return transform_.AreCorrectionsPositive();
   72|  5.57k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  4.32k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  4.32k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 264, False: 4.06k]
  ------------------
   50|    264|      return false;
   51|    264|    }
   52|  4.06k|    return true;
   53|  4.32k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  8.15M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    658|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    664|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    658|                                 const PointCloudDecoder *decoder) {
  188|    658|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    658|      method, att_id, decoder, TransformT());
  190|    658|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    658|                                 const TransformT &transform) {
  156|    658|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 658]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    658|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    658|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 658, 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|    658|    const MeshDecoder *const mesh_decoder =
  167|    658|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    658|    auto ret = CreateMeshPredictionScheme<
  170|    658|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    658|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    658|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    658|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 426, False: 232]
  ------------------
  174|    426|      return ret;
  175|    426|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    658|  }
  178|       |  // Create delta decoder.
  179|    232|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    232|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    658|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    243|      uint16_t bitstream_version) {
  143|    243|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    243|        method, attribute, transform, mesh_data, bitstream_version);
  145|    243|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    243|        uint16_t bitstream_version) {
  127|    243|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 225, False: 18]
  ------------------
  128|    225|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    225|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    225|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    225|                                                  mesh_data));
  132|    225|      }
  133|     18|      return nullptr;
  134|    243|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    207|      uint16_t bitstream_version) {
  143|    207|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    207|        method, attribute, transform, mesh_data, bitstream_version);
  145|    207|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    207|        uint16_t bitstream_version) {
  127|    207|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 201, False: 6]
  ------------------
  128|    201|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    201|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    201|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    201|                                                  mesh_data));
  132|    201|      }
  133|      6|      return nullptr;
  134|    207|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    664|                                 const PointCloudDecoder *decoder) {
  188|    664|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    664|      method, att_id, decoder, TransformT());
  190|    664|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    664|                                 const TransformT &transform) {
  156|    664|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 664]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    664|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    664|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 664, 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|    664|    const MeshDecoder *const mesh_decoder =
  167|    664|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    664|    auto ret = CreateMeshPredictionScheme<
  170|    664|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    664|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    664|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    664|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 396, False: 268]
  ------------------
  174|    396|      return ret;
  175|    396|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    664|  }
  178|       |  // Create delta decoder.
  179|    268|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    268|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    664|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    228|      uint16_t bitstream_version) {
  143|    228|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    228|        method, attribute, transform, mesh_data, bitstream_version);
  145|    228|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    228|        uint16_t bitstream_version) {
  111|    228|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 224, False: 4]
  ------------------
  112|    224|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    224|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    224|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    224|                                                  mesh_data));
  116|    224|      }
  117|      4|      return nullptr;
  118|    228|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    175|      uint16_t bitstream_version) {
  143|    175|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    175|        method, attribute, transform, mesh_data, bitstream_version);
  145|    175|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    175|        uint16_t bitstream_version) {
  111|    175|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 172, False: 3]
  ------------------
  112|    172|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    172|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    172|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    172|                                                  mesh_data));
  116|    172|      }
  117|      3|      return nullptr;
  118|    175|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  5.82k|                                 const PointCloudDecoder *decoder) {
  188|  5.82k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  5.82k|      method, att_id, decoder, TransformT());
  190|  5.82k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  5.82k|                                 const TransformT &transform) {
  156|  5.82k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 5.82k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  5.82k|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|  5.82k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 5.82k, 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|  5.82k|    const MeshDecoder *const mesh_decoder =
  167|  5.82k|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|  5.82k|    auto ret = CreateMeshPredictionScheme<
  170|  5.82k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  5.82k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  5.82k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  5.82k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 5.29k, False: 537]
  ------------------
  174|  5.29k|      return ret;
  175|  5.29k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  5.82k|  }
  178|       |  // Create delta decoder.
  179|    537|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    537|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  5.82k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.62k|      uint16_t bitstream_version) {
  143|  2.62k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.62k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.62k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.62k|        uint16_t bitstream_version) {
   53|  2.62k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 896, False: 1.73k]
  ------------------
   54|    896|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    896|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    896|                                                         MeshDataT>(
   57|    896|                attribute, transform, mesh_data));
   58|    896|      }
   59|  1.73k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.73k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 336, False: 1.39k]
  ------------------
   61|    336|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    336|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    336|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    336|                                                  mesh_data));
   65|    336|      }
   66|  1.39k|#endif
   67|  1.39k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 464, False: 933]
  ------------------
   68|    464|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    464|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    464|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    464|                                                  mesh_data));
   72|    464|      }
   73|    933|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    933|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 235, False: 698]
  ------------------
   75|    235|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    235|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    235|                                                     MeshDataT>(
   78|    235|                attribute, transform, mesh_data, bitstream_version));
   79|    235|      }
   80|    698|#endif
   81|    698|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 261, False: 437]
  ------------------
   82|    261|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    261|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    261|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    261|                                                  mesh_data));
   86|    261|      }
   87|    437|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    437|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 437, False: 0]
  ------------------
   89|    437|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    437|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    437|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    437|                                                  mesh_data));
   93|    437|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.62k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.66k|      uint16_t bitstream_version) {
  143|  2.66k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.66k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.66k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.66k|        uint16_t bitstream_version) {
   53|  2.66k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 634, False: 2.02k]
  ------------------
   54|    634|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    634|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    634|                                                         MeshDataT>(
   57|    634|                attribute, transform, mesh_data));
   58|    634|      }
   59|  2.02k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  2.02k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 612, False: 1.41k]
  ------------------
   61|    612|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    612|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    612|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    612|                                                  mesh_data));
   65|    612|      }
   66|  1.41k|#endif
   67|  1.41k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 499, False: 917]
  ------------------
   68|    499|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    499|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    499|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    499|                                                  mesh_data));
   72|    499|      }
   73|    917|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    917|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 173, False: 744]
  ------------------
   75|    173|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    173|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    173|                                                     MeshDataT>(
   78|    173|                attribute, transform, mesh_data, bitstream_version));
   79|    173|      }
   80|    744|#endif
   81|    744|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 272, False: 472]
  ------------------
   82|    272|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    272|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    272|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    272|                                                  mesh_data));
   86|    272|      }
   87|    472|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    472|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 472, False: 0]
  ------------------
   89|    472|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    472|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    472|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    472|                                                  mesh_data));
   93|    472|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.66k|    }

_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    175|    const PointIndex *) {
   50|    175|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    175|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    175|  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|   334k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 334k, False: 175]
  ------------------
   57|   334k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|   334k|                                           in_corr + i, out_data + i);
   59|   334k|  }
   60|    175|  return true;
   61|    175|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    228|    const PointIndex *) {
   50|    228|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    228|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    228|  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|   413k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 412k, False: 228]
  ------------------
   57|   412k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|   412k|                                           in_corr + i, out_data + i);
   59|   412k|  }
   60|    228|  return true;
   61|    228|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    537|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    434|    const PointIndex *) {
   50|    434|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    434|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    434|  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.04M|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 1.04M, False: 434]
  ------------------
   57|  1.04M|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|  1.04M|                                           in_corr + i, out_data + i);
   59|  1.04M|  }
   60|    434|  return true;
   61|    434|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    232|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    268|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    658|    uint16_t bitstream_version) {
   38|    658|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    658|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 658, False: 0]
  ------------------
   40|    658|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 117, False: 541]
  ------------------
   41|    541|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 6, False: 535]
  ------------------
   42|    535|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 3, False: 532]
  ------------------
   43|    532|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 1, False: 531]
  ------------------
   44|    531|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 466, False: 65]
  ------------------
   45|    596|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 3, False: 62]
  ------------------
   46|    596|    const CornerTable *const ct = source->GetCornerTable();
   47|    596|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    596|        source->GetAttributeEncodingData(att_id);
   49|    596|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 146, False: 450]
  |  Branch (49:26): [True: 0, False: 450]
  ------------------
   50|       |      // No connectivity data found.
   51|    146|      return nullptr;
   52|    146|    }
   53|       |    // Connectivity data exists.
   54|    450|    const MeshAttributeCornerTable *const att_ct =
   55|    450|        source->GetAttributeCornerTable(att_id);
   56|    450|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 243, False: 207]
  ------------------
   57|    243|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    243|      MeshData md;
   59|    243|      md.Set(source->mesh(), att_ct,
   60|    243|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    243|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    243|      MeshPredictionSchemeFactoryT factory;
   63|    243|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    243|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 225, False: 18]
  ------------------
   65|    225|        return ret;
   66|    225|      }
   67|    243|    } else {
   68|    207|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    207|      MeshData md;
   70|    207|      md.Set(source->mesh(), ct,
   71|    207|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    207|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    207|      MeshPredictionSchemeFactoryT factory;
   74|    207|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    207|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 201, False: 6]
  ------------------
   76|    201|        return ret;
   77|    201|      }
   78|    207|    }
   79|    450|  }
   80|     86|  return nullptr;
   81|    658|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    664|    uint16_t bitstream_version) {
   38|    664|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    664|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 664, False: 0]
  ------------------
   40|    664|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 17, False: 647]
  ------------------
   41|    647|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 33, False: 614]
  ------------------
   42|    614|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 2, False: 612]
  ------------------
   43|    612|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 21, False: 591]
  ------------------
   44|    591|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 450, False: 141]
  ------------------
   45|    576|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 53, False: 88]
  ------------------
   46|    576|    const CornerTable *const ct = source->GetCornerTable();
   47|    576|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    576|        source->GetAttributeEncodingData(att_id);
   49|    576|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 173, False: 403]
  |  Branch (49:26): [True: 0, False: 403]
  ------------------
   50|       |      // No connectivity data found.
   51|    173|      return nullptr;
   52|    173|    }
   53|       |    // Connectivity data exists.
   54|    403|    const MeshAttributeCornerTable *const att_ct =
   55|    403|        source->GetAttributeCornerTable(att_id);
   56|    403|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 228, False: 175]
  ------------------
   57|    228|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    228|      MeshData md;
   59|    228|      md.Set(source->mesh(), att_ct,
   60|    228|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    228|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    228|      MeshPredictionSchemeFactoryT factory;
   63|    228|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    228|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 224, False: 4]
  ------------------
   65|    224|        return ret;
   66|    224|      }
   67|    228|    } else {
   68|    175|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    175|      MeshData md;
   70|    175|      md.Set(source->mesh(), ct,
   71|    175|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    175|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    175|      MeshPredictionSchemeFactoryT factory;
   74|    175|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    175|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 172, False: 3]
  ------------------
   76|    172|        return ret;
   77|    172|      }
   78|    175|    }
   79|    403|  }
   80|     95|  return nullptr;
   81|    664|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  5.82k|    uint16_t bitstream_version) {
   38|  5.82k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  5.82k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 5.82k, False: 0]
  ------------------
   40|  5.82k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 1.64k, False: 4.18k]
  ------------------
   41|  4.18k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 1.04k, False: 3.14k]
  ------------------
   42|  3.14k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 998, False: 2.14k]
  ------------------
   43|  2.14k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 539, False: 1.60k]
  ------------------
   44|  1.60k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 919, False: 690]
  ------------------
   45|  5.55k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 417, False: 273]
  ------------------
   46|  5.55k|    const CornerTable *const ct = source->GetCornerTable();
   47|  5.55k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  5.55k|        source->GetAttributeEncodingData(att_id);
   49|  5.55k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 264, False: 5.29k]
  |  Branch (49:26): [True: 0, False: 5.29k]
  ------------------
   50|       |      // No connectivity data found.
   51|    264|      return nullptr;
   52|    264|    }
   53|       |    // Connectivity data exists.
   54|  5.29k|    const MeshAttributeCornerTable *const att_ct =
   55|  5.29k|        source->GetAttributeCornerTable(att_id);
   56|  5.29k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 2.62k, False: 2.66k]
  ------------------
   57|  2.62k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  2.62k|      MeshData md;
   59|  2.62k|      md.Set(source->mesh(), att_ct,
   60|  2.62k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  2.62k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  2.62k|      MeshPredictionSchemeFactoryT factory;
   63|  2.62k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  2.62k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 2.62k, False: 0]
  ------------------
   65|  2.62k|        return ret;
   66|  2.62k|      }
   67|  2.66k|    } else {
   68|  2.66k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  2.66k|      MeshData md;
   70|  2.66k|      md.Set(source->mesh(), ct,
   71|  2.66k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  2.66k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  2.66k|      MeshPredictionSchemeFactoryT factory;
   74|  2.66k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  2.66k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 2.66k, False: 0]
  ------------------
   76|  2.66k|        return ret;
   77|  2.66k|      }
   78|  2.66k|    }
   79|  5.29k|  }
   80|    273|  return nullptr;
   81|  5.82k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  1.47M|  bool IsInBottomLeft(const Point2 &p) const {
   93|  1.47M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 1.07M, False: 403k]
  |  Branch (93:22): [True: 1.01M, False: 55.1k]
  ------------------
   94|  1.01M|      return true;
   95|  1.01M|    }
   96|   458k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 166k, False: 292k]
  |  Branch (96:25): [True: 107k, False: 59.1k]
  ------------------
   97|  1.47M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  1.47M|  int32_t GetRotationCount(Point2 pred) const {
   51|  1.47M|    const DataType sign_x = pred[0];
   52|  1.47M|    const DataType sign_y = pred[1];
   53|       |
   54|  1.47M|    int32_t rotation_count = 0;
   55|  1.47M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 1.07M, False: 403k]
  ------------------
   56|  1.07M|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 1.01M, False: 55.1k]
  ------------------
   57|  1.01M|        rotation_count = 0;
   58|  1.01M|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 50.3k, False: 4.82k]
  ------------------
   59|  50.3k|        rotation_count = 3;
   60|  50.3k|      } else {
   61|  4.82k|        rotation_count = 1;
   62|  4.82k|      }
   63|  1.07M|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 237k, False: 166k]
  ------------------
   64|   237k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 140k, False: 97.3k]
  ------------------
   65|   140k|        rotation_count = 2;
   66|   140k|      } else {
   67|  97.3k|        rotation_count = 1;
   68|  97.3k|      }
   69|   237k|    } else {
   70|   166k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 107k, False: 59.1k]
  ------------------
   71|   107k|        rotation_count = 0;
   72|   107k|      } else {
   73|  59.1k|        rotation_count = 3;
   74|  59.1k|      }
   75|   166k|    }
   76|  1.47M|    return rotation_count;
   77|  1.47M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   703k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   703k|    switch (rotation_count) {
   81|   211k|      case 1:
  ------------------
  |  Branch (81:7): [True: 211k, False: 491k]
  ------------------
   82|   211k|        return Point2(p[1], -p[0]);
   83|   280k|      case 2:
  ------------------
  |  Branch (83:7): [True: 280k, False: 423k]
  ------------------
   84|   280k|        return Point2(-p[0], -p[1]);
   85|   211k|      case 3:
  ------------------
  |  Branch (85:7): [True: 211k, False: 491k]
  ------------------
   86|   211k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 703k]
  ------------------
   88|      0|        return p;
   89|   703k|    }
   90|   703k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    664|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

_ZN5draco49PredictionSchemeNormalOctahedronDecodingTransformIiE19DecodeTransformDataEPNS_13DecoderBufferE:
   45|    634|  bool DecodeTransformData(DecoderBuffer *buffer) {
   46|    634|    DataTypeT max_quantized_value, center_value;
   47|    634|    if (!buffer->Decode(&max_quantized_value)) {
  ------------------
  |  Branch (47:9): [True: 13, False: 621]
  ------------------
   48|     13|      return false;
   49|     13|    }
   50|    621|    if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    621|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (50:9): [True: 109, False: 512]
  ------------------
   51|    109|      if (!buffer->Decode(&center_value)) {
  ------------------
  |  Branch (51:11): [True: 3, False: 106]
  ------------------
   52|      3|        return false;
   53|      3|      }
   54|    109|    }
   55|    618|    (void)center_value;
   56|    618|    return this->set_max_quantized_value(max_quantized_value);
   57|    621|  }
_ZNK5draco49PredictionSchemeNormalOctahedronDecodingTransformIiE20ComputeOriginalValueEPKiS3_Pi:
   61|  1.58M|                                   DataType *out_orig_vals) const {
   62|  1.58M|    DRACO_DCHECK_LE(pred_vals[0], 2 * this->center_value());
   63|  1.58M|    DRACO_DCHECK_LE(pred_vals[1], 2 * this->center_value());
   64|  1.58M|    DRACO_DCHECK_LE(corr_vals[0], 2 * this->center_value());
   65|  1.58M|    DRACO_DCHECK_LE(corr_vals[1], 2 * this->center_value());
   66|       |
   67|  1.58M|    DRACO_DCHECK_LE(0, pred_vals[0]);
   68|  1.58M|    DRACO_DCHECK_LE(0, pred_vals[1]);
   69|  1.58M|    DRACO_DCHECK_LE(0, corr_vals[0]);
   70|  1.58M|    DRACO_DCHECK_LE(0, corr_vals[1]);
   71|       |
   72|  1.58M|    const Point2 pred = Point2(pred_vals[0], pred_vals[1]);
   73|  1.58M|    const Point2 corr = Point2(corr_vals[0], corr_vals[1]);
   74|  1.58M|    const Point2 orig = ComputeOriginalValue(pred, corr);
   75|       |
   76|  1.58M|    out_orig_vals[0] = orig[0];
   77|  1.58M|    out_orig_vals[1] = orig[1];
   78|  1.58M|  }
_ZNK5draco49PredictionSchemeNormalOctahedronDecodingTransformIiE20ComputeOriginalValueENS_7VectorDIiLi2EEERKS3_:
   81|  1.58M|  Point2 ComputeOriginalValue(Point2 pred, const Point2 &corr) const {
   82|  1.58M|    const Point2 t(this->center_value(), this->center_value());
   83|  1.58M|    typedef typename std::make_unsigned<DataTypeT>::type UnsignedDataTypeT;
   84|  1.58M|    typedef VectorD<UnsignedDataTypeT, 2> Point2u;
   85|       |
   86|       |    // Perform the addition in unsigned type to avoid signed integer overflow.
   87|       |    // Note that the result will be the same (for non-overflowing values).
   88|  1.58M|    pred = Point2(Point2u(pred) - Point2u(t));
   89|       |
   90|  1.58M|    const bool pred_is_in_diamond = this->IsInDiamond(pred[0], pred[1]);
   91|  1.58M|    if (!pred_is_in_diamond) {
  ------------------
  |  Branch (91:9): [True: 821k, False: 760k]
  ------------------
   92|   821k|      this->InvertDiamond(&pred[0], &pred[1]);
   93|   821k|    }
   94|       |
   95|       |    // Perform the addition in unsigned type to avoid signed integer overflow.
   96|       |    // Note that the result will be the same (for non-overflowing values).
   97|  1.58M|    Point2 orig(Point2u(pred) + Point2u(corr));
   98|       |
   99|  1.58M|    orig[0] = this->ModMax(orig[0]);
  100|  1.58M|    orig[1] = this->ModMax(orig[1]);
  101|  1.58M|    if (!pred_is_in_diamond) {
  ------------------
  |  Branch (101:9): [True: 821k, False: 760k]
  ------------------
  102|   821k|      this->InvertDiamond(&orig[0], &orig[1]);
  103|   821k|    }
  104|       |
  105|       |    // Perform the addition in unsigned type to avoid signed integer overflow.
  106|       |    // Note that the result will be the same (for non-overflowing values).
  107|  1.58M|    orig = Point2(Point2u(orig) + Point2u(t));
  108|  1.58M|    return orig;
  109|  1.58M|  }
_ZN5draco49PredictionSchemeNormalOctahedronDecodingTransformIiE4InitEi:
   44|    175|  void Init(int num_components) {}
_ZN5draco49PredictionSchemeNormalOctahedronDecodingTransformIiEC2Ev:
   41|    658|  PredictionSchemeNormalOctahedronDecodingTransform() {}

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

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

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|  5.57k|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|  4.89k|  inline void set_min_value(const DataTypeT &v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|  4.89k|  inline void set_max_value(const DataTypeT &v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|  4.89k|  bool InitCorrectionBounds() {
   84|  4.89k|    const int64_t dif =
   85|  4.89k|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|  4.89k|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 4.89k]
  |  Branch (86:20): [True: 24, False: 4.86k]
  ------------------
   87|     24|      return false;
   88|     24|    }
   89|  4.86k|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|  4.86k|    max_correction_ = max_dif_ / 2;
   91|  4.86k|    min_correction_ = -max_correction_;
   92|  4.86k|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 2.00k, False: 2.86k]
  ------------------
   93|  2.00k|      max_correction_ -= 1;
   94|  2.00k|    }
   95|  4.86k|    return true;
   96|  4.89k|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|  4.04k|  void Init(int num_components) {
   56|  4.04k|    num_components_ = num_components;
   57|  4.04k|    clamped_value_.resize(num_components);
   58|  4.04k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|  8.15M|      const DataTypeT *predicted_val) const {
   64|   166M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 158M, False: 8.15M]
  ------------------
   65|   158M|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 524k, False: 157M]
  ------------------
   66|   524k|        clamped_value_[i] = max_value_;
   67|   157M|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 13.7M, False: 144M]
  ------------------
   68|  13.7M|        clamped_value_[i] = min_value_;
   69|   144M|      } else {
   70|   144M|        clamped_value_[i] = predicted_val[i];
   71|   144M|      }
   72|   158M|    }
   73|  8.15M|    return clamped_value_.data();
   74|  8.15M|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|   333M|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|   158M|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|   813k|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|   158M|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|    732|  int quantization_bits() const {
   78|    732|    DRACO_DCHECK(false);
   79|    732|    return -1;
   80|    732|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   44|  5.82k|      : num_components_(0),
   45|  5.82k|        min_value_(0),
   46|  5.82k|        max_value_(0),
   47|  5.82k|        max_dif_(0),
   48|  5.82k|        max_correction_(0),
   49|  5.82k|        min_correction_(0) {}

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

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

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  37.7k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  10.2k|    DecoderBuffer *buffer) {
   30|  10.2k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 257, False: 9.98k]
  ------------------
   31|    257|    return false;
   32|    257|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  9.98k|  const int32_t num_attributes = GetNumAttributes();
   35|  9.98k|  sequential_decoders_.resize(num_attributes);
   36|  37.5k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 27.6k, False: 9.94k]
  ------------------
   37|  27.6k|    uint8_t decoder_type;
   38|  27.6k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 18, False: 27.6k]
  ------------------
   39|     18|      return false;
   40|     18|    }
   41|       |    // Create the decoder from the id.
   42|  27.6k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  27.6k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 16, False: 27.6k]
  ------------------
   44|     16|      return false;
   45|     16|    }
   46|  27.6k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 8, False: 27.6k]
  ------------------
   47|      8|      return false;
   48|      8|    }
   49|  27.6k|  }
   50|  9.94k|  return true;
   51|  9.98k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  6.67k|    DecoderBuffer *buffer) {
   55|  6.67k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 6.67k]
  |  Branch (55:22): [True: 8, False: 6.66k]
  ------------------
   56|      8|    return false;
   57|      8|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  6.66k|  const int32_t num_attributes = GetNumAttributes();
   60|  24.5k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 17.8k, False: 6.66k]
  ------------------
   61|  17.8k|    PointAttribute *const pa =
   62|  17.8k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  17.8k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 3, False: 17.8k]
  ------------------
   64|      3|      return false;
   65|      3|    }
   66|  17.8k|  }
   67|  6.66k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  6.66k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  6.66k|    DecoderBuffer *in_buffer) {
   72|  6.66k|  const int32_t num_attributes = GetNumAttributes();
   73|  17.4k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 13.5k, False: 3.99k]
  ------------------
   74|  13.5k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 2.67k, False: 10.8k]
  ------------------
   75|  13.5k|                                                          in_buffer)) {
   76|  2.67k|      return false;
   77|  2.67k|    }
   78|  13.5k|  }
   79|  3.99k|  return true;
   80|  6.66k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  3.99k|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|  3.99k|  const int32_t num_attributes = GetNumAttributes();
   85|  10.1k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 7.02k, False: 3.10k]
  ------------------
   86|  7.02k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 890, False: 6.13k]
  ------------------
   87|  7.02k|            point_ids_, in_buffer)) {
   88|    890|      return false;
   89|    890|    }
   90|  7.02k|  }
   91|  3.10k|  return true;
   92|  3.99k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  3.10k|    TransformAttributesToOriginalFormat() {
   96|  3.10k|  const int32_t num_attributes = GetNumAttributes();
   97|  8.02k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 5.40k, False: 2.61k]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  5.40k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 5.40k, False: 0]
  ------------------
  100|  5.40k|      const PointAttribute *const attribute =
  101|  5.40k|          sequential_decoders_[i]->attribute();
  102|  5.40k|      const PointAttribute *const portable_attribute =
  103|  5.40k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  5.40k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 5.07k, False: 336]
  |  Branch (104:11): [True: 854, False: 4.55k]
  ------------------
  105|  5.07k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 854, False: 4.21k]
  ------------------
  106|  5.07k|              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|    854|        sequential_decoders_[i]->attribute()->CopyFrom(*portable_attribute);
  113|    854|        continue;
  114|    854|      }
  115|  5.40k|    }
  116|  4.55k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 488, False: 4.06k]
  ------------------
  117|  4.55k|            point_ids_)) {
  118|    488|      return false;
  119|    488|    }
  120|  4.55k|  }
  121|  2.61k|  return true;
  122|  3.10k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  27.6k|    uint8_t decoder_type) {
  127|  27.6k|  switch (decoder_type) {
  128|  1.93k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 1.93k, False: 25.7k]
  ------------------
  129|  1.93k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  1.93k|          new SequentialAttributeDecoder());
  131|  23.4k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 23.4k, False: 4.17k]
  ------------------
  132|  23.4k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  23.4k|          new SequentialIntegerAttributeDecoder());
  134|    725|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 725, False: 26.9k]
  ------------------
  135|    725|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    725|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|  1.50k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 1.50k, False: 26.1k]
  ------------------
  139|  1.50k|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|  1.50k|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|     16|    default:
  ------------------
  |  Branch (142:5): [True: 16, False: 27.6k]
  ------------------
  143|     16|      break;
  144|  27.6k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|     16|  return nullptr;
  147|  27.6k|}

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

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

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

_ZN5draco32SequentialNormalAttributeDecoderC2Ev:
   21|  1.50k|SequentialNormalAttributeDecoder::SequentialNormalAttributeDecoder() {}
_ZN5draco32SequentialNormalAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   24|  1.50k|                                            int attribute_id) {
   25|  1.50k|  if (!SequentialIntegerAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (25:7): [True: 0, False: 1.50k]
  ------------------
   26|      0|    return false;
   27|      0|  }
   28|       |  // Currently, this encoder works only for 3-component normal vectors.
   29|  1.50k|  if (attribute()->num_components() != 3) {
  ------------------
  |  Branch (29:7): [True: 4, False: 1.49k]
  ------------------
   30|      4|    return false;
   31|      4|  }
   32|       |  // Also the data type must be DT_FLOAT32.
   33|  1.49k|  if (attribute()->data_type() != DT_FLOAT32) {
  ------------------
  |  Branch (33:7): [True: 1, False: 1.49k]
  ------------------
   34|      1|    return false;
   35|      1|  }
   36|  1.49k|  return true;
   37|  1.49k|}
_ZN5draco32SequentialNormalAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   40|  1.36k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   41|  1.36k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   42|  1.36k|  if (decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.36k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (42:7): [True: 0, False: 1.36k]
  ------------------
   43|       |    // Note: in older bitstreams, we do not have a PortableAttribute() decoded
   44|       |    // at this stage so we cannot pass it down to the DecodeParameters() call.
   45|       |    // It still works fine for octahedral transform because it does not need to
   46|       |    // use any data from the attribute.
   47|      0|    if (!octahedral_transform_.DecodeParameters(*attribute(), in_buffer)) {
  ------------------
  |  Branch (47:9): [True: 0, False: 0]
  ------------------
   48|      0|      return false;
   49|      0|    }
   50|      0|  }
   51|  1.36k|#endif
   52|  1.36k|  return SequentialIntegerAttributeDecoder::DecodeIntegerValues(point_ids,
   53|  1.36k|                                                                in_buffer);
   54|  1.36k|}
_ZN5draco32SequentialNormalAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   57|  1.17k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   58|  1.17k|  if (decoder()->bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.17k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (58:7): [True: 1.17k, False: 0]
  ------------------
   59|       |    // For newer file version, decode attribute transform data here.
   60|  1.17k|    if (!octahedral_transform_.DecodeParameters(*GetPortableAttribute(),
  ------------------
  |  Branch (60:9): [True: 564, False: 607]
  ------------------
   61|  1.17k|                                                in_buffer)) {
   62|    564|      return false;
   63|    564|    }
   64|  1.17k|  }
   65|       |
   66|       |  // Store the decoded transform data in portable attribute.
   67|    607|  return octahedral_transform_.TransferToAttribute(portable_attribute());
   68|  1.17k|}
_ZN5draco32SequentialNormalAttributeDecoder11StoreValuesEj:
   70|    542|bool SequentialNormalAttributeDecoder::StoreValues(uint32_t num_points) {
   71|       |  // Convert all quantized values back to floats.
   72|    542|  return octahedral_transform_.InverseTransformAttribute(
   73|    542|      *GetPortableAttribute(), attribute());
   74|    542|}

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

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

_ZN5draco14RAnsBitDecoderC2Ev:
   23|  25.6k|RAnsBitDecoder::RAnsBitDecoder() : prob_zero_(0) {}
_ZN5draco14RAnsBitDecoderD2Ev:
   25|  25.6k|RAnsBitDecoder::~RAnsBitDecoder() { Clear(); }
_ZN5draco14RAnsBitDecoder13StartDecodingEPNS_13DecoderBufferE:
   27|  22.2k|bool RAnsBitDecoder::StartDecoding(DecoderBuffer *source_buffer) {
   28|  22.2k|  Clear();
   29|       |
   30|  22.2k|  if (!source_buffer->Decode(&prob_zero_)) {
  ------------------
  |  Branch (30:7): [True: 30, False: 22.2k]
  ------------------
   31|     30|    return false;
   32|     30|  }
   33|       |
   34|  22.2k|  uint32_t size_in_bytes;
   35|  22.2k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  22.2k|  if (source_buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  22.2k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (36:7): [True: 1.47k, False: 20.7k]
  ------------------
   37|  1.47k|    if (!source_buffer->Decode(&size_in_bytes)) {
  ------------------
  |  Branch (37:9): [True: 11, False: 1.46k]
  ------------------
   38|     11|      return false;
   39|     11|    }
   40|       |
   41|  1.47k|  } else
   42|  20.7k|#endif
   43|  20.7k|  {
   44|  20.7k|    if (!DecodeVarint(&size_in_bytes, source_buffer)) {
  ------------------
  |  Branch (44:9): [True: 34, False: 20.7k]
  ------------------
   45|     34|      return false;
   46|     34|    }
   47|  20.7k|  }
   48|       |
   49|  22.1k|  if (size_in_bytes > source_buffer->remaining_size()) {
  ------------------
  |  Branch (49:7): [True: 121, False: 22.0k]
  ------------------
   50|    121|    return false;
   51|    121|  }
   52|       |
   53|  22.0k|  if (ans_read_init(&ans_decoder_,
  ------------------
  |  Branch (53:7): [True: 60, False: 22.0k]
  ------------------
   54|  22.0k|                    reinterpret_cast<uint8_t *>(
   55|  22.0k|                        const_cast<char *>(source_buffer->data_head())),
   56|  22.0k|                    size_in_bytes) != 0) {
   57|     60|    return false;
   58|     60|  }
   59|  22.0k|  source_buffer->Advance(size_in_bytes);
   60|  22.0k|  return true;
   61|  22.0k|}
_ZN5draco14RAnsBitDecoder13DecodeNextBitEv:
   63|  11.0G|bool RAnsBitDecoder::DecodeNextBit() {
   64|  11.0G|  const uint8_t bit = rabs_read(&ans_decoder_, prob_zero_);
  ------------------
  |  |  246|  11.0G|#define rabs_read rabs_desc_read
  ------------------
   65|  11.0G|  return bit > 0;
   66|  11.0G|}
_ZN5draco14RAnsBitDecoder5ClearEv:
   80|  47.9k|void RAnsBitDecoder::Clear() { ans_read_end(&ans_decoder_); }

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

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

_ZN5draco17CreateMeshDecoderEh:
   45|  13.3k|StatusOr<std::unique_ptr<MeshDecoder>> CreateMeshDecoder(uint8_t method) {
   46|  13.3k|  if (method == MESH_SEQUENTIAL_ENCODING) {
  ------------------
  |  Branch (46:7): [True: 3.91k, False: 9.39k]
  ------------------
   47|  3.91k|    return std::unique_ptr<MeshDecoder>(new MeshSequentialDecoder());
   48|  9.39k|  } else if (method == MESH_EDGEBREAKER_ENCODING) {
  ------------------
  |  Branch (48:14): [True: 9.39k, False: 1]
  ------------------
   49|  9.39k|    return std::unique_ptr<MeshDecoder>(new MeshEdgebreakerDecoder());
   50|  9.39k|  }
   51|      1|  return Status(Status::DRACO_ERROR, "Unsupported encoding method.");
   52|  13.3k|}
_ZN5draco7Decoder20DecodeMeshFromBufferEPNS_13DecoderBufferE:
   87|  13.3k|    DecoderBuffer *in_buffer) {
   88|  13.3k|  std::unique_ptr<Mesh> mesh(new Mesh());
   89|  13.3k|  DRACO_RETURN_IF_ERROR(DecodeBufferToGeometry(in_buffer, mesh.get()))
  ------------------
  |  |   74|  13.3k|  {                                                   \
  |  |   75|  13.3k|    const draco::Status _local_status = (expression); \
  |  |   76|  13.3k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 11.9k, False: 1.33k]
  |  |  ------------------
  |  |   77|  11.9k|      return _local_status;                           \
  |  |   78|  11.9k|    }                                                 \
  |  |   79|  13.3k|  }
  ------------------
   90|  1.33k|  return std::move(mesh);
   91|  13.3k|}
_ZN5draco7Decoder22DecodeBufferToGeometryEPNS_13DecoderBufferEPNS_4MeshE:
  113|  13.3k|                                       Mesh *out_geometry) {
  114|  13.3k|#ifdef DRACO_MESH_COMPRESSION_SUPPORTED
  115|  13.3k|  DecoderBuffer temp_buffer(*in_buffer);
  116|  13.3k|  DracoHeader header;
  117|  13.3k|  DRACO_RETURN_IF_ERROR(PointCloudDecoder::DecodeHeader(&temp_buffer, &header))
  ------------------
  |  |   74|  13.3k|  {                                                   \
  |  |   75|  13.3k|    const draco::Status _local_status = (expression); \
  |  |   76|  13.3k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 4, False: 13.3k]
  |  |  ------------------
  |  |   77|      4|      return _local_status;                           \
  |  |   78|      4|    }                                                 \
  |  |   79|  13.3k|  }
  ------------------
  118|  13.3k|  if (header.encoder_type != TRIANGULAR_MESH) {
  ------------------
  |  Branch (118:7): [True: 0, False: 13.3k]
  ------------------
  119|      0|    return Status(Status::DRACO_ERROR, "Input is not a mesh.");
  120|      0|  }
  121|  26.6k|  DRACO_ASSIGN_OR_RETURN(std::unique_ptr<MeshDecoder> decoder,
  ------------------
  |  |   66|  13.3k|  DRACO_ASSIGN_OR_RETURN_IMPL_(DRACO_MACROS_IMPL_CONCAT_(_statusor, __LINE__), \
  |  |  ------------------
  |  |  |  |   71|  13.3k|  auto statusor = (expression);                                             \
  |  |  |  |   72|  13.3k|  if (!statusor.ok()) {                                                     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (72:7): [True: 1, False: 13.3k]
  |  |  |  |  ------------------
  |  |  |  |   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|  13.3k|  lhs = std::move(statusor).value();
  |  |  ------------------
  |  |   67|  13.3k|                               lhs, expression, _status)
  ------------------
  122|  26.6k|                         CreateMeshDecoder(header.encoder_method))
  123|       |
  124|  26.6k|  DRACO_RETURN_IF_ERROR(decoder->Decode(options_, in_buffer, out_geometry))
  ------------------
  |  |   74|  13.3k|  {                                                   \
  |  |   75|  13.3k|    const draco::Status _local_status = (expression); \
  |  |   76|  13.3k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 11.9k, False: 1.33k]
  |  |  ------------------
  |  |   77|  11.9k|      return _local_status;                           \
  |  |   78|  11.9k|    }                                                 \
  |  |   79|  13.3k|  }
  ------------------
  125|  1.33k|  return OkStatus();
  126|       |#else
  127|       |  return Status(Status::DRACO_ERROR, "Unsupported geometry type.");
  128|       |#endif
  129|  26.6k|}
_ZN5draco7Decoder25SetSkipAttributeTransformENS_17GeometryAttribute4TypeE:
  131|  13.3k|void Decoder::SetSkipAttributeTransform(GeometryAttribute::Type att_type) {
  132|  13.3k|  options_.SetAttributeBool(att_type, "skip_attribute_transform", true);
  133|  13.3k|}

_ZN5draco10AnsDecoderC2Ev:
   56|  34.4k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  22.0k|                                const uint8_t *const buf, int offset) {
  301|  22.0k|  unsigned x;
  302|  22.0k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 36, False: 22.0k]
  ------------------
  303|     36|    return 1;
  304|     36|  }
  305|  22.0k|  ans->buf = buf;
  306|  22.0k|  x = buf[offset - 1] >> 6;
  307|  22.0k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 19.4k, False: 2.59k]
  ------------------
  308|  19.4k|    ans->buf_offset = offset - 1;
  309|  19.4k|    ans->state = buf[offset - 1] & 0x3F;
  310|  19.4k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 2.30k, False: 295]
  ------------------
  311|  2.30k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 5, False: 2.29k]
  ------------------
  312|      5|      return 1;
  313|      5|    }
  314|  2.29k|    ans->buf_offset = offset - 2;
  315|  2.29k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  2.29k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 284, False: 11]
  ------------------
  317|    284|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 1, False: 283]
  ------------------
  318|      1|      return 1;
  319|      1|    }
  320|    283|    ans->buf_offset = offset - 3;
  321|    283|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    283|  } else {
  323|     11|    return 1;
  324|     11|  }
  325|  22.0k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  22.0k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  22.0k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  22.0k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  22.0k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 7, False: 22.0k]
  ------------------
  327|      7|    return 1;
  328|      7|  }
  329|  22.0k|  return 0;
  330|  22.0k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  2.29k|static uint32_t mem_get_le16(const void *vmem) {
   68|  2.29k|  uint32_t val;
   69|  2.29k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  2.29k|  val = mem[1] << 8;
   72|  2.29k|  val |= mem[0];
   73|  2.29k|  return val;
   74|  2.29k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    283|static uint32_t mem_get_le24(const void *vmem) {
   77|    283|  uint32_t val;
   78|    283|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    283|  val = mem[2] << 16;
   81|    283|  val |= mem[1] << 8;
   82|    283|  val |= mem[0];
   83|    283|  return val;
   84|    283|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  11.0G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  11.0G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  11.0G|  unsigned quot, rem, x, xn;
  172|  11.0G|#endif
  173|  11.0G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  11.0G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  11.0G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  22.1G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 9.33G, False: 1.73G]
  |  Branch (174:40): [True: 179k, False: 9.33G]
  ------------------
  175|   179k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   179k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   179k|  }
  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|  11.0G|  x = ans->state;
  184|  11.0G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  11.0G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  11.0G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  11.0G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  11.0G|  xn = quot * p;
  187|  11.0G|  val = rem < p;
  188|  11.0G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  22.1G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 9.35G, False: 1.70G]
  |  |  ------------------
  ------------------
  189|  9.35G|    ans->state = xn + rem;
  190|  9.35G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|  1.70G|    ans->state = x - xn - p;
  193|  1.70G|  }
  194|  11.0G|#endif
  195|  11.0G|  return val;
  196|  11.0G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  47.9k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  47.9k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  47.9k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  47.9k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  4.77k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|  2.71k|                                       uint32_t num_symbols) {
  482|  2.71k|    lut_table_.resize(rans_precision);
  483|  2.71k|    probability_table_.resize(num_symbols);
  484|  2.71k|    uint32_t cum_prob = 0;
  485|  2.71k|    uint32_t act_prob = 0;
  486|  21.8k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 19.3k, False: 2.54k]
  ------------------
  487|  19.3k|      probability_table_[i].prob = token_probs[i];
  488|  19.3k|      probability_table_[i].cum_prob = cum_prob;
  489|  19.3k|      cum_prob += token_probs[i];
  490|  19.3k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 172, False: 19.1k]
  ------------------
  491|    172|        return false;
  492|    172|      }
  493|  9.34M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 9.32M, False: 19.1k]
  ------------------
  494|  9.32M|        lut_table_[j] = i;
  495|  9.32M|      }
  496|  19.1k|      act_prob = cum_prob;
  497|  19.1k|    }
  498|  2.54k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 325, False: 2.22k]
  ------------------
  499|    325|      return false;
  500|    325|    }
  501|  2.22k|    return true;
  502|  2.54k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.89k|  inline int read_init(const uint8_t *const buf, int offset) {
  422|  1.89k|    unsigned x;
  423|  1.89k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 168, False: 1.73k]
  ------------------
  424|    168|      return 1;
  425|    168|    }
  426|  1.73k|    ans_.buf = buf;
  427|  1.73k|    x = buf[offset - 1] >> 6;
  428|  1.73k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 1.06k, False: 667]
  ------------------
  429|  1.06k|      ans_.buf_offset = offset - 1;
  430|  1.06k|      ans_.state = buf[offset - 1] & 0x3F;
  431|  1.06k|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 301, False: 366]
  ------------------
  432|    301|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 67, False: 234]
  ------------------
  433|     67|        return 1;
  434|     67|      }
  435|    234|      ans_.buf_offset = offset - 2;
  436|    234|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    366|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 242, False: 124]
  ------------------
  438|    242|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 57, False: 185]
  ------------------
  439|     57|        return 1;
  440|     57|      }
  441|    185|      ans_.buf_offset = offset - 3;
  442|    185|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    185|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 124, False: 0]
  ------------------
  444|    124|      ans_.buf_offset = offset - 4;
  445|    124|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    124|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|  1.60k|    ans_.state += l_rans_base;
  450|  1.60k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.60k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 115, False: 1.49k]
  ------------------
  451|    115|      return 1;
  452|    115|    }
  453|  1.49k|    return 0;
  454|  1.60k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    413|static uint32_t mem_get_le16(const void *vmem) {
   68|    413|  uint32_t val;
   69|    413|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    413|  val = mem[1] << 8;
   72|    413|  val |= mem[0];
   73|    413|  return val;
   74|    413|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    298|static uint32_t mem_get_le24(const void *vmem) {
   77|    298|  uint32_t val;
   78|    298|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    298|  val = mem[2] << 16;
   81|    298|  val |= mem[1] << 8;
   82|    298|  val |= mem[0];
   83|    298|  return val;
   84|    298|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    453|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    453|  uint32_t val;
   88|    453|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    453|  val = mem[3] << 24;
   91|    453|  val |= mem[2] << 16;
   92|    453|  val |= mem[1] << 8;
   93|    453|  val |= mem[0];
   94|    453|  return val;
   95|    453|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|   109M|  inline int rans_read() {
  463|   109M|    unsigned rem;
  464|   109M|    unsigned quo;
  465|   109M|    struct rans_dec_sym sym;
  466|   109M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 97.2M, False: 11.9M]
  |  Branch (466:40): [True: 34.3k, False: 97.1M]
  ------------------
  467|  34.3k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  34.3k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  34.3k|    }
  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|   109M|    quo = ans_.state / rans_precision;
  472|   109M|    rem = ans_.state % rans_precision;
  473|   109M|    fetch_sym(&sym, rem);
  474|   109M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   109M|    return sym.val;
  476|   109M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|   109M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   109M|    uint32_t symbol = lut_table_[rem];
  507|   109M|    out->val = symbol;
  508|   109M|    out->prob = probability_table_[symbol].prob;
  509|   109M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   109M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|  1.40k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    562|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|    429|                                       uint32_t num_symbols) {
  482|    429|    lut_table_.resize(rans_precision);
  483|    429|    probability_table_.resize(num_symbols);
  484|    429|    uint32_t cum_prob = 0;
  485|    429|    uint32_t act_prob = 0;
  486|  10.9k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 10.5k, False: 403]
  ------------------
  487|  10.5k|      probability_table_[i].prob = token_probs[i];
  488|  10.5k|      probability_table_[i].cum_prob = cum_prob;
  489|  10.5k|      cum_prob += token_probs[i];
  490|  10.5k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 26, False: 10.5k]
  ------------------
  491|     26|        return false;
  492|     26|      }
  493|  3.19M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 3.18M, False: 10.5k]
  ------------------
  494|  3.18M|        lut_table_[j] = i;
  495|  3.18M|      }
  496|  10.5k|      act_prob = cum_prob;
  497|  10.5k|    }
  498|    403|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 30, False: 373]
  ------------------
  499|     30|      return false;
  500|     30|    }
  501|    373|    return true;
  502|    403|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|    304|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    304|    unsigned x;
  423|    304|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 10, False: 294]
  ------------------
  424|     10|      return 1;
  425|     10|    }
  426|    294|    ans_.buf = buf;
  427|    294|    x = buf[offset - 1] >> 6;
  428|    294|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 187, False: 107]
  ------------------
  429|    187|      ans_.buf_offset = offset - 1;
  430|    187|      ans_.state = buf[offset - 1] & 0x3F;
  431|    187|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 42, False: 65]
  ------------------
  432|     42|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 15, False: 27]
  ------------------
  433|     15|        return 1;
  434|     15|      }
  435|     27|      ans_.buf_offset = offset - 2;
  436|     27|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     65|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 31, False: 34]
  ------------------
  438|     31|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 11, False: 20]
  ------------------
  439|     11|        return 1;
  440|     11|      }
  441|     20|      ans_.buf_offset = offset - 3;
  442|     20|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     34|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 34, False: 0]
  ------------------
  444|     34|      ans_.buf_offset = offset - 4;
  445|     34|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     34|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    268|    ans_.state += l_rans_base;
  450|    268|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    268|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 21, False: 247]
  ------------------
  451|     21|      return 1;
  452|     21|    }
  453|    247|    return 0;
  454|    268|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|  10.7M|  inline int rans_read() {
  463|  10.7M|    unsigned rem;
  464|  10.7M|    unsigned quo;
  465|  10.7M|    struct rans_dec_sym sym;
  466|  10.7M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 10.6M, False: 28.4k]
  |  Branch (466:40): [True: 3.99k, False: 10.6M]
  ------------------
  467|  3.99k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  3.99k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  3.99k|    }
  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|  10.7M|    quo = ans_.state / rans_precision;
  472|  10.7M|    rem = ans_.state % rans_precision;
  473|  10.7M|    fetch_sym(&sym, rem);
  474|  10.7M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  10.7M|    return sym.val;
  476|  10.7M|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|  10.7M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  10.7M|    uint32_t symbol = lut_table_[rem];
  507|  10.7M|    out->val = symbol;
  508|  10.7M|    out->prob = probability_table_[symbol].prob;
  509|  10.7M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  10.7M|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|    247|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    405|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|    271|                                       uint32_t num_symbols) {
  482|    271|    lut_table_.resize(rans_precision);
  483|    271|    probability_table_.resize(num_symbols);
  484|    271|    uint32_t cum_prob = 0;
  485|    271|    uint32_t act_prob = 0;
  486|  6.97k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 6.72k, False: 245]
  ------------------
  487|  6.72k|      probability_table_[i].prob = token_probs[i];
  488|  6.72k|      probability_table_[i].cum_prob = cum_prob;
  489|  6.72k|      cum_prob += token_probs[i];
  490|  6.72k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 26, False: 6.70k]
  ------------------
  491|     26|        return false;
  492|     26|      }
  493|  7.08M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 7.08M, False: 6.70k]
  ------------------
  494|  7.08M|        lut_table_[j] = i;
  495|  7.08M|      }
  496|  6.70k|      act_prob = cum_prob;
  497|  6.70k|    }
  498|    245|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 45, False: 200]
  ------------------
  499|     45|      return false;
  500|     45|    }
  501|    200|    return true;
  502|    245|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|    142|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    142|    unsigned x;
  423|    142|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 14, False: 128]
  ------------------
  424|     14|      return 1;
  425|     14|    }
  426|    128|    ans_.buf = buf;
  427|    128|    x = buf[offset - 1] >> 6;
  428|    128|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 33, False: 95]
  ------------------
  429|     33|      ans_.buf_offset = offset - 1;
  430|     33|      ans_.state = buf[offset - 1] & 0x3F;
  431|     95|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 22, False: 73]
  ------------------
  432|     22|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 11, False: 11]
  ------------------
  433|     11|        return 1;
  434|     11|      }
  435|     11|      ans_.buf_offset = offset - 2;
  436|     11|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     73|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 23, False: 50]
  ------------------
  438|     23|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 11, False: 12]
  ------------------
  439|     11|        return 1;
  440|     11|      }
  441|     12|      ans_.buf_offset = offset - 3;
  442|     12|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     50|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 50, False: 0]
  ------------------
  444|     50|      ans_.buf_offset = offset - 4;
  445|     50|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     50|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    106|    ans_.state += l_rans_base;
  450|    106|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    106|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 33, False: 73]
  ------------------
  451|     33|      return 1;
  452|     33|    }
  453|     73|    return 0;
  454|    106|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|   630k|  inline int rans_read() {
  463|   630k|    unsigned rem;
  464|   630k|    unsigned quo;
  465|   630k|    struct rans_dec_sym sym;
  466|   631k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 261k, False: 369k]
  |  Branch (466:40): [True: 861, False: 260k]
  ------------------
  467|    861|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    861|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    861|    }
  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|   630k|    quo = ans_.state / rans_precision;
  472|   630k|    rem = ans_.state % rans_precision;
  473|   630k|    fetch_sym(&sym, rem);
  474|   630k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   630k|    return sym.val;
  476|   630k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|   630k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   630k|    uint32_t symbol = lut_table_[rem];
  507|   630k|    out->val = symbol;
  508|   630k|    out->prob = probability_table_[symbol].prob;
  509|   630k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   630k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     73|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    376|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|    232|                                       uint32_t num_symbols) {
  482|    232|    lut_table_.resize(rans_precision);
  483|    232|    probability_table_.resize(num_symbols);
  484|    232|    uint32_t cum_prob = 0;
  485|    232|    uint32_t act_prob = 0;
  486|  3.39k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 3.17k, False: 213]
  ------------------
  487|  3.17k|      probability_table_[i].prob = token_probs[i];
  488|  3.17k|      probability_table_[i].cum_prob = cum_prob;
  489|  3.17k|      cum_prob += token_probs[i];
  490|  3.17k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 19, False: 3.16k]
  ------------------
  491|     19|        return false;
  492|     19|      }
  493|  11.5M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 11.5M, False: 3.16k]
  ------------------
  494|  11.5M|        lut_table_[j] = i;
  495|  11.5M|      }
  496|  3.16k|      act_prob = cum_prob;
  497|  3.16k|    }
  498|    213|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 49, False: 164]
  ------------------
  499|     49|      return false;
  500|     49|    }
  501|    164|    return true;
  502|    213|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     92|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     92|    unsigned x;
  423|     92|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 9, False: 83]
  ------------------
  424|      9|      return 1;
  425|      9|    }
  426|     83|    ans_.buf = buf;
  427|     83|    x = buf[offset - 1] >> 6;
  428|     83|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 34, False: 49]
  ------------------
  429|     34|      ans_.buf_offset = offset - 1;
  430|     34|      ans_.state = buf[offset - 1] & 0x3F;
  431|     49|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 18, False: 31]
  ------------------
  432|     18|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 2, False: 16]
  ------------------
  433|      2|        return 1;
  434|      2|      }
  435|     16|      ans_.buf_offset = offset - 2;
  436|     16|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     31|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 12, False: 19]
  ------------------
  438|     12|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 12]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|     12|      ans_.buf_offset = offset - 3;
  442|     12|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     19|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 19, False: 0]
  ------------------
  444|     19|      ans_.buf_offset = offset - 4;
  445|     19|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     19|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     81|    ans_.state += l_rans_base;
  450|     81|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     81|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 14, False: 67]
  ------------------
  451|     14|      return 1;
  452|     14|    }
  453|     67|    return 0;
  454|     81|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|   419k|  inline int rans_read() {
  463|   419k|    unsigned rem;
  464|   419k|    unsigned quo;
  465|   419k|    struct rans_dec_sym sym;
  466|   420k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 134k, False: 286k]
  |  Branch (466:40): [True: 1.53k, False: 132k]
  ------------------
  467|  1.53k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.53k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.53k|    }
  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|   419k|    quo = ans_.state / rans_precision;
  472|   419k|    rem = ans_.state % rans_precision;
  473|   419k|    fetch_sym(&sym, rem);
  474|   419k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   419k|    return sym.val;
  476|   419k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|   419k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   419k|    uint32_t symbol = lut_table_[rem];
  507|   419k|    out->val = symbol;
  508|   419k|    out->prob = probability_table_[symbol].prob;
  509|   419k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   419k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|     67|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    395|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|    244|                                       uint32_t num_symbols) {
  482|    244|    lut_table_.resize(rans_precision);
  483|    244|    probability_table_.resize(num_symbols);
  484|    244|    uint32_t cum_prob = 0;
  485|    244|    uint32_t act_prob = 0;
  486|  6.00k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 5.78k, False: 216]
  ------------------
  487|  5.78k|      probability_table_[i].prob = token_probs[i];
  488|  5.78k|      probability_table_[i].cum_prob = cum_prob;
  489|  5.78k|      cum_prob += token_probs[i];
  490|  5.78k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 28, False: 5.75k]
  ------------------
  491|     28|        return false;
  492|     28|      }
  493|  52.8M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 52.8M, False: 5.75k]
  ------------------
  494|  52.8M|        lut_table_[j] = i;
  495|  52.8M|      }
  496|  5.75k|      act_prob = cum_prob;
  497|  5.75k|    }
  498|    216|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 39, False: 177]
  ------------------
  499|     39|      return false;
  500|     39|    }
  501|    177|    return true;
  502|    216|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     86|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     86|    unsigned x;
  423|     86|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 2, False: 84]
  ------------------
  424|      2|      return 1;
  425|      2|    }
  426|     84|    ans_.buf = buf;
  427|     84|    x = buf[offset - 1] >> 6;
  428|     84|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 32, False: 52]
  ------------------
  429|     32|      ans_.buf_offset = offset - 1;
  430|     32|      ans_.state = buf[offset - 1] & 0x3F;
  431|     52|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 27, False: 25]
  ------------------
  432|     27|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 11, False: 16]
  ------------------
  433|     11|        return 1;
  434|     11|      }
  435|     16|      ans_.buf_offset = offset - 2;
  436|     16|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     25|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 12, False: 13]
  ------------------
  438|     12|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 3, False: 9]
  ------------------
  439|      3|        return 1;
  440|      3|      }
  441|      9|      ans_.buf_offset = offset - 3;
  442|      9|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     13|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 13, False: 0]
  ------------------
  444|     13|      ans_.buf_offset = offset - 4;
  445|     13|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     13|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     70|    ans_.state += l_rans_base;
  450|     70|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     70|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 5, False: 65]
  ------------------
  451|      5|      return 1;
  452|      5|    }
  453|     65|    return 0;
  454|     70|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|  81.1k|  inline int rans_read() {
  463|  81.1k|    unsigned rem;
  464|  81.1k|    unsigned quo;
  465|  81.1k|    struct rans_dec_sym sym;
  466|  82.0k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 70.7k, False: 11.2k]
  |  Branch (466:40): [True: 978, False: 69.8k]
  ------------------
  467|    978|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    978|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    978|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  81.1k|    quo = ans_.state / rans_precision;
  472|  81.1k|    rem = ans_.state % rans_precision;
  473|  81.1k|    fetch_sym(&sym, rem);
  474|  81.1k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  81.1k|    return sym.val;
  476|  81.1k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|  81.1k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  81.1k|    uint32_t symbol = lut_table_[rem];
  507|  81.1k|    out->val = symbol;
  508|  81.1k|    out->prob = probability_table_[symbol].prob;
  509|  81.1k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  81.1k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|     65|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    418|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|    263|                                       uint32_t num_symbols) {
  482|    263|    lut_table_.resize(rans_precision);
  483|    263|    probability_table_.resize(num_symbols);
  484|    263|    uint32_t cum_prob = 0;
  485|    263|    uint32_t act_prob = 0;
  486|  5.22k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 4.98k, False: 242]
  ------------------
  487|  4.98k|      probability_table_[i].prob = token_probs[i];
  488|  4.98k|      probability_table_[i].cum_prob = cum_prob;
  489|  4.98k|      cum_prob += token_probs[i];
  490|  4.98k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 21, False: 4.96k]
  ------------------
  491|     21|        return false;
  492|     21|      }
  493|   109M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 109M, False: 4.96k]
  ------------------
  494|   109M|        lut_table_[j] = i;
  495|   109M|      }
  496|  4.96k|      act_prob = cum_prob;
  497|  4.96k|    }
  498|    242|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 48, False: 194]
  ------------------
  499|     48|      return false;
  500|     48|    }
  501|    194|    return true;
  502|    242|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|    117|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    117|    unsigned x;
  423|    117|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 5, False: 112]
  ------------------
  424|      5|      return 1;
  425|      5|    }
  426|    112|    ans_.buf = buf;
  427|    112|    x = buf[offset - 1] >> 6;
  428|    112|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 32, False: 80]
  ------------------
  429|     32|      ans_.buf_offset = offset - 1;
  430|     32|      ans_.state = buf[offset - 1] & 0x3F;
  431|     80|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 28, False: 52]
  ------------------
  432|     28|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 6, False: 22]
  ------------------
  433|      6|        return 1;
  434|      6|      }
  435|     22|      ans_.buf_offset = offset - 2;
  436|     22|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     52|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 5, False: 47]
  ------------------
  438|      5|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 4]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|      4|      ans_.buf_offset = offset - 3;
  442|      4|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     47|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 47, False: 0]
  ------------------
  444|     47|      ans_.buf_offset = offset - 4;
  445|     47|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     47|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    105|    ans_.state += l_rans_base;
  450|    105|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    105|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 10, False: 95]
  ------------------
  451|     10|      return 1;
  452|     10|    }
  453|     95|    return 0;
  454|    105|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|   131k|  inline int rans_read() {
  463|   131k|    unsigned rem;
  464|   131k|    unsigned quo;
  465|   131k|    struct rans_dec_sym sym;
  466|   133k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 111k, False: 21.4k]
  |  Branch (466:40): [True: 1.33k, False: 110k]
  ------------------
  467|  1.33k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.33k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.33k|    }
  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|   131k|    quo = ans_.state / rans_precision;
  472|   131k|    rem = ans_.state % rans_precision;
  473|   131k|    fetch_sym(&sym, rem);
  474|   131k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   131k|    return sym.val;
  476|   131k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|   131k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   131k|    uint32_t symbol = lut_table_[rem];
  507|   131k|    out->val = symbol;
  508|   131k|    out->prob = probability_table_[symbol].prob;
  509|   131k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   131k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     95|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.85k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|  1.15k|                                       uint32_t num_symbols) {
  482|  1.15k|    lut_table_.resize(rans_precision);
  483|  1.15k|    probability_table_.resize(num_symbols);
  484|  1.15k|    uint32_t cum_prob = 0;
  485|  1.15k|    uint32_t act_prob = 0;
  486|  27.8k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 26.7k, False: 1.11k]
  ------------------
  487|  26.7k|      probability_table_[i].prob = token_probs[i];
  488|  26.7k|      probability_table_[i].cum_prob = cum_prob;
  489|  26.7k|      cum_prob += token_probs[i];
  490|  26.7k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 37, False: 26.6k]
  ------------------
  491|     37|        return false;
  492|     37|      }
  493|  1.07G|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.07G, False: 26.6k]
  ------------------
  494|  1.07G|        lut_table_[j] = i;
  495|  1.07G|      }
  496|  26.6k|      act_prob = cum_prob;
  497|  26.6k|    }
  498|  1.11k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 129, False: 985]
  ------------------
  499|    129|      return false;
  500|    129|    }
  501|    985|    return true;
  502|  1.11k|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    574|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    574|    unsigned x;
  423|    574|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 52, False: 522]
  ------------------
  424|     52|      return 1;
  425|     52|    }
  426|    522|    ans_.buf = buf;
  427|    522|    x = buf[offset - 1] >> 6;
  428|    522|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 141, False: 381]
  ------------------
  429|    141|      ans_.buf_offset = offset - 1;
  430|    141|      ans_.state = buf[offset - 1] & 0x3F;
  431|    381|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 116, False: 265]
  ------------------
  432|    116|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 29, False: 87]
  ------------------
  433|     29|        return 1;
  434|     29|      }
  435|     87|      ans_.buf_offset = offset - 2;
  436|     87|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    265|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 99, False: 166]
  ------------------
  438|     99|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 43, False: 56]
  ------------------
  439|     43|        return 1;
  440|     43|      }
  441|     56|      ans_.buf_offset = offset - 3;
  442|     56|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    166|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 166, False: 0]
  ------------------
  444|    166|      ans_.buf_offset = offset - 4;
  445|    166|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    166|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    450|    ans_.state += l_rans_base;
  450|    450|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    450|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 64, False: 386]
  ------------------
  451|     64|      return 1;
  452|     64|    }
  453|    386|    return 0;
  454|    450|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|   939k|  inline int rans_read() {
  463|   939k|    unsigned rem;
  464|   939k|    unsigned quo;
  465|   939k|    struct rans_dec_sym sym;
  466|   945k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 759k, False: 185k]
  |  Branch (466:40): [True: 5.63k, False: 753k]
  ------------------
  467|  5.63k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  5.63k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  5.63k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|   939k|    quo = ans_.state / rans_precision;
  472|   939k|    rem = ans_.state % rans_precision;
  473|   939k|    fetch_sym(&sym, rem);
  474|   939k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   939k|    return sym.val;
  476|   939k|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|   939k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   939k|    uint32_t symbol = lut_table_[rem];
  507|   939k|    out->val = symbol;
  508|   939k|    out->prob = probability_table_[symbol].prob;
  509|   939k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   939k|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    386|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|  1.42k|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|  1.42k|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|  1.42k|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 1.42k]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|  1.42k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|  1.42k|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.42k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 130, False: 1.29k]
  ------------------
   67|    130|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 10, False: 120]
  ------------------
   68|     10|      return false;
   69|     10|    }
   70|       |
   71|    130|  } else
   72|  1.29k|#endif
   73|  1.29k|  {
   74|  1.29k|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 35, False: 1.25k]
  ------------------
   75|     35|      return false;
   76|     35|    }
   77|  1.29k|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|  1.37k|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 105, False: 1.27k]
  ------------------
   83|    105|    return false;
   84|    105|  }
   85|  1.27k|  probability_table_.resize(num_symbols_);
   86|  1.27k|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 385, False: 885]
  ------------------
   87|    385|    return true;
   88|    385|  }
   89|       |  // Decode the table.
   90|  65.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 64.6k, False: 584]
  ------------------
   91|  64.6k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  64.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 76, False: 64.5k]
  ------------------
   95|     76|      return false;
   96|     76|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  64.5k|    const int token = prob_data & 3;
  102|  64.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 13.8k, False: 50.7k]
  ------------------
  103|  13.8k|      const uint32_t offset = prob_data >> 2;
  104|  13.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 196, False: 13.6k]
  ------------------
  105|    196|        return false;
  106|    196|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   490k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 476k, False: 13.6k]
  ------------------
  109|   476k|        probability_table_[i + j] = 0;
  110|   476k|      }
  111|  13.6k|      i += offset;
  112|  50.7k|    } else {
  113|  50.7k|      const int extra_bytes = token;
  114|  50.7k|      uint32_t prob = prob_data >> 2;
  115|  80.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 29.6k, False: 50.6k]
  ------------------
  116|  29.6k|        uint8_t eb;
  117|  29.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 29, False: 29.6k]
  ------------------
  118|     29|          return false;
  119|     29|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  29.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  29.6k|      }
  124|  50.6k|      probability_table_[i] = prob;
  125|  50.6k|    }
  126|  64.5k|  }
  127|    584|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 157, False: 427]
  ------------------
  128|    157|    return false;
  129|    157|  }
  130|    427|  return true;
  131|    584|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    767|    DecoderBuffer *buffer) {
  136|    767|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    767|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    767|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    767|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 58, False: 709]
  ------------------
  140|     58|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 55]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     58|  } else
  145|    709|#endif
  146|    709|  {
  147|    709|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 18, False: 691]
  ------------------
  148|     18|      return false;
  149|     18|    }
  150|    709|  }
  151|    746|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 126, False: 620]
  ------------------
  152|    126|    return false;
  153|    126|  }
  154|    620|  const uint8_t *const data_head =
  155|    620|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    620|  buffer->Advance(bytes_encoded);
  158|    620|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 147, False: 473]
  ------------------
  159|    147|    return false;
  160|    147|  }
  161|    473|  return true;
  162|    620|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    530|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  25.1M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    391|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    391|  ans_.read_end();
  167|    391|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    696|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    696|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    696|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 696]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    696|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    696|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    696|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 69, False: 627]
  ------------------
   67|     69|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 65]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     69|  } else
   72|    627|#endif
   73|    627|  {
   74|    627|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 24, False: 603]
  ------------------
   75|     24|      return false;
   76|     24|    }
   77|    627|  }
   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|    668|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 64, False: 604]
  ------------------
   83|     64|    return false;
   84|     64|  }
   85|    604|  probability_table_.resize(num_symbols_);
   86|    604|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 35, False: 569]
  ------------------
   87|     35|    return true;
   88|     35|  }
   89|       |  // Decode the table.
   90|  2.08M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 2.08M, False: 405]
  ------------------
   91|  2.08M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  2.08M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 65, False: 2.08M]
  ------------------
   95|     65|      return false;
   96|     65|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  2.08M|    const int token = prob_data & 3;
  102|  2.08M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.34M, False: 738k]
  ------------------
  103|  1.34M|      const uint32_t offset = prob_data >> 2;
  104|  1.34M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 77, False: 1.34M]
  ------------------
  105|     77|        return false;
  106|     77|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  71.8M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 70.5M, False: 1.34M]
  ------------------
  109|  70.5M|        probability_table_[i + j] = 0;
  110|  70.5M|      }
  111|  1.34M|      i += offset;
  112|  1.34M|    } else {
  113|   738k|      const int extra_bytes = token;
  114|   738k|      uint32_t prob = prob_data >> 2;
  115|  1.27M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 538k, False: 738k]
  ------------------
  116|   538k|        uint8_t eb;
  117|   538k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 538k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   538k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   538k|      }
  124|   738k|      probability_table_[i] = prob;
  125|   738k|    }
  126|  2.08M|  }
  127|    405|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 187, False: 218]
  ------------------
  128|    187|    return false;
  129|    187|  }
  130|    218|  return true;
  131|    405|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    253|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    218|    DecoderBuffer *buffer) {
  136|    218|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    218|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    218|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    218|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 7, False: 211]
  ------------------
  140|      7|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 7]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      7|  } else
  145|    211|#endif
  146|    211|  {
  147|    211|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 12, False: 199]
  ------------------
  148|     12|      return false;
  149|     12|    }
  150|    211|  }
  151|    206|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 40, False: 166]
  ------------------
  152|     40|    return false;
  153|     40|  }
  154|    166|  const uint8_t *const data_head =
  155|    166|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    166|  buffer->Advance(bytes_encoded);
  158|    166|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 42, False: 124]
  ------------------
  159|     42|    return false;
  160|     42|  }
  161|    124|  return true;
  162|    166|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  24.7M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    124|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    124|  ans_.read_end();
  167|    124|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    542|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    542|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    542|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 542]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    542|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    542|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    542|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 71, False: 471]
  ------------------
   67|     71|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 71]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     71|  } else
   72|    471|#endif
   73|    471|  {
   74|    471|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 15, False: 456]
  ------------------
   75|     15|      return false;
   76|     15|    }
   77|    471|  }
   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|    527|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 41, False: 486]
  ------------------
   83|     41|    return false;
   84|     41|  }
   85|    486|  probability_table_.resize(num_symbols_);
   86|    486|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 477]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|   614k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 614k, False: 347]
  ------------------
   91|   614k|    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|   614k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 46, False: 614k]
  ------------------
   95|     46|      return false;
   96|     46|    }
   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|   614k|    const int token = prob_data & 3;
  102|   614k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 150k, False: 463k]
  ------------------
  103|   150k|      const uint32_t offset = prob_data >> 2;
  104|   150k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 46, False: 150k]
  ------------------
  105|     46|        return false;
  106|     46|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  6.22M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 6.07M, False: 150k]
  ------------------
  109|  6.07M|        probability_table_[i + j] = 0;
  110|  6.07M|      }
  111|   150k|      i += offset;
  112|   463k|    } else {
  113|   463k|      const int extra_bytes = token;
  114|   463k|      uint32_t prob = prob_data >> 2;
  115|   846k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 383k, False: 463k]
  ------------------
  116|   383k|        uint8_t eb;
  117|   383k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 38, False: 383k]
  ------------------
  118|     38|          return false;
  119|     38|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   383k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   383k|      }
  124|   463k|      probability_table_[i] = prob;
  125|   463k|    }
  126|   614k|  }
  127|    347|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 33, False: 314]
  ------------------
  128|     33|    return false;
  129|     33|  }
  130|    314|  return true;
  131|    347|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    323|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    314|    DecoderBuffer *buffer) {
  136|    314|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    314|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    314|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    314|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 36, False: 278]
  ------------------
  140|     36|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 36]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     36|  } else
  145|    278|#endif
  146|    278|  {
  147|    278|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 11, False: 267]
  ------------------
  148|     11|      return false;
  149|     11|    }
  150|    278|  }
  151|    303|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 76, False: 227]
  ------------------
  152|     76|    return false;
  153|     76|  }
  154|    227|  const uint8_t *const data_head =
  155|    227|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    227|  buffer->Advance(bytes_encoded);
  158|    227|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 38, False: 189]
  ------------------
  159|     38|    return false;
  160|     38|  }
  161|    189|  return true;
  162|    227|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  4.48M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    189|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    189|  ans_.read_end();
  167|    189|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    487|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    487|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    487|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 487]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    487|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    487|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    487|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 88, False: 399]
  ------------------
   67|     88|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 88]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     88|  } else
   72|    399|#endif
   73|    399|  {
   74|    399|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 392]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    399|  }
   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|    480|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 468]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    468|  probability_table_.resize(num_symbols_);
   86|    468|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 20, False: 448]
  ------------------
   87|     20|    return true;
   88|     20|  }
   89|       |  // Decode the table.
   90|  19.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 18.8k, False: 342]
  ------------------
   91|  18.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|  18.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 49, False: 18.8k]
  ------------------
   95|     49|      return false;
   96|     49|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  18.8k|    const int token = prob_data & 3;
  102|  18.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.96k, False: 13.8k]
  ------------------
  103|  4.96k|      const uint32_t offset = prob_data >> 2;
  104|  4.96k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 37, False: 4.92k]
  ------------------
  105|     37|        return false;
  106|     37|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   170k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 165k, False: 4.92k]
  ------------------
  109|   165k|        probability_table_[i + j] = 0;
  110|   165k|      }
  111|  4.92k|      i += offset;
  112|  13.8k|    } else {
  113|  13.8k|      const int extra_bytes = token;
  114|  13.8k|      uint32_t prob = prob_data >> 2;
  115|  25.6k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 11.8k, False: 13.8k]
  ------------------
  116|  11.8k|        uint8_t eb;
  117|  11.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 11.8k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  11.8k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  11.8k|      }
  124|  13.8k|      probability_table_[i] = prob;
  125|  13.8k|    }
  126|  18.8k|  }
  127|    342|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 35, False: 307]
  ------------------
  128|     35|    return false;
  129|     35|  }
  130|    307|  return true;
  131|    342|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    327|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    307|    DecoderBuffer *buffer) {
  136|    307|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    307|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    307|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    307|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 71, False: 236]
  ------------------
  140|     71|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 71]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     71|  } else
  145|    236|#endif
  146|    236|  {
  147|    236|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 13, False: 223]
  ------------------
  148|     13|      return false;
  149|     13|    }
  150|    236|  }
  151|    294|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 102, False: 192]
  ------------------
  152|    102|    return false;
  153|    102|  }
  154|    192|  const uint8_t *const data_head =
  155|    192|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    192|  buffer->Advance(bytes_encoded);
  158|    192|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 44, False: 148]
  ------------------
  159|     44|    return false;
  160|     44|  }
  161|    148|  return true;
  162|    192|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  1.41M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    148|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    148|  ans_.read_end();
  167|    148|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    361|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    361|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    361|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 361]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    361|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    361|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    361|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 13, False: 348]
  ------------------
   67|     13|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 13]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     13|  } else
   72|    348|#endif
   73|    348|  {
   74|    348|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 342]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    348|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    355|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 340]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    340|  probability_table_.resize(num_symbols_);
   86|    340|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 335]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|   834k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 834k, False: 236]
  ------------------
   91|   834k|    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|   834k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 41, False: 834k]
  ------------------
   95|     41|      return false;
   96|     41|    }
   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|   834k|    const int token = prob_data & 3;
  102|   834k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 709k, False: 125k]
  ------------------
  103|   709k|      const uint32_t offset = prob_data >> 2;
  104|   709k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 43, False: 708k]
  ------------------
  105|     43|        return false;
  106|     43|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  40.3M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 39.6M, False: 708k]
  ------------------
  109|  39.6M|        probability_table_[i + j] = 0;
  110|  39.6M|      }
  111|   708k|      i += offset;
  112|   708k|    } else {
  113|   125k|      const int extra_bytes = token;
  114|   125k|      uint32_t prob = prob_data >> 2;
  115|   232k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 107k, False: 125k]
  ------------------
  116|   107k|        uint8_t eb;
  117|   107k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 15, False: 107k]
  ------------------
  118|     15|          return false;
  119|     15|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   107k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   107k|      }
  124|   125k|      probability_table_[i] = prob;
  125|   125k|    }
  126|   834k|  }
  127|    236|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 19, False: 217]
  ------------------
  128|     19|    return false;
  129|     19|  }
  130|    217|  return true;
  131|    236|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    222|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    217|    DecoderBuffer *buffer) {
  136|    217|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    217|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    217|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    217|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 216]
  ------------------
  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|    216|#endif
  146|    216|  {
  147|    216|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 207]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    216|  }
  151|    208|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 14, False: 194]
  ------------------
  152|     14|    return false;
  153|     14|  }
  154|    194|  const uint8_t *const data_head =
  155|    194|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    194|  buffer->Advance(bytes_encoded);
  158|    194|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 35, False: 159]
  ------------------
  159|     35|    return false;
  160|     35|  }
  161|    159|  return true;
  162|    194|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  8.18M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|    159|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    159|  ans_.read_end();
  167|    159|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    420|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    420|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    420|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 420]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    420|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    420|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    420|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 74, False: 346]
  ------------------
   67|     74|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 74]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     74|  } else
   72|    346|#endif
   73|    346|  {
   74|    346|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 335]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    346|  }
   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|    409|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 37, False: 372]
  ------------------
   83|     37|    return false;
   84|     37|  }
   85|    372|  probability_table_.resize(num_symbols_);
   86|    372|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 362]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|  24.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 23.8k, False: 270]
  ------------------
   91|  23.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|  23.8k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 23.7k]
  ------------------
   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|  23.7k|    const int token = prob_data & 3;
  102|  23.7k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 12.9k, False: 10.8k]
  ------------------
  103|  12.9k|      const uint32_t offset = prob_data >> 2;
  104|  12.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 12.8k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   396k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 383k, False: 12.8k]
  ------------------
  109|   383k|        probability_table_[i + j] = 0;
  110|   383k|      }
  111|  12.8k|      i += offset;
  112|  12.8k|    } else {
  113|  10.8k|      const int extra_bytes = token;
  114|  10.8k|      uint32_t prob = prob_data >> 2;
  115|  18.6k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 7.80k, False: 10.8k]
  ------------------
  116|  7.80k|        uint8_t eb;
  117|  7.80k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 29, False: 7.77k]
  ------------------
  118|     29|          return false;
  119|     29|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  7.77k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  7.77k|      }
  124|  10.8k|      probability_table_[i] = prob;
  125|  10.8k|    }
  126|  23.7k|  }
  127|    270|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 14, False: 256]
  ------------------
  128|     14|    return false;
  129|     14|  }
  130|    256|  return true;
  131|    270|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    266|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    256|    DecoderBuffer *buffer) {
  136|    256|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    256|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    256|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    256|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 45, False: 211]
  ------------------
  140|     45|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 44]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     45|  } else
  145|    211|#endif
  146|    211|  {
  147|    211|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 209]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    211|  }
  151|    253|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 80, False: 173]
  ------------------
  152|     80|    return false;
  153|     80|  }
  154|    173|  const uint8_t *const data_head =
  155|    173|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    173|  buffer->Advance(bytes_encoded);
  158|    173|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 34, False: 139]
  ------------------
  159|     34|    return false;
  160|     34|  }
  161|    139|  return true;
  162|    173|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  12.3M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|    139|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    139|  ans_.read_end();
  167|    139|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    401|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    401|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    401|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 401]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    401|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    401|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    401|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 62, False: 339]
  ------------------
   67|     62|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 62]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     62|  } else
   72|    339|#endif
   73|    339|  {
   74|    339|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 333]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    339|  }
   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|    395|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 7, False: 388]
  ------------------
   83|      7|    return false;
   84|      7|  }
   85|    388|  probability_table_.resize(num_symbols_);
   86|    388|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 378]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|  2.03M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 2.03M, False: 250]
  ------------------
   91|  2.03M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  2.03M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 47, False: 2.03M]
  ------------------
   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|  2.03M|    const int token = prob_data & 3;
  102|  2.03M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 539k, False: 1.49M]
  ------------------
  103|   539k|      const uint32_t offset = prob_data >> 2;
  104|   539k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 39, False: 539k]
  ------------------
  105|     39|        return false;
  106|     39|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  24.5M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 24.0M, False: 539k]
  ------------------
  109|  24.0M|        probability_table_[i + j] = 0;
  110|  24.0M|      }
  111|   539k|      i += offset;
  112|  1.49M|    } else {
  113|  1.49M|      const int extra_bytes = token;
  114|  1.49M|      uint32_t prob = prob_data >> 2;
  115|  2.38M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 887k, False: 1.49M]
  ------------------
  116|   887k|        uint8_t eb;
  117|   887k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 42, False: 887k]
  ------------------
  118|     42|          return false;
  119|     42|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   887k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   887k|      }
  124|  1.49M|      probability_table_[i] = prob;
  125|  1.49M|    }
  126|  2.03M|  }
  127|    250|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 26, False: 224]
  ------------------
  128|     26|    return false;
  129|     26|  }
  130|    224|  return true;
  131|    250|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    234|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    224|    DecoderBuffer *buffer) {
  136|    224|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    224|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    224|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    224|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 34, False: 190]
  ------------------
  140|     34|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 4, False: 30]
  ------------------
  141|      4|      return false;
  142|      4|    }
  143|       |
  144|     34|  } else
  145|    190|#endif
  146|    190|  {
  147|    190|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 12, False: 178]
  ------------------
  148|     12|      return false;
  149|     12|    }
  150|    190|  }
  151|    208|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 58, False: 150]
  ------------------
  152|     58|    return false;
  153|     58|  }
  154|    150|  const uint8_t *const data_head =
  155|    150|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    150|  buffer->Advance(bytes_encoded);
  158|    150|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 32, False: 118]
  ------------------
  159|     32|    return false;
  160|     32|  }
  161|    118|  return true;
  162|    150|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  12.2M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|    118|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    118|  ans_.read_end();
  167|    118|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    451|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    451|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    451|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 451]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    451|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    451|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    451|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 77, False: 374]
  ------------------
   67|     77|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 75]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     77|  } else
   72|    374|#endif
   73|    374|  {
   74|    374|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 363]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    374|  }
   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|    438|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 36, False: 402]
  ------------------
   83|     36|    return false;
   84|     36|  }
   85|    402|  probability_table_.resize(num_symbols_);
   86|    402|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 393]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  1.32M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.32M, False: 283]
  ------------------
   91|  1.32M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  1.32M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 52, False: 1.32M]
  ------------------
   95|     52|      return false;
   96|     52|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.32M|    const int token = prob_data & 3;
  102|  1.32M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 335k, False: 988k]
  ------------------
  103|   335k|      const uint32_t offset = prob_data >> 2;
  104|   335k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 36, False: 335k]
  ------------------
  105|     36|        return false;
  106|     36|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  16.6M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 16.3M, False: 335k]
  ------------------
  109|  16.3M|        probability_table_[i + j] = 0;
  110|  16.3M|      }
  111|   335k|      i += offset;
  112|   988k|    } else {
  113|   988k|      const int extra_bytes = token;
  114|   988k|      uint32_t prob = prob_data >> 2;
  115|  1.51M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 523k, False: 988k]
  ------------------
  116|   523k|        uint8_t eb;
  117|   523k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 523k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   523k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   523k|      }
  124|   988k|      probability_table_[i] = prob;
  125|   988k|    }
  126|  1.32M|  }
  127|    283|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 26, False: 257]
  ------------------
  128|     26|    return false;
  129|     26|  }
  130|    257|  return true;
  131|    283|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    266|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|    257|    DecoderBuffer *buffer) {
  136|    257|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    257|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    257|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    257|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 29, False: 228]
  ------------------
  140|     29|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 28]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     29|  } else
  145|    228|#endif
  146|    228|  {
  147|    228|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 228]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    228|  }
  151|    256|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 80, False: 176]
  ------------------
  152|     80|    return false;
  153|     80|  }
  154|    176|  const uint8_t *const data_head =
  155|    176|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    176|  buffer->Advance(bytes_encoded);
  158|    176|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 35, False: 141]
  ------------------
  159|     35|    return false;
  160|     35|  }
  161|    141|  return true;
  162|    176|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  20.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|    141|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    141|  ans_.read_end();
  167|    141|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    562|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    562|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    562|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 562]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    562|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    562|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    562|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 36, False: 526]
  ------------------
   67|     36|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 35]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     36|  } else
   72|    526|#endif
   73|    526|  {
   74|    526|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 516]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    526|  }
   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|    551|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 26, False: 525]
  ------------------
   83|     26|    return false;
   84|     26|  }
   85|    525|  probability_table_.resize(num_symbols_);
   86|    525|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 523]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|   206k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 205k, False: 429]
  ------------------
   91|   205k|    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|   205k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 41, False: 205k]
  ------------------
   95|     41|      return false;
   96|     41|    }
   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|   205k|    const int token = prob_data & 3;
  102|   205k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 31.2k, False: 174k]
  ------------------
  103|  31.2k|      const uint32_t offset = prob_data >> 2;
  104|  31.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 34, False: 31.1k]
  ------------------
  105|     34|        return false;
  106|     34|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.08M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.05M, False: 31.1k]
  ------------------
  109|  1.05M|        probability_table_[i + j] = 0;
  110|  1.05M|      }
  111|  31.1k|      i += offset;
  112|   174k|    } else {
  113|   174k|      const int extra_bytes = token;
  114|   174k|      uint32_t prob = prob_data >> 2;
  115|   313k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 139k, False: 174k]
  ------------------
  116|   139k|        uint8_t eb;
  117|   139k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 19, False: 139k]
  ------------------
  118|     19|          return false;
  119|     19|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   139k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   139k|      }
  124|   174k|      probability_table_[i] = prob;
  125|   174k|    }
  126|   205k|  }
  127|    429|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 56, False: 373]
  ------------------
  128|     56|    return false;
  129|     56|  }
  130|    373|  return true;
  131|    429|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    375|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|    373|    DecoderBuffer *buffer) {
  136|    373|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    373|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    373|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    373|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 11, False: 362]
  ------------------
  140|     11|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 11]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     11|  } else
  145|    362|#endif
  146|    362|  {
  147|    362|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 360]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    362|  }
  151|    371|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 67, False: 304]
  ------------------
  152|     67|    return false;
  153|     67|  }
  154|    304|  const uint8_t *const data_head =
  155|    304|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    304|  buffer->Advance(bytes_encoded);
  158|    304|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 57, False: 247]
  ------------------
  159|     57|    return false;
  160|     57|  }
  161|    247|  return true;
  162|    304|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|  10.7M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|    247|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    247|  ans_.read_end();
  167|    247|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    405|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    405|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    405|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 405]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    405|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    405|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    405|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 33, False: 372]
  ------------------
   67|     33|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 32]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     33|  } else
   72|    372|#endif
   73|    372|  {
   74|    372|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 5, False: 367]
  ------------------
   75|      5|      return false;
   76|      5|    }
   77|    372|  }
   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|    399|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 13, False: 386]
  ------------------
   83|     13|    return false;
   84|     13|  }
   85|    386|  probability_table_.resize(num_symbols_);
   86|    386|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 374]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|   415k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 415k, False: 271]
  ------------------
   91|   415k|    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|   415k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 61, False: 415k]
  ------------------
   95|     61|      return false;
   96|     61|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   415k|    const int token = prob_data & 3;
  102|   415k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 59.9k, False: 355k]
  ------------------
  103|  59.9k|      const uint32_t offset = prob_data >> 2;
  104|  59.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 59.9k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.05M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.99M, False: 59.9k]
  ------------------
  109|  1.99M|        probability_table_[i + j] = 0;
  110|  1.99M|      }
  111|  59.9k|      i += offset;
  112|   355k|    } else {
  113|   355k|      const int extra_bytes = token;
  114|   355k|      uint32_t prob = prob_data >> 2;
  115|   708k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 353k, False: 355k]
  ------------------
  116|   353k|        uint8_t eb;
  117|   353k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 353k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   353k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   353k|      }
  124|   355k|      probability_table_[i] = prob;
  125|   355k|    }
  126|   415k|  }
  127|    271|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 71, False: 200]
  ------------------
  128|     71|    return false;
  129|     71|  }
  130|    200|  return true;
  131|    271|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    212|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    200|    DecoderBuffer *buffer) {
  136|    200|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    200|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    200|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    200|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 184]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 15]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     16|  } else
  145|    184|#endif
  146|    184|  {
  147|    184|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 182]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    184|  }
  151|    197|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 55, False: 142]
  ------------------
  152|     55|    return false;
  153|     55|  }
  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: 69, False: 73]
  ------------------
  159|     69|    return false;
  160|     69|  }
  161|     73|  return true;
  162|    142|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   630k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     73|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     73|  ans_.read_end();
  167|     73|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    376|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    376|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    376|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 376]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    376|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    376|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    376|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 29, False: 347]
  ------------------
   67|     29|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 29]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     29|  } else
   72|    347|#endif
   73|    347|  {
   74|    347|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 336]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    347|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    365|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 23, False: 342]
  ------------------
   83|     23|    return false;
   84|     23|  }
   85|    342|  probability_table_.resize(num_symbols_);
   86|    342|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 335]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|   977k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 977k, False: 232]
  ------------------
   91|   977k|    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|   977k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 47, False: 976k]
  ------------------
   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|   976k|    const int token = prob_data & 3;
  102|   976k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 616k, False: 360k]
  ------------------
  103|   616k|      const uint32_t offset = prob_data >> 2;
  104|   616k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 34, False: 616k]
  ------------------
  105|     34|        return false;
  106|     34|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  35.1M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 34.5M, False: 616k]
  ------------------
  109|  34.5M|        probability_table_[i + j] = 0;
  110|  34.5M|      }
  111|   616k|      i += offset;
  112|   616k|    } else {
  113|   360k|      const int extra_bytes = token;
  114|   360k|      uint32_t prob = prob_data >> 2;
  115|   643k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 282k, False: 360k]
  ------------------
  116|   282k|        uint8_t eb;
  117|   282k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 282k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   282k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   282k|      }
  124|   360k|      probability_table_[i] = prob;
  125|   360k|    }
  126|   976k|  }
  127|    232|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 68, False: 164]
  ------------------
  128|     68|    return false;
  129|     68|  }
  130|    164|  return true;
  131|    232|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|    171|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_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: 0, False: 164]
  ------------------
  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|    164|#endif
  146|    164|  {
  147|    164|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 155]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    164|  }
  151|    155|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 63, False: 92]
  ------------------
  152|     63|    return false;
  153|     63|  }
  154|     92|  const uint8_t *const data_head =
  155|     92|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     92|  buffer->Advance(bytes_encoded);
  158|     92|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 67]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     67|  return true;
  162|     92|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|   419k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     67|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     67|  ans_.read_end();
  167|     67|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    395|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    395|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    395|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 395]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    395|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    395|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    395|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 52, False: 343]
  ------------------
   67|     52|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 52]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     52|  } else
   72|    343|#endif
   73|    343|  {
   74|    343|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 334]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    343|  }
   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|    386|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 19, False: 367]
  ------------------
   83|     19|    return false;
   84|     19|  }
   85|    367|  probability_table_.resize(num_symbols_);
   86|    367|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 365]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|   205k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 205k, False: 244]
  ------------------
   91|   205k|    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|   205k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 51, False: 205k]
  ------------------
   95|     51|      return false;
   96|     51|    }
   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|   205k|    const int token = prob_data & 3;
  102|   205k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 37.2k, False: 167k]
  ------------------
  103|  37.2k|      const uint32_t offset = prob_data >> 2;
  104|  37.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 47, False: 37.2k]
  ------------------
  105|     47|        return false;
  106|     47|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.37M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.33M, False: 37.2k]
  ------------------
  109|  1.33M|        probability_table_[i + j] = 0;
  110|  1.33M|      }
  111|  37.2k|      i += offset;
  112|   167k|    } else {
  113|   167k|      const int extra_bytes = token;
  114|   167k|      uint32_t prob = prob_data >> 2;
  115|   314k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 146k, False: 167k]
  ------------------
  116|   146k|        uint8_t eb;
  117|   146k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 23, False: 146k]
  ------------------
  118|     23|          return false;
  119|     23|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   146k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   146k|      }
  124|   167k|      probability_table_[i] = prob;
  125|   167k|    }
  126|   205k|  }
  127|    244|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 67, False: 177]
  ------------------
  128|     67|    return false;
  129|     67|  }
  130|    177|  return true;
  131|    244|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    179|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    177|    DecoderBuffer *buffer) {
  136|    177|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    177|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    177|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    177|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 29, False: 148]
  ------------------
  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|    148|#endif
  146|    148|  {
  147|    148|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 145]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    148|  }
  151|    172|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 86, False: 86]
  ------------------
  152|     86|    return false;
  153|     86|  }
  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: 21, False: 65]
  ------------------
  159|     21|    return false;
  160|     21|  }
  161|     65|  return true;
  162|     86|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|  81.1k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     65|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     65|  ans_.read_end();
  167|     65|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    418|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    418|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    418|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 418]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    418|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    418|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    418|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 34, False: 384]
  ------------------
   67|     34|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 34]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     34|  } else
   72|    384|#endif
   73|    384|  {
   74|    384|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 14, False: 370]
  ------------------
   75|     14|      return false;
   76|     14|    }
   77|    384|  }
   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|    404|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 24, False: 380]
  ------------------
   83|     24|    return false;
   84|     24|  }
   85|    380|  probability_table_.resize(num_symbols_);
   86|    380|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 371]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|   940k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 940k, False: 263]
  ------------------
   91|   940k|    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|   940k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 54, False: 940k]
  ------------------
   95|     54|      return false;
   96|     54|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   940k|    const int token = prob_data & 3;
  102|   940k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 536k, False: 403k]
  ------------------
  103|   536k|      const uint32_t offset = prob_data >> 2;
  104|   536k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 33, False: 536k]
  ------------------
  105|     33|        return false;
  106|     33|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  28.9M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 28.4M, False: 536k]
  ------------------
  109|  28.4M|        probability_table_[i + j] = 0;
  110|  28.4M|      }
  111|   536k|      i += offset;
  112|   536k|    } else {
  113|   403k|      const int extra_bytes = token;
  114|   403k|      uint32_t prob = prob_data >> 2;
  115|   596k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 192k, False: 403k]
  ------------------
  116|   192k|        uint8_t eb;
  117|   192k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 192k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   192k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   192k|      }
  124|   403k|      probability_table_[i] = prob;
  125|   403k|    }
  126|   940k|  }
  127|    263|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 69, False: 194]
  ------------------
  128|     69|    return false;
  129|     69|  }
  130|    194|  return true;
  131|    263|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|    203|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|    194|    DecoderBuffer *buffer) {
  136|    194|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    194|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    194|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    194|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 194]
  ------------------
  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|    194|#endif
  146|    194|  {
  147|    194|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 193]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    194|  }
  151|    193|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 76, False: 117]
  ------------------
  152|     76|    return false;
  153|     76|  }
  154|    117|  const uint8_t *const data_head =
  155|    117|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    117|  buffer->Advance(bytes_encoded);
  158|    117|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 22, False: 95]
  ------------------
  159|     22|    return false;
  160|     22|  }
  161|     95|  return true;
  162|    117|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   131k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     95|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     95|  ans_.read_end();
  167|     95|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    380|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    380|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    380|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 380]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    380|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    380|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    380|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 45, False: 335]
  ------------------
   67|     45|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 44]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     45|  } else
   72|    335|#endif
   73|    335|  {
   74|    335|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 8, False: 327]
  ------------------
   75|      8|      return false;
   76|      8|    }
   77|    335|  }
   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|    371|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 17, False: 354]
  ------------------
   83|     17|    return false;
   84|     17|  }
   85|    354|  probability_table_.resize(num_symbols_);
   86|    354|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 342]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|   371k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 371k, False: 229]
  ------------------
   91|   371k|    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|   371k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 44, False: 371k]
  ------------------
   95|     44|      return false;
   96|     44|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   371k|    const int token = prob_data & 3;
  102|   371k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 237k, False: 133k]
  ------------------
  103|   237k|      const uint32_t offset = prob_data >> 2;
  104|   237k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 41, False: 237k]
  ------------------
  105|     41|        return false;
  106|     41|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  10.2M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 9.97M, False: 237k]
  ------------------
  109|  9.97M|        probability_table_[i + j] = 0;
  110|  9.97M|      }
  111|   237k|      i += offset;
  112|   237k|    } else {
  113|   133k|      const int extra_bytes = token;
  114|   133k|      uint32_t prob = prob_data >> 2;
  115|   218k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 85.4k, False: 133k]
  ------------------
  116|  85.4k|        uint8_t eb;
  117|  85.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 28, False: 85.4k]
  ------------------
  118|     28|          return false;
  119|     28|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  85.4k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  85.4k|      }
  124|   133k|      probability_table_[i] = prob;
  125|   133k|    }
  126|   371k|  }
  127|    229|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 35, False: 194]
  ------------------
  128|     35|    return false;
  129|     35|  }
  130|    194|  return true;
  131|    229|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    206|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    194|    DecoderBuffer *buffer) {
  136|    194|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    194|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    194|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    194|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 19, False: 175]
  ------------------
  140|     19|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 18]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     19|  } else
  145|    175|#endif
  146|    175|  {
  147|    175|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 13, False: 162]
  ------------------
  148|     13|      return false;
  149|     13|    }
  150|    175|  }
  151|    180|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 61, False: 119]
  ------------------
  152|     61|    return false;
  153|     61|  }
  154|    119|  const uint8_t *const data_head =
  155|    119|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    119|  buffer->Advance(bytes_encoded);
  158|    119|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 42, False: 77]
  ------------------
  159|     42|    return false;
  160|     42|  }
  161|     77|  return true;
  162|    119|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|   163k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     77|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     77|  ans_.read_end();
  167|     77|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    383|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    383|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    383|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 383]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    383|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    383|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    383|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 77, False: 306]
  ------------------
   67|     77|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 74]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     77|  } else
   72|    306|#endif
   73|    306|  {
   74|    306|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 303]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    306|  }
   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|    377|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 20, False: 357]
  ------------------
   83|     20|    return false;
   84|     20|  }
   85|    357|  probability_table_.resize(num_symbols_);
   86|    357|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 348]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  2.34M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 2.34M, False: 242]
  ------------------
   91|  2.34M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  2.34M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 51, False: 2.34M]
  ------------------
   95|     51|      return false;
   96|     51|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  2.34M|    const int token = prob_data & 3;
  102|  2.34M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.97M, False: 372k]
  ------------------
  103|  1.97M|      const uint32_t offset = prob_data >> 2;
  104|  1.97M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 32, False: 1.97M]
  ------------------
  105|     32|        return false;
  106|     32|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   114M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 112M, False: 1.97M]
  ------------------
  109|   112M|        probability_table_[i + j] = 0;
  110|   112M|      }
  111|  1.97M|      i += offset;
  112|  1.97M|    } else {
  113|   372k|      const int extra_bytes = token;
  114|   372k|      uint32_t prob = prob_data >> 2;
  115|   636k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 264k, False: 372k]
  ------------------
  116|   264k|        uint8_t eb;
  117|   264k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 23, False: 264k]
  ------------------
  118|     23|          return false;
  119|     23|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   264k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   264k|      }
  124|   372k|      probability_table_[i] = prob;
  125|   372k|    }
  126|  2.34M|  }
  127|    242|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 27, False: 215]
  ------------------
  128|     27|    return false;
  129|     27|  }
  130|    215|  return true;
  131|    242|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    224|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|    215|    DecoderBuffer *buffer) {
  136|    215|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    215|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    215|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    215|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 49, False: 166]
  ------------------
  140|     49|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 46]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     49|  } else
  145|    166|#endif
  146|    166|  {
  147|    166|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 6, False: 160]
  ------------------
  148|      6|      return false;
  149|      6|    }
  150|    166|  }
  151|    206|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 76, False: 130]
  ------------------
  152|     76|    return false;
  153|     76|  }
  154|    130|  const uint8_t *const data_head =
  155|    130|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    130|  buffer->Advance(bytes_encoded);
  158|    130|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 50, False: 80]
  ------------------
  159|     50|    return false;
  160|     50|  }
  161|     80|  return true;
  162|    130|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|   339k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     80|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     80|  ans_.read_end();
  167|     80|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    374|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    374|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    374|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 374]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    374|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    374|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    374|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 32, False: 342]
  ------------------
   67|     32|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 32]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     32|  } else
   72|    342|#endif
   73|    342|  {
   74|    342|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 332]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    342|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    364|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 349]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    349|  probability_table_.resize(num_symbols_);
   86|    349|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 13, False: 336]
  ------------------
   87|     13|    return true;
   88|     13|  }
   89|       |  // Decode the table.
   90|   183k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 183k, False: 230]
  ------------------
   91|   183k|    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|   183k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 54, False: 183k]
  ------------------
   95|     54|      return false;
   96|     54|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   183k|    const int token = prob_data & 3;
  102|   183k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 30.2k, False: 153k]
  ------------------
  103|  30.2k|      const uint32_t offset = prob_data >> 2;
  104|  30.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 23, False: 30.2k]
  ------------------
  105|     23|        return false;
  106|     23|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.07M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.04M, False: 30.2k]
  ------------------
  109|  1.04M|        probability_table_[i + j] = 0;
  110|  1.04M|      }
  111|  30.2k|      i += offset;
  112|   153k|    } else {
  113|   153k|      const int extra_bytes = token;
  114|   153k|      uint32_t prob = prob_data >> 2;
  115|   292k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 139k, False: 153k]
  ------------------
  116|   139k|        uint8_t eb;
  117|   139k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 29, False: 139k]
  ------------------
  118|     29|          return false;
  119|     29|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   139k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   139k|      }
  124|   153k|      probability_table_[i] = prob;
  125|   153k|    }
  126|   183k|  }
  127|    230|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 45, False: 185]
  ------------------
  128|     45|    return false;
  129|     45|  }
  130|    185|  return true;
  131|    230|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    198|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    185|    DecoderBuffer *buffer) {
  136|    185|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    185|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    185|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    185|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 7, False: 178]
  ------------------
  140|      7|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 6]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      7|  } else
  145|    178|#endif
  146|    178|  {
  147|    178|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 176]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    178|  }
  151|    182|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 81, False: 101]
  ------------------
  152|     81|    return false;
  153|     81|  }
  154|    101|  const uint8_t *const data_head =
  155|    101|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    101|  buffer->Advance(bytes_encoded);
  158|    101|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 34, False: 67]
  ------------------
  159|     34|    return false;
  160|     34|  }
  161|     67|  return true;
  162|    101|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|   132k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     67|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     67|  ans_.read_end();
  167|     67|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    344|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    344|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    344|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 344]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    344|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    344|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    344|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 44, False: 300]
  ------------------
   67|     44|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 41]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     44|  } else
   72|    300|#endif
   73|    300|  {
   74|    300|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 293]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    300|  }
   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|    334|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 24, False: 310]
  ------------------
   83|     24|    return false;
   84|     24|  }
   85|    310|  probability_table_.resize(num_symbols_);
   86|    310|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 301]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  28.7k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 28.5k, False: 217]
  ------------------
   91|  28.5k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  28.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 31, False: 28.4k]
  ------------------
   95|     31|      return false;
   96|     31|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  28.4k|    const int token = prob_data & 3;
  102|  28.4k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 8.72k, False: 19.7k]
  ------------------
  103|  8.72k|      const uint32_t offset = prob_data >> 2;
  104|  8.72k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 8.69k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   325k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 316k, False: 8.69k]
  ------------------
  109|   316k|        probability_table_[i + j] = 0;
  110|   316k|      }
  111|  8.69k|      i += offset;
  112|  19.7k|    } else {
  113|  19.7k|      const int extra_bytes = token;
  114|  19.7k|      uint32_t prob = prob_data >> 2;
  115|  37.2k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 17.4k, False: 19.7k]
  ------------------
  116|  17.4k|        uint8_t eb;
  117|  17.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 23, False: 17.4k]
  ------------------
  118|     23|          return false;
  119|     23|        }
  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|  19.7k|      probability_table_[i] = prob;
  125|  19.7k|    }
  126|  28.4k|  }
  127|    217|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 23, False: 194]
  ------------------
  128|     23|    return false;
  129|     23|  }
  130|    194|  return true;
  131|    217|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    203|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    194|    DecoderBuffer *buffer) {
  136|    194|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    194|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    194|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    194|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 27, False: 167]
  ------------------
  140|     27|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 25]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     27|  } else
  145|    167|#endif
  146|    167|  {
  147|    167|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 167]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    167|  }
  151|    192|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 71, False: 121]
  ------------------
  152|     71|    return false;
  153|     71|  }
  154|    121|  const uint8_t *const data_head =
  155|    121|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    121|  buffer->Advance(bytes_encoded);
  158|    121|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 32, False: 89]
  ------------------
  159|     32|    return false;
  160|     32|  }
  161|     89|  return true;
  162|    121|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|   242k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     89|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     89|  ans_.read_end();
  167|     89|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    378|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    378|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    378|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 378]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    378|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    378|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    378|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 70, False: 308]
  ------------------
   67|     70|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 69]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     70|  } else
   72|    308|#endif
   73|    308|  {
   74|    308|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 305]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    308|  }
   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|    374|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 25, False: 349]
  ------------------
   83|     25|    return false;
   84|     25|  }
   85|    349|  probability_table_.resize(num_symbols_);
   86|    349|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 344]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|  1.39M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.39M, False: 233]
  ------------------
   91|  1.39M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  1.39M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 50, False: 1.39M]
  ------------------
   95|     50|      return false;
   96|     50|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.39M|    const int token = prob_data & 3;
  102|  1.39M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 438k, False: 951k]
  ------------------
  103|   438k|      const uint32_t offset = prob_data >> 2;
  104|   438k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 26, False: 438k]
  ------------------
  105|     26|        return false;
  106|     26|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  20.0M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 19.5M, False: 438k]
  ------------------
  109|  19.5M|        probability_table_[i + j] = 0;
  110|  19.5M|      }
  111|   438k|      i += offset;
  112|   951k|    } else {
  113|   951k|      const int extra_bytes = token;
  114|   951k|      uint32_t prob = prob_data >> 2;
  115|  1.82M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 876k, False: 951k]
  ------------------
  116|   876k|        uint8_t eb;
  117|   876k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 35, False: 876k]
  ------------------
  118|     35|          return false;
  119|     35|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   876k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   876k|      }
  124|   951k|      probability_table_[i] = prob;
  125|   951k|    }
  126|  1.39M|  }
  127|    233|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 36, False: 197]
  ------------------
  128|     36|    return false;
  129|     36|  }
  130|    197|  return true;
  131|    233|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    202|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    197|    DecoderBuffer *buffer) {
  136|    197|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    197|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    197|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    197|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 35, False: 162]
  ------------------
  140|     35|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 33]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     35|  } else
  145|    162|#endif
  146|    162|  {
  147|    162|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 162]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    162|  }
  151|    195|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 92, False: 103]
  ------------------
  152|     92|    return false;
  153|     92|  }
  154|    103|  const uint8_t *const data_head =
  155|    103|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    103|  buffer->Advance(bytes_encoded);
  158|    103|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 30, False: 73]
  ------------------
  159|     30|    return false;
  160|     30|  }
  161|     73|  return true;
  162|    103|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  61.9k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     73|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     73|  ans_.read_end();
  167|     73|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  12.9k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  12.9k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 42, False: 12.9k]
  ------------------
   35|     42|    return true;
   36|     42|  }
   37|       |  // Decode which scheme to use.
   38|  12.9k|  uint8_t scheme;
   39|  12.9k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 192, False: 12.7k]
  ------------------
   40|    192|    return false;
   41|    192|  }
   42|  12.7k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 1.19k, False: 11.5k]
  ------------------
   43|  1.19k|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|  1.19k|                                                  src_buffer, out_values);
   45|  11.5k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 8.14k, False: 3.38k]
  ------------------
   46|  8.14k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  8.14k|                                               out_values);
   48|  8.14k|  }
   49|  3.38k|  return false;
   50|  12.7k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|  1.19k|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|  1.19k|  SymbolDecoderT<5> tag_decoder;
   57|  1.19k|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 556, False: 634]
  ------------------
   58|    556|    return false;
   59|    556|  }
   60|       |
   61|    634|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 282, False: 352]
  ------------------
   62|    282|    return false;
   63|    282|  }
   64|       |
   65|    352|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 352, False: 0]
  |  Branch (65:25): [True: 68, False: 284]
  ------------------
   66|     68|    return false;  // Wrong number of symbols.
   67|     68|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    284|  src_buffer->StartBitDecoding(false, nullptr);
   72|    284|  int value_id = 0;
   73|  10.4M|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 10.4M, False: 270]
  ------------------
   74|       |    // Decode the tag.
   75|  10.4M|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  26.8M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 16.3M, False: 10.4M]
  ------------------
   78|  16.3M|      uint32_t val;
   79|  16.3M|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 14, False: 16.3M]
  ------------------
   80|     14|        return false;
   81|     14|      }
   82|  16.3M|      out_values[value_id++] = val;
   83|  16.3M|    }
   84|  10.4M|  }
   85|    270|  tag_decoder.EndDecoding();
   86|    270|  src_buffer->EndBitDecoding();
   87|    270|  return true;
   88|    284|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  8.14k|                      uint32_t *out_values) {
  117|  8.14k|  uint8_t max_bit_length;
  118|  8.14k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 64, False: 8.08k]
  ------------------
  119|     64|    return false;
  120|     64|  }
  121|  8.08k|  switch (max_bit_length) {
  122|    696|    case 1:
  ------------------
  |  Branch (122:5): [True: 696, False: 7.38k]
  ------------------
  123|    696|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    696|                                                         out_values);
  125|    542|    case 2:
  ------------------
  |  Branch (125:5): [True: 542, False: 7.53k]
  ------------------
  126|    542|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    542|                                                         out_values);
  128|    487|    case 3:
  ------------------
  |  Branch (128:5): [True: 487, False: 7.59k]
  ------------------
  129|    487|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    487|                                                         out_values);
  131|    361|    case 4:
  ------------------
  |  Branch (131:5): [True: 361, False: 7.72k]
  ------------------
  132|    361|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    361|                                                         out_values);
  134|    230|    case 5:
  ------------------
  |  Branch (134:5): [True: 230, False: 7.85k]
  ------------------
  135|    230|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    230|                                                         out_values);
  137|    420|    case 6:
  ------------------
  |  Branch (137:5): [True: 420, False: 7.66k]
  ------------------
  138|    420|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    420|                                                         out_values);
  140|    401|    case 7:
  ------------------
  |  Branch (140:5): [True: 401, False: 7.68k]
  ------------------
  141|    401|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    401|                                                         out_values);
  143|    451|    case 8:
  ------------------
  |  Branch (143:5): [True: 451, False: 7.63k]
  ------------------
  144|    451|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    451|                                                         out_values);
  146|    562|    case 9:
  ------------------
  |  Branch (146:5): [True: 562, False: 7.51k]
  ------------------
  147|    562|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    562|                                                         out_values);
  149|    405|    case 10:
  ------------------
  |  Branch (149:5): [True: 405, False: 7.67k]
  ------------------
  150|    405|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    405|          num_values, src_buffer, out_values);
  152|    376|    case 11:
  ------------------
  |  Branch (152:5): [True: 376, False: 7.70k]
  ------------------
  153|    376|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    376|          num_values, src_buffer, out_values);
  155|    395|    case 12:
  ------------------
  |  Branch (155:5): [True: 395, False: 7.68k]
  ------------------
  156|    395|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    395|          num_values, src_buffer, out_values);
  158|    418|    case 13:
  ------------------
  |  Branch (158:5): [True: 418, False: 7.66k]
  ------------------
  159|    418|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    418|          num_values, src_buffer, out_values);
  161|    380|    case 14:
  ------------------
  |  Branch (161:5): [True: 380, False: 7.70k]
  ------------------
  162|    380|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    380|          num_values, src_buffer, out_values);
  164|    383|    case 15:
  ------------------
  |  Branch (164:5): [True: 383, False: 7.69k]
  ------------------
  165|    383|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    383|          num_values, src_buffer, out_values);
  167|    374|    case 16:
  ------------------
  |  Branch (167:5): [True: 374, False: 7.70k]
  ------------------
  168|    374|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    374|          num_values, src_buffer, out_values);
  170|    344|    case 17:
  ------------------
  |  Branch (170:5): [True: 344, False: 7.73k]
  ------------------
  171|    344|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    344|          num_values, src_buffer, out_values);
  173|    378|    case 18:
  ------------------
  |  Branch (173:5): [True: 378, False: 7.70k]
  ------------------
  174|    378|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    378|          num_values, src_buffer, out_values);
  176|    478|    default:
  ------------------
  |  Branch (176:5): [True: 478, False: 7.60k]
  ------------------
  177|    478|      return false;
  178|  8.08k|  }
  179|  8.08k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    696|                              uint32_t *out_values) {
   93|    696|  SymbolDecoderT decoder;
   94|    696|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 443, False: 253]
  ------------------
   95|    443|    return false;
   96|    443|  }
   97|       |
   98|    253|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 253, False: 0]
  |  Branch (98:25): [True: 35, False: 218]
  ------------------
   99|     35|    return false;  // Wrong number of symbols.
  100|     35|  }
  101|       |
  102|    218|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 94, False: 124]
  ------------------
  103|     94|    return false;
  104|     94|  }
  105|  24.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 24.7M, False: 124]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  24.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  24.7M|    out_values[i] = value;
  109|  24.7M|  }
  110|    124|  decoder.EndDecoding();
  111|    124|  return true;
  112|    218|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    542|                              uint32_t *out_values) {
   93|    542|  SymbolDecoderT decoder;
   94|    542|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 219, False: 323]
  ------------------
   95|    219|    return false;
   96|    219|  }
   97|       |
   98|    323|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 323, False: 0]
  |  Branch (98:25): [True: 9, False: 314]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    314|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 125, False: 189]
  ------------------
  103|    125|    return false;
  104|    125|  }
  105|  4.48M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.48M, False: 189]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.48M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.48M|    out_values[i] = value;
  109|  4.48M|  }
  110|    189|  decoder.EndDecoding();
  111|    189|  return true;
  112|    314|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    487|                              uint32_t *out_values) {
   93|    487|  SymbolDecoderT decoder;
   94|    487|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 160, False: 327]
  ------------------
   95|    160|    return false;
   96|    160|  }
   97|       |
   98|    327|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 327, False: 0]
  |  Branch (98:25): [True: 20, False: 307]
  ------------------
   99|     20|    return false;  // Wrong number of symbols.
  100|     20|  }
  101|       |
  102|    307|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 159, False: 148]
  ------------------
  103|    159|    return false;
  104|    159|  }
  105|  1.41M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.41M, False: 148]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.41M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.41M|    out_values[i] = value;
  109|  1.41M|  }
  110|    148|  decoder.EndDecoding();
  111|    148|  return true;
  112|    307|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    361|                              uint32_t *out_values) {
   93|    361|  SymbolDecoderT decoder;
   94|    361|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 139, False: 222]
  ------------------
   95|    139|    return false;
   96|    139|  }
   97|       |
   98|    222|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 222, False: 0]
  |  Branch (98:25): [True: 5, False: 217]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    217|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 58, False: 159]
  ------------------
  103|     58|    return false;
  104|     58|  }
  105|  8.18M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.18M, False: 159]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.18M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.18M|    out_values[i] = value;
  109|  8.18M|  }
  110|    159|  decoder.EndDecoding();
  111|    159|  return true;
  112|    217|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    230|                              uint32_t *out_values) {
   93|    230|  SymbolDecoderT decoder;
   94|    230|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 52, False: 178]
  ------------------
   95|     52|    return false;
   96|     52|  }
   97|       |
   98|    178|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 178, False: 0]
  |  Branch (98:25): [True: 45, False: 133]
  ------------------
   99|     45|    return false;  // Wrong number of symbols.
  100|     45|  }
  101|       |
  102|    133|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 12, False: 121]
  ------------------
  103|     12|    return false;
  104|     12|  }
  105|  14.6M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 14.6M, False: 121]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  14.6M|    const uint32_t value = decoder.DecodeSymbol();
  108|  14.6M|    out_values[i] = value;
  109|  14.6M|  }
  110|    121|  decoder.EndDecoding();
  111|    121|  return true;
  112|    133|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    420|                              uint32_t *out_values) {
   93|    420|  SymbolDecoderT decoder;
   94|    420|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 154, False: 266]
  ------------------
   95|    154|    return false;
   96|    154|  }
   97|       |
   98|    266|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 266, False: 0]
  |  Branch (98:25): [True: 10, False: 256]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    256|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 117, False: 139]
  ------------------
  103|    117|    return false;
  104|    117|  }
  105|  12.3M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.3M, False: 139]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.3M|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.3M|    out_values[i] = value;
  109|  12.3M|  }
  110|    139|  decoder.EndDecoding();
  111|    139|  return true;
  112|    256|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    401|                              uint32_t *out_values) {
   93|    401|  SymbolDecoderT decoder;
   94|    401|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 167, False: 234]
  ------------------
   95|    167|    return false;
   96|    167|  }
   97|       |
   98|    234|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 234, False: 0]
  |  Branch (98:25): [True: 10, False: 224]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    224|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 106, False: 118]
  ------------------
  103|    106|    return false;
  104|    106|  }
  105|  12.2M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.2M, False: 118]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.2M|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.2M|    out_values[i] = value;
  109|  12.2M|  }
  110|    118|  decoder.EndDecoding();
  111|    118|  return true;
  112|    224|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    451|                              uint32_t *out_values) {
   93|    451|  SymbolDecoderT decoder;
   94|    451|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 185, False: 266]
  ------------------
   95|    185|    return false;
   96|    185|  }
   97|       |
   98|    266|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 266, False: 0]
  |  Branch (98:25): [True: 9, False: 257]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    257|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 116, False: 141]
  ------------------
  103|    116|    return false;
  104|    116|  }
  105|  20.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 20.5M, False: 141]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  20.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  20.5M|    out_values[i] = value;
  109|  20.5M|  }
  110|    141|  decoder.EndDecoding();
  111|    141|  return true;
  112|    257|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    562|                              uint32_t *out_values) {
   93|    562|  SymbolDecoderT decoder;
   94|    562|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 187, False: 375]
  ------------------
   95|    187|    return false;
   96|    187|  }
   97|       |
   98|    375|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 375, False: 0]
  |  Branch (98:25): [True: 2, False: 373]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    373|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 126, False: 247]
  ------------------
  103|    126|    return false;
  104|    126|  }
  105|  10.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 10.7M, False: 247]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  10.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  10.7M|    out_values[i] = value;
  109|  10.7M|  }
  110|    247|  decoder.EndDecoding();
  111|    247|  return true;
  112|    373|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    405|                              uint32_t *out_values) {
   93|    405|  SymbolDecoderT decoder;
   94|    405|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 193, False: 212]
  ------------------
   95|    193|    return false;
   96|    193|  }
   97|       |
   98|    212|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 212, False: 0]
  |  Branch (98:25): [True: 12, False: 200]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|    200|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 127, False: 73]
  ------------------
  103|    127|    return false;
  104|    127|  }
  105|   630k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 630k, False: 73]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   630k|    const uint32_t value = decoder.DecodeSymbol();
  108|   630k|    out_values[i] = value;
  109|   630k|  }
  110|     73|  decoder.EndDecoding();
  111|     73|  return true;
  112|    200|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    376|                              uint32_t *out_values) {
   93|    376|  SymbolDecoderT decoder;
   94|    376|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 205, False: 171]
  ------------------
   95|    205|    return false;
   96|    205|  }
   97|       |
   98|    171|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 171, False: 0]
  |  Branch (98:25): [True: 7, False: 164]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    164|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 97, False: 67]
  ------------------
  103|     97|    return false;
  104|     97|  }
  105|   419k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 419k, False: 67]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   419k|    const uint32_t value = decoder.DecodeSymbol();
  108|   419k|    out_values[i] = value;
  109|   419k|  }
  110|     67|  decoder.EndDecoding();
  111|     67|  return true;
  112|    164|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    395|                              uint32_t *out_values) {
   93|    395|  SymbolDecoderT decoder;
   94|    395|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 216, False: 179]
  ------------------
   95|    216|    return false;
   96|    216|  }
   97|       |
   98|    179|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 179, False: 0]
  |  Branch (98:25): [True: 2, False: 177]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|    177|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 112, False: 65]
  ------------------
  103|    112|    return false;
  104|    112|  }
  105|  81.1k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 81.1k, False: 65]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  81.1k|    const uint32_t value = decoder.DecodeSymbol();
  108|  81.1k|    out_values[i] = value;
  109|  81.1k|  }
  110|     65|  decoder.EndDecoding();
  111|     65|  return true;
  112|    177|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    418|                              uint32_t *out_values) {
   93|    418|  SymbolDecoderT decoder;
   94|    418|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 215, False: 203]
  ------------------
   95|    215|    return false;
   96|    215|  }
   97|       |
   98|    203|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 203, False: 0]
  |  Branch (98:25): [True: 9, False: 194]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    194|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 99, False: 95]
  ------------------
  103|     99|    return false;
  104|     99|  }
  105|   131k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 131k, False: 95]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   131k|    const uint32_t value = decoder.DecodeSymbol();
  108|   131k|    out_values[i] = value;
  109|   131k|  }
  110|     95|  decoder.EndDecoding();
  111|     95|  return true;
  112|    194|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    380|                              uint32_t *out_values) {
   93|    380|  SymbolDecoderT decoder;
   94|    380|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 174, False: 206]
  ------------------
   95|    174|    return false;
   96|    174|  }
   97|       |
   98|    206|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 206, False: 0]
  |  Branch (98:25): [True: 12, False: 194]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|    194|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 117, False: 77]
  ------------------
  103|    117|    return false;
  104|    117|  }
  105|   163k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 163k, False: 77]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   163k|    const uint32_t value = decoder.DecodeSymbol();
  108|   163k|    out_values[i] = value;
  109|   163k|  }
  110|     77|  decoder.EndDecoding();
  111|     77|  return true;
  112|    194|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    383|                              uint32_t *out_values) {
   93|    383|  SymbolDecoderT decoder;
   94|    383|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 159, False: 224]
  ------------------
   95|    159|    return false;
   96|    159|  }
   97|       |
   98|    224|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 224, False: 0]
  |  Branch (98:25): [True: 9, False: 215]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    215|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 135, False: 80]
  ------------------
  103|    135|    return false;
  104|    135|  }
  105|   339k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 339k, False: 80]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   339k|    const uint32_t value = decoder.DecodeSymbol();
  108|   339k|    out_values[i] = value;
  109|   339k|  }
  110|     80|  decoder.EndDecoding();
  111|     80|  return true;
  112|    215|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    374|                              uint32_t *out_values) {
   93|    374|  SymbolDecoderT decoder;
   94|    374|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 176, False: 198]
  ------------------
   95|    176|    return false;
   96|    176|  }
   97|       |
   98|    198|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 198, False: 0]
  |  Branch (98:25): [True: 13, False: 185]
  ------------------
   99|     13|    return false;  // Wrong number of symbols.
  100|     13|  }
  101|       |
  102|    185|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 118, False: 67]
  ------------------
  103|    118|    return false;
  104|    118|  }
  105|   132k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 132k, False: 67]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   132k|    const uint32_t value = decoder.DecodeSymbol();
  108|   132k|    out_values[i] = value;
  109|   132k|  }
  110|     67|  decoder.EndDecoding();
  111|     67|  return true;
  112|    185|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    344|                              uint32_t *out_values) {
   93|    344|  SymbolDecoderT decoder;
   94|    344|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 141, False: 203]
  ------------------
   95|    141|    return false;
   96|    141|  }
   97|       |
   98|    203|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 203, False: 0]
  |  Branch (98:25): [True: 9, False: 194]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    194|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 105, False: 89]
  ------------------
  103|    105|    return false;
  104|    105|  }
  105|   242k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 242k, False: 89]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   242k|    const uint32_t value = decoder.DecodeSymbol();
  108|   242k|    out_values[i] = value;
  109|   242k|  }
  110|     89|  decoder.EndDecoding();
  111|     89|  return true;
  112|    194|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    378|                              uint32_t *out_values) {
   93|    378|  SymbolDecoderT decoder;
   94|    378|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 176, False: 202]
  ------------------
   95|    176|    return false;
   96|    176|  }
   97|       |
   98|    202|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 202, False: 0]
  |  Branch (98:25): [True: 5, False: 197]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    197|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 124, False: 73]
  ------------------
  103|    124|    return false;
  104|    124|  }
  105|  61.9k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 61.9k, False: 73]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  61.9k|    const uint32_t value = decoder.DecodeSymbol();
  108|  61.9k|    out_values[i] = value;
  109|  61.9k|  }
  110|     73|  decoder.EndDecoding();
  111|     73|  return true;
  112|    197|}

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

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

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

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

_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEEC2Ev:
   48|  3.74k|    : decoder_(nullptr),
   49|  3.74k|      last_symbol_id_(-1),
   50|  3.74k|      last_vert_id_(-1),
   51|  3.74k|      last_face_id_(-1),
   52|  3.74k|      num_new_vertices_(0),
   53|  3.74k|      num_encoded_vertices_(0),
   54|  3.74k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  3.74k|    MeshEdgebreakerDecoder *decoder) {
   59|  3.74k|  decoder_ = decoder;
   60|  3.74k|  return true;
   61|  3.74k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23GetAttributeCornerTableEi:
   66|  3.88k|    int att_id) const {
   67|  5.29k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 4.41k, False: 879]
  ------------------
   68|  4.41k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  4.41k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.40k, False: 3.01k]
  |  Branch (69:27): [True: 0, False: 3.01k]
  ------------------
   70|  1.40k|      continue;
   71|  1.40k|    }
   72|  3.01k|    const AttributesDecoderInterface *const dec =
   73|  3.01k|        decoder_->attributes_decoder(decoder_id);
   74|  5.99k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 5.99k, False: 6]
  ------------------
   75|  5.99k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 3.00k, False: 2.98k]
  ------------------
   76|  3.00k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 2.02k, False: 985]
  ------------------
   77|  2.02k|          return &attribute_data_[i].connectivity_data;
   78|  2.02k|        }
   79|    985|        return nullptr;
   80|  3.00k|      }
   81|  5.99k|    }
   82|  3.01k|  }
   83|    879|  return nullptr;
   84|  3.88k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE24GetAttributeEncodingDataEi:
   89|  3.88k|    int att_id) const {
   90|  5.29k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 4.41k, False: 879]
  ------------------
   91|  4.41k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  4.41k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.40k, False: 3.01k]
  |  Branch (92:27): [True: 0, False: 3.01k]
  ------------------
   93|  1.40k|      continue;
   94|  1.40k|    }
   95|  3.01k|    const AttributesDecoderInterface *const dec =
   96|  3.01k|        decoder_->attributes_decoder(decoder_id);
   97|  5.99k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 5.99k, False: 6]
  ------------------
   98|  5.99k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 3.00k, False: 2.98k]
  ------------------
   99|  3.00k|        return &attribute_data_[i].encoding_data;
  100|  3.00k|      }
  101|  5.99k|    }
  102|  3.01k|  }
  103|    879|  return &pos_encoding_data_;
  104|  3.88k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23CreateAttributesDecoderEi:
  130|  3.12k|    int32_t att_decoder_id) {
  131|  3.12k|  int8_t att_data_id;
  132|  3.12k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 6, False: 3.11k]
  ------------------
  133|      6|    return false;
  134|      6|  }
  135|  3.11k|  uint8_t decoder_type;
  136|  3.11k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 10, False: 3.10k]
  ------------------
  137|     10|    return false;
  138|     10|  }
  139|       |
  140|  3.10k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 2.37k, False: 735]
  ------------------
  141|  2.37k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 68, False: 2.30k]
  ------------------
  142|     68|      return false;  // Unexpected attribute data.
  143|     68|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  2.30k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 5, False: 2.29k]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|       |
  151|  2.29k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  2.29k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    735|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 2, False: 733]
  ------------------
  155|      2|      return false;  // Some other decoder is already using the data. Error.
  156|      2|    }
  157|    733|    pos_data_decoder_id_ = att_decoder_id;
  158|    733|  }
  159|       |
  160|  3.03k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  3.03k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  3.03k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 3.02k, False: 9]
  ------------------
  162|  3.02k|    uint8_t traversal_method_encoded;
  163|  3.02k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 5, False: 3.01k]
  ------------------
  164|      5|      return false;
  165|      5|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  3.01k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 16, False: 3.00k]
  ------------------
  168|     16|      return false;
  169|     16|    }
  170|  3.00k|    traversal_method =
  171|  3.00k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  3.00k|  }
  173|       |
  174|  3.00k|  const Mesh *mesh = decoder_->mesh();
  175|  3.00k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  3.00k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 1.50k, False: 1.50k]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|  1.50k|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|  1.50k|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 714, False: 793]
  ------------------
  182|    714|      encoding_data = &pos_encoding_data_;
  183|    793|    } else {
  184|    793|      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|    793|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    793|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|  1.50k|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 210, False: 1.29k]
  ------------------
  191|    210|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    210|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    210|          AttTraverser;
  194|    210|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|  1.29k|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 1.29k, False: 0]
  ------------------
  196|  1.29k|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|  1.29k|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|  1.29k|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|  1.29k|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|  1.50k|  } else {
  203|  1.50k|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 15, False: 1.48k]
  ------------------
  204|     15|      return false;  // Unsupported method.
  205|     15|    }
  206|  1.48k|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 6, False: 1.48k]
  ------------------
  207|      6|      return false;  // Attribute data must be specified.
  208|      6|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|  1.48k|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|  1.48k|        AttObserver;
  214|  1.48k|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|  1.48k|        AttTraverser;
  216|       |
  217|  1.48k|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|  1.48k|        &attribute_data_[att_data_id].encoding_data;
  219|  1.48k|    const MeshAttributeCornerTable *const corner_table =
  220|  1.48k|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|  1.48k|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|  1.48k|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|  1.48k|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|  1.48k|                             encoding_data);
  227|       |
  228|  1.48k|    AttTraverser att_traverser;
  229|  1.48k|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|  1.48k|    traversal_sequencer->SetTraverser(att_traverser);
  232|  1.48k|    sequencer = std::move(traversal_sequencer);
  233|  1.48k|  }
  234|       |
  235|  2.98k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 2.98k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  2.98k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  2.98k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  2.98k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  2.98k|                                        std::move(att_controller));
  244|  2.98k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEv:
  247|  3.74k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  3.74k|  num_new_vertices_ = 0;
  249|  3.74k|  new_to_parent_vertex_map_.clear();
  250|  3.74k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  3.74k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.74k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 537, False: 3.20k]
  ------------------
  252|    537|    uint32_t num_new_verts;
  253|    537|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    537|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 184, False: 353]
  ------------------
  254|    184|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 184]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|    353|    } else {
  258|    353|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 353]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|    353|    }
  262|    537|    num_new_vertices_ = num_new_verts;
  263|    537|  }
  264|  3.74k|#endif
  265|       |
  266|  3.74k|  uint32_t num_encoded_vertices;
  267|  3.74k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  3.74k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.74k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 184, False: 3.55k]
  ------------------
  269|    184|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 184]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|    184|  } else
  274|  3.55k|#endif
  275|  3.55k|  {
  276|  3.55k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 1, False: 3.55k]
  ------------------
  277|      1|      return false;
  278|      1|    }
  279|  3.55k|  }
  280|  3.73k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  3.73k|  uint32_t num_faces;
  283|  3.73k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  3.73k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.73k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 184, False: 3.55k]
  ------------------
  285|    184|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 184]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|    184|  } else
  290|  3.55k|#endif
  291|  3.55k|  {
  292|  3.55k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 3.55k]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|  3.55k|  }
  296|  3.73k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 4, False: 3.73k]
  ------------------
  297|      4|    return false;  // Draco cannot handle this many faces.
  298|      4|  }
  299|       |
  300|  3.73k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 4, False: 3.73k]
  ------------------
  301|      4|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|      4|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  3.73k|  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|  3.73k|  const uint64_t num_encoded_vertices_64 =
  311|  3.73k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  3.73k|  const uint64_t max_num_vertex_edges =
  313|  3.73k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  3.73k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 1, False: 3.73k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      1|    return false;
  317|      1|  }
  318|       |
  319|  3.73k|  uint8_t num_attribute_data;
  320|  3.73k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 3.73k]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|  3.73k|  uint32_t num_encoded_symbols;
  325|  3.73k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  3.73k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.73k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 177, False: 3.55k]
  ------------------
  327|    177|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 177]
  ------------------
  328|      0|      return false;
  329|      0|    }
  330|       |
  331|    177|  } else
  332|  3.55k|#endif
  333|  3.55k|  {
  334|  3.55k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 3.55k]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|  3.55k|  }
  338|       |
  339|  3.73k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 8, False: 3.72k]
  ------------------
  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|      8|    return false;
  344|      8|  }
  345|  3.72k|  const uint32_t max_encoded_faces =
  346|  3.72k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  3.72k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 10, False: 3.71k]
  ------------------
  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|     10|    return false;
  352|     10|  }
  353|       |
  354|  3.71k|  uint32_t num_encoded_split_symbols;
  355|  3.71k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  3.71k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.71k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 162, False: 3.55k]
  ------------------
  357|    162|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 162]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|    162|  } else
  362|  3.55k|#endif
  363|  3.55k|  {
  364|  3.55k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 3.55k]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|  3.55k|  }
  368|       |
  369|  3.71k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 9, False: 3.70k]
  ------------------
  370|      9|    return false;  // Split symbols are a sub-set of all symbols.
  371|      9|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  3.70k|  vertex_traversal_length_.clear();
  375|  3.70k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  3.70k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 3.70k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  3.70k|  processed_corner_ids_.clear();
  380|  3.70k|  processed_corner_ids_.reserve(num_faces);
  381|  3.70k|  processed_connectivity_corners_.clear();
  382|  3.70k|  processed_connectivity_corners_.reserve(num_faces);
  383|  3.70k|  topology_split_data_.clear();
  384|  3.70k|  hole_event_data_.clear();
  385|  3.70k|  init_face_configurations_.clear();
  386|  3.70k|  init_corners_.clear();
  387|       |
  388|  3.70k|  last_symbol_id_ = -1;
  389|  3.70k|  last_face_id_ = -1;
  390|  3.70k|  last_vert_id_ = -1;
  391|       |
  392|  3.70k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  3.70k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  3.70k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 1, False: 3.70k]
  ------------------
  397|  3.70k|          num_faces, num_encoded_vertices_ + num_encoded_split_symbols)) {
  398|      1|    return false;
  399|      1|  }
  400|       |
  401|       |  // Start with all vertices marked as holes (boundaries).
  402|       |  // Only vertices decoded with TOPOLOGY_C symbol (and the initial face) will
  403|       |  // be marked as non hole vertices. We need to allocate the array larger
  404|       |  // because split symbols can create extra vertices during the decoding
  405|       |  // process (these extra vertices are then eliminated during deduplication).
  406|  3.70k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  3.70k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  3.70k|  int32_t topology_split_decoded_bytes = -1;
  410|  3.70k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.70k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 510, False: 3.19k]
  ------------------
  411|    510|    uint32_t encoded_connectivity_size;
  412|    510|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    510|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 157, False: 353]
  ------------------
  413|    157|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 6, False: 151]
  ------------------
  414|      6|        return false;
  415|      6|      }
  416|    353|    } else {
  417|    353|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 353]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|    353|    }
  421|    504|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 1, False: 503]
  ------------------
  422|    503|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 28, False: 475]
  ------------------
  423|     29|      return false;
  424|     29|    }
  425|    475|    DecoderBuffer event_buffer;
  426|    475|    event_buffer.Init(
  427|    475|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    475|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    475|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    475|    topology_split_decoded_bytes =
  432|    475|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    475|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 138, False: 337]
  ------------------
  434|    138|      return false;
  435|    138|    }
  436|       |
  437|    475|  } else
  438|  3.19k|#endif
  439|  3.19k|  {
  440|  3.19k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 24, False: 3.16k]
  ------------------
  441|     24|      return false;
  442|     24|    }
  443|  3.19k|  }
  444|       |
  445|  3.50k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  3.50k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  3.50k|                                           num_encoded_split_symbols);
  449|  3.50k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  3.50k|  DecoderBuffer traversal_end_buffer;
  452|  3.50k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 101, False: 3.40k]
  ------------------
  453|    101|    return false;
  454|    101|  }
  455|       |
  456|  3.40k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  3.40k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 302, False: 3.10k]
  ------------------
  458|    302|    return false;
  459|    302|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  3.10k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  3.10k|                           traversal_end_buffer.remaining_size(),
  464|  3.10k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  3.10k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  3.10k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.10k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 240, False: 2.86k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|    240|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|    240|  }
  471|  3.10k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  3.10k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 3.05k, False: 44]
  ------------------
  475|  3.05k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  3.05k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  3.05k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 234, False: 2.82k]
  ------------------
  477|  1.40k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 1.17k, False: 234]
  ------------------
  478|  1.17k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 1.17k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  1.17k|      }
  482|       |
  483|    234|    } else
  484|  2.82k|#endif
  485|  2.82k|    {
  486|   236k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 233k, False: 2.82k]
  ------------------
  487|   233k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 233k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   233k|      }
  491|  2.82k|    }
  492|  3.05k|  }
  493|  3.10k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  8.53k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 5.42k, False: 3.10k]
  ------------------
  498|  5.42k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|   557k|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 557k, False: 5.42k]
  ------------------
  501|   557k|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|   557k|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  5.42k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 5.42k]
  ------------------
  505|  5.42k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  5.42k|  }
  509|       |
  510|  3.10k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  8.53k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 5.42k, False: 3.10k]
  ------------------
  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|  5.42k|    int32_t att_connectivity_verts =
  517|  5.42k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  5.42k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 540, False: 4.88k]
  ------------------
  519|    540|      att_connectivity_verts = corner_table_->num_vertices();
  520|    540|    }
  521|  5.42k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  5.42k|  }
  523|  3.10k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 3, False: 3.09k]
  ------------------
  524|      3|    return false;
  525|      3|  }
  526|  3.09k|  return true;
  527|  3.10k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE19OnAttributesDecodedEv:
  530|    701|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    701|  return true;
  532|    701|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEi:
  536|  3.40k|    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|  3.40k|  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|  3.40k|  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|  3.40k|  std::vector<VertexIndex> invalid_vertices;
  558|  3.40k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  3.40k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  3.40k|  int num_faces = 0;
  562|  36.0M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 36.0M, False: 3.19k]
  ------------------
  563|  36.0M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  36.0M|    bool check_topology_split = false;
  566|  36.0M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  36.0M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 15.9M, False: 20.0M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  15.9M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 1, False: 15.9M]
  ------------------
  588|      1|        return -1;
  589|      1|      }
  590|       |
  591|  15.9M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  15.9M|      const VertexIndex vertex_x =
  593|  15.9M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  15.9M|      const CornerIndex corner_b =
  595|  15.9M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  15.9M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 150, False: 15.9M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    150|        return -1;
  600|    150|      }
  601|  15.9M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 15.9M]
  |  Branch (601:11): [True: 0, False: 15.9M]
  ------------------
  602|  15.9M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 15.9M]
  ------------------
  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|  15.9M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  15.9M|      SetOppositeCorners(corner_a, corner + 1);
  612|  15.9M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  15.9M|      const VertexIndex vert_a_prev =
  616|  15.9M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  15.9M|      const VertexIndex vert_b_next =
  618|  15.9M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  15.9M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 15.9M]
  |  Branch (619:38): [True: 0, False: 15.9M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  15.9M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  15.9M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  15.9M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  15.9M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  15.9M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  15.9M|      active_corner_stack.back() = corner;
  631|  20.0M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 5.99M, False: 14.0M]
  |  Branch (631:40): [True: 4.02M, False: 10.0M]
  ------------------
  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|  10.0M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 0, False: 10.0M]
  ------------------
  647|      0|        return -1;
  648|      0|      }
  649|  10.0M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  10.0M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 10.0M]
  ------------------
  651|       |        // Active corner is already opposite to an existing face, which should
  652|       |        // not happen unless the input was tampered with.
  653|      0|        return -1;
  654|      0|      }
  655|       |
  656|       |      // First corner on the new face is either corner "l" or "r".
  657|  10.0M|      const CornerIndex corner(3 * face.value());
  658|  10.0M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  10.0M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 5.99M, False: 4.02M]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  5.99M|        opp_corner = corner + 2;
  662|  5.99M|        corner_l = corner + 1;
  663|  5.99M|        corner_r = corner;
  664|  5.99M|      } else {
  665|       |        // "l" is the new first corner.
  666|  4.02M|        opp_corner = corner + 1;
  667|  4.02M|        corner_l = corner;
  668|  4.02M|        corner_r = corner + 2;
  669|  4.02M|      }
  670|  10.0M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  10.0M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  10.0M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 0, False: 10.0M]
  ------------------
  675|      0|        return -1;  // Unexpected number of decoded vertices.
  676|      0|      }
  677|       |
  678|  10.0M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  10.0M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  10.0M|      const VertexIndex vertex_r =
  682|  10.0M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  10.0M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  10.0M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  10.0M|      corner_table_->MapCornerToVertex(
  688|  10.0M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  10.0M|      active_corner_stack.back() = corner;
  690|  10.0M|      check_topology_split = true;
  691|  10.0M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 4.97M, False: 5.09M]
  ------------------
  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|  4.97M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 0, False: 4.97M]
  ------------------
  703|      0|        return -1;
  704|      0|      }
  705|  4.97M|      const CornerIndex corner_b = active_corner_stack.back();
  706|  4.97M|      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|  4.97M|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  4.97M|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 100, False: 4.97M]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|    100|        active_corner_stack.push_back(it->second);
  714|    100|      }
  715|  4.97M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 20, False: 4.97M]
  ------------------
  716|     20|        return -1;
  717|     20|      }
  718|  4.97M|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  4.97M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 4.97M]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  4.97M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 4, False: 4.97M]
  |  Branch (724:11): [True: 4, False: 4.97M]
  ------------------
  725|  4.97M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 4.97M]
  ------------------
  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|  4.97M|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  4.97M|      SetOppositeCorners(corner_a, corner + 2);
  735|  4.97M|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  4.97M|      const VertexIndex vertex_p =
  739|  4.97M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  4.97M|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  4.97M|      corner_table_->MapCornerToVertex(
  742|  4.97M|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  4.97M|      const VertexIndex vert_b_prev =
  744|  4.97M|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  4.97M|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  4.97M|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  4.97M|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  4.97M|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  4.97M|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  4.97M|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  4.97M|                                       corner_table_->LeftMostCorner(vertex_n));
  753|       |
  754|       |      // Also update the vertex id at corner "n" and all corners that are
  755|       |      // connected to it in the CCW direction.
  756|  4.97M|      const CornerIndex first_corner = corner_n;
  757|  17.6M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 12.6M, False: 4.97M]
  ------------------
  758|  12.6M|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  12.6M|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  12.6M|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 0, False: 12.6M]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      0|          return -1;
  764|      0|        }
  765|  12.6M|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  4.97M|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  4.97M|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 1.45M, False: 3.51M]
  ------------------
  770|  1.45M|        invalid_vertices.push_back(vertex_n);
  771|  1.45M|      }
  772|  4.97M|      active_corner_stack.back() = corner;
  773|  5.09M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 5.09M, False: 0]
  ------------------
  774|  5.09M|      const CornerIndex corner(3 * face.value());
  775|  5.09M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  5.09M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  5.09M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  5.09M|                                       corner_table_->AddNewVertex());
  780|  5.09M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  5.09M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  5.09M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 2, False: 5.09M]
  ------------------
  784|      2|        return -1;  // Unexpected number of decoded vertices.
  785|      2|      }
  786|       |
  787|  5.09M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  5.09M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  5.09M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  5.09M|      active_corner_stack.push_back(corner);
  792|  5.09M|      check_topology_split = true;
  793|  5.09M|    } 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|  36.0M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  36.0M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 15.1M, False: 20.9M]
  ------------------
  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|  15.1M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  15.1M|      EdgeFaceName split_edge;
  812|  15.1M|      int encoder_split_symbol_id;
  813|  15.1M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 2.13k, False: 15.1M]
  ------------------
  814|  15.1M|                             &encoder_split_symbol_id)) {
  815|  2.13k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 36, False: 2.09k]
  ------------------
  816|     36|          return -1;  // Wrong split symbol id.
  817|     36|        }
  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|  2.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|  2.09k|        CornerIndex new_active_corner;
  831|  2.09k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 1.03k, False: 1.06k]
  ------------------
  832|  1.03k|          new_active_corner = corner_table_->Next(act_top_corner);
  833|  1.06k|        } else {
  834|  1.06k|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|  1.06k|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  2.09k|        const int decoder_split_symbol_id =
  839|  2.09k|            num_symbols - encoder_split_symbol_id - 1;
  840|  2.09k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  2.09k|            new_active_corner;
  842|  2.09k|      }
  843|  15.1M|    }
  844|  36.0M|  }
  845|  3.19k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 3.19k]
  ------------------
  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|  33.0k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 29.9k, False: 3.11k]
  ------------------
  850|  29.9k|    const CornerIndex corner = active_corner_stack.back();
  851|  29.9k|    active_corner_stack.pop_back();
  852|  29.9k|    const bool interior_face =
  853|  29.9k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  29.9k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 20.3k, False: 9.60k]
  ------------------
  855|       |      // The start face is interior, we need to find three corners that are
  856|       |      // opposite to it. The first opposite corner "a" is the corner from the
  857|       |      // top of the active corner stack and the remaining two corners "b" and
  858|       |      // "c" are then the next corners from the left-most corners of vertices
  859|       |      // "n" and "x" respectively.
  860|       |      //
  861|       |      //           *-------*
  862|       |      //          / \     / \
  863|       |      //         /   \   /   \
  864|       |      //        /     \ /     \
  865|       |      //       *-------p-------*
  866|       |      //      / \a    . .    c/ \
  867|       |      //     /   \   .   .   /   \
  868|       |      //    /     \ .  I  . /     \
  869|       |      //   *-------n.......x------*
  870|       |      //    \     / \     / \     /
  871|       |      //     \   /   \   /   \   /
  872|       |      //      \ /     \b/     \ /
  873|       |      //       *-------*-------*
  874|       |      //
  875|       |
  876|  20.3k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 17, False: 20.3k]
  ------------------
  877|     17|        return -1;  // More faces than expected added to the mesh.
  878|     17|      }
  879|       |
  880|  20.3k|      const CornerIndex corner_a = corner;
  881|  20.3k|      const VertexIndex vert_n =
  882|  20.3k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  20.3k|      const CornerIndex corner_b =
  884|  20.3k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  20.3k|      const VertexIndex vert_x =
  887|  20.3k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  20.3k|      const CornerIndex corner_c =
  889|  20.3k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  20.3k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 4, False: 20.3k]
  |  Branch (891:33): [True: 43, False: 20.2k]
  |  Branch (891:55): [True: 0, False: 20.2k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     47|        return -1;
  894|     47|      }
  895|  20.2k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 10, False: 20.2k]
  |  Branch (895:11): [True: 13, False: 20.2k]
  ------------------
  896|  20.2k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 2, False: 20.2k]
  ------------------
  897|  20.2k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 1, False: 20.2k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|     13|        return -1;
  901|     13|      }
  902|       |
  903|  20.2k|      const VertexIndex vert_p =
  904|  20.2k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  20.2k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  20.2k|      const CornerIndex new_corner(3 * face.value());
  909|  20.2k|      SetOppositeCorners(new_corner, corner);
  910|  20.2k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  20.2k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  20.2k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  20.2k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  20.2k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  81.0k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 60.7k, False: 20.2k]
  ------------------
  920|  60.7k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  60.7k|      }
  922|       |
  923|  20.2k|      init_face_configurations_.push_back(true);
  924|  20.2k|      init_corners_.push_back(new_corner);
  925|  20.2k|    } 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|  9.60k|      init_face_configurations_.push_back(false);
  930|  9.60k|      init_corners_.push_back(corner);
  931|  9.60k|    }
  932|  29.9k|  }
  933|  3.11k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 11, False: 3.10k]
  ------------------
  934|     11|    return -1;  // Unexpected number of decoded faces.
  935|     11|  }
  936|       |
  937|  3.10k|  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|  8.08k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 8.08k, False: 3.10k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  8.08k|    VertexIndex src_vert(num_vertices - 1);
  943|  9.23k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 1.15k, False: 8.08k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|  1.15k|      src_vert = VertexIndex(--num_vertices - 1);
  946|  1.15k|    }
  947|  8.08k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 1.15k, False: 6.92k]
  ------------------
  948|  1.15k|      continue;  // No need to swap anything.
  949|  1.15k|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  6.92k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  77.5k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 70.6k, False: 6.92k]
  ------------------
  954|  70.6k|      const CornerIndex cid = vcit.Corner();
  955|  70.6k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 1, False: 70.6k]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      1|        return -1;
  959|      1|      }
  960|  70.6k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  70.6k|    }
  962|  6.92k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  6.92k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  6.92k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  6.92k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  6.92k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  6.92k|    num_vertices--;
  972|  6.92k|  }
  973|  3.10k|  return num_vertices;
  974|  3.10k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  3.66k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  3.66k|  uint32_t num_topology_splits;
  982|  3.66k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  3.66k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.66k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 126, False: 3.54k]
  ------------------
  984|    126|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 2, False: 124]
  ------------------
  985|      2|      return -1;
  986|      2|    }
  987|       |
  988|    126|  } else
  989|  3.54k|#endif
  990|  3.54k|  {
  991|  3.54k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 3.54k]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|  3.54k|  }
  995|  3.66k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 1.83k, False: 1.82k]
  ------------------
  996|  1.83k|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 12, False: 1.82k]
  ------------------
  997|  1.83k|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     12|      return -1;
  999|     12|    }
 1000|  1.82k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|  1.82k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.82k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 64, False: 1.76k]
  ------------------
 1002|  5.65k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 5.62k, False: 31]
  ------------------
 1003|  5.62k|        TopologySplitEventData event_data;
 1004|  5.62k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 22, False: 5.60k]
  ------------------
 1005|     22|          return -1;
 1006|     22|        }
 1007|  5.60k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 8, False: 5.59k]
  ------------------
 1008|      8|          return -1;
 1009|      8|        }
 1010|  5.59k|        uint8_t edge_data;
 1011|  5.59k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 3, False: 5.59k]
  ------------------
 1012|      3|          return -1;
 1013|      3|        }
 1014|  5.59k|        event_data.source_edge = edge_data & 1;
 1015|  5.59k|        topology_split_data_.push_back(event_data);
 1016|  5.59k|      }
 1017|       |
 1018|     64|    } else
 1019|  1.76k|#endif
 1020|  1.76k|    {
 1021|       |      // Decode source and split symbol ids using delta and varint coding. See
 1022|       |      // description in mesh_edgebreaker_encoder_impl.cc for more details.
 1023|  1.76k|      int last_source_symbol_id = 0;
 1024|  7.18k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 5.43k, False: 1.74k]
  ------------------
 1025|  5.43k|        TopologySplitEventData event_data;
 1026|  5.43k|        uint32_t delta;
 1027|  5.43k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 9, False: 5.43k]
  ------------------
 1028|      9|          return -1;
 1029|      9|        }
 1030|  5.43k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  5.43k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 2, False: 5.42k]
  ------------------
 1032|      2|          return -1;
 1033|      2|        }
 1034|  5.42k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 10, False: 5.41k]
  ------------------
 1035|     10|          return -1;
 1036|     10|        }
 1037|  5.41k|        event_data.split_symbol_id =
 1038|  5.41k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  5.41k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  5.41k|        topology_split_data_.push_back(event_data);
 1041|  5.41k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|  1.74k|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  6.64k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 4.89k, False: 1.74k]
  ------------------
 1045|  4.89k|        uint32_t edge_data;
 1046|  4.89k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.89k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 1.07k, False: 3.82k]
  ------------------
 1047|  1.07k|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  3.82k|        } else {
 1049|  3.82k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  3.82k|        }
 1051|  4.89k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  4.89k|        event_data.source_edge = edge_data & 1;
 1053|  4.89k|      }
 1054|  1.74k|      decoder_buffer->EndBitDecoding();
 1055|  1.74k|    }
 1056|  1.82k|  }
 1057|  3.59k|  uint32_t num_hole_events = 0;
 1058|  3.59k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  3.59k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.59k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 84, False: 3.51k]
  ------------------
 1060|     84|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 3, False: 81]
  ------------------
 1061|      3|      return -1;
 1062|      3|    }
 1063|  3.51k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  3.51k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 289, False: 3.22k]
  ------------------
 1064|    289|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 7, False: 282]
  ------------------
 1065|      7|      return -1;
 1066|      7|    }
 1067|    289|  }
 1068|  3.58k|#endif
 1069|  3.58k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 112, False: 3.47k]
  ------------------
 1070|    112|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|    112|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    112|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 72, False: 40]
  ------------------
 1072|   203k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 203k, False: 7]
  ------------------
 1073|   203k|        HoleEventData event_data;
 1074|   203k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 65, False: 203k]
  ------------------
 1075|     65|          return -1;
 1076|     65|        }
 1077|   203k|        hole_event_data_.push_back(event_data);
 1078|   203k|      }
 1079|       |
 1080|     72|    } else
 1081|     40|#endif
 1082|     40|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     40|      int last_symbol_id = 0;
 1085|  25.4k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 25.3k, False: 21]
  ------------------
 1086|  25.3k|        HoleEventData event_data;
 1087|  25.3k|        uint32_t delta;
 1088|  25.3k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 19, False: 25.3k]
  ------------------
 1089|     19|          return -1;
 1090|     19|        }
 1091|  25.3k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  25.3k|        last_symbol_id = event_data.symbol_id;
 1093|  25.3k|        hole_event_data_.push_back(event_data);
 1094|  25.3k|      }
 1095|     40|    }
 1096|    112|  }
 1097|  3.50k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  3.58k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  1.17k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  1.17k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  1.17k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  4.69k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 3.52k, False: 1.17k]
  ------------------
 1109|  3.52k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  3.52k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 1.33k, False: 2.19k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  3.04k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 1.71k, False: 1.33k]
  ------------------
 1114|  1.71k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|  1.71k|      }
 1116|  1.33k|      continue;
 1117|  1.33k|    }
 1118|       |
 1119|  5.83k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 3.64k, False: 2.19k]
  ------------------
 1120|  3.64k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  3.64k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 2.02k, False: 1.61k]
  ------------------
 1122|  2.02k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  2.02k|      }
 1124|  3.64k|    }
 1125|  2.19k|  }
 1126|  1.17k|  return true;
 1127|  1.17k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   233k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   233k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   233k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   233k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|   933k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 700k, False: 233k]
  ------------------
 1139|   700k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   700k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 45.5k, False: 654k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   126k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 80.7k, False: 45.5k]
  ------------------
 1144|  80.7k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|  80.7k|      }
 1146|  45.5k|      continue;
 1147|  45.5k|    }
 1148|   654k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   654k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 327k, False: 327k]
  ------------------
 1151|   327k|      continue;
 1152|   327k|    }
 1153|       |
 1154|   955k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 628k, False: 327k]
  ------------------
 1155|   628k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|   628k|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 472k, False: 155k]
  ------------------
 1157|   472k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|   472k|      }
 1159|   628k|    }
 1160|   327k|  }
 1161|   233k|  return true;
 1162|   233k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE21AssignPointsToCornersEi:
 1166|  3.10k|    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|  3.10k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  3.10k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 44, False: 3.05k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|   149k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 149k, False: 44]
  ------------------
 1176|   149k|      Mesh::Face face;
 1177|   149k|      const CornerIndex start_corner(3 * f.value());
 1178|   596k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 447k, False: 149k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   447k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   447k|        face[c] = vert_id;
 1182|   447k|      }
 1183|   149k|      decoder_->mesh()->SetFace(f, face);
 1184|   149k|    }
 1185|     44|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     44|    return true;
 1187|     44|  }
 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|  3.05k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  3.05k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   155k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 152k, False: 3.05k]
  ------------------
 1197|   152k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   152k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 14.9k, False: 137k]
  ------------------
 1199|  14.9k|      continue;  // Isolated vertex.
 1200|  14.9k|    }
 1201|   137k|    CornerIndex deduplication_first_corner = c;
 1202|   137k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 42.0k, False: 95.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|  42.0k|      deduplication_first_corner = c;
 1206|  95.8k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   126k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 107k, False: 18.9k]
  ------------------
 1210|   107k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 17.9k, False: 89.1k]
  ------------------
 1211|  17.9k|          continue;  // No seam for this attribute, ignore it.
 1212|  17.9k|        }
 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|  89.1k|        const VertexIndex vert_id =
 1217|  89.1k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  89.1k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  89.1k|        bool seam_found = false;
 1220|   143k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 131k, False: 12.2k]
  ------------------
 1221|   131k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 3, False: 131k]
  ------------------
 1222|      3|            return false;
 1223|      3|          }
 1224|   131k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 76.8k, False: 54.7k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  76.8k|            deduplication_first_corner = act_c;
 1227|  76.8k|            seam_found = true;
 1228|  76.8k|            break;
 1229|  76.8k|          }
 1230|  54.7k|          act_c = corner_table_->SwingRight(act_c);
 1231|  54.7k|        }
 1232|  89.1k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 76.8k, False: 12.2k]
  ------------------
 1233|  76.8k|          break;  // No reason to process other attributes if we found a seam.
 1234|  76.8k|        }
 1235|  89.1k|      }
 1236|  95.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|   137k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   137k|    corner_to_point_map[c.value()] =
 1246|   137k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   137k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   137k|    CornerIndex prev_c = c;
 1250|   137k|    c = corner_table_->SwingRight(c);
 1251|   670k|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 628k, False: 42.6k]
  |  Branch (1251:40): [True: 533k, False: 95.2k]
  ------------------
 1252|   533k|      bool attribute_seam = false;
 1253|   733k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 633k, False: 100k]
  ------------------
 1254|   633k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 432k, False: 200k]
  ------------------
 1255|   633k|            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|   432k|          attribute_seam = true;
 1259|   432k|          break;
 1260|   432k|        }
 1261|   633k|      }
 1262|   533k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 432k, False: 100k]
  ------------------
 1263|   432k|        corner_to_point_map[c.value()] =
 1264|   432k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   432k|        point_to_corner_map.push_back(c.value());
 1266|   432k|      } else {
 1267|   100k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|   100k|      }
 1269|   533k|      prev_c = c;
 1270|   533k|      c = corner_table_->SwingRight(c);
 1271|   533k|    }
 1272|   137k|  }
 1273|       |  // Add faces.
 1274|   223k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 220k, False: 3.05k]
  ------------------
 1275|   220k|    Mesh::Face face;
 1276|   883k|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 662k, False: 220k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   662k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   662k|    }
 1280|   220k|    decoder_->mesh()->SetFace(f, face);
 1281|   220k|  }
 1282|  3.05k|  decoder_->point_cloud()->set_num_points(
 1283|  3.05k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  3.05k|  return true;
 1285|  3.05k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEEC2Ev:
   48|  2.34k|    : decoder_(nullptr),
   49|  2.34k|      last_symbol_id_(-1),
   50|  2.34k|      last_vert_id_(-1),
   51|  2.34k|      last_face_id_(-1),
   52|  2.34k|      num_new_vertices_(0),
   53|  2.34k|      num_encoded_vertices_(0),
   54|  2.34k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.34k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.34k|  decoder_ = decoder;
   60|  2.34k|  return true;
   61|  2.34k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23GetAttributeCornerTableEi:
   66|  1.99k|    int att_id) const {
   67|  3.08k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 2.44k, False: 639]
  ------------------
   68|  2.44k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  2.44k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.08k, False: 1.35k]
  |  Branch (69:27): [True: 0, False: 1.35k]
  ------------------
   70|  1.08k|      continue;
   71|  1.08k|    }
   72|  1.35k|    const AttributesDecoderInterface *const dec =
   73|  1.35k|        decoder_->attributes_decoder(decoder_id);
   74|  3.75k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 3.75k, False: 4]
  ------------------
   75|  3.75k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 1.35k, False: 2.39k]
  ------------------
   76|  1.35k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 1.04k, False: 307]
  ------------------
   77|  1.04k|          return &attribute_data_[i].connectivity_data;
   78|  1.04k|        }
   79|    307|        return nullptr;
   80|  1.35k|      }
   81|  3.75k|    }
   82|  1.35k|  }
   83|    639|  return nullptr;
   84|  1.99k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE24GetAttributeEncodingDataEi:
   89|  1.99k|    int att_id) const {
   90|  3.08k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 2.44k, False: 639]
  ------------------
   91|  2.44k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  2.44k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.08k, False: 1.35k]
  |  Branch (92:27): [True: 0, False: 1.35k]
  ------------------
   93|  1.08k|      continue;
   94|  1.08k|    }
   95|  1.35k|    const AttributesDecoderInterface *const dec =
   96|  1.35k|        decoder_->attributes_decoder(decoder_id);
   97|  3.75k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 3.75k, False: 4]
  ------------------
   98|  3.75k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 1.35k, False: 2.39k]
  ------------------
   99|  1.35k|        return &attribute_data_[i].encoding_data;
  100|  1.35k|      }
  101|  3.75k|    }
  102|  1.35k|  }
  103|    639|  return &pos_encoding_data_;
  104|  1.99k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23CreateAttributesDecoderEi:
  130|  1.60k|    int32_t att_decoder_id) {
  131|  1.60k|  int8_t att_data_id;
  132|  1.60k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 37, False: 1.57k]
  ------------------
  133|     37|    return false;
  134|     37|  }
  135|  1.57k|  uint8_t decoder_type;
  136|  1.57k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 21, False: 1.55k]
  ------------------
  137|     21|    return false;
  138|     21|  }
  139|       |
  140|  1.55k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 1.07k, False: 477]
  ------------------
  141|  1.07k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 58, False: 1.01k]
  ------------------
  142|     58|      return false;  // Unexpected attribute data.
  143|     58|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  1.01k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 6, False: 1.01k]
  ------------------
  148|      6|      return false;
  149|      6|    }
  150|       |
  151|  1.01k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  1.01k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    477|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 1, False: 476]
  ------------------
  155|      1|      return false;  // Some other decoder is already using the data. Error.
  156|      1|    }
  157|    476|    pos_data_decoder_id_ = att_decoder_id;
  158|    476|  }
  159|       |
  160|  1.48k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  1.48k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.48k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 1.48k, False: 0]
  ------------------
  162|  1.48k|    uint8_t traversal_method_encoded;
  163|  1.48k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 17, False: 1.46k]
  ------------------
  164|     17|      return false;
  165|     17|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  1.46k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 26, False: 1.44k]
  ------------------
  168|     26|      return false;
  169|     26|    }
  170|  1.44k|    traversal_method =
  171|  1.44k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  1.44k|  }
  173|       |
  174|  1.44k|  const Mesh *mesh = decoder_->mesh();
  175|  1.44k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  1.44k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 669, False: 774]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    669|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    669|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 450, False: 219]
  ------------------
  182|    450|      encoding_data = &pos_encoding_data_;
  183|    450|    } else {
  184|    219|      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|    219|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    219|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    669|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 253, False: 416]
  ------------------
  191|    253|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    253|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    253|          AttTraverser;
  194|    253|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    416|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 416, False: 0]
  ------------------
  196|    416|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    416|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    416|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    416|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    774|  } else {
  203|    774|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 4, False: 770]
  ------------------
  204|      4|      return false;  // Unsupported method.
  205|      4|    }
  206|    770|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 2, False: 768]
  ------------------
  207|      2|      return false;  // Attribute data must be specified.
  208|      2|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    768|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    768|        AttObserver;
  214|    768|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    768|        AttTraverser;
  216|       |
  217|    768|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|    768|        &attribute_data_[att_data_id].encoding_data;
  219|    768|    const MeshAttributeCornerTable *const corner_table =
  220|    768|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    768|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    768|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    768|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    768|                             encoding_data);
  227|       |
  228|    768|    AttTraverser att_traverser;
  229|    768|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    768|    traversal_sequencer->SetTraverser(att_traverser);
  232|    768|    sequencer = std::move(traversal_sequencer);
  233|    768|  }
  234|       |
  235|  1.43k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 1.43k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  1.43k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  1.43k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  1.43k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  1.43k|                                        std::move(att_controller));
  244|  1.43k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEv:
  247|  2.34k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.34k|  num_new_vertices_ = 0;
  249|  2.34k|  new_to_parent_vertex_map_.clear();
  250|  2.34k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.34k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.34k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 659, False: 1.68k]
  ------------------
  252|    659|    uint32_t num_new_verts;
  253|    659|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    659|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 235, False: 424]
  ------------------
  254|    235|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 235]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|    424|    } else {
  258|    424|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 424]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|    424|    }
  262|    659|    num_new_vertices_ = num_new_verts;
  263|    659|  }
  264|  2.34k|#endif
  265|       |
  266|  2.34k|  uint32_t num_encoded_vertices;
  267|  2.34k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.34k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.34k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 235, False: 2.10k]
  ------------------
  269|    235|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 235]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|    235|  } else
  274|  2.10k|#endif
  275|  2.10k|  {
  276|  2.10k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 0, False: 2.10k]
  ------------------
  277|      0|      return false;
  278|      0|    }
  279|  2.10k|  }
  280|  2.34k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.34k|  uint32_t num_faces;
  283|  2.34k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.34k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.34k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 235, False: 2.10k]
  ------------------
  285|    235|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 235]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|    235|  } else
  290|  2.10k|#endif
  291|  2.10k|  {
  292|  2.10k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 2.10k]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|  2.10k|  }
  296|  2.34k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 1, False: 2.34k]
  ------------------
  297|      1|    return false;  // Draco cannot handle this many faces.
  298|      1|  }
  299|       |
  300|  2.34k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 6, False: 2.33k]
  ------------------
  301|      6|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|      6|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.33k|  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.33k|  const uint64_t num_encoded_vertices_64 =
  311|  2.33k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.33k|  const uint64_t max_num_vertex_edges =
  313|  2.33k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.33k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 4, False: 2.33k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      4|    return false;
  317|      4|  }
  318|       |
  319|  2.33k|  uint8_t num_attribute_data;
  320|  2.33k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 2.33k]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|  2.33k|  uint32_t num_encoded_symbols;
  325|  2.33k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.33k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.33k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 228, False: 2.10k]
  ------------------
  327|    228|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 228]
  ------------------
  328|      0|      return false;
  329|      0|    }
  330|       |
  331|    228|  } else
  332|  2.10k|#endif
  333|  2.10k|  {
  334|  2.10k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 2.10k]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|  2.10k|  }
  338|       |
  339|  2.33k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 8, False: 2.32k]
  ------------------
  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|      8|    return false;
  344|      8|  }
  345|  2.32k|  const uint32_t max_encoded_faces =
  346|  2.32k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.32k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 23, False: 2.30k]
  ------------------
  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|     23|    return false;
  352|     23|  }
  353|       |
  354|  2.30k|  uint32_t num_encoded_split_symbols;
  355|  2.30k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.30k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.30k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 201, False: 2.10k]
  ------------------
  357|    201|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 201]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|    201|  } else
  362|  2.10k|#endif
  363|  2.10k|  {
  364|  2.10k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 2.10k]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|  2.10k|  }
  368|       |
  369|  2.30k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 12, False: 2.29k]
  ------------------
  370|     12|    return false;  // Split symbols are a sub-set of all symbols.
  371|     12|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.29k|  vertex_traversal_length_.clear();
  375|  2.29k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.29k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.29k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.29k|  processed_corner_ids_.clear();
  380|  2.29k|  processed_corner_ids_.reserve(num_faces);
  381|  2.29k|  processed_connectivity_corners_.clear();
  382|  2.29k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.29k|  topology_split_data_.clear();
  384|  2.29k|  hole_event_data_.clear();
  385|  2.29k|  init_face_configurations_.clear();
  386|  2.29k|  init_corners_.clear();
  387|       |
  388|  2.29k|  last_symbol_id_ = -1;
  389|  2.29k|  last_face_id_ = -1;
  390|  2.29k|  last_vert_id_ = -1;
  391|       |
  392|  2.29k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.29k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.29k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 1, False: 2.28k]
  ------------------
  397|  2.29k|          num_faces, num_encoded_vertices_ + num_encoded_split_symbols)) {
  398|      1|    return false;
  399|      1|  }
  400|       |
  401|       |  // Start with all vertices marked as holes (boundaries).
  402|       |  // Only vertices decoded with TOPOLOGY_C symbol (and the initial face) will
  403|       |  // be marked as non hole vertices. We need to allocate the array larger
  404|       |  // because split symbols can create extra vertices during the decoding
  405|       |  // process (these extra vertices are then eliminated during deduplication).
  406|  2.28k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.28k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.28k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.28k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.28k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 617, False: 1.67k]
  ------------------
  411|    617|    uint32_t encoded_connectivity_size;
  412|    617|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    617|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 193, False: 424]
  ------------------
  413|    193|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 2, False: 191]
  ------------------
  414|      2|        return false;
  415|      2|      }
  416|    424|    } else {
  417|    424|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 424]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|    424|    }
  421|    615|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 1, False: 614]
  ------------------
  422|    614|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 26, False: 588]
  ------------------
  423|     27|      return false;
  424|     27|    }
  425|    588|    DecoderBuffer event_buffer;
  426|    588|    event_buffer.Init(
  427|    588|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    588|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    588|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    588|    topology_split_decoded_bytes =
  432|    588|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    588|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 197, False: 391]
  ------------------
  434|    197|      return false;
  435|    197|    }
  436|       |
  437|    588|  } else
  438|  1.67k|#endif
  439|  1.67k|  {
  440|  1.67k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 26, False: 1.64k]
  ------------------
  441|     26|      return false;
  442|     26|    }
  443|  1.67k|  }
  444|       |
  445|  2.03k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.03k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.03k|                                           num_encoded_split_symbols);
  449|  2.03k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.03k|  DecoderBuffer traversal_end_buffer;
  452|  2.03k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 158, False: 1.87k]
  ------------------
  453|    158|    return false;
  454|    158|  }
  455|       |
  456|  1.87k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.87k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 226, False: 1.65k]
  ------------------
  458|    226|    return false;
  459|    226|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  1.65k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  1.65k|                           traversal_end_buffer.remaining_size(),
  464|  1.65k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  1.65k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  1.65k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.65k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 307, False: 1.34k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|    307|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|    307|  }
  471|  1.65k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  1.65k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 1.49k, False: 162]
  ------------------
  475|  1.49k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  1.49k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.49k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 246, False: 1.24k]
  ------------------
  477|   555k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 555k, False: 246]
  ------------------
  478|   555k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 555k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|   555k|      }
  482|       |
  483|    246|    } else
  484|  1.24k|#endif
  485|  1.24k|    {
  486|  10.4M|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 10.4M, False: 1.24k]
  ------------------
  487|  10.4M|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 10.4M]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|  10.4M|      }
  491|  1.24k|    }
  492|  1.49k|  }
  493|  1.65k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  3.72k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 2.07k, False: 1.65k]
  ------------------
  498|  2.07k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  16.4M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 16.4M, False: 2.07k]
  ------------------
  501|  16.4M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  16.4M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  2.07k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 2.07k]
  ------------------
  505|  2.07k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  2.07k|  }
  509|       |
  510|  1.65k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  3.72k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 2.07k, False: 1.65k]
  ------------------
  512|       |    // For non-position attributes, preallocate the vertex to value mapping
  513|       |    // using the maximum number of vertices from the base corner table and the
  514|       |    // attribute corner table (since the attribute decoder may use either of
  515|       |    // it).
  516|  2.07k|    int32_t att_connectivity_verts =
  517|  2.07k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  2.07k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 452, False: 1.61k]
  ------------------
  519|    452|      att_connectivity_verts = corner_table_->num_vertices();
  520|    452|    }
  521|  2.07k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  2.07k|  }
  523|  1.65k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 7, False: 1.64k]
  ------------------
  524|      7|    return false;
  525|      7|  }
  526|  1.64k|  return true;
  527|  1.65k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE19OnAttributesDecodedEv:
  530|    348|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    348|  return true;
  532|    348|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEi:
  536|  1.87k|    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.87k|  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.87k|  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.87k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.87k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.87k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.87k|  int num_faces = 0;
  562|  82.0M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 82.0M, False: 1.75k]
  ------------------
  563|  82.0M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  82.0M|    bool check_topology_split = false;
  566|  82.0M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  82.0M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 40.1M, False: 41.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|  40.1M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 0, False: 40.1M]
  ------------------
  588|      0|        return -1;
  589|      0|      }
  590|       |
  591|  40.1M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  40.1M|      const VertexIndex vertex_x =
  593|  40.1M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  40.1M|      const CornerIndex corner_b =
  595|  40.1M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  40.1M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 30, False: 40.1M]
  ------------------
  598|       |        // All matched corners must be different.
  599|     30|        return -1;
  600|     30|      }
  601|  40.1M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 40.1M]
  |  Branch (601:11): [True: 0, False: 40.1M]
  ------------------
  602|  40.1M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 40.1M]
  ------------------
  603|       |        // One of the corners is already opposite to an existing face, which
  604|       |        // should not happen unless the input was tampered with.
  605|      0|        return -1;
  606|      0|      }
  607|       |
  608|       |      // New tip corner.
  609|  40.1M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  40.1M|      SetOppositeCorners(corner_a, corner + 1);
  612|  40.1M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  40.1M|      const VertexIndex vert_a_prev =
  616|  40.1M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  40.1M|      const VertexIndex vert_b_next =
  618|  40.1M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  40.1M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 40.1M]
  |  Branch (619:38): [True: 0, False: 40.1M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  40.1M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  40.1M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  40.1M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  40.1M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  40.1M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  40.1M|      active_corner_stack.back() = corner;
  631|  41.9M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 41.8M, False: 83.7k]
  |  Branch (631:40): [True: 16.3k, False: 67.3k]
  ------------------
  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|  41.8M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 0, False: 41.8M]
  ------------------
  647|      0|        return -1;
  648|      0|      }
  649|  41.8M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  41.8M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 41.8M]
  ------------------
  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|  41.8M|      const CornerIndex corner(3 * face.value());
  658|  41.8M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  41.8M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 41.8M, False: 16.3k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  41.8M|        opp_corner = corner + 2;
  662|  41.8M|        corner_l = corner + 1;
  663|  41.8M|        corner_r = corner;
  664|  41.8M|      } else {
  665|       |        // "l" is the new first corner.
  666|  16.3k|        opp_corner = corner + 1;
  667|  16.3k|        corner_l = corner;
  668|  16.3k|        corner_r = corner + 2;
  669|  16.3k|      }
  670|  41.8M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  41.8M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  41.8M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 8, False: 41.8M]
  ------------------
  675|      8|        return -1;  // Unexpected number of decoded vertices.
  676|      8|      }
  677|       |
  678|  41.8M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  41.8M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  41.8M|      const VertexIndex vertex_r =
  682|  41.8M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  41.8M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  41.8M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  41.8M|      corner_table_->MapCornerToVertex(
  688|  41.8M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  41.8M|      active_corner_stack.back() = corner;
  690|  41.8M|      check_topology_split = true;
  691|  41.8M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 16.1k, False: 51.2k]
  ------------------
  692|       |      // Create a new face that merges two last active edges from the active
  693|       |      // stack. No new vertex is created, but two vertices at corners "p" and
  694|       |      // "n" need to be merged into a single vertex.
  695|       |      //
  696|       |      // *-------v-------*
  697|       |      //  \a   p/x\n   b/
  698|       |      //   \   /   \   /
  699|       |      //    \ /  S  \ /
  700|       |      //     *.......*
  701|       |      //
  702|  16.1k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 0, False: 16.1k]
  ------------------
  703|      0|        return -1;
  704|      0|      }
  705|  16.1k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  16.1k|      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|  16.1k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  16.1k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 34, False: 16.1k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     34|        active_corner_stack.push_back(it->second);
  714|     34|      }
  715|  16.1k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 16, False: 16.1k]
  ------------------
  716|     16|        return -1;
  717|     16|      }
  718|  16.1k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  16.1k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 16.1k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  16.1k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 6, False: 16.1k]
  |  Branch (724:11): [True: 6, False: 16.1k]
  ------------------
  725|  16.1k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 16.1k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      6|        return -1;
  729|      6|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  16.1k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  16.1k|      SetOppositeCorners(corner_a, corner + 2);
  735|  16.1k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  16.1k|      const VertexIndex vertex_p =
  739|  16.1k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  16.1k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  16.1k|      corner_table_->MapCornerToVertex(
  742|  16.1k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  16.1k|      const VertexIndex vert_b_prev =
  744|  16.1k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  16.1k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  16.1k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  16.1k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  16.1k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  16.1k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  16.1k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  16.1k|                                       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|  16.1k|      const CornerIndex first_corner = corner_n;
  757|  77.6k|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 61.5k, False: 16.1k]
  ------------------
  758|  61.5k|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  61.5k|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  61.5k|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 3, False: 61.5k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      3|          return -1;
  764|      3|        }
  765|  61.5k|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  16.1k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  16.1k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 3.93k, False: 12.1k]
  ------------------
  770|  3.93k|        invalid_vertices.push_back(vertex_n);
  771|  3.93k|      }
  772|  16.1k|      active_corner_stack.back() = corner;
  773|  51.2k|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 51.2k, False: 0]
  ------------------
  774|  51.2k|      const CornerIndex corner(3 * face.value());
  775|  51.2k|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  51.2k|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  51.2k|      corner_table_->MapCornerToVertex(corner + 1,
  779|  51.2k|                                       corner_table_->AddNewVertex());
  780|  51.2k|      corner_table_->MapCornerToVertex(corner + 2,
  781|  51.2k|                                       corner_table_->AddNewVertex());
  782|       |
  783|  51.2k|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 4, False: 51.2k]
  ------------------
  784|      4|        return -1;  // Unexpected number of decoded vertices.
  785|      4|      }
  786|       |
  787|  51.2k|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  51.2k|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  51.2k|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  51.2k|      active_corner_stack.push_back(corner);
  792|  51.2k|      check_topology_split = true;
  793|  51.2k|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|      0|      return -1;
  796|      0|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  82.0M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  82.0M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 41.9M, False: 40.1M]
  ------------------
  801|       |      // Check for topology splits happens only for TOPOLOGY_L, TOPOLOGY_R and
  802|       |      // TOPOLOGY_E symbols because those are the symbols that correspond to
  803|       |      // faces that can be directly connected a TOPOLOGY_S face through the
  804|       |      // topology split event.
  805|       |      // If a topology split is detected, we need to add a new active edge
  806|       |      // onto the active_corner_stack because it will be used later when the
  807|       |      // corresponding TOPOLOGY_S event is decoded.
  808|       |
  809|       |      // Symbol id used by the encoder (reverse).
  810|  41.9M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  41.9M|      EdgeFaceName split_edge;
  812|  41.9M|      int encoder_split_symbol_id;
  813|  41.9M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.67k, False: 41.9M]
  ------------------
  814|  41.9M|                             &encoder_split_symbol_id)) {
  815|  1.67k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 56, False: 1.62k]
  ------------------
  816|     56|          return -1;  // Wrong split symbol id.
  817|     56|        }
  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.62k|        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.62k|        CornerIndex new_active_corner;
  831|  1.62k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 581, False: 1.03k]
  ------------------
  832|    581|          new_active_corner = corner_table_->Next(act_top_corner);
  833|  1.03k|        } else {
  834|  1.03k|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|  1.03k|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.62k|        const int decoder_split_symbol_id =
  839|  1.62k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.62k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.62k|            new_active_corner;
  842|  1.62k|      }
  843|  41.9M|    }
  844|  82.0M|  }
  845|  1.75k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 1.75k]
  ------------------
  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|  34.5k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 32.8k, False: 1.72k]
  ------------------
  850|  32.8k|    const CornerIndex corner = active_corner_stack.back();
  851|  32.8k|    active_corner_stack.pop_back();
  852|  32.8k|    const bool interior_face =
  853|  32.8k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  32.8k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 24.3k, False: 8.56k]
  ------------------
  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|  24.3k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 14, False: 24.2k]
  ------------------
  877|     14|        return -1;  // More faces than expected added to the mesh.
  878|     14|      }
  879|       |
  880|  24.2k|      const CornerIndex corner_a = corner;
  881|  24.2k|      const VertexIndex vert_n =
  882|  24.2k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  24.2k|      const CornerIndex corner_b =
  884|  24.2k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  24.2k|      const VertexIndex vert_x =
  887|  24.2k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  24.2k|      const CornerIndex corner_c =
  889|  24.2k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  24.2k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 6, False: 24.2k]
  |  Branch (891:33): [True: 10, False: 24.2k]
  |  Branch (891:55): [True: 0, False: 24.2k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     16|        return -1;
  894|     16|      }
  895|  24.2k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 6, False: 24.2k]
  |  Branch (895:11): [True: 6, False: 24.2k]
  ------------------
  896|  24.2k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 24.2k]
  ------------------
  897|  24.2k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 24.2k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      6|        return -1;
  901|      6|      }
  902|       |
  903|  24.2k|      const VertexIndex vert_p =
  904|  24.2k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  24.2k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  24.2k|      const CornerIndex new_corner(3 * face.value());
  909|  24.2k|      SetOppositeCorners(new_corner, corner);
  910|  24.2k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  24.2k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  24.2k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  24.2k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  24.2k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  97.0k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 72.8k, False: 24.2k]
  ------------------
  920|  72.8k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  72.8k|      }
  922|       |
  923|  24.2k|      init_face_configurations_.push_back(true);
  924|  24.2k|      init_corners_.push_back(new_corner);
  925|  24.2k|    } else {
  926|       |      // The initial face wasn't interior and the traversal had to start from
  927|       |      // an open boundary. In this case no new face is added, but we need to
  928|       |      // keep record about the first opposite corner to this boundary.
  929|  8.56k|      init_face_configurations_.push_back(false);
  930|  8.56k|      init_corners_.push_back(corner);
  931|  8.56k|    }
  932|  32.8k|  }
  933|  1.72k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 62, False: 1.65k]
  ------------------
  934|     62|    return -1;  // Unexpected number of decoded faces.
  935|     62|  }
  936|       |
  937|  1.65k|  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.74k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 1.74k, False: 1.65k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  1.74k|    VertexIndex src_vert(num_vertices - 1);
  943|  1.94k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 202, False: 1.74k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    202|      src_vert = VertexIndex(--num_vertices - 1);
  946|    202|    }
  947|  1.74k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 202, False: 1.54k]
  ------------------
  948|    202|      continue;  // No need to swap anything.
  949|    202|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  1.54k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  7.76k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 6.23k, False: 1.53k]
  ------------------
  954|  6.23k|      const CornerIndex cid = vcit.Corner();
  955|  6.23k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 5, False: 6.22k]
  ------------------
  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|  6.22k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  6.22k|    }
  962|  1.53k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  1.53k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  1.53k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  1.53k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  1.53k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  1.53k|    num_vertices--;
  972|  1.53k|  }
  973|  1.65k|  return num_vertices;
  974|  1.65k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.26k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.26k|  uint32_t num_topology_splits;
  982|  2.26k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.26k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.26k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 168, False: 2.09k]
  ------------------
  984|    168|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 1, False: 167]
  ------------------
  985|      1|      return -1;
  986|      1|    }
  987|       |
  988|    168|  } else
  989|  2.09k|#endif
  990|  2.09k|  {
  991|  2.09k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 2.09k]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|  2.09k|  }
  995|  2.25k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 893, False: 1.36k]
  ------------------
  996|    893|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 41, False: 852]
  ------------------
  997|    893|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     41|      return -1;
  999|     41|    }
 1000|    852|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    852|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    852|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 87, False: 765]
  ------------------
 1002|   315k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 315k, False: 43]
  ------------------
 1003|   315k|        TopologySplitEventData event_data;
 1004|   315k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 30, False: 315k]
  ------------------
 1005|     30|          return -1;
 1006|     30|        }
 1007|   315k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 9, False: 315k]
  ------------------
 1008|      9|          return -1;
 1009|      9|        }
 1010|   315k|        uint8_t edge_data;
 1011|   315k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 5, False: 315k]
  ------------------
 1012|      5|          return -1;
 1013|      5|        }
 1014|   315k|        event_data.source_edge = edge_data & 1;
 1015|   315k|        topology_split_data_.push_back(event_data);
 1016|   315k|      }
 1017|       |
 1018|     87|    } else
 1019|    765|#endif
 1020|    765|    {
 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|    765|      int last_source_symbol_id = 0;
 1024|  66.4k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 65.6k, False: 741]
  ------------------
 1025|  65.6k|        TopologySplitEventData event_data;
 1026|  65.6k|        uint32_t delta;
 1027|  65.6k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 6, False: 65.6k]
  ------------------
 1028|      6|          return -1;
 1029|      6|        }
 1030|  65.6k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  65.6k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 6, False: 65.6k]
  ------------------
 1032|      6|          return -1;
 1033|      6|        }
 1034|  65.6k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 12, False: 65.6k]
  ------------------
 1035|     12|          return -1;
 1036|     12|        }
 1037|  65.6k|        event_data.split_symbol_id =
 1038|  65.6k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  65.6k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  65.6k|        topology_split_data_.push_back(event_data);
 1041|  65.6k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    741|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  65.8k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 65.0k, False: 741]
  ------------------
 1045|  65.0k|        uint32_t edge_data;
 1046|  65.0k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  65.0k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 1.81k, False: 63.2k]
  ------------------
 1047|  1.81k|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  63.2k|        } else {
 1049|  63.2k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  63.2k|        }
 1051|  65.0k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  65.0k|        event_data.source_edge = edge_data & 1;
 1053|  65.0k|      }
 1054|    741|      decoder_buffer->EndBitDecoding();
 1055|    741|    }
 1056|    852|  }
 1057|  2.15k|  uint32_t num_hole_events = 0;
 1058|  2.15k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.15k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.15k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 96, False: 2.05k]
  ------------------
 1060|     96|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 3, False: 93]
  ------------------
 1061|      3|      return -1;
 1062|      3|    }
 1063|  2.05k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.05k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 315, False: 1.73k]
  ------------------
 1064|    315|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 10, False: 305]
  ------------------
 1065|     10|      return -1;
 1066|     10|    }
 1067|    315|  }
 1068|  2.13k|#endif
 1069|  2.13k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 113, False: 2.02k]
  ------------------
 1070|    113|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|    113|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    113|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 82, False: 31]
  ------------------
 1072|  1.08M|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 1.08M, False: 3]
  ------------------
 1073|  1.08M|        HoleEventData event_data;
 1074|  1.08M|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 79, False: 1.08M]
  ------------------
 1075|     79|          return -1;
 1076|     79|        }
 1077|  1.08M|        hole_event_data_.push_back(event_data);
 1078|  1.08M|      }
 1079|       |
 1080|     82|    } else
 1081|     31|#endif
 1082|     31|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     31|      int last_symbol_id = 0;
 1085|   335k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 335k, False: 10]
  ------------------
 1086|   335k|        HoleEventData event_data;
 1087|   335k|        uint32_t delta;
 1088|   335k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 21, False: 335k]
  ------------------
 1089|     21|          return -1;
 1090|     21|        }
 1091|   335k|        event_data.symbol_id = delta + last_symbol_id;
 1092|   335k|        last_symbol_id = event_data.symbol_id;
 1093|   335k|        hole_event_data_.push_back(event_data);
 1094|   335k|      }
 1095|     31|    }
 1096|    113|  }
 1097|  2.03k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.13k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|   555k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|   555k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|   555k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  2.22M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 1.66M, False: 555k]
  ------------------
 1109|  1.66M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  1.66M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 6.74k, False: 1.65M]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  13.7k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 7.02k, False: 6.74k]
  ------------------
 1114|  7.02k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|  7.02k|      }
 1116|  6.74k|      continue;
 1117|  6.74k|    }
 1118|       |
 1119|  3.32M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 1.66M, False: 1.65M]
  ------------------
 1120|  1.66M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  1.66M|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 434k, False: 1.22M]
  ------------------
 1122|   434k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|   434k|      }
 1124|  1.66M|    }
 1125|  1.65M|  }
 1126|   555k|  return true;
 1127|   555k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|  10.4M|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|  10.4M|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|  10.4M|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|  10.4M|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  41.6M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 31.2M, False: 10.4M]
  ------------------
 1139|  31.2M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  31.2M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 127k, False: 31.0M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   306k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 179k, False: 127k]
  ------------------
 1144|   179k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   179k|      }
 1146|   127k|      continue;
 1147|   127k|    }
 1148|  31.0M|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|  31.0M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 15.5M, False: 15.5M]
  ------------------
 1151|  15.5M|      continue;
 1152|  15.5M|    }
 1153|       |
 1154|  34.4M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 18.9M, False: 15.5M]
  ------------------
 1155|  18.9M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  18.9M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 15.7M, False: 3.15M]
  ------------------
 1157|  15.7M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  15.7M|      }
 1159|  18.9M|    }
 1160|  15.5M|  }
 1161|  10.4M|  return true;
 1162|  10.4M|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE21AssignPointsToCornersEi:
 1166|  1.65k|    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.65k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  1.65k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 162, False: 1.49k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  1.68M|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 1.68M, False: 162]
  ------------------
 1176|  1.68M|      Mesh::Face face;
 1177|  1.68M|      const CornerIndex start_corner(3 * f.value());
 1178|  6.72M|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 5.04M, False: 1.68M]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  5.04M|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  5.04M|        face[c] = vert_id;
 1182|  5.04M|      }
 1183|  1.68M|      decoder_->mesh()->SetFace(f, face);
 1184|  1.68M|    }
 1185|    162|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|    162|    return true;
 1187|    162|  }
 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.49k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  1.49k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|  5.54M|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 5.54M, False: 1.48k]
  ------------------
 1197|  5.54M|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|  5.54M|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 3.09k, False: 5.53M]
  ------------------
 1199|  3.09k|      continue;  // Isolated vertex.
 1200|  3.09k|    }
 1201|  5.53M|    CornerIndex deduplication_first_corner = c;
 1202|  5.53M|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 133k, False: 5.40M]
  ------------------
 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|   133k|      deduplication_first_corner = c;
 1206|  5.40M|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  6.17M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 5.57M, False: 593k]
  ------------------
 1210|  5.57M|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 754k, False: 4.82M]
  ------------------
 1211|   754k|          continue;  // No seam for this attribute, ignore it.
 1212|   754k|        }
 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|  4.82M|        const VertexIndex vert_id =
 1217|  4.82M|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  4.82M|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  4.82M|        bool seam_found = false;
 1220|  4.92M|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 4.90M, False: 11.3k]
  ------------------
 1221|  4.90M|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 7, False: 4.90M]
  ------------------
 1222|      7|            return false;
 1223|      7|          }
 1224|  4.90M|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 4.81M, False: 97.9k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  4.81M|            deduplication_first_corner = act_c;
 1227|  4.81M|            seam_found = true;
 1228|  4.81M|            break;
 1229|  4.81M|          }
 1230|  97.9k|          act_c = corner_table_->SwingRight(act_c);
 1231|  97.9k|        }
 1232|  4.82M|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 4.81M, False: 11.3k]
  ------------------
 1233|  4.81M|          break;  // No reason to process other attributes if we found a seam.
 1234|  4.81M|        }
 1235|  4.82M|      }
 1236|  5.40M|    }
 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|  5.53M|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|  5.53M|    corner_to_point_map[c.value()] =
 1246|  5.53M|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|  5.53M|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|  5.53M|    CornerIndex prev_c = c;
 1250|  5.53M|    c = corner_table_->SwingRight(c);
 1251|  32.8M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 32.6M, False: 134k]
  |  Branch (1251:40): [True: 27.2M, False: 5.40M]
  ------------------
 1252|  27.2M|      bool attribute_seam = false;
 1253|  31.2M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 28.1M, False: 3.06M]
  ------------------
 1254|  28.1M|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 24.2M, False: 3.93M]
  ------------------
 1255|  28.1M|            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|  24.2M|          attribute_seam = true;
 1259|  24.2M|          break;
 1260|  24.2M|        }
 1261|  28.1M|      }
 1262|  27.2M|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 24.2M, False: 3.06M]
  ------------------
 1263|  24.2M|        corner_to_point_map[c.value()] =
 1264|  24.2M|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  24.2M|        point_to_corner_map.push_back(c.value());
 1266|  24.2M|      } else {
 1267|  3.06M|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  3.06M|      }
 1269|  27.2M|      prev_c = c;
 1270|  27.2M|      c = corner_table_->SwingRight(c);
 1271|  27.2M|    }
 1272|  5.53M|  }
 1273|       |  // Add faces.
 1274|  10.9M|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 10.9M, False: 1.48k]
  ------------------
 1275|  10.9M|    Mesh::Face face;
 1276|  43.7M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 32.7M, False: 10.9M]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  32.7M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  32.7M|    }
 1280|  10.9M|    decoder_->mesh()->SetFace(f, face);
 1281|  10.9M|  }
 1282|  1.48k|  decoder_->point_cloud()->set_num_points(
 1283|  1.48k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  1.48k|  return true;
 1285|  1.49k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEEC2Ev:
   48|  2.95k|    : decoder_(nullptr),
   49|  2.95k|      last_symbol_id_(-1),
   50|  2.95k|      last_vert_id_(-1),
   51|  2.95k|      last_face_id_(-1),
   52|  2.95k|      num_new_vertices_(0),
   53|  2.95k|      num_encoded_vertices_(0),
   54|  2.95k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.95k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.95k|  decoder_ = decoder;
   60|  2.95k|  return true;
   61|  2.95k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23GetAttributeCornerTableEi:
   66|    264|    int att_id) const {
   67|    408|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 196, False: 212]
  ------------------
   68|    196|    const int decoder_id = attribute_data_[i].decoder_id;
   69|    196|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 133, False: 63]
  |  Branch (69:27): [True: 0, False: 63]
  ------------------
   70|    133|      continue;
   71|    133|    }
   72|     63|    const AttributesDecoderInterface *const dec =
   73|     63|        decoder_->attributes_decoder(decoder_id);
   74|    125|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 114, False: 11]
  ------------------
   75|    114|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 52, False: 62]
  ------------------
   76|     52|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 30, False: 22]
  ------------------
   77|     30|          return &attribute_data_[i].connectivity_data;
   78|     30|        }
   79|     22|        return nullptr;
   80|     52|      }
   81|    114|    }
   82|     63|  }
   83|    212|  return nullptr;
   84|    264|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE24GetAttributeEncodingDataEi:
   89|    264|    int att_id) const {
   90|    408|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 196, False: 212]
  ------------------
   91|    196|    const int decoder_id = attribute_data_[i].decoder_id;
   92|    196|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 133, False: 63]
  |  Branch (92:27): [True: 0, False: 63]
  ------------------
   93|    133|      continue;
   94|    133|    }
   95|     63|    const AttributesDecoderInterface *const dec =
   96|     63|        decoder_->attributes_decoder(decoder_id);
   97|    125|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 114, False: 11]
  ------------------
   98|    114|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 52, False: 62]
  ------------------
   99|     52|        return &attribute_data_[i].encoding_data;
  100|     52|      }
  101|    114|    }
  102|     63|  }
  103|    212|  return &pos_encoding_data_;
  104|    264|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23CreateAttributesDecoderEi:
  130|    361|    int32_t att_decoder_id) {
  131|    361|  int8_t att_data_id;
  132|    361|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 22, False: 339]
  ------------------
  133|     22|    return false;
  134|     22|  }
  135|    339|  uint8_t decoder_type;
  136|    339|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 6, False: 333]
  ------------------
  137|      6|    return false;
  138|      6|  }
  139|       |
  140|    333|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 171, False: 162]
  ------------------
  141|    171|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 28, False: 143]
  ------------------
  142|     28|      return false;  // Unexpected attribute data.
  143|     28|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|    143|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 7, False: 136]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|       |
  151|    136|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|    162|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    162|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 1, False: 161]
  ------------------
  155|      1|      return false;  // Some other decoder is already using the data. Error.
  156|      1|    }
  157|    161|    pos_data_decoder_id_ = att_decoder_id;
  158|    161|  }
  159|       |
  160|    297|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|    297|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    297|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 297, False: 0]
  ------------------
  162|    297|    uint8_t traversal_method_encoded;
  163|    297|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 6, False: 291]
  ------------------
  164|      6|      return false;
  165|      6|    }
  166|       |    // Check that decoded traversal method is valid.
  167|    291|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 22, False: 269]
  ------------------
  168|     22|      return false;
  169|     22|    }
  170|    269|    traversal_method =
  171|    269|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|    269|  }
  173|       |
  174|    269|  const Mesh *mesh = decoder_->mesh();
  175|    269|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|    269|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 198, False: 71]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    198|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    198|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 137, False: 61]
  ------------------
  182|    137|      encoding_data = &pos_encoding_data_;
  183|    137|    } else {
  184|     61|      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|     61|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|     61|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    198|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 60, False: 138]
  ------------------
  191|     60|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|     60|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|     60|          AttTraverser;
  194|     60|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    138|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 138, False: 0]
  ------------------
  196|    138|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    138|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    138|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    138|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    198|  } else {
  203|     71|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 11, False: 60]
  ------------------
  204|     11|      return false;  // Unsupported method.
  205|     11|    }
  206|     60|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 0, False: 60]
  ------------------
  207|      0|      return false;  // Attribute data must be specified.
  208|      0|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|     60|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|     60|        AttObserver;
  214|     60|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|     60|        AttTraverser;
  216|       |
  217|     60|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|     60|        &attribute_data_[att_data_id].encoding_data;
  219|     60|    const MeshAttributeCornerTable *const corner_table =
  220|     60|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|     60|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|     60|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|     60|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|     60|                             encoding_data);
  227|       |
  228|     60|    AttTraverser att_traverser;
  229|     60|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|     60|    traversal_sequencer->SetTraverser(att_traverser);
  232|     60|    sequencer = std::move(traversal_sequencer);
  233|     60|  }
  234|       |
  235|    258|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 258]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|    258|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|    258|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|    258|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|    258|                                        std::move(att_controller));
  244|    258|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEv:
  247|  2.95k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.95k|  num_new_vertices_ = 0;
  249|  2.95k|  new_to_parent_vertex_map_.clear();
  250|  2.95k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.95k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.95k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 524, False: 2.43k]
  ------------------
  252|    524|    uint32_t num_new_verts;
  253|    524|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    524|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 345, False: 179]
  ------------------
  254|    345|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 345]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|    345|    } else {
  258|    179|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 179]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|    179|    }
  262|    524|    num_new_vertices_ = num_new_verts;
  263|    524|  }
  264|  2.95k|#endif
  265|       |
  266|  2.95k|  uint32_t num_encoded_vertices;
  267|  2.95k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.95k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.95k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 345, False: 2.61k]
  ------------------
  269|    345|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 345]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|    345|  } else
  274|  2.61k|#endif
  275|  2.61k|  {
  276|  2.61k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 0, False: 2.61k]
  ------------------
  277|      0|      return false;
  278|      0|    }
  279|  2.61k|  }
  280|  2.95k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.95k|  uint32_t num_faces;
  283|  2.95k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.95k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.95k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 345, False: 2.61k]
  ------------------
  285|    345|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 345]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|    345|  } else
  290|  2.61k|#endif
  291|  2.61k|  {
  292|  2.61k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 2.61k]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|  2.61k|  }
  296|  2.95k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 1, False: 2.95k]
  ------------------
  297|      1|    return false;  // Draco cannot handle this many faces.
  298|      1|  }
  299|       |
  300|  2.95k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 2, False: 2.95k]
  ------------------
  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|  2.95k|  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.95k|  const uint64_t num_encoded_vertices_64 =
  311|  2.95k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.95k|  const uint64_t max_num_vertex_edges =
  313|  2.95k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.95k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 1, False: 2.95k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      1|    return false;
  317|      1|  }
  318|       |
  319|  2.95k|  uint8_t num_attribute_data;
  320|  2.95k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 2.95k]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|  2.95k|  uint32_t num_encoded_symbols;
  325|  2.95k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.95k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.95k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 343, False: 2.61k]
  ------------------
  327|    343|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 1, False: 342]
  ------------------
  328|      1|      return false;
  329|      1|    }
  330|       |
  331|    343|  } else
  332|  2.61k|#endif
  333|  2.61k|  {
  334|  2.61k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 2.61k]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|  2.61k|  }
  338|       |
  339|  2.95k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 8, False: 2.94k]
  ------------------
  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|      8|    return false;
  344|      8|  }
  345|  2.94k|  const uint32_t max_encoded_faces =
  346|  2.94k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.94k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 12, False: 2.93k]
  ------------------
  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|     12|    return false;
  352|     12|  }
  353|       |
  354|  2.93k|  uint32_t num_encoded_split_symbols;
  355|  2.93k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.93k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.93k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 331, False: 2.60k]
  ------------------
  357|    331|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 331]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|    331|  } else
  362|  2.60k|#endif
  363|  2.60k|  {
  364|  2.60k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 2.60k]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|  2.60k|  }
  368|       |
  369|  2.93k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 14, False: 2.91k]
  ------------------
  370|     14|    return false;  // Split symbols are a sub-set of all symbols.
  371|     14|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.91k|  vertex_traversal_length_.clear();
  375|  2.91k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.91k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.91k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.91k|  processed_corner_ids_.clear();
  380|  2.91k|  processed_corner_ids_.reserve(num_faces);
  381|  2.91k|  processed_connectivity_corners_.clear();
  382|  2.91k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.91k|  topology_split_data_.clear();
  384|  2.91k|  hole_event_data_.clear();
  385|  2.91k|  init_face_configurations_.clear();
  386|  2.91k|  init_corners_.clear();
  387|       |
  388|  2.91k|  last_symbol_id_ = -1;
  389|  2.91k|  last_face_id_ = -1;
  390|  2.91k|  last_vert_id_ = -1;
  391|       |
  392|  2.91k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.91k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.91k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.91k]
  ------------------
  397|  2.91k|          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.91k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.91k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.91k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.91k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.91k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 505, False: 2.41k]
  ------------------
  411|    505|    uint32_t encoded_connectivity_size;
  412|    505|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    505|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 326, False: 179]
  ------------------
  413|    326|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 5, False: 321]
  ------------------
  414|      5|        return false;
  415|      5|      }
  416|    326|    } else {
  417|    179|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 179]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|    179|    }
  421|    500|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 0, False: 500]
  ------------------
  422|    500|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 32, False: 468]
  ------------------
  423|     32|      return false;
  424|     32|    }
  425|    468|    DecoderBuffer event_buffer;
  426|    468|    event_buffer.Init(
  427|    468|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    468|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    468|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    468|    topology_split_decoded_bytes =
  432|    468|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    468|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 95, False: 373]
  ------------------
  434|     95|      return false;
  435|     95|    }
  436|       |
  437|    468|  } else
  438|  2.41k|#endif
  439|  2.41k|  {
  440|  2.41k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 38, False: 2.37k]
  ------------------
  441|     38|      return false;
  442|     38|    }
  443|  2.41k|  }
  444|       |
  445|  2.74k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.74k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.74k|                                           num_encoded_split_symbols);
  449|  2.74k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.74k|  DecoderBuffer traversal_end_buffer;
  452|  2.74k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 1.38k, False: 1.36k]
  ------------------
  453|  1.38k|    return false;
  454|  1.38k|  }
  455|       |
  456|  1.36k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.36k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 1.02k, False: 342]
  ------------------
  458|  1.02k|    return false;
  459|  1.02k|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|    342|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|    342|                           traversal_end_buffer.remaining_size(),
  464|    342|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|    342|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|    342|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    342|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 5, False: 337]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|      5|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|      5|  }
  471|    342|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|    342|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 225, False: 117]
  ------------------
  475|    225|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|    225|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|    225|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 5, False: 220]
  ------------------
  477|     15|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 10, False: 5]
  ------------------
  478|     10|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 10]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|     10|      }
  482|       |
  483|      5|    } else
  484|    220|#endif
  485|    220|    {
  486|   788k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 788k, False: 220]
  ------------------
  487|   788k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 788k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   788k|      }
  491|    220|    }
  492|    225|  }
  493|    342|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  1.56k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 1.22k, False: 342]
  ------------------
  498|  1.22k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  2.06M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 2.06M, False: 1.22k]
  ------------------
  501|  2.06M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  2.06M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  1.22k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 1.22k]
  ------------------
  505|  1.22k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  1.22k|  }
  509|       |
  510|    342|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  1.56k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 1.22k, False: 342]
  ------------------
  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.22k|    int32_t att_connectivity_verts =
  517|  1.22k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  1.22k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 3, False: 1.21k]
  ------------------
  519|      3|      att_connectivity_verts = corner_table_->num_vertices();
  520|      3|    }
  521|  1.22k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  1.22k|  }
  523|    342|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 13, False: 329]
  ------------------
  524|     13|    return false;
  525|     13|  }
  526|    329|  return true;
  527|    342|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE19OnAttributesDecodedEv:
  530|     26|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|     26|  return true;
  532|     26|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEi:
  536|  1.36k|    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.36k|  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.36k|  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.36k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.36k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.36k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.36k|  int num_faces = 0;
  562|  62.6M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 62.6M, False: 509]
  ------------------
  563|  62.6M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  62.6M|    bool check_topology_split = false;
  566|  62.6M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  62.6M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 3.79M, False: 58.8M]
  ------------------
  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.79M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 116, False: 3.79M]
  ------------------
  588|    116|        return -1;
  589|    116|      }
  590|       |
  591|  3.79M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  3.79M|      const VertexIndex vertex_x =
  593|  3.79M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  3.79M|      const CornerIndex corner_b =
  595|  3.79M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  3.79M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 340, False: 3.79M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    340|        return -1;
  600|    340|      }
  601|  3.79M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 3.79M]
  |  Branch (601:11): [True: 0, False: 3.79M]
  ------------------
  602|  3.79M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 3.79M]
  ------------------
  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.79M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  3.79M|      SetOppositeCorners(corner_a, corner + 1);
  612|  3.79M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  3.79M|      const VertexIndex vert_a_prev =
  616|  3.79M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  3.79M|      const VertexIndex vert_b_next =
  618|  3.79M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  3.79M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 3.79M]
  |  Branch (619:38): [True: 0, False: 3.79M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  3.79M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  3.79M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  3.79M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  3.79M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  3.79M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  3.79M|      active_corner_stack.back() = corner;
  631|  58.8M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 1.95k, False: 58.8M]
  |  Branch (631:40): [True: 53.5M, False: 5.28M]
  ------------------
  632|       |      // Create a new face extending from the open boundary edge opposite to the
  633|       |      // corner "a" from the image below. Two new boundary edges are created
  634|       |      // opposite to corners "r" and "l". New active corner is set to either "r"
  635|       |      // or "l" depending on the decoded symbol. One new vertex is created
  636|       |      // at the opposite corner to corner "a".
  637|       |      //     *-------*
  638|       |      //    /a\     / \
  639|       |      //   /   \   /   \
  640|       |      //  /     \ /     \
  641|       |      // *-------v-------*
  642|       |      //  .l   r.
  643|       |      //   .   .
  644|       |      //    . .
  645|       |      //     *
  646|  53.5M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 53.5M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  53.5M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  53.5M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 53.5M]
  ------------------
  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|  53.5M|      const CornerIndex corner(3 * face.value());
  658|  53.5M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  53.5M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 1.95k, False: 53.5M]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  1.95k|        opp_corner = corner + 2;
  662|  1.95k|        corner_l = corner + 1;
  663|  1.95k|        corner_r = corner;
  664|  53.5M|      } else {
  665|       |        // "l" is the new first corner.
  666|  53.5M|        opp_corner = corner + 1;
  667|  53.5M|        corner_l = corner;
  668|  53.5M|        corner_r = corner + 2;
  669|  53.5M|      }
  670|  53.5M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  53.5M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  53.5M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 8, False: 53.5M]
  ------------------
  675|      8|        return -1;  // Unexpected number of decoded vertices.
  676|      8|      }
  677|       |
  678|  53.5M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  53.5M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  53.5M|      const VertexIndex vertex_r =
  682|  53.5M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  53.5M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  53.5M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  53.5M|      corner_table_->MapCornerToVertex(
  688|  53.5M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  53.5M|      active_corner_stack.back() = corner;
  690|  53.5M|      check_topology_split = true;
  691|  53.5M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 36.0k, False: 5.24M]
  ------------------
  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|  36.0k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 1, False: 36.0k]
  ------------------
  703|      1|        return -1;
  704|      1|      }
  705|  36.0k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  36.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|  36.0k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  36.0k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 39, False: 36.0k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     39|        active_corner_stack.push_back(it->second);
  714|     39|      }
  715|  36.0k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 48, False: 36.0k]
  ------------------
  716|     48|        return -1;
  717|     48|      }
  718|  36.0k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  36.0k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 36.0k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  36.0k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 4, False: 36.0k]
  |  Branch (724:11): [True: 4, False: 36.0k]
  ------------------
  725|  36.0k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 36.0k]
  ------------------
  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|  36.0k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  36.0k|      SetOppositeCorners(corner_a, corner + 2);
  735|  36.0k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  36.0k|      const VertexIndex vertex_p =
  739|  36.0k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  36.0k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  36.0k|      corner_table_->MapCornerToVertex(
  742|  36.0k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  36.0k|      const VertexIndex vert_b_prev =
  744|  36.0k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  36.0k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  36.0k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  36.0k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  36.0k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  36.0k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  36.0k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  36.0k|                                       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|  36.0k|      const CornerIndex first_corner = corner_n;
  757|   334k|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 298k, False: 36.0k]
  ------------------
  758|   298k|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|   298k|        corner_n = corner_table_->SwingLeft(corner_n);
  760|   298k|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 1, False: 298k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      1|          return -1;
  764|      1|        }
  765|   298k|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  36.0k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  36.0k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 35.4k, False: 514]
  ------------------
  770|  35.4k|        invalid_vertices.push_back(vertex_n);
  771|  35.4k|      }
  772|  36.0k|      active_corner_stack.back() = corner;
  773|  5.24M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 5.24M, False: 272]
  ------------------
  774|  5.24M|      const CornerIndex corner(3 * face.value());
  775|  5.24M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  5.24M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  5.24M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  5.24M|                                       corner_table_->AddNewVertex());
  780|  5.24M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  5.24M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  5.24M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 10, False: 5.24M]
  ------------------
  784|     10|        return -1;  // Unexpected number of decoded vertices.
  785|     10|      }
  786|       |
  787|  5.24M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  5.24M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  5.24M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  5.24M|      active_corner_stack.push_back(corner);
  792|  5.24M|      check_topology_split = true;
  793|  5.24M|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|    272|      return -1;
  796|    272|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  62.6M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  62.6M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 58.7M, False: 3.83M]
  ------------------
  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|  58.7M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  58.7M|      EdgeFaceName split_edge;
  812|  58.7M|      int encoder_split_symbol_id;
  813|  58.7M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 2.44k, False: 58.7M]
  ------------------
  814|  58.7M|                             &encoder_split_symbol_id)) {
  815|  2.44k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 57, False: 2.38k]
  ------------------
  816|     57|          return -1;  // Wrong split symbol id.
  817|     57|        }
  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|  2.38k|        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|  2.38k|        CornerIndex new_active_corner;
  831|  2.38k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 1.11k, False: 1.27k]
  ------------------
  832|  1.11k|          new_active_corner = corner_table_->Next(act_top_corner);
  833|  1.27k|        } else {
  834|  1.27k|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|  1.27k|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  2.38k|        const int decoder_split_symbol_id =
  839|  2.38k|            num_symbols - encoder_split_symbol_id - 1;
  840|  2.38k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  2.38k|            new_active_corner;
  842|  2.38k|      }
  843|  58.7M|    }
  844|  62.6M|  }
  845|    509|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 509]
  ------------------
  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|  4.33M|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 4.33M, False: 445]
  ------------------
  850|  4.33M|    const CornerIndex corner = active_corner_stack.back();
  851|  4.33M|    active_corner_stack.pop_back();
  852|  4.33M|    const bool interior_face =
  853|  4.33M|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  4.33M|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 2.31M, False: 2.01M]
  ------------------
  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.31M|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 61, False: 2.31M]
  ------------------
  877|     61|        return -1;  // More faces than expected added to the mesh.
  878|     61|      }
  879|       |
  880|  2.31M|      const CornerIndex corner_a = corner;
  881|  2.31M|      const VertexIndex vert_n =
  882|  2.31M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  2.31M|      const CornerIndex corner_b =
  884|  2.31M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  2.31M|      const VertexIndex vert_x =
  887|  2.31M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  2.31M|      const CornerIndex corner_c =
  889|  2.31M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  2.31M|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 1, False: 2.31M]
  |  Branch (891:33): [True: 2, False: 2.31M]
  |  Branch (891:55): [True: 0, False: 2.31M]
  ------------------
  892|       |        // All matched corners must be different.
  893|      3|        return -1;
  894|      3|      }
  895|  2.31M|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 0, False: 2.31M]
  |  Branch (895:11): [True: 0, False: 2.31M]
  ------------------
  896|  2.31M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 2.31M]
  ------------------
  897|  2.31M|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 2.31M]
  ------------------
  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.31M|      const VertexIndex vert_p =
  904|  2.31M|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  2.31M|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  2.31M|      const CornerIndex new_corner(3 * face.value());
  909|  2.31M|      SetOppositeCorners(new_corner, corner);
  910|  2.31M|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  2.31M|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  2.31M|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  2.31M|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  2.31M|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  9.24M|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 6.93M, False: 2.31M]
  ------------------
  920|  6.93M|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  6.93M|      }
  922|       |
  923|  2.31M|      init_face_configurations_.push_back(true);
  924|  2.31M|      init_corners_.push_back(new_corner);
  925|  2.31M|    } else {
  926|       |      // The initial face wasn't interior and the traversal had to start from
  927|       |      // an open boundary. In this case no new face is added, but we need to
  928|       |      // keep record about the first opposite corner to this boundary.
  929|  2.01M|      init_face_configurations_.push_back(false);
  930|  2.01M|      init_corners_.push_back(corner);
  931|  2.01M|    }
  932|  4.33M|  }
  933|    445|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 97, False: 348]
  ------------------
  934|     97|    return -1;  // Unexpected number of decoded faces.
  935|     97|  }
  936|       |
  937|    348|  int num_vertices = corner_table_->num_vertices();
  938|       |  // If any vertex was marked as isolated, we want to remove it from the corner
  939|       |  // table to ensure that all vertices in range <0, num_vertices> are valid.
  940|  3.34k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 3.34k, False: 342]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  3.34k|    VertexIndex src_vert(num_vertices - 1);
  943|  4.08k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 736, False: 3.34k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    736|      src_vert = VertexIndex(--num_vertices - 1);
  946|    736|    }
  947|  3.34k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 457, False: 2.88k]
  ------------------
  948|    457|      continue;  // No need to swap anything.
  949|    457|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  2.88k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  11.4k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 8.53k, False: 2.88k]
  ------------------
  954|  8.53k|      const CornerIndex cid = vcit.Corner();
  955|  8.53k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 6, False: 8.53k]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      6|        return -1;
  959|      6|      }
  960|  8.53k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  8.53k|    }
  962|  2.88k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  2.88k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  2.88k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  2.88k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  2.88k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  2.88k|    num_vertices--;
  972|  2.88k|  }
  973|    342|  return num_vertices;
  974|    348|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.88k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.88k|  uint32_t num_topology_splits;
  982|  2.88k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.88k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.88k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 294, False: 2.58k]
  ------------------
  984|    294|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 2, False: 292]
  ------------------
  985|      2|      return -1;
  986|      2|    }
  987|       |
  988|    294|  } else
  989|  2.58k|#endif
  990|  2.58k|  {
  991|  2.58k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 2.58k]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|  2.58k|  }
  995|  2.88k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 628, False: 2.25k]
  ------------------
  996|    628|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 29, False: 599]
  ------------------
  997|    628|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     29|      return -1;
  999|     29|    }
 1000|    599|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    599|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    599|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 46, False: 553]
  ------------------
 1002|   207k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 207k, False: 13]
  ------------------
 1003|   207k|        TopologySplitEventData event_data;
 1004|   207k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 19, False: 207k]
  ------------------
 1005|     19|          return -1;
 1006|     19|        }
 1007|   207k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 11, False: 207k]
  ------------------
 1008|     11|          return -1;
 1009|     11|        }
 1010|   207k|        uint8_t edge_data;
 1011|   207k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 3, False: 207k]
  ------------------
 1012|      3|          return -1;
 1013|      3|        }
 1014|   207k|        event_data.source_edge = edge_data & 1;
 1015|   207k|        topology_split_data_.push_back(event_data);
 1016|   207k|      }
 1017|       |
 1018|     46|    } else
 1019|    553|#endif
 1020|    553|    {
 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|    553|      int last_source_symbol_id = 0;
 1024|  5.49k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 4.95k, False: 531]
  ------------------
 1025|  4.95k|        TopologySplitEventData event_data;
 1026|  4.95k|        uint32_t delta;
 1027|  4.95k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 7, False: 4.95k]
  ------------------
 1028|      7|          return -1;
 1029|      7|        }
 1030|  4.95k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  4.95k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 5, False: 4.94k]
  ------------------
 1032|      5|          return -1;
 1033|      5|        }
 1034|  4.94k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 10, False: 4.93k]
  ------------------
 1035|     10|          return -1;
 1036|     10|        }
 1037|  4.93k|        event_data.split_symbol_id =
 1038|  4.93k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  4.93k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  4.93k|        topology_split_data_.push_back(event_data);
 1041|  4.93k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    531|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  4.89k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 4.36k, False: 531]
  ------------------
 1045|  4.36k|        uint32_t edge_data;
 1046|  4.36k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.36k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 810, False: 3.55k]
  ------------------
 1047|    810|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  3.55k|        } else {
 1049|  3.55k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  3.55k|        }
 1051|  4.36k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  4.36k|        event_data.source_edge = edge_data & 1;
 1053|  4.36k|      }
 1054|    531|      decoder_buffer->EndBitDecoding();
 1055|    531|    }
 1056|    599|  }
 1057|  2.79k|  uint32_t num_hole_events = 0;
 1058|  2.79k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.79k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.79k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 247, False: 2.54k]
  ------------------
 1060|    247|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 5, False: 242]
  ------------------
 1061|      5|      return -1;
 1062|      5|    }
 1063|  2.54k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.54k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 124, False: 2.42k]
  ------------------
 1064|    124|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 6, False: 118]
  ------------------
 1065|      6|      return -1;
 1066|      6|    }
 1067|    124|  }
 1068|  2.78k|#endif
 1069|  2.78k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 48, False: 2.73k]
  ------------------
 1070|     48|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     48|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     48|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 26, False: 22]
  ------------------
 1072|   142k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 142k, False: 2]
  ------------------
 1073|   142k|        HoleEventData event_data;
 1074|   142k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 24, False: 142k]
  ------------------
 1075|     24|          return -1;
 1076|     24|        }
 1077|   142k|        hole_event_data_.push_back(event_data);
 1078|   142k|      }
 1079|       |
 1080|     26|    } else
 1081|     22|#endif
 1082|     22|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     22|      int last_symbol_id = 0;
 1085|   119k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 119k, False: 10]
  ------------------
 1086|   119k|        HoleEventData event_data;
 1087|   119k|        uint32_t delta;
 1088|   119k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 12, False: 119k]
  ------------------
 1089|     12|          return -1;
 1090|     12|        }
 1091|   119k|        event_data.symbol_id = delta + last_symbol_id;
 1092|   119k|        last_symbol_id = event_data.symbol_id;
 1093|   119k|        hole_event_data_.push_back(event_data);
 1094|   119k|      }
 1095|     22|    }
 1096|     48|  }
 1097|  2.74k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.78k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|     10|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|     10|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|     10|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|     40|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 30, False: 10]
  ------------------
 1109|     30|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|     30|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 10, False: 20]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|     20|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 10, False: 10]
  ------------------
 1114|     10|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|     10|      }
 1116|     10|      continue;
 1117|     10|    }
 1118|       |
 1119|     40|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 20, False: 20]
  ------------------
 1120|     20|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|     20|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 10, False: 10]
  ------------------
 1122|     10|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|     10|      }
 1124|     20|    }
 1125|     20|  }
 1126|     10|  return true;
 1127|     10|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   788k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   788k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   788k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   788k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  3.15M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 2.36M, False: 788k]
  ------------------
 1139|  2.36M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  2.36M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 407k, False: 1.95M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|  1.22M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 817k, False: 407k]
  ------------------
 1144|   817k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   817k|      }
 1146|   407k|      continue;
 1147|   407k|    }
 1148|  1.95M|    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.95M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 978k, False: 978k]
  ------------------
 1151|   978k|      continue;
 1152|   978k|    }
 1153|       |
 1154|  2.93M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 1.95M, False: 978k]
  ------------------
 1155|  1.95M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  1.95M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 1.24M, False: 710k]
  ------------------
 1157|  1.24M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  1.24M|      }
 1159|  1.95M|    }
 1160|   978k|  }
 1161|   788k|  return true;
 1162|   788k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE21AssignPointsToCornersEi:
 1166|    342|    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|    342|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|    342|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 117, False: 225]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  88.5k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 88.4k, False: 117]
  ------------------
 1176|  88.4k|      Mesh::Face face;
 1177|  88.4k|      const CornerIndex start_corner(3 * f.value());
 1178|   353k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 265k, False: 88.4k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   265k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   265k|        face[c] = vert_id;
 1182|   265k|      }
 1183|  88.4k|      decoder_->mesh()->SetFace(f, face);
 1184|  88.4k|    }
 1185|    117|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|    117|    return true;
 1187|    117|  }
 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|    225|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|    225|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   589k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 589k, False: 212]
  ------------------
 1197|   589k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   589k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 103, False: 589k]
  ------------------
 1199|    103|      continue;  // Isolated vertex.
 1200|    103|    }
 1201|   589k|    CornerIndex deduplication_first_corner = c;
 1202|   589k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 407k, 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|   407k|      deduplication_first_corner = c;
 1206|   407k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   296k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 243k, False: 53.0k]
  ------------------
 1210|   243k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 113k, False: 130k]
  ------------------
 1211|   113k|          continue;  // No seam for this attribute, ignore it.
 1212|   113k|        }
 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|   130k|        const VertexIndex vert_id =
 1217|   130k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|   130k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|   130k|        bool seam_found = false;
 1220|   146k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 144k, False: 1.86k]
  ------------------
 1221|   144k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 13, False: 144k]
  ------------------
 1222|     13|            return false;
 1223|     13|          }
 1224|   144k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 128k, False: 16.0k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|   128k|            deduplication_first_corner = act_c;
 1227|   128k|            seam_found = true;
 1228|   128k|            break;
 1229|   128k|          }
 1230|  16.0k|          act_c = corner_table_->SwingRight(act_c);
 1231|  16.0k|        }
 1232|   130k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 128k, False: 1.86k]
  ------------------
 1233|   128k|          break;  // No reason to process other attributes if we found a seam.
 1234|   128k|        }
 1235|   130k|      }
 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|   589k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   589k|    corner_to_point_map[c.value()] =
 1246|   589k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   589k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   589k|    CornerIndex prev_c = c;
 1250|   589k|    c = corner_table_->SwingRight(c);
 1251|  2.37M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 1.96M, False: 407k]
  |  Branch (1251:40): [True: 1.78M, False: 181k]
  ------------------
 1252|  1.78M|      bool attribute_seam = false;
 1253|  2.90M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 2.46M, False: 442k]
  ------------------
 1254|  2.46M|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 1.34M, False: 1.12M]
  ------------------
 1255|  2.46M|            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.34M|          attribute_seam = true;
 1259|  1.34M|          break;
 1260|  1.34M|        }
 1261|  2.46M|      }
 1262|  1.78M|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 1.34M, False: 442k]
  ------------------
 1263|  1.34M|        corner_to_point_map[c.value()] =
 1264|  1.34M|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  1.34M|        point_to_corner_map.push_back(c.value());
 1266|  1.34M|      } else {
 1267|   442k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|   442k|      }
 1269|  1.78M|      prev_c = c;
 1270|  1.78M|      c = corner_table_->SwingRight(c);
 1271|  1.78M|    }
 1272|   589k|  }
 1273|       |  // Add faces.
 1274|   736k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 736k, False: 212]
  ------------------
 1275|   736k|    Mesh::Face face;
 1276|  2.94M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 2.20M, False: 736k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  2.20M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  2.20M|    }
 1280|   736k|    decoder_->mesh()->SetFace(f, face);
 1281|   736k|  }
 1282|    212|  decoder_->point_cloud()->set_num_points(
 1283|    212|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|    212|  return true;
 1285|    225|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    210|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    210|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    210|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    210|  const Mesh *mesh = decoder_->mesh();
  115|    210|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    210|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    210|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    210|                           encoding_data);
  120|       |
  121|    210|  TraverserT att_traverser;
  122|    210|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    210|  traversal_sequencer->SetTraverser(att_traverser);
  125|    210|  return std::move(traversal_sequencer);
  126|    210|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|  1.29k|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|  1.29k|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|  1.29k|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|  1.29k|  const Mesh *mesh = decoder_->mesh();
  115|  1.29k|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|  1.29k|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|  1.29k|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|  1.29k|                           encoding_data);
  120|       |
  121|  1.29k|  TraverserT att_traverser;
  122|  1.29k|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|  1.29k|  traversal_sequencer->SetTraverser(att_traverser);
  125|  1.29k|  return std::move(traversal_sequencer);
  126|  1.29k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    253|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    253|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    253|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    253|  const Mesh *mesh = decoder_->mesh();
  115|    253|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    253|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    253|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    253|                           encoding_data);
  120|       |
  121|    253|  TraverserT att_traverser;
  122|    253|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    253|  traversal_sequencer->SetTraverser(att_traverser);
  125|    253|  return std::move(traversal_sequencer);
  126|    253|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    416|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    416|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    416|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    416|  const Mesh *mesh = decoder_->mesh();
  115|    416|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    416|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    416|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    416|                           encoding_data);
  120|       |
  121|    416|  TraverserT att_traverser;
  122|    416|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    416|  traversal_sequencer->SetTraverser(att_traverser);
  125|    416|  return std::move(traversal_sequencer);
  126|    416|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     60|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|     60|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     60|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     60|  const Mesh *mesh = decoder_->mesh();
  115|     60|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     60|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     60|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     60|                           encoding_data);
  120|       |
  121|     60|  TraverserT att_traverser;
  122|     60|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     60|  traversal_sequencer->SetTraverser(att_traverser);
  125|     60|  return std::move(traversal_sequencer);
  126|     60|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    138|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    138|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    138|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    138|  const Mesh *mesh = decoder_->mesh();
  115|    138|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    138|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    138|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    138|                           encoding_data);
  120|       |
  121|    138|  TraverserT att_traverser;
  122|    138|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    138|  traversal_sequencer->SetTraverser(att_traverser);
  125|    138|  return std::move(traversal_sequencer);
  126|    138|}

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  10.5k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  3.88k|  const CornerTable *GetCornerTable() const override {
   67|  3.88k|    return corner_table_.get();
   68|  3.88k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  15.1M|                       int *out_encoder_split_symbol_id) {
   87|  15.1M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 1.82M, False: 13.2M]
  ------------------
   88|  1.82M|      return false;
   89|  1.82M|    }
   90|  13.2M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 36, False: 13.2M]
  ------------------
   91|  13.2M|        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|     36|      *out_encoder_split_symbol_id = -1;
   98|     36|      return true;
   99|     36|    }
  100|  13.2M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 13.2M, False: 2.09k]
  ------------------
  101|  13.2M|      return false;
  102|  13.2M|    }
  103|  2.09k|    *out_face_edge =
  104|  2.09k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  2.09k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  2.09k|    topology_split_data_.pop_back();
  108|  2.09k|    return true;
  109|  13.2M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  51.9M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  51.9M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  51.9M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  51.9M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  12.4k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  6.11k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  4.03k|  const CornerTable *GetCornerTable() const override {
   67|  4.03k|    return corner_table_.get();
   68|  4.03k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  41.9M|                       int *out_encoder_split_symbol_id) {
   87|  41.9M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 41.3M, False: 578k]
  ------------------
   88|  41.3M|      return false;
   89|  41.3M|    }
   90|   578k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 56, False: 578k]
  ------------------
   91|   578k|        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|     56|      *out_encoder_split_symbol_id = -1;
   98|     56|      return true;
   99|     56|    }
  100|   578k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 576k, False: 1.62k]
  ------------------
  101|   576k|      return false;
  102|   576k|    }
  103|  1.62k|    *out_face_edge =
  104|  1.62k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.62k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.62k|    topology_split_data_.pop_back();
  108|  1.62k|    return true;
  109|   578k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|   122M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|   122M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|   122M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|   122M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  15.8k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  15.1k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  3.01k|  const CornerTable *GetCornerTable() const override {
   67|  3.01k|    return corner_table_.get();
   68|  3.01k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  58.7M|                       int *out_encoder_split_symbol_id) {
   87|  58.7M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 58.2M, False: 532k]
  ------------------
   88|  58.2M|      return false;
   89|  58.2M|    }
   90|   532k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 57, False: 532k]
  ------------------
   91|   532k|        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|     57|      *out_encoder_split_symbol_id = -1;
   98|     57|      return true;
   99|     57|    }
  100|   532k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 530k, False: 2.38k]
  ------------------
  101|   530k|      return false;
  102|   530k|    }
  103|  2.38k|    *out_face_edge =
  104|  2.38k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  2.38k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  2.38k|    topology_split_data_.pop_back();
  108|  2.38k|    return true;
  109|   532k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  68.1M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  68.1M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  68.1M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  68.1M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  9.61k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  9.04k|      : attribute_connectivity_decoders_(nullptr),
   34|  9.04k|        num_attribute_data_(0),
   35|  9.04k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  8.29k|  void Init(MeshEdgebreakerDecoderImplInterface *decoder) {
   37|  8.29k|    decoder_impl_ = decoder;
   38|  8.29k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  8.29k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  8.29k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  8.29k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  6.87k|  uint16_t BitstreamVersion() const {
   45|  6.87k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  6.87k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  3.50k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  8.29k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  5.54k|  bool Start(DecoderBuffer *out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  5.54k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 79, False: 5.46k]
  ------------------
   63|     79|      return false;
   64|     79|    }
   65|       |
   66|  5.46k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 109, False: 5.35k]
  ------------------
   67|    109|      return false;
   68|    109|    }
   69|       |
   70|  5.35k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 8, False: 5.34k]
  ------------------
   71|      8|      return false;
   72|      8|    }
   73|  5.34k|    *out_buffer = buffer_;
   74|  5.34k|    return true;
   75|  5.35k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  4.39M|  inline bool DecodeStartFaceConfiguration() {
   79|  4.39M|    uint32_t face_configuration;
   80|  4.39M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  4.39M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.39M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 1.24k, False: 4.39M]
  ------------------
   82|  1.24k|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|  1.24k|    } else
   85|  4.39M|#endif
   86|  4.39M|    {
   87|  4.39M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  4.39M|    }
   89|  4.39M|    return face_configuration;
   90|  4.39M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  36.2M|  inline uint32_t DecodeSymbol() {
   94|  36.2M|    uint32_t symbol;
   95|  36.2M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  36.2M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 16.0M, False: 20.2M]
  ------------------
   97|  16.0M|      return symbol;
   98|  16.0M|    }
   99|       |    // Else decode two additional bits.
  100|  20.2M|    uint32_t symbol_suffix;
  101|  20.2M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  20.2M|    symbol |= (symbol_suffix << 1);
  103|  20.2M|    return symbol;
  104|  36.2M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  36.0M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|  4.97M|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  23.2M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  23.2M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  23.2M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  5.09k|  void Done() {
  123|  5.09k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 4.76k, False: 337]
  ------------------
  124|  4.76k|      symbol_buffer_.EndBitDecoding();
  125|  4.76k|    }
  126|  5.09k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  5.09k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  5.09k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 552, False: 4.54k]
  ------------------
  128|    552|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    552|    } else
  131|  4.54k|#endif
  132|  4.54k|    {
  133|  4.54k|      start_face_decoder_.EndDecoding();
  134|  4.54k|    }
  135|  5.09k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|  2.56k|  DecoderBuffer *buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  5.91k|  bool DecodeTraversalSymbols() {
  141|  5.91k|    uint64_t traversal_size;
  142|  5.91k|    symbol_buffer_ = buffer_;
  143|  5.91k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 29, False: 5.88k]
  ------------------
  144|     29|      return false;
  145|     29|    }
  146|  5.88k|    buffer_ = symbol_buffer_;
  147|  5.88k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 122, False: 5.76k]
  ------------------
  148|    122|      return false;
  149|    122|    }
  150|  5.76k|    buffer_.Advance(traversal_size);
  151|  5.76k|    return true;
  152|  5.88k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  8.14k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  8.14k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  8.14k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  8.14k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 1.00k, False: 7.13k]
  ------------------
  158|  1.00k|      start_face_buffer_ = buffer_;
  159|  1.00k|      uint64_t traversal_size;
  160|  1.00k|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 3, False: 999]
  ------------------
  161|      3|        return false;
  162|      3|      }
  163|    999|      buffer_ = start_face_buffer_;
  164|    999|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 188, False: 811]
  ------------------
  165|    188|        return false;
  166|    188|      }
  167|    811|      buffer_.Advance(traversal_size);
  168|    811|      return true;
  169|    999|    }
  170|  7.13k|#endif
  171|  7.13k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  8.14k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  7.92k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  7.92k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 5.18k, False: 2.73k]
  ------------------
  177|  5.18k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  5.18k|          new BinaryDecoder[num_attribute_data_]);
  179|  14.7k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 9.55k, False: 5.16k]
  ------------------
  180|  9.55k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 22, False: 9.53k]
  ------------------
  181|     22|          return false;
  182|     22|        }
  183|  9.55k|      }
  184|  5.18k|    }
  185|  7.90k|    return true;
  186|  7.92k|  }

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

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

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

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.74k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.19M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.19M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 2.11M, False: 80.8k]
  ------------------
   61|  2.11M|      return true;  // Already traversed.
   62|  2.11M|    }
   63|       |
   64|  80.8k|    corner_traversal_stack_.clear();
   65|  80.8k|    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|  80.8k|    const VertexIndex next_vert =
   69|  80.8k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  80.8k|    const VertexIndex prev_vert =
   71|  80.8k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  80.8k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 80.8k]
  |  Branch (72:45): [True: 0, False: 80.8k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  80.8k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 79.8k, False: 985]
  ------------------
   76|  79.8k|      this->MarkVertexVisited(next_vert);
   77|  79.8k|      this->traversal_observer().OnNewVertexVisited(
   78|  79.8k|          next_vert, this->corner_table()->Next(corner_id));
   79|  79.8k|    }
   80|  80.8k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 4.17k, False: 76.6k]
  ------------------
   81|  4.17k|      this->MarkVertexVisited(prev_vert);
   82|  4.17k|      this->traversal_observer().OnNewVertexVisited(
   83|  4.17k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  4.17k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|   173k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 92.5k, False: 80.8k]
  ------------------
   88|       |      // Currently processed corner.
   89|  92.5k|      corner_id = corner_traversal_stack_.back();
   90|  92.5k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  92.5k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 92.5k]
  |  Branch (92:47): [True: 706, False: 91.8k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    706|        corner_traversal_stack_.pop_back();
   95|    706|        continue;
   96|    706|      }
   97|  2.19M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 2.19M, Folded]
  ------------------
   98|  2.19M|        this->MarkFaceVisited(face_id);
   99|  2.19M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.19M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.19M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.19M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.19M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 1.06M, False: 1.12M]
  ------------------
  105|  1.06M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  1.06M|          this->MarkVertexVisited(vert_id);
  107|  1.06M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  1.06M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 1.04M, False: 23.0k]
  ------------------
  109|  1.04M|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|  1.04M|            face_id = FaceIndex(corner_id.value() / 3);
  111|  1.04M|            continue;
  112|  1.04M|          }
  113|  1.06M|        }
  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.14M|        const CornerIndex right_corner_id =
  118|  1.14M|            this->corner_table()->GetRightCorner(corner_id);
  119|  1.14M|        const CornerIndex left_corner_id =
  120|  1.14M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  1.14M|        const FaceIndex right_face_id(
  122|  1.14M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 16.9k, False: 1.13M]
  ------------------
  123|  1.14M|                 ? kInvalidFaceIndex
  124|  1.14M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  1.14M|        const FaceIndex left_face_id(
  126|  1.14M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 85.5k, False: 1.06M]
  ------------------
  127|  1.14M|                 ? kInvalidFaceIndex
  128|  1.14M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  1.14M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 1.09M, False: 52.1k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  1.09M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 85.9k, False: 1.00M]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  85.9k|            corner_traversal_stack_.pop_back();
  134|  85.9k|            break;  // Break from the while (true) loop.
  135|  1.00M|          } else {
  136|       |            // Go to the left face.
  137|  1.00M|            corner_id = left_corner_id;
  138|  1.00M|            face_id = left_face_id;
  139|  1.00M|          }
  140|  1.09M|        } else {
  141|       |          // Right face was not visited.
  142|  52.1k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 46.3k, False: 5.84k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  46.3k|            corner_id = right_corner_id;
  145|  46.3k|            face_id = right_face_id;
  146|  46.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|  5.84k|            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|  5.84k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  5.84k|            break;
  159|  5.84k|          }
  160|  52.1k|        }
  161|  1.14M|      }
  162|  91.8k|    }
  163|  80.8k|    return true;
  164|  80.8k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.74k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  3.70k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  2.22k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  5.24M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  5.24M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.62M, False: 3.62M]
  ------------------
   61|  1.62M|      return true;  // Already traversed.
   62|  1.62M|    }
   63|       |
   64|  3.62M|    corner_traversal_stack_.clear();
   65|  3.62M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  3.62M|    const VertexIndex next_vert =
   69|  3.62M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  3.62M|    const VertexIndex prev_vert =
   71|  3.62M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  3.62M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 3.62M]
  |  Branch (72:45): [True: 0, False: 3.62M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  3.62M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 3.62M, False: 1.82k]
  ------------------
   76|  3.62M|      this->MarkVertexVisited(next_vert);
   77|  3.62M|      this->traversal_observer().OnNewVertexVisited(
   78|  3.62M|          next_vert, this->corner_table()->Next(corner_id));
   79|  3.62M|    }
   80|  3.62M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 3.57M, False: 45.0k]
  ------------------
   81|  3.57M|      this->MarkVertexVisited(prev_vert);
   82|  3.57M|      this->traversal_observer().OnNewVertexVisited(
   83|  3.57M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  3.57M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  7.29M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 3.67M, False: 3.62M]
  ------------------
   88|       |      // Currently processed corner.
   89|  3.67M|      corner_id = corner_traversal_stack_.back();
   90|  3.67M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  3.67M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 3.67M]
  |  Branch (92:47): [True: 4.18k, False: 3.66M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  4.18k|        corner_traversal_stack_.pop_back();
   95|  4.18k|        continue;
   96|  4.18k|      }
   97|  5.24M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 5.24M, Folded]
  ------------------
   98|  5.24M|        this->MarkFaceVisited(face_id);
   99|  5.24M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  5.24M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  5.24M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 5.24M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  5.24M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 4.41M, False: 834k]
  ------------------
  105|  4.41M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  4.41M|          this->MarkVertexVisited(vert_id);
  107|  4.41M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  4.41M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 778k, False: 3.63M]
  ------------------
  109|   778k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   778k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   778k|            continue;
  112|   778k|          }
  113|  4.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|  4.46M|        const CornerIndex right_corner_id =
  118|  4.46M|            this->corner_table()->GetRightCorner(corner_id);
  119|  4.46M|        const CornerIndex left_corner_id =
  120|  4.46M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  4.46M|        const FaceIndex right_face_id(
  122|  4.46M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 3.60M, False: 857k]
  ------------------
  123|  4.46M|                 ? kInvalidFaceIndex
  124|  4.46M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  4.46M|        const FaceIndex left_face_id(
  126|  4.46M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 3.64M, False: 823k]
  ------------------
  127|  4.46M|                 ? kInvalidFaceIndex
  128|  4.46M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  4.46M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 4.38M, False: 81.9k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  4.38M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 3.64M, False: 742k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  3.64M|            corner_traversal_stack_.pop_back();
  134|  3.64M|            break;  // Break from the while (true) loop.
  135|  3.64M|          } else {
  136|       |            // Go to the left face.
  137|   742k|            corner_id = left_corner_id;
  138|   742k|            face_id = left_face_id;
  139|   742k|          }
  140|  4.38M|        } else {
  141|       |          // Right face was not visited.
  142|  81.9k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 57.6k, False: 24.3k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  57.6k|            corner_id = right_corner_id;
  145|  57.6k|            face_id = right_face_id;
  146|  57.6k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  24.3k|            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|  24.3k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  24.3k|            break;
  159|  24.3k|          }
  160|  81.9k|        }
  161|  4.46M|      }
  162|  3.66M|    }
  163|  3.62M|    return true;
  164|  3.62M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  2.22k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  4.61k|  DepthFirstTraverser() {}

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

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

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

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  4.61k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  34.3M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  18.1M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  18.1M|    return is_vertex_visited_[vert_id.value()];
   65|  18.1M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  2.62M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  2.62M|    is_vertex_visited_[vert_id.value()] = true;
   68|  2.62M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  7.69M|  inline TraversalObserverT &traversal_observer() {
   75|  7.69M|    return traversal_observer_;
   76|  7.69M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  13.7M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  13.7M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 158k, False: 13.5M]
  ------------------
   47|   158k|      return true;  // Invalid faces are always considered as visited.
   48|   158k|    }
   49|  13.5M|    return is_face_visited_[face_id.value()];
   50|  13.7M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  5.07M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  5.07M|    is_face_visited_[face_id.value()] = true;
   62|  5.07M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  4.74k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  4.74k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  2.37k|                    TraversalObserver traversal_observer) {
   37|  2.37k|    corner_table_ = corner_table;
   38|  2.37k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  2.37k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  2.37k|    traversal_observer_ = traversal_observer;
   41|  2.37k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.19M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.19M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.19M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.19M|    return is_face_visited_[corner_id.value() / 3];
   58|  2.19M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  41.0M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  5.24M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  5.24M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 5.24M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  5.24M|    return is_face_visited_[corner_id.value() / 3];
   58|  5.24M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  12.4M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  12.4M|    return is_vertex_visited_[vert_id.value()];
   65|  12.4M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  11.6M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  11.6M|    is_vertex_visited_[vert_id.value()] = true;
   68|  11.6M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  16.8M|  inline TraversalObserverT &traversal_observer() {
   75|  16.8M|    return traversal_observer_;
   76|  16.8M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  12.6M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  12.6M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 7.25M, False: 5.35M]
  ------------------
   47|  7.25M|      return true;  // Invalid faces are always considered as visited.
   48|  7.25M|    }
   49|  5.35M|    return is_face_visited_[face_id.value()];
   50|  12.6M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  5.24M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  5.24M|    is_face_visited_[face_id.value()] = true;
   62|  5.24M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  4.61k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  2.30k|                    TraversalObserver traversal_observer) {
   37|  2.30k|    corner_table_ = corner_table;
   38|  2.30k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  2.30k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  2.30k|    traversal_observer_ = traversal_observer;
   41|  2.30k|  }

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

_ZN5draco17PointCloudDecoder20SetAttributesDecoderEiNSt3__110unique_ptrINS_26AttributesDecoderInterfaceENS1_14default_deleteIS3_EEEE:
   44|  37.7k|      int att_decoder_id, std::unique_ptr<AttributesDecoderInterface> decoder) {
   45|  37.7k|    if (att_decoder_id < 0) {
  ------------------
  |  Branch (45:9): [True: 0, False: 37.7k]
  ------------------
   46|      0|      return false;
   47|      0|    }
   48|  37.7k|    if (att_decoder_id >= static_cast<int>(attributes_decoders_.size())) {
  ------------------
  |  Branch (48:9): [True: 37.7k, False: 0]
  ------------------
   49|  37.7k|      attributes_decoders_.resize(att_decoder_id + 1);
   50|  37.7k|    }
   51|  37.7k|    attributes_decoders_[att_decoder_id] = std::move(decoder);
   52|  37.7k|    return true;
   53|  37.7k|  }
_ZNK5draco17PointCloudDecoder17bitstream_versionEv:
   63|   278k|  uint16_t bitstream_version() const {
   64|   278k|    return DRACO_BITSTREAM_VERSION(version_major_, version_minor_);
  ------------------
  |  |  115|   278k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
   65|   278k|  }
_ZN5draco17PointCloudDecoder18attributes_decoderEi:
   67|  8.87k|  const AttributesDecoderInterface *attributes_decoder(int dec_id) {
   68|  8.87k|    return attributes_decoders_[dec_id].get();
   69|  8.87k|  }
_ZNK5draco17PointCloudDecoder23num_attributes_decodersEv:
   70|  8.87k|  int32_t num_attributes_decoders() const {
   71|  8.87k|    return static_cast<int32_t>(attributes_decoders_.size());
   72|  8.87k|  }
_ZN5draco17PointCloudDecoder11point_cloudEv:
   76|  88.1k|  PointCloud *point_cloud() { return point_cloud_; }
_ZNK5draco17PointCloudDecoder11point_cloudEv:
   77|  14.3k|  const PointCloud *point_cloud() const { return point_cloud_; }
_ZN5draco17PointCloudDecoder6bufferEv:
   79|  2.10M|  DecoderBuffer *buffer() { return buffer_; }
_ZNK5draco17PointCloudDecoder7optionsEv:
   80|  10.4k|  const DecoderOptions *options() const { return options_; }
_ZN5draco17PointCloudDecoder17InitializeDecoderEv:
   85|  3.54k|  virtual bool InitializeDecoder() { return true; }
_ZN5draco17PointCloudDecoder18DecodeGeometryDataEv:
   89|  6.26k|  virtual bool DecodeGeometryData() { return true; }
_ZN5draco17PointCloudDecoder19OnAttributesDecodedEv:
   93|    257|  virtual bool OnAttributesDecoded() { return true; }
_ZN5draco17PointCloudDecoderD2Ev:
   31|  13.3k|  virtual ~PointCloudDecoder() = default;

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

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

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

_ZN5draco20DataBufferDescriptorC2Ev:
   28|  79.3k|  DataBufferDescriptor() : buffer_id(0), buffer_update_count(0) {}
_ZN5draco10DataBuffer5WriteElPKvm:
   53|  18.1M|  void Write(int64_t byte_pos, const void *in_data, size_t data_size) {
   54|  18.1M|    memcpy(const_cast<uint8_t *>(data()) + byte_pos, in_data, data_size);
   55|  18.1M|  }
_ZNK5draco10DataBuffer12update_countEv:
   67|  25.6k|  int64_t update_count() const { return descriptor_.buffer_update_count; }
_ZNK5draco10DataBuffer9data_sizeEv:
   68|  57.0M|  size_t data_size() const { return data_.size(); }
_ZN5draco10DataBuffer4dataEv:
   70|  94.2M|  uint8_t *data() { return data_.data(); }
_ZNK5draco10DataBuffer9buffer_idEv:
   71|  25.6k|  int64_t buffer_id() const { return descriptor_.buffer_id; }

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  72.8M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  72.8M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 72.8M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  72.8M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  72.8M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|  1.16G|  bool Decode(void *out_data, size_t size_to_decode) {
   77|  1.16G|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 576, False: 1.16G]
  ------------------
   78|    576|      return false;  // Buffer overflow.
   79|    576|    }
   80|  1.16G|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|  1.16G|    pos_ += size_to_decode;
   82|  1.16G|    return true;
   83|  1.16G|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  32.3k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  13.3k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  50.3k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   381k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  8.29k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  72.9M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  4.47M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  10.1k|    inline void reset(const void *b, size_t s) {
  131|  10.1k|      bit_offset_ = 0;
  132|  10.1k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  10.1k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  10.1k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  8.59k|    inline uint64_t BitsDecoded() const {
  138|  8.59k|      return static_cast<uint64_t>(bit_offset_);
  139|  8.59k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  72.8M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  72.8M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 14, False: 72.8M]
  ------------------
  162|     14|        return false;
  163|     14|      }
  164|  72.8M|      uint32_t value = 0;
  165|   162M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 89.5M, False: 72.8M]
  ------------------
  166|  89.5M|        value |= GetBit() << bit;
  167|  89.5M|      }
  168|  72.8M|      *x = value;
  169|  72.8M|      return true;
  170|  72.8M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  89.5M|    inline int GetBit() {
  176|  89.5M|      const size_t off = bit_offset_;
  177|  89.5M|      const size_t byte_offset = off >> 3;
  178|  89.5M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  89.5M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 73.2M, False: 16.2M]
  ------------------
  180|  73.2M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  73.2M|        bit_offset_ = off + 1;
  182|  73.2M|        return bit;
  183|  73.2M|      }
  184|  16.2M|      return 0;
  185|  89.5M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  21.6M|  bool Decode(T *out_val) {
   69|  21.6M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 3.90k, False: 21.6M]
  ------------------
   70|  3.90k|      return false;
   71|  3.90k|    }
   72|  21.6M|    pos_ += sizeof(T);
   73|  21.6M|    return true;
   74|  21.6M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  21.6M|  bool Peek(T *out_val) {
   88|  21.6M|    const size_t size_to_decode = sizeof(T);
   89|  21.6M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 3.90k, False: 21.6M]
  ------------------
   90|  3.90k|      return false;  // Buffer overflow.
   91|  3.90k|    }
   92|  21.6M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  21.6M|    return true;
   94|  21.6M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  14.8k|  bool Decode(T *out_val) {
   69|  14.8k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 148, False: 14.7k]
  ------------------
   70|    148|      return false;
   71|    148|    }
   72|  14.7k|    pos_ += sizeof(T);
   73|  14.7k|    return true;
   74|  14.8k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  14.8k|  bool Peek(T *out_val) {
   88|  14.8k|    const size_t size_to_decode = sizeof(T);
   89|  14.8k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 148, False: 14.7k]
  ------------------
   90|    148|      return false;  // Buffer overflow.
   91|    148|    }
   92|  14.7k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  14.7k|    return true;
   94|  14.8k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|  1.11M|  bool Decode(T *out_val) {
   69|  1.11M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 195, False: 1.11M]
  ------------------
   70|    195|      return false;
   71|    195|    }
   72|  1.11M|    pos_ += sizeof(T);
   73|  1.11M|    return true;
   74|  1.11M|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|  1.11M|  bool Peek(T *out_val) {
   88|  1.11M|    const size_t size_to_decode = sizeof(T);
   89|  1.11M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 195, False: 1.11M]
  ------------------
   90|    195|      return false;  // Buffer overflow.
   91|    195|    }
   92|  1.11M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.11M|    return true;
   94|  1.11M|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  30.0k|  bool Decode(T *out_val) {
   69|  30.0k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 352, False: 29.6k]
  ------------------
   70|    352|      return false;
   71|    352|    }
   72|  29.6k|    pos_ += sizeof(T);
   73|  29.6k|    return true;
   74|  30.0k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   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: 352, False: 29.6k]
  ------------------
   90|    352|      return false;  // Buffer overflow.
   91|    352|    }
   92|  29.6k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  29.6k|    return true;
   94|  30.0k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|  1.43M|  bool Decode(T *out_val) {
   69|  1.43M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 168, False: 1.43M]
  ------------------
   70|    168|      return false;
   71|    168|    }
   72|  1.43M|    pos_ += sizeof(T);
   73|  1.43M|    return true;
   74|  1.43M|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|  1.43M|  bool Peek(T *out_val) {
   88|  1.43M|    const size_t size_to_decode = sizeof(T);
   89|  1.43M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 168, False: 1.43M]
  ------------------
   90|    168|      return false;  // Buffer overflow.
   91|    168|    }
   92|  1.43M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.43M|    return true;
   94|  1.43M|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  1.70M|  bool Decode(T *out_val) {
   69|  1.70M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 22, False: 1.70M]
  ------------------
   70|     22|      return false;
   71|     22|    }
   72|  1.70M|    pos_ += sizeof(T);
   73|  1.70M|    return true;
   74|  1.70M|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  1.70M|  bool Peek(T *out_val) {
   88|  1.70M|    const size_t size_to_decode = sizeof(T);
   89|  1.70M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 22, False: 1.70M]
  ------------------
   90|     22|      return false;  // Buffer overflow.
   91|     22|    }
   92|  1.70M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.70M|    return true;
   94|  1.70M|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  2.57k|  bool Decode(T *out_val) {
   69|  2.57k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 24, False: 2.55k]
  ------------------
   70|     24|      return false;
   71|     24|    }
   72|  2.55k|    pos_ += sizeof(T);
   73|  2.55k|    return true;
   74|  2.57k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  2.57k|  bool Peek(T *out_val) {
   88|  2.57k|    const size_t size_to_decode = sizeof(T);
   89|  2.57k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 24, False: 2.55k]
  ------------------
   90|     24|      return false;  // Buffer overflow.
   91|     24|    }
   92|  2.55k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  2.55k|    return true;
   94|  2.57k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    272|  bool Decode(T *out_val) {
   69|    272|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 25, False: 247]
  ------------------
   70|     25|      return false;
   71|     25|    }
   72|    247|    pos_ += sizeof(T);
   73|    247|    return true;
   74|    272|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    272|  bool Peek(T *out_val) {
   88|    272|    const size_t size_to_decode = sizeof(T);
   89|    272|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 25, False: 247]
  ------------------
   90|     25|      return false;  // Buffer overflow.
   91|     25|    }
   92|    247|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    247|    return true;
   94|    272|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   117M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   125M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  13.8M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  13.8M|    return value_ >= val;
  100|  13.8M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   347M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  4.38G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  31.1M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|   115M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   115M|    value_ = i.value_;
  153|   115M|    return *this;
  154|   115M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   901M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   901M|    value_ = i.value_;
  153|   901M|    return *this;
  154|   901M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  31.1M|  inline ThisIndexType &operator++() {
  103|  31.1M|    ++value_;
  104|  31.1M|    return *this;
  105|  31.1M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  3.19G|  constexpr bool operator==(const IndexType &i) const {
   76|  3.19G|    return value_ == i.value_;
   77|  3.19G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|  1.26G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  13.1k|  constexpr bool operator<(const IndexType &i) const {
   88|  13.1k|    return value_ < i.value_;
   89|  13.1k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   186M|  constexpr bool operator==(const IndexType &i) const {
   76|   186M|    return value_ == i.value_;
   77|   186M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   224M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   224M|    return ThisIndexType(value_ - val);
  133|   224M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|  1.03G|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  1.03G|    return ThisIndexType(value_ + val);
  127|  1.03G|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  26.3M|  constexpr bool operator==(const IndexType &i) const {
   76|  26.3M|    return value_ == i.value_;
   77|  26.3M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   348M|  constexpr bool operator!=(const IndexType &i) const {
   82|   348M|    return value_ != i.value_;
   83|   348M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   473M|  constexpr bool operator!=(const IndexType &i) const {
   82|   473M|    return value_ != i.value_;
   83|   473M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   710M|  inline ThisIndexType &operator++() {
  103|   710M|    ++value_;
  104|   710M|    return *this;
  105|   710M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   608M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   608M|    value_ = i.value_;
  153|   608M|    return *this;
  154|   608M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|  1.48G|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  1.48G|    value_ = i.value_;
  153|  1.48G|    return *this;
  154|  1.48G|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  52.0M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  52.0M|    return value_ >= val;
  100|  52.0M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  11.9M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|  1.52G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  33.3G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   266M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  26.6G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   330M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  20.7M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  20.7M|    return ThisIndexType(value_ + val);
  127|  20.7M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   209M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  33.7M|  constexpr bool operator<(const IndexType &i) const {
   88|  33.7M|    return value_ < i.value_;
   89|  33.7M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   286M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   903M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  85.5M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|  90.1M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   344M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  6.55M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  6.55M|    value_ = i.value_;
  153|  6.55M|    return *this;
  154|  6.55M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  11.9M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  11.9M|    value_ += val;
  141|  11.9M|    return *this;
  142|  11.9M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  43.4M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  43.4M|    value_ = val;
  157|  43.4M|    return *this;
  158|  43.4M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|   860M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  8.24M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  8.23M|  inline ThisIndexType &operator++() {
  103|  8.23M|    ++value_;
  104|  8.23M|    return *this;
  105|  8.23M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  27.4M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|  27.4M|  inline ThisIndexType &operator++() {
  103|  27.4M|    ++value_;
  104|  27.4M|    return *this;
  105|  27.4M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  46.4M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  46.4M|    return vector_[index.value()];
   75|  46.4M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  27.4M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  15.3k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  19.7k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  79.4M|  inline reference operator[](const IndexTypeT &index) {
   71|  79.4M|    return vector_[index.value()];
   72|  79.4M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|   663k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  27.6M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  5.09k|  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|  13.8M|  inline reference operator[](const IndexTypeT &index) {
   71|  13.8M|    return vector_[index.value()];
   72|  13.8M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  31.5M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  31.5M|    return vector_[index.value()];
   75|  31.5M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   267M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  14.4M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   432M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   432M|    return vector_[index.value()];
   75|   432M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|  1.12G|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  1.12G|    return vector_[index.value()];
   75|  1.12G|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   562M|  inline reference operator[](const IndexTypeT &index) {
   71|   562M|    return vector_[index.value()];
   72|   562M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  85.2M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  85.2M|    return vector_[index.value()];
   75|  85.2M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   484M|  inline reference operator[](const IndexTypeT &index) {
   71|   484M|    return vector_[index.value()];
   72|   484M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|   136M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   317M|  inline reference operator[](const IndexTypeT &index) {
   71|   317M|    return vector_[index.value()];
   72|   317M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  3.02k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   249M|  inline reference operator[](const IndexTypeT &index) {
   71|   249M|    return vector_[index.value()];
   72|   249M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  68.4k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  2.88M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  64.4k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  8.91k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  8.91k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  8.91k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  8.91k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  17.6k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  17.6k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  17.6k|    vector_.swap(arg.vector_);
   57|  17.6k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  17.6k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  17.6k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  17.6k|    vector_.swap(arg.vector_);
   57|  17.6k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  8.91k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  8.91k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  8.91k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  13.3k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  52.9k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  89.8k|int32_t DataTypeLength(DataType dt) {
   20|  89.8k|  switch (dt) {
   21|  40.5k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 40.5k, False: 49.2k]
  ------------------
   22|  43.2k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 2.70k, False: 87.1k]
  ------------------
   23|  43.2k|      return 1;
   24|  2.08k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 2.08k, False: 87.7k]
  ------------------
   25|  2.44k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 357, False: 89.4k]
  ------------------
   26|  2.44k|      return 2;
   27|  36.4k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 36.4k, False: 53.3k]
  ------------------
   28|  37.5k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 1.04k, False: 88.7k]
  ------------------
   29|  37.5k|      return 4;
   30|    606|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 606, False: 89.2k]
  ------------------
   31|  1.07k|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 468, False: 89.3k]
  ------------------
   32|  1.07k|      return 8;
   33|  4.80k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 4.80k, False: 85.0k]
  ------------------
   34|  4.80k|      return 4;
   35|    226|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 226, False: 89.6k]
  ------------------
   36|    226|      return 8;
   37|    525|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 525, False: 89.3k]
  ------------------
   38|    525|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 89.8k]
  ------------------
   40|      0|      return -1;
   41|  89.8k|  }
   42|  89.8k|}

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

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  13.3k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|      1|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_4MeshENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  11.9k|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_4MeshENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  1.33k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  13.3k|  bool ok() const { return status_.ok(); }
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE6statusEv:
   43|      1|  const Status &status() const { return status_; }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  13.3k|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|  1.13M|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  1.13M|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 1.13M, Folded]
  ------------------
   65|  1.13M|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 1.43k, False: 1.13M]
  ------------------
   66|  1.43k|      return false;
   67|  1.43k|    }
   68|  1.13M|  } 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|  1.13M|  return true;
   77|  1.13M|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   715k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   715k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   715k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 122, False: 715k]
  ------------------
   33|    122|    return false;
   34|    122|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   715k|  uint8_t in;
   39|   715k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 910, False: 714k]
  ------------------
   40|    910|    return false;
   41|    910|  }
   42|   714k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 26.0k, False: 688k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  26.0k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 728, False: 25.3k]
  ------------------
   45|    728|      return false;
   46|    728|    }
   47|       |    // Append decoded info from this byte.
   48|  25.3k|    *out_val <<= 7;
   49|  25.3k|    *out_val |= in & ((1 << 7) - 1);
   50|   688k|  } else {
   51|       |    // Last byte reached
   52|   688k|    *out_val = in;
   53|   688k|  }
   54|   713k|  return true;
   55|   714k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  9.34k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  9.34k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  9.34k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 9.34k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  9.34k|  uint8_t in;
   39|  9.34k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 7, False: 9.33k]
  ------------------
   40|      7|    return false;
   41|      7|  }
   42|  9.33k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 783, False: 8.55k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    783|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 9, False: 774]
  ------------------
   45|      9|      return false;
   46|      9|    }
   47|       |    // Append decoded info from this byte.
   48|    774|    *out_val <<= 7;
   49|    774|    *out_val |= in & ((1 << 7) - 1);
   50|  8.55k|  } else {
   51|       |    // Last byte reached
   52|  8.55k|    *out_val = in;
   53|  8.55k|  }
   54|  9.32k|  return true;
   55|  9.33k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  8.99k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  8.99k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 8.99k, Folded]
  ------------------
   65|  8.99k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 144, False: 8.84k]
  ------------------
   66|    144|      return false;
   67|    144|    }
   68|  8.99k|  } 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|  8.84k|  return true;
   77|  8.99k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  4.91k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.91k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.91k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 4.91k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.91k|  uint8_t in;
   39|  4.91k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 29, False: 4.88k]
  ------------------
   40|     29|    return false;
   41|     29|  }
   42|  4.88k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 99, False: 4.78k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     99|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 4, False: 95]
  ------------------
   45|      4|      return false;
   46|      4|    }
   47|       |    // Append decoded info from this byte.
   48|     95|    *out_val <<= 7;
   49|     95|    *out_val |= in & ((1 << 7) - 1);
   50|  4.78k|  } else {
   51|       |    // Last byte reached
   52|  4.78k|    *out_val = in;
   53|  4.78k|  }
   54|  4.88k|  return true;
   55|  4.88k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   357k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   357k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   357k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 12, False: 357k]
  ------------------
   33|     12|    return false;
   34|     12|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   357k|  uint8_t in;
   39|   357k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 77, False: 357k]
  ------------------
   40|     77|    return false;
   41|     77|  }
   42|   357k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.78k, False: 355k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.78k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 71, False: 1.71k]
  ------------------
   45|     71|      return false;
   46|     71|    }
   47|       |    // Append decoded info from this byte.
   48|  1.71k|    *out_val <<= 7;
   49|  1.71k|    *out_val |= in & ((1 << 7) - 1);
   50|   355k|  } else {
   51|       |    // Last byte reached
   52|   355k|    *out_val = in;
   53|   355k|  }
   54|   357k|  return true;
   55|   357k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  4.41k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.41k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.41k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 6, False: 4.41k]
  ------------------
   33|      6|    return false;
   34|      6|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.41k|  uint8_t in;
   39|  4.41k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 29, False: 4.38k]
  ------------------
   40|     29|    return false;
   41|     29|  }
   42|  4.38k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 788, False: 3.59k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    788|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 46, False: 742]
  ------------------
   45|     46|      return false;
   46|     46|    }
   47|       |    // Append decoded info from this byte.
   48|    742|    *out_val <<= 7;
   49|    742|    *out_val |= in & ((1 << 7) - 1);
   50|  3.59k|  } else {
   51|       |    // Last byte reached
   52|  3.59k|    *out_val = in;
   53|  3.59k|  }
   54|  4.33k|  return true;
   55|  4.38k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  21.1k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  21.1k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  21.1k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 14, False: 21.0k]
  ------------------
   33|     14|    return false;
   34|     14|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  21.0k|  uint8_t in;
   39|  21.0k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 20, False: 21.0k]
  ------------------
   40|     20|    return false;
   41|     20|  }
   42|  21.0k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 349, False: 20.7k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    349|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 71, False: 278]
  ------------------
   45|     71|      return false;
   46|     71|    }
   47|       |    // Append decoded info from this byte.
   48|    278|    *out_val <<= 7;
   49|    278|    *out_val |= in & ((1 << 7) - 1);
   50|  20.7k|  } else {
   51|       |    // Last byte reached
   52|  20.7k|    *out_val = in;
   53|  20.7k|  }
   54|  21.0k|  return true;
   55|  21.0k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  10.3k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  10.3k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  10.3k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 117, False: 10.2k]
  ------------------
   33|    117|    return false;
   34|    117|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  10.2k|  uint8_t in;
   39|  10.2k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 78, False: 10.1k]
  ------------------
   40|     78|    return false;
   41|     78|  }
   42|  10.1k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.57k, False: 7.56k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.57k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 604, False: 1.96k]
  ------------------
   45|    604|      return false;
   46|    604|    }
   47|       |    // Append decoded info from this byte.
   48|  1.96k|    *out_val <<= 7;
   49|  1.96k|    *out_val |= in & ((1 << 7) - 1);
   50|  7.56k|  } else {
   51|       |    // Last byte reached
   52|  7.56k|    *out_val = in;
   53|  7.56k|  }
   54|  9.52k|  return true;
   55|  10.1k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  8.83k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  8.83k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  8.83k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 63, False: 8.76k]
  ------------------
   33|     63|    return false;
   34|     63|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  8.76k|  uint8_t in;
   39|  8.76k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 52, False: 8.71k]
  ------------------
   40|     52|    return false;
   41|     52|  }
   42|  8.71k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 4.65k, False: 4.06k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  4.65k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 743, False: 3.91k]
  ------------------
   45|    743|      return false;
   46|    743|    }
   47|       |    // Append decoded info from this byte.
   48|  3.91k|    *out_val <<= 7;
   49|  3.91k|    *out_val |= in & ((1 << 7) - 1);
   50|  4.06k|  } else {
   51|       |    // Last byte reached
   52|  4.06k|    *out_val = in;
   53|  4.06k|  }
   54|  7.97k|  return true;
   55|  8.71k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  52.4k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  52.4k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  52.4k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 11, False: 52.4k]
  ------------------
   33|     11|    return false;
   34|     11|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  52.4k|  uint8_t in;
   39|  52.4k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 28, False: 52.4k]
  ------------------
   40|     28|    return false;
   41|     28|  }
   42|  52.4k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.66k, False: 50.7k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.66k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 71, False: 1.59k]
  ------------------
   45|     71|      return false;
   46|     71|    }
   47|       |    // Append decoded info from this byte.
   48|  1.59k|    *out_val <<= 7;
   49|  1.59k|    *out_val |= in & ((1 << 7) - 1);
   50|  50.7k|  } else {
   51|       |    // Last byte reached
   52|  50.7k|    *out_val = in;
   53|  50.7k|  }
   54|  52.3k|  return true;
   55|  52.4k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|   159k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|   204k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  17.0k|  Self operator-(const Self &o) const {
  138|  17.0k|    Self ret;
  139|  68.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 51.2k, False: 17.0k]
  ------------------
  140|  51.2k|      ret[i] = (*this)[i] - o[i];
  141|  51.2k|    }
  142|  17.0k|    return ret;
  143|  17.0k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  42.4k|  VectorD() {
   41|   169k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 127k, False: 42.4k]
  ------------------
   42|   127k|      (*this)[i] = Scalar(0);
   43|   127k|    }
   44|  42.4k|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|   189M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  15.6M|  Self operator-(const Self &o) const {
  138|  15.6M|    Self ret;
  139|  62.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 47.0M, False: 15.6M]
  ------------------
  140|  47.0M|      ret[i] = (*this)[i] - o[i];
  141|  47.0M|    }
  142|  15.6M|    return ret;
  143|  15.6M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  7.82M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  7.82M|  static_assert(std::is_signed<ScalarT>::value,
  321|  7.82M|                "ScalarT must be a signed type. ");
  322|  7.82M|  VectorD<ScalarT, 3> r;
  323|  7.82M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  7.82M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  7.82M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  7.82M|  return r;
  327|  7.82M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  7.82M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  7.82M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  3.22M|  Scalar AbsSum() const {
  238|  3.22M|    Scalar result(0);
  239|  12.8M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 9.67M, False: 3.20M]
  ------------------
  240|  9.67M|      Scalar next_value = std::abs(v_[i]);
  241|  9.67M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 16.0k, False: 9.65M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  16.0k|        return std::numeric_limits<Scalar>::max();
  244|  16.0k|      }
  245|  9.65M|      result += next_value;
  246|  9.65M|    }
  247|  3.20M|    return result;
  248|  3.22M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   278k|  Self operator/(const Scalar &o) const {
  183|   278k|    Self ret;
  184|  1.11M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 835k, False: 278k]
  ------------------
  185|   835k|      ret[i] = (*this)[i] / o;
  186|   835k|    }
  187|   278k|    return ret;
  188|   278k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   238M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  12.1M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  9.67M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  2.03M|  Self operator-() const {
  121|  2.03M|    Self ret;
  122|  8.12M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 6.09M, False: 2.03M]
  ------------------
  123|  6.09M|      ret[i] = -(*this)[i];
  124|  6.09M|    }
  125|  2.03M|    return ret;
  126|  2.03M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  6.09M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|  1.58M|  Self operator-(const Self &o) const {
  138|  1.58M|    Self ret;
  139|  4.74M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 3.16M, False: 1.58M]
  ------------------
  140|  3.16M|      ret[i] = (*this)[i] - o[i];
  141|  3.16M|    }
  142|  1.58M|    return ret;
  143|  1.58M|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  18.9M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  28.4M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  54.7M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  3.16M|  Self operator+(const Self &o) const {
  130|  3.16M|    Self ret;
  131|  9.48M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 6.32M, False: 3.16M]
  ------------------
  132|  6.32M|      ret[i] = (*this)[i] + o[i];
  133|  6.32M|    }
  134|  3.16M|    return ret;
  135|  3.16M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  53.5M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|  1.47M|  Self operator-(const Self &o) const {
  138|  1.47M|    Self ret;
  139|  4.43M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.95M, False: 1.47M]
  ------------------
  140|  2.95M|      ret[i] = (*this)[i] - o[i];
  141|  2.95M|    }
  142|  1.47M|    return ret;
  143|  1.47M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|  1.47M|  Self operator+(const Self &o) const {
  130|  1.47M|    Self ret;
  131|  4.43M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.95M, False: 1.47M]
  ------------------
  132|  2.95M|      ret[i] = (*this)[i] + o[i];
  133|  2.95M|    }
  134|  1.47M|    return ret;
  135|  1.47M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   404k|  bool operator==(const Self &o) const {
  207|  1.19M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 801k, False: 396k]
  ------------------
  208|   801k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 8.29k, False: 793k]
  ------------------
  209|  8.29k|        return false;
  210|  8.29k|      }
  211|   801k|    }
  212|   396k|    return true;
  213|   404k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  4.74M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  8.78k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  9.28k|  Scalar Dot(const Self &o) const {
  251|  9.28k|    Scalar ret(0);
  252|  37.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 27.8k, False: 9.28k]
  ------------------
  253|  27.8k|      ret += (*this)[i] * o[i];
  254|  27.8k|    }
  255|  9.28k|    return ret;
  256|  9.28k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    495|  Self operator*(const Scalar &o) const {
  175|    495|    Self ret;
  176|  1.98k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 1.48k, False: 495]
  ------------------
  177|  1.48k|      ret[i] = (*this)[i] * o;
  178|  1.48k|    }
  179|    495|    return ret;
  180|    495|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  8.29k|  Self operator-(const Self &o) const {
  138|  8.29k|    Self ret;
  139|  24.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 16.5k, False: 8.29k]
  ------------------
  140|  16.5k|      ret[i] = (*this)[i] - o[i];
  141|  16.5k|    }
  142|  8.29k|    return ret;
  143|  8.29k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  16.5k|  VectorD() {
   41|  49.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 33.1k, False: 16.5k]
  ------------------
   42|  33.1k|      (*this)[i] = Scalar(0);
   43|  33.1k|    }
   44|  16.5k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   817k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   817k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   817k|    v_[0] = c0;
   55|   817k|    v_[1] = c1;
   56|   817k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  66.2k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   455k|  bool operator==(const Self &o) const {
  207|  1.29M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 874k, False: 417k]
  ------------------
  208|   874k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 37.3k, False: 836k]
  ------------------
  209|  37.3k|        return false;
  210|  37.3k|      }
  211|   874k|    }
  212|   417k|    return true;
  213|   455k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  2.64M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  46.0M|  VectorD() {
   41|   184M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 138M, False: 46.0M]
  ------------------
   42|   138M|      (*this)[i] = Scalar(0);
   43|   138M|    }
   44|  46.0M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  39.6k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  42.2k|  Scalar Dot(const Self &o) const {
  251|  42.2k|    Scalar ret(0);
  252|   168k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 126k, False: 42.2k]
  ------------------
  253|   126k|      ret += (*this)[i] * o[i];
  254|   126k|    }
  255|  42.2k|    return ret;
  256|  42.2k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  2.51k|  Self operator-(const Self &o) const {
  138|  2.51k|    Self ret;
  139|  7.54k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 5.03k, False: 2.51k]
  ------------------
  140|  5.03k|      ret[i] = (*this)[i] - o[i];
  141|  5.03k|    }
  142|  2.51k|    return ret;
  143|  2.51k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  7.12k|  Self operator*(const Scalar &o) const {
  175|  7.12k|    Self ret;
  176|  21.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 14.2k, False: 7.12k]
  ------------------
  177|  14.2k|      ret[i] = (*this)[i] * o;
  178|  14.2k|    }
  179|  7.12k|    return ret;
  180|  7.12k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  2.38k|  Self operator+(const Self &o) const {
  130|  2.38k|    Self ret;
  131|  7.15k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 4.77k, False: 2.38k]
  ------------------
  132|  4.77k|      ret[i] = (*this)[i] + o[i];
  133|  4.77k|    }
  134|  2.38k|    return ret;
  135|  2.38k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.38k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.38k|  return v * o;
  294|  2.38k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  2.35k|  Self operator+(const Self &o) const {
  130|  2.35k|    Self ret;
  131|  9.43k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 7.07k, False: 2.35k]
  ------------------
  132|  7.07k|      ret[i] = (*this)[i] + o[i];
  133|  7.07k|    }
  134|  2.35k|    return ret;
  135|  2.35k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.35k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.35k|  return v * o;
  294|  2.35k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  2.35k|  Self operator*(const Scalar &o) const {
  175|  2.35k|    Self ret;
  176|  9.43k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 7.07k, False: 2.35k]
  ------------------
  177|  7.07k|      ret[i] = (*this)[i] * o;
  178|  7.07k|    }
  179|  2.35k|    return ret;
  180|  2.35k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   912k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   912k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   912k|    v_[0] = c0;
   55|   912k|    v_[1] = c1;
   56|   912k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  16.7k|  VectorD() {
   41|  50.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 33.4k, False: 16.7k]
  ------------------
   42|  33.4k|      (*this)[i] = Scalar(0);
   43|  33.4k|    }
   44|  16.7k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  4.70k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  14.1k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 9.41k, False: 4.70k]
  ------------------
  104|  9.41k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 9.41k, False: 0]
  ------------------
  105|  9.41k|        v_[i] = Scalar(src_vector[i]);
  106|  9.41k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  9.41k|    }
  110|  4.70k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|    824|  Self operator+(const Self &o) const {
  130|    824|    Self ret;
  131|  2.47k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.64k, False: 824]
  ------------------
  132|  1.64k|      ret[i] = (*this)[i] + o[i];
  133|  1.64k|    }
  134|    824|    return ret;
  135|    824|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  2.35k|  VectorD() {
   41|  7.05k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 4.70k, False: 2.35k]
  ------------------
   42|  4.70k|      (*this)[i] = Scalar(0);
   43|  4.70k|    }
   44|  2.35k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  14.1k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  9.41k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  2.35k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  7.05k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 4.70k, False: 2.35k]
  ------------------
  104|  4.70k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 4.70k, False: 0]
  ------------------
  105|  4.70k|        v_[i] = Scalar(src_vector[i]);
  106|  4.70k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  4.70k|    }
  110|  2.35k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  2.35k|  Self operator/(const Scalar &o) const {
  183|  2.35k|    Self ret;
  184|  7.05k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 4.70k, False: 2.35k]
  ------------------
  185|  4.70k|      ret[i] = (*this)[i] / o;
  186|  4.70k|    }
  187|  2.35k|    return ret;
  188|  2.35k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  1.52k|  Self operator-(const Self &o) const {
  138|  1.52k|    Self ret;
  139|  4.58k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 3.05k, False: 1.52k]
  ------------------
  140|  3.05k|      ret[i] = (*this)[i] - o[i];
  141|  3.05k|    }
  142|  1.52k|    return ret;
  143|  1.52k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  66.9k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  2.03M|  VectorD() {
   41|  8.13M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 6.09M, False: 2.03M]
  ------------------
   42|  6.09M|      (*this)[i] = Scalar(0);
   43|  6.09M|    }
   44|  2.03M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  11.3M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  11.3M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  11.3M|    v_[0] = c0;
   55|  11.3M|    v_[1] = c1;
   56|  11.3M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  9.48M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  28.4M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 18.9M, False: 9.48M]
  ------------------
  104|  18.9M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 18.9M, False: 0]
  ------------------
  105|  18.9M|        v_[i] = Scalar(src_vector[i]);
  106|  18.9M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  18.9M|    }
  110|  9.48M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  4.74M|  VectorD() {
   41|  14.2M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 9.48M, False: 4.74M]
  ------------------
   42|  9.48M|      (*this)[i] = Scalar(0);
   43|  9.48M|    }
   44|  4.74M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  4.74M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  14.2M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 9.48M, False: 4.74M]
  ------------------
  104|  9.48M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 9.48M, False: 0]
  ------------------
  105|  9.48M|        v_[i] = Scalar(src_vector[i]);
  106|  9.48M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  9.48M|    }
  110|  4.74M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  6.71M|  VectorD(const Self &o) {
   89|  20.1M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 13.4M, False: 6.71M]
  ------------------
   90|  13.4M|      (*this)[i] = o[i];
   91|  13.4M|    }
   92|  6.71M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  2.95M|  VectorD() {
   41|  8.86M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 5.90M, False: 2.95M]
  ------------------
   42|  5.90M|      (*this)[i] = Scalar(0);
   43|  5.90M|    }
   44|  2.95M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|   130M|  inline int num_vertices() const {
   74|   130M|    return static_cast<int>(vertex_corners_.size());
   75|   130M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  12.0M|  inline int num_corners() const {
   77|  12.0M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  12.0M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  2.39M|  inline int num_faces() const {
   80|  2.39M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  2.39M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   432M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   432M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 432M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   432M|    return opposite_corners_[corner];
   88|   432M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   729M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   729M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 18.9M, False: 710M]
  ------------------
   91|  18.9M|      return corner;
   92|  18.9M|    }
   93|   710M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 644M, False: 65.1M]
  ------------------
   94|   729M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   600M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   600M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 5.66M, False: 595M]
  ------------------
   97|  5.66M|      return corner;
   98|  5.66M|    }
   99|   595M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 159M, False: 435M]
  ------------------
  100|   600M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.12G|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|  1.12G|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 1.12G]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|  1.12G|    return ConfidentVertex(corner);
  106|  1.12G|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  1.12G|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|  1.12G|    DRACO_DCHECK_GE(corner.value(), 0);
  109|  1.12G|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|  1.12G|    return corner_to_vertex_map_[corner];
  111|  1.12G|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  45.1M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  45.1M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 45.1M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  45.1M|    return FaceIndex(corner.value() / 3);
  117|  45.1M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|  1.30G|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  85.2M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  85.2M|    return vertex_corners_[v];
  152|  85.2M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|  1.06M|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|  1.06M|    const CornerIndex corner = LeftMostCorner(vert);
  187|  1.06M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 23.0k, False: 1.04M]
  ------------------
  188|  23.0k|      return true;
  189|  23.0k|    }
  190|  1.04M|    return false;
  191|  1.06M|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  92.8M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  92.8M|    return Previous(Opposite(Previous(corner)));
  202|  92.8M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  19.5M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  19.5M|    return Next(Opposite(Next(corner)));
  207|  19.5M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  4.02M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  4.02M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 4.02M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  4.02M|    return Opposite(Previous(corner_id));
  222|  4.02M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  5.07M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  5.07M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 5.07M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  5.07M|    return Opposite(Next(corner_id));
  228|  5.07M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   484M|                                CornerIndex opp_corner_id) {
  249|   484M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   484M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   484M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   562M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   562M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   562M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   562M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|   136M|  VertexIndex AddNewVertex() {
  271|   136M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|   136M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|   136M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|   136M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   311M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   311M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   311M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 311M, False: 0]
  ------------------
  295|   311M|      vertex_corners_[vert] = corner;
  296|   311M|    }
  297|   311M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|  5.03M|  void MakeVertexIsolated(VertexIndex vert) {
  329|  5.03M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|  5.03M|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|  5.03M|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  11.3k|      : corner_table_(table),
  229|  11.3k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  11.3k|        corner_(start_corner_),
  231|  11.3k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  5.58M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  85.4k|  VertexCornersIterator &operator++() {
  268|  85.4k|    Next();
  269|  85.4k|    return *this;
  270|  85.4k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  4.78M|  void Next() {
  248|  4.78M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 4.70M, False: 71.6k]
  ------------------
  249|  4.70M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  4.70M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 23.6k, False: 4.68M]
  ------------------
  251|       |        // Open boundary reached.
  252|  23.6k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  23.6k|        left_traversal_ = false;
  254|  4.68M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 780k, False: 3.90M]
  ------------------
  255|       |        // End reached.
  256|   780k|        corner_ = kInvalidCornerIndex;
  257|   780k|      }
  258|  4.70M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  71.6k|      corner_ = corner_table_->SwingRight(corner_);
  262|  71.6k|    }
  263|  4.78M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  8.76M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  5.56M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  5.43M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  3.12M|  void Next() {
  248|  3.12M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.10M, False: 27.4k]
  ------------------
  249|  3.10M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.10M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 2.30M, False: 797k]
  ------------------
  251|       |        // Open boundary reached.
  252|  2.30M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  2.30M|        left_traversal_ = false;
  254|  2.30M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 130k, False: 667k]
  ------------------
  255|       |        // End reached.
  256|   130k|        corner_ = kInvalidCornerIndex;
  257|   130k|      }
  258|  3.10M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  27.4k|      corner_ = corner_table_->SwingRight(corner_);
  262|  27.4k|    }
  263|  3.12M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  2.43M|      : corner_table_(table),
  236|  2.43M|        start_corner_(corner_id),
  237|  2.43M|        corner_(start_corner_),
  238|  2.43M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   792k|      : corner_table_(table),
  236|   792k|        start_corner_(corner_id),
  237|   792k|        corner_(start_corner_),
  238|   792k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  72.3M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  72.3M|    return is_edge_on_seam_[corner.value()];
   47|  72.3M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  34.6M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  34.6M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 34.6M]
  |  Branch (50:42): [True: 27.7M, False: 6.85M]
  ------------------
   51|  27.7M|      return kInvalidCornerIndex;
   52|  27.7M|    }
   53|  6.85M|    return corner_table_->Opposite(corner);
   54|  34.6M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  49.7M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  49.7M|    return corner_table_->Next(corner);
   58|  49.7M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  27.3M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  27.3M|    return corner_table_->Previous(corner);
   62|  27.3M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  5.92M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  5.92M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  5.92M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  4.46M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  4.46M|    return Opposite(Previous(corner));
   73|  4.46M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  5.24M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  5.24M|    return Opposite(Next(corner));
   76|  5.24M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  4.90M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  4.90M|    return Previous(Opposite(Previous(corner)));
   81|  4.90M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  15.7M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  15.7M|    return Next(Opposite(Next(corner)));
   86|  15.7M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  13.2k|  int num_vertices() const {
   89|  13.2k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  13.2k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  4.53k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  1.80k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|   126M|  VertexIndex Vertex(CornerIndex corner) const {
   95|   126M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|   126M|    return ConfidentVertex(corner);
   97|   126M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|   126M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|   126M|    return corner_to_vertex_map_[corner.value()];
  100|   126M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  4.41M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  4.41M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  4.41M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  4.41M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  4.41M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  4.41M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 4.41M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  4.41M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 3.63M, False: 778k]
  ------------------
  128|  3.63M|      return true;
  129|  3.63M|    }
  130|   778k|    return false;
  131|  4.41M|  }

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

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

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

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

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

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

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

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

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

