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

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

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

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

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

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

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

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

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

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

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

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

_ZNK5draco17AttributesDecoder14GetAttributeIdEi:
   44|  81.6k|  int32_t GetAttributeId(int i) const override {
   45|  81.6k|    return point_attribute_ids_[i];
   46|  81.6k|  }
_ZNK5draco17AttributesDecoder16GetNumAttributesEv:
   47|  52.2k|  int32_t GetNumAttributes() const override {
   48|  52.2k|    return static_cast<int32_t>(point_attribute_ids_.size());
   49|  52.2k|  }
_ZNK5draco17AttributesDecoder10GetDecoderEv:
   50|  49.6k|  PointCloudDecoder *GetDecoder() const override {
   51|  49.6k|    return point_cloud_decoder_;
   52|  49.6k|  }
_ZN5draco17AttributesDecoder16DecodeAttributesEPNS_13DecoderBufferE:
   55|  5.80k|  bool DecodeAttributes(DecoderBuffer *in_buffer) override {
   56|  5.80k|    if (!DecodePortableAttributes(in_buffer)) {
  ------------------
  |  Branch (56:9): [True: 2.38k, False: 3.42k]
  ------------------
   57|  2.38k|      return false;
   58|  2.38k|    }
   59|  3.42k|    if (!DecodeDataNeededByPortableTransforms(in_buffer)) {
  ------------------
  |  Branch (59:9): [True: 790, False: 2.63k]
  ------------------
   60|    790|      return false;
   61|    790|    }
   62|  2.63k|    if (!TransformAttributesToOriginalFormat()) {
  ------------------
  |  Branch (62:9): [True: 396, False: 2.24k]
  ------------------
   63|    396|      return false;
   64|    396|    }
   65|  2.24k|    return true;
   66|  2.63k|  }
_ZNK5draco17AttributesDecoder27GetLocalIdForPointAttributeEi:
   69|  2.36k|  int32_t GetLocalIdForPointAttribute(int32_t point_attribute_id) const {
   70|  2.36k|    const int id_map_size =
   71|  2.36k|        static_cast<int>(point_attribute_to_local_id_map_.size());
   72|  2.36k|    if (point_attribute_id >= id_map_size) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.36k]
  ------------------
   73|      0|      return -1;
   74|      0|    }
   75|  2.36k|    return point_attribute_to_local_id_map_[point_attribute_id];
   76|  2.36k|  }
_ZN5draco17AttributesDecoderD2Ev:
   35|  33.1k|  virtual ~AttributesDecoder() = default;

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  3.06k|      : quantization_bits_(-1),
   54|  3.06k|        max_quantized_value_(-1),
   55|  3.06k|        max_value_(-1),
   56|  3.06k|        dequantization_scale_(1.f),
   57|  3.06k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  2.77k|  bool SetQuantizationBits(int32_t q) {
   60|  2.77k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 829, False: 1.94k]
  |  Branch (60:18): [True: 177, False: 1.77k]
  ------------------
   61|  1.00k|      return false;
   62|  1.00k|    }
   63|  1.77k|    quantization_bits_ = q;
   64|  1.77k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.77k|    max_value_ = max_quantized_value_ - 1;
   66|  1.77k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.77k|    center_value_ = max_value_ / 2;
   68|  1.77k|    return true;
   69|  2.77k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  2.79M|                                           int32_t *out_t) const {
   77|  2.79M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 2.42k, False: 2.79M]
  |  Branch (77:20): [True: 0, False: 2.42k]
  |  Branch (77:32): [True: 2.42k, False: 2.79M]
  |  Branch (77:42): [True: 0, False: 2.42k]
  ------------------
   78|  2.79M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 1.85M, False: 940k]
  |  Branch (78:29): [True: 4.49k, False: 1.85M]
  ------------------
   79|  4.49k|      s = max_value_;
   80|  4.49k|      t = max_value_;
   81|  2.79M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 2.42k, False: 2.78M]
  |  Branch (81:26): [True: 681, False: 1.74k]
  ------------------
   82|    681|      t = center_value_ - (t - center_value_);
   83|  2.79M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 1.85M, False: 940k]
  |  Branch (83:35): [True: 4.64k, False: 1.84M]
  ------------------
   84|  4.64k|      t = center_value_ + (center_value_ - t);
   85|  2.78M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 1.84M, False: 937k]
  |  Branch (85:35): [True: 232, False: 1.84M]
  ------------------
   86|    232|      s = center_value_ + (center_value_ - s);
   87|  2.78M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 3.57k, False: 2.78M]
  |  Branch (87:26): [True: 1.67k, False: 1.89k]
  ------------------
   88|  1.67k|      s = center_value_ - (s - center_value_);
   89|  1.67k|    }
   90|       |
   91|  2.79M|    *out_s = s;
   92|  2.79M|    *out_t = t;
   93|  2.79M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  2.79M|                                                       int32_t *out_t) const {
  100|  2.79M|    DRACO_DCHECK_EQ(
  101|  2.79M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  2.79M|        center_value_);
  103|  2.79M|    int32_t s, t;
  104|  2.79M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 1.40M, False: 1.39M]
  ------------------
  105|       |      // Right hemisphere.
  106|  1.40M|      s = (int_vec[1] + center_value_);
  107|  1.40M|      t = (int_vec[2] + center_value_);
  108|  1.40M|    } else {
  109|       |      // Left hemisphere.
  110|  1.39M|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 37.6k, False: 1.35M]
  ------------------
  111|  37.6k|        s = std::abs(int_vec[2]);
  112|  1.35M|      } else {
  113|  1.35M|        s = (max_value_ - std::abs(int_vec[2]));
  114|  1.35M|      }
  115|  1.39M|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 42.0k, False: 1.35M]
  ------------------
  116|  42.0k|        t = std::abs(int_vec[1]);
  117|  1.35M|      } else {
  118|  1.35M|        t = (max_value_ - std::abs(int_vec[1]));
  119|  1.35M|      }
  120|  1.39M|    }
  121|  2.79M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  2.79M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|   305k|                                                    float *out_vector) const {
  199|   305k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|   305k|                                 in_t * dequantization_scale_ - 1.f,
  201|   305k|                                 out_vector);
  202|   305k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  2.56M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  2.56M|    DRACO_DCHECK_LE(s, center_value_);
  208|  2.56M|    DRACO_DCHECK_LE(t, center_value_);
  209|  2.56M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  2.56M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  2.56M|    const uint32_t st =
  212|  2.56M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  2.56M|    return st <= center_value_;
  214|  2.56M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  2.91M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  2.91M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  2.91M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  2.91M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  2.91M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  2.91M|    int32_t sign_s = 0;
  223|  2.91M|    int32_t sign_t = 0;
  224|  2.91M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 2.60M, False: 318k]
  |  Branch (224:20): [True: 2.37M, False: 223k]
  ------------------
  225|  2.37M|      sign_s = 1;
  226|  2.37M|      sign_t = 1;
  227|  2.37M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 336k, False: 205k]
  |  Branch (227:27): [True: 241k, False: 94.2k]
  ------------------
  228|   241k|      sign_s = -1;
  229|   241k|      sign_t = -1;
  230|   299k|    } else {
  231|   299k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 205k, False: 94.2k]
  ------------------
  232|   299k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 94.2k, False: 205k]
  ------------------
  233|   299k|    }
  234|       |
  235|       |    // Perform the addition and subtraction using unsigned integers to avoid
  236|       |    // signed integer overflows for bad data. Note that the result will be
  237|       |    // unchanged for non-overflowing cases.
  238|  2.91M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  2.91M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  2.91M|    uint32_t us = *s;
  241|  2.91M|    uint32_t ut = *t;
  242|  2.91M|    us = us + us - corner_point_s;
  243|  2.91M|    ut = ut + ut - corner_point_t;
  244|  2.91M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 2.61M, False: 299k]
  ------------------
  245|  2.61M|      uint32_t temp = us;
  246|  2.61M|      us = -ut;
  247|  2.61M|      ut = -temp;
  248|  2.61M|    } else {
  249|   299k|      std::swap(us, ut);
  250|   299k|    }
  251|  2.91M|    us = us + corner_point_s;
  252|  2.91M|    ut = ut + corner_point_t;
  253|       |
  254|  2.91M|    *s = us;
  255|  2.91M|    *t = ut;
  256|  2.91M|    *s /= 2;
  257|  2.91M|    *t /= 2;
  258|  2.91M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  5.12M|  int32_t ModMax(int32_t x) const {
  273|  5.12M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 12.4k, False: 5.11M]
  ------------------
  274|  12.4k|      return x - this->max_quantized_value();
  275|  12.4k|    }
  276|  5.11M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 2.32k, False: 5.11M]
  ------------------
  277|  2.32k|      return x + this->max_quantized_value();
  278|  2.32k|    }
  279|  5.11M|    return x;
  280|  5.11M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.67k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  14.7k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  15.3M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|   305k|                                           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|   305k|    float y = in_s_scaled;
  329|   305k|    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|   305k|    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|   305k|    float x_offset = -x;
  342|   305k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 16.6k, False: 288k]
  ------------------
  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|   305k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 82.4k, False: 223k]
  ------------------
  348|   305k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 96.8k, False: 208k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|   305k|    const float norm_squared = x * x + y * y + z * z;
  352|   305k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 305k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|   305k|    } else {
  357|   305k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|   305k|      out_vector[0] = x * d;
  359|   305k|      out_vector[1] = y * d;
  360|   305k|      out_vector[2] = z * d;
  361|   305k|    }
  362|   305k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  2.79M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  2.79M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  2.79M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  2.79M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  2.79M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  2.79M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  2.79M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 2.59M, False: 203k]
  ------------------
  181|  2.59M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  2.59M|    } else {
  183|   203k|      vec[0] =
  184|   203k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   203k|          abs_sum;
  186|   203k|      vec[1] =
  187|   203k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   203k|          abs_sum;
  189|   203k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 108k, False: 94.7k]
  ------------------
  190|   108k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   108k|      } else {
  192|  94.7k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|  94.7k|      }
  194|   203k|    }
  195|  2.79M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    402|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    402|            attribute, transform, mesh_data),
   52|    402|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    391|                                                                *buffer) {
  194|    391|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    391|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    391|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 18, False: 373]
  ------------------
  196|       |    // Decode prediction mode.
  197|     18|    uint8_t mode;
  198|     18|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 18]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|     18|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 13, False: 5]
  ------------------
  203|       |      // Unsupported mode.
  204|     13|      return false;
  205|     13|    }
  206|     18|  }
  207|    378|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.64k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.37k, False: 271]
  ------------------
  211|  1.37k|    uint32_t num_flags;
  212|  1.37k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 11, False: 1.36k]
  ------------------
  213|     11|      return false;
  214|     11|    }
  215|  1.36k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 60, False: 1.30k]
  ------------------
  216|     60|      return false;
  217|     60|    }
  218|  1.30k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 593, False: 710]
  ------------------
  219|    593|      is_crease_edge_[i].resize(num_flags);
  220|    593|      RAnsBitDecoder decoder;
  221|    593|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 36, False: 557]
  ------------------
  222|     36|        return false;
  223|     36|      }
  224|  1.09M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.08M, False: 557]
  ------------------
  225|  1.08M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.08M|      }
  227|    557|      decoder.EndDecoding();
  228|    557|    }
  229|  1.30k|  }
  230|    271|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    271|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    378|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    248|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    248|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    248|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.24k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 992, False: 248]
  ------------------
   93|    992|    pred_vals[i].resize(num_components, 0);
   94|    992|  }
   95|    248|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    248|                                         out_data);
   97|       |
   98|    248|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    248|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    248|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    248|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    248|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    248|  const int corner_map_size =
  109|    248|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  1.07M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 1.07M, False: 143]
  ------------------
  111|  1.07M|    const CornerIndex start_corner_id =
  112|  1.07M|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  1.07M|    CornerIndex corner_id(start_corner_id);
  115|  1.07M|    int num_parallelograms = 0;
  116|  1.07M|    bool first_pass = true;
  117|  2.34M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 1.29M, False: 1.04M]
  ------------------
  118|  1.29M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 70.6k, False: 1.22M]
  ------------------
  119|  1.29M|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|  1.29M|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  70.6k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  70.6k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 361, False: 70.2k]
  ------------------
  127|    361|          break;
  128|    361|        }
  129|  70.6k|      }
  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.29M|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 1.25M, False: 40.2k]
  ------------------
  134|  1.25M|        corner_id = table->SwingLeft(corner_id);
  135|  1.25M|      } else {
  136|  40.2k|        corner_id = table->SwingRight(corner_id);
  137|  40.2k|      }
  138|  1.29M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 24.0k, False: 1.26M]
  ------------------
  139|  24.0k|        break;
  140|  24.0k|      }
  141|  1.26M|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 1.07M, False: 198k]
  |  Branch (141:47): [True: 1.04M, False: 21.6k]
  ------------------
  142|  1.04M|        first_pass = false;
  143|  1.04M|        corner_id = table->SwingRight(start_corner_id);
  144|  1.04M|      }
  145|  1.26M|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  1.07M|    int num_used_parallelograms = 0;
  150|  1.07M|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 46.7k, False: 1.02M]
  ------------------
  151|  6.71M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 6.66M, False: 46.7k]
  ------------------
  152|  6.66M|        multi_pred_vals[i] = 0;
  153|  6.66M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   117k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 70.6k, False: 46.6k]
  ------------------
  156|  70.6k|        const int context = num_parallelograms - 1;
  157|  70.6k|        const int pos = is_crease_edge_pos[context]++;
  158|  70.6k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 105, False: 70.5k]
  ------------------
  159|    105|          return false;
  160|    105|        }
  161|  70.5k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  70.5k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 8.86k, False: 61.6k]
  ------------------
  163|  8.86k|          ++num_used_parallelograms;
  164|   932k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 923k, False: 8.86k]
  ------------------
  165|   923k|            multi_pred_vals[j] =
  166|   923k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|   923k|          }
  168|  8.86k|        }
  169|  70.5k|      }
  170|  46.7k|    }
  171|  1.07M|    const int dst_offset = p * num_components;
  172|  1.07M|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 1.07M, False: 4.17k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  1.07M|      const int src_offset = (p - 1) * num_components;
  176|  1.07M|      this->transform().ComputeOriginalValue(
  177|  1.07M|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  1.07M|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   432k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 427k, False: 4.17k]
  ------------------
  181|   427k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   427k|      }
  183|  4.17k|      this->transform().ComputeOriginalValue(
  184|  4.17k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  4.17k|    }
  186|  1.07M|  }
  187|    143|  return true;
  188|    248|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    463|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    463|            attribute, transform, mesh_data),
   52|    463|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    451|                                                                *buffer) {
  194|    451|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    451|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    451|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 3, False: 448]
  ------------------
  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|    449|#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.59k, False: 327]
  ------------------
  211|  1.59k|    uint32_t num_flags;
  212|  1.59k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 17, False: 1.58k]
  ------------------
  213|     17|      return false;
  214|     17|    }
  215|  1.58k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 69, False: 1.51k]
  ------------------
  216|     69|      return false;
  217|     69|    }
  218|  1.51k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 629, False: 883]
  ------------------
  219|    629|      is_crease_edge_[i].resize(num_flags);
  220|    629|      RAnsBitDecoder decoder;
  221|    629|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 36, False: 593]
  ------------------
  222|     36|        return false;
  223|     36|      }
  224|   943k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 943k, False: 593]
  ------------------
  225|   943k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|   943k|      }
  227|    593|      decoder.EndDecoding();
  228|    593|    }
  229|  1.51k|  }
  230|    327|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    327|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    449|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    292|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    292|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    292|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.46k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.16k, False: 292]
  ------------------
   93|  1.16k|    pred_vals[i].resize(num_components, 0);
   94|  1.16k|  }
   95|    292|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    292|                                         out_data);
   97|       |
   98|    292|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    292|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    292|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    292|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    292|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    292|  const int corner_map_size =
  109|    292|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   162k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 161k, False: 151]
  ------------------
  111|   161k|    const CornerIndex start_corner_id =
  112|   161k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   161k|    CornerIndex corner_id(start_corner_id);
  115|   161k|    int num_parallelograms = 0;
  116|   161k|    bool first_pass = true;
  117|   996k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 971k, False: 25.5k]
  ------------------
  118|   971k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 294k, False: 676k]
  ------------------
  119|   971k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   971k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   294k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   294k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 677, False: 293k]
  ------------------
  127|    677|          break;
  128|    677|        }
  129|   294k|      }
  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|   970k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 905k, False: 64.9k]
  ------------------
  134|   905k|        corner_id = table->SwingLeft(corner_id);
  135|   905k|      } else {
  136|  64.9k|        corner_id = table->SwingRight(corner_id);
  137|  64.9k|      }
  138|   970k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 135k, False: 834k]
  ------------------
  139|   135k|        break;
  140|   135k|      }
  141|   834k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 47.6k, False: 786k]
  |  Branch (141:47): [True: 25.5k, False: 22.1k]
  ------------------
  142|  25.5k|        first_pass = false;
  143|  25.5k|        corner_id = table->SwingRight(start_corner_id);
  144|  25.5k|      }
  145|   834k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   161k|    int num_used_parallelograms = 0;
  150|   161k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 160k, False: 1.76k]
  ------------------
  151|  13.8M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 13.6M, False: 160k]
  ------------------
  152|  13.6M|        multi_pred_vals[i] = 0;
  153|  13.6M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   454k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 294k, False: 160k]
  ------------------
  156|   294k|        const int context = num_parallelograms - 1;
  157|   294k|        const int pos = is_crease_edge_pos[context]++;
  158|   294k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 141, False: 293k]
  ------------------
  159|    141|          return false;
  160|    141|        }
  161|   293k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   293k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 11.3k, False: 282k]
  ------------------
  163|  11.3k|          ++num_used_parallelograms;
  164|  1.21M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 1.20M, False: 11.3k]
  ------------------
  165|  1.20M|            multi_pred_vals[j] =
  166|  1.20M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  1.20M|          }
  168|  11.3k|        }
  169|   293k|      }
  170|   160k|    }
  171|   161k|    const int dst_offset = p * num_components;
  172|   161k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 156k, False: 5.57k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   156k|      const int src_offset = (p - 1) * num_components;
  176|   156k|      this->transform().ComputeOriginalValue(
  177|   156k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   156k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   578k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 572k, False: 5.57k]
  ------------------
  181|   572k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   572k|      }
  183|  5.57k|      this->transform().ComputeOriginalValue(
  184|  5.57k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  5.57k|    }
  186|   161k|  }
  187|    151|  return true;
  188|    292|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  2.77k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  2.77k|    mesh_ = mesh;
   39|  2.77k|    corner_table_ = table;
   40|  2.77k|    data_to_corner_map_ = data_to_corner_map;
   41|  2.77k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  2.77k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  13.7M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  9.69M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  9.69M|    return vertex_to_data_map_;
   48|  9.69M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  6.04M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  6.04M|    return data_to_corner_map_;
   51|  6.04M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  2.71k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  2.71k|    mesh_ = mesh;
   39|  2.71k|    corner_table_ = table;
   40|  2.71k|    data_to_corner_map_ = data_to_corner_map;
   41|  2.71k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  2.71k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  9.86M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  8.55M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  8.55M|    return vertex_to_data_map_;
   48|  8.55M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  2.07M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  2.07M|    return data_to_corner_map_;
   51|  2.07M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  2.77k|      : mesh_(nullptr),
   31|  2.77k|        corner_table_(nullptr),
   32|  2.77k|        vertex_to_data_map_(nullptr),
   33|  2.77k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  2.71k|      : mesh_(nullptr),
   31|  2.71k|        corner_table_(nullptr),
   32|  2.71k|        vertex_to_data_map_(nullptr),
   33|  2.71k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   722k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   209k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   764k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   209k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.37k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.37k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  7.76M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.39k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.39k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  2.71M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    199|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    199|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    161|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    161|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    191|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    191|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    147|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    147|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    396|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    199|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    199|    DRACO_DCHECK_EQ(i, 0);
   70|    199|    (void)i;
   71|    199|    return GeometryAttribute::POSITION;
   72|    199|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_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: 1, False: 197]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    197|    predictor_.SetPositionAttribute(*att);
   82|    197|    return true;
   83|    198|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_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: 51, False: 139]
  ------------------
  150|     51|    uint8_t prediction_mode;
  151|     51|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 50]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     50|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 49]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     49|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 49]
  ------------------
  160|     49|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     49|  }
  164|    188|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    188|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 8, False: 180]
  ------------------
  168|      8|    return false;
  169|      8|  }
  170|       |
  171|    180|  return true;
  172|    188|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    180|                                      const PointIndex *entry_to_point_id_map) {
  103|    180|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    180|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    180|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    180|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    180|  const int corner_map_size =
  111|    180|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    180|  VectorD<int32_t, 3> pred_normal_3d;
  114|    180|  int32_t pred_normal_oct[2];
  115|       |
  116|   722k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 722k, False: 180]
  ------------------
  117|   722k|    const CornerIndex corner_id =
  118|   722k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   722k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   722k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   722k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   722k|                    octahedron_tool_box_.center_value());
  125|   722k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 441k, False: 281k]
  ------------------
  126|   441k|      pred_normal_3d = -pred_normal_3d;
  127|   441k|    }
  128|   722k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   722k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   722k|    const int data_offset = data_id * 2;
  132|   722k|    this->transform().ComputeOriginalValue(
  133|   722k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   722k|  }
  135|    180|  flip_normal_bit_decoder_.EndDecoding();
  136|    180|  return true;
  137|    180|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    180|  void SetQuantizationBits(int q) {
   85|    180|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    180|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    317|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    161|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    161|    DRACO_DCHECK_EQ(i, 0);
   70|    161|    (void)i;
   71|    161|    return GeometryAttribute::POSITION;
   72|    161|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    158|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    158|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 158]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    158|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 156]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    156|    predictor_.SetPositionAttribute(*att);
   82|    156|    return true;
   83|    158|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    156|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    156|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 151]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|       |
  148|    151|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    151|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    151|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 21, False: 130]
  ------------------
  150|     21|    uint8_t prediction_mode;
  151|     21|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 20]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     20|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 19]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     19|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 19]
  ------------------
  160|     19|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     19|  }
  164|    149|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    149|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 4, False: 145]
  ------------------
  168|      4|    return false;
  169|      4|  }
  170|       |
  171|    145|  return true;
  172|    149|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    145|                                      const PointIndex *entry_to_point_id_map) {
  103|    145|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    145|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    145|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    145|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    145|  const int corner_map_size =
  111|    145|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    145|  VectorD<int32_t, 3> pred_normal_3d;
  114|    145|  int32_t pred_normal_oct[2];
  115|       |
  116|   209k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 209k, False: 145]
  ------------------
  117|   209k|    const CornerIndex corner_id =
  118|   209k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   209k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   209k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   209k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   209k|                    octahedron_tool_box_.center_value());
  125|   209k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 153k, False: 55.8k]
  ------------------
  126|   153k|      pred_normal_3d = -pred_normal_3d;
  127|   153k|    }
  128|   209k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   209k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   209k|    const int data_offset = data_id * 2;
  132|   209k|    this->transform().ComputeOriginalValue(
  133|   209k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   209k|  }
  135|    145|  flip_normal_bit_decoder_.EndDecoding();
  136|    145|  return true;
  137|    145|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    145|  void SetQuantizationBits(int q) {
   85|    145|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    145|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    381|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    191|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    191|    DRACO_DCHECK_EQ(i, 0);
   70|    191|    (void)i;
   71|    191|    return GeometryAttribute::POSITION;
   72|    191|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    191|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    191|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 191]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    191|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 190]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    190|    predictor_.SetPositionAttribute(*att);
   82|    190|    return true;
   83|    191|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    190|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    190|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 9, False: 181]
  ------------------
  145|      9|    return false;
  146|      9|  }
  147|       |
  148|    181|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    181|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    181|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 49, False: 132]
  ------------------
  150|     49|    uint8_t prediction_mode;
  151|     49|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 48]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     48|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 3, False: 45]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      3|      return false;
  157|      3|    }
  158|       |
  159|     45|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 45]
  ------------------
  160|     45|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     45|  }
  164|    177|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    177|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 4, False: 173]
  ------------------
  168|      4|    return false;
  169|      4|  }
  170|       |
  171|    173|  return true;
  172|    177|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    173|                                      const PointIndex *entry_to_point_id_map) {
  103|    173|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    173|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    173|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    173|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    173|  const int corner_map_size =
  111|    173|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    173|  VectorD<int32_t, 3> pred_normal_3d;
  114|    173|  int32_t pred_normal_oct[2];
  115|       |
  116|   764k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 764k, False: 173]
  ------------------
  117|   764k|    const CornerIndex corner_id =
  118|   764k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   764k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   764k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   764k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   764k|                    octahedron_tool_box_.center_value());
  125|   764k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 404k, False: 359k]
  ------------------
  126|   404k|      pred_normal_3d = -pred_normal_3d;
  127|   404k|    }
  128|   764k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   764k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   764k|    const int data_offset = data_id * 2;
  132|   764k|    this->transform().ComputeOriginalValue(
  133|   764k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   764k|  }
  135|    173|  flip_normal_bit_decoder_.EndDecoding();
  136|    173|  return true;
  137|    173|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    173|  void SetQuantizationBits(int q) {
   85|    173|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    173|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    292|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    147|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    147|    DRACO_DCHECK_EQ(i, 0);
   70|    147|    (void)i;
   71|    147|    return GeometryAttribute::POSITION;
   72|    147|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    147|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    147|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 147]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    147|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 145]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    145|    predictor_.SetPositionAttribute(*att);
   82|    145|    return true;
   83|    147|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    144|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    144|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 5, False: 139]
  ------------------
  145|      5|    return false;
  146|      5|  }
  147|       |
  148|    139|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    139|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    139|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 26, False: 113]
  ------------------
  150|     26|    uint8_t prediction_mode;
  151|     26|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 25]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     25|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 24]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     24|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 24]
  ------------------
  160|     24|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     24|  }
  164|    137|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    137|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 3, False: 134]
  ------------------
  168|      3|    return false;
  169|      3|  }
  170|       |
  171|    134|  return true;
  172|    137|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    134|                                      const PointIndex *entry_to_point_id_map) {
  103|    134|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    134|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    134|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    134|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    134|  const int corner_map_size =
  111|    134|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    134|  VectorD<int32_t, 3> pred_normal_3d;
  114|    134|  int32_t pred_normal_oct[2];
  115|       |
  116|   209k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 209k, False: 134]
  ------------------
  117|   209k|    const CornerIndex corner_id =
  118|   209k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   209k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   209k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   209k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   209k|                    octahedron_tool_box_.center_value());
  125|   209k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 153k, False: 55.7k]
  ------------------
  126|   153k|      pred_normal_3d = -pred_normal_3d;
  127|   153k|    }
  128|   209k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   209k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   209k|    const int data_offset = data_id * 2;
  132|   209k|    this->transform().ComputeOriginalValue(
  133|   209k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   209k|  }
  135|    134|  flip_normal_bit_decoder_.EndDecoding();
  136|    134|  return true;
  137|    134|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    134|  void SetQuantizationBits(int q) {
   85|    134|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    134|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    406|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    406|            attribute, transform, mesh_data),
   37|    406|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    808|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    406|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    406|    DRACO_DCHECK_EQ(i, 0);
   70|    406|    (void)i;
   71|    406|    return GeometryAttribute::POSITION;
   72|    406|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    404|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    404|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 404]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    404|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 402]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    402|    predictor_.SetPositionAttribute(*att);
   82|    402|    return true;
   83|    404|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    401|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    401|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 27, False: 374]
  ------------------
  145|     27|    return false;
  146|     27|  }
  147|       |
  148|    374|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    374|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    374|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 196, False: 178]
  ------------------
  150|    196|    uint8_t prediction_mode;
  151|    196|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 195]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|    195|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 3, False: 192]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      3|      return false;
  157|      3|    }
  158|       |
  159|    192|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 192]
  ------------------
  160|    192|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|    192|  }
  164|    370|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    370|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 30, False: 340]
  ------------------
  168|     30|    return false;
  169|     30|  }
  170|       |
  171|    340|  return true;
  172|    370|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    340|                                      const PointIndex *entry_to_point_id_map) {
  103|    340|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    340|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    340|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    340|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    340|  const int corner_map_size =
  111|    340|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    340|  VectorD<int32_t, 3> pred_normal_3d;
  114|    340|  int32_t pred_normal_oct[2];
  115|       |
  116|   697k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 697k, False: 340]
  ------------------
  117|   697k|    const CornerIndex corner_id =
  118|   697k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   697k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   697k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   697k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   697k|                    octahedron_tool_box_.center_value());
  125|   697k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 439k, False: 257k]
  ------------------
  126|   439k|      pred_normal_3d = -pred_normal_3d;
  127|   439k|    }
  128|   697k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   697k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   697k|    const int data_offset = data_id * 2;
  132|   697k|    this->transform().ComputeOriginalValue(
  133|   697k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   697k|  }
  135|    340|  flip_normal_bit_decoder_.EndDecoding();
  136|    340|  return true;
  137|    340|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    340|  void SetQuantizationBits(int q) {
   85|    340|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    340|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    402|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    402|            attribute, transform, mesh_data),
   37|    402|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    801|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    402|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    402|    DRACO_DCHECK_EQ(i, 0);
   70|    402|    (void)i;
   71|    402|    return GeometryAttribute::POSITION;
   72|    402|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    401|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    401|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 401]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    401|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 399]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    399|    predictor_.SetPositionAttribute(*att);
   82|    399|    return true;
   83|    401|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    399|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    399|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 42, False: 357]
  ------------------
  145|     42|    return false;
  146|     42|  }
  147|       |
  148|    357|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    357|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    357|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 130, False: 227]
  ------------------
  150|    130|    uint8_t prediction_mode;
  151|    130|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 129]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|    129|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 128]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|    128|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 128]
  ------------------
  160|    128|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|    128|  }
  164|    355|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    355|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 25, False: 330]
  ------------------
  168|     25|    return false;
  169|     25|  }
  170|       |
  171|    330|  return true;
  172|    355|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    330|                                      const PointIndex *entry_to_point_id_map) {
  103|    330|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    330|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    330|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    330|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    330|  const int corner_map_size =
  111|    330|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    330|  VectorD<int32_t, 3> pred_normal_3d;
  114|    330|  int32_t pred_normal_oct[2];
  115|       |
  116|   193k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 193k, False: 330]
  ------------------
  117|   193k|    const CornerIndex corner_id =
  118|   193k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   193k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   193k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   193k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   193k|                    octahedron_tool_box_.center_value());
  125|   193k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 105k, False: 88.1k]
  ------------------
  126|   105k|      pred_normal_3d = -pred_normal_3d;
  127|   105k|    }
  128|   193k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   193k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   193k|    const int data_offset = data_id * 2;
  132|   193k|    this->transform().ComputeOriginalValue(
  133|   193k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   193k|  }
  135|    330|  flip_normal_bit_decoder_.EndDecoding();
  136|    330|  return true;
  137|    330|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    330|  void SetQuantizationBits(int q) {
   85|    330|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    330|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    199|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    199|            attribute, transform, mesh_data),
   37|    199|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    161|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    161|            attribute, transform, mesh_data),
   37|    161|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    191|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    191|            attribute, transform, mesh_data),
   37|    191|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    147|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    147|            attribute, transform, mesh_data),
   37|    147|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    248|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    248|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 40, False: 208]
  ------------------
  105|     40|      this->normal_prediction_mode_ = mode;
  106|     40|      return true;
  107|    208|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 208, False: 0]
  ------------------
  108|    208|      this->normal_prediction_mode_ = mode;
  109|    208|      return true;
  110|    208|    }
  111|      0|    return false;
  112|    248|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   722k|                             DataTypeT *prediction) override {
   42|   722k|    DRACO_DCHECK(this->IsInitialized());
   43|   722k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   722k|    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|   722k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   722k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   722k|    VectorD<int64_t, 3> normal;
   53|   722k|    CornerIndex c_next, c_prev;
   54|  1.48M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 760k, False: 722k]
  ------------------
   55|       |      // Getting corners.
   56|   760k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 228, False: 760k]
  ------------------
   57|    228|        c_next = corner_table->Next(corner_id);
   58|    228|        c_prev = corner_table->Previous(corner_id);
   59|   760k|      } else {
   60|   760k|        c_next = corner_table->Next(cit.Corner());
   61|   760k|        c_prev = corner_table->Previous(cit.Corner());
   62|   760k|      }
   63|   760k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   760k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   760k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   760k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   760k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   760k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   760k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   760k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   760k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   760k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   760k|      cit.Next();
   81|   760k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   722k|    constexpr int64_t upper_bound = 1 << 29;
   85|   722k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 152, False: 722k]
  ------------------
   86|    152|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    152|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 37, False: 115]
  ------------------
   88|     37|        const int64_t quotient = abs_sum / upper_bound;
   89|     37|        normal = normal / quotient;
   90|     37|      }
   91|   722k|    } else {
   92|   722k|      const int64_t abs_sum = normal.AbsSum();
   93|   722k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 3.29k, False: 718k]
  ------------------
   94|  3.29k|        const int64_t quotient = abs_sum / upper_bound;
   95|  3.29k|        normal = normal / quotient;
   96|  3.29k|      }
   97|   722k|    }
   98|   722k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   722k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   722k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   722k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   722k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    180|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    180|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 17, False: 163]
  ------------------
  105|     17|      this->normal_prediction_mode_ = mode;
  106|     17|      return true;
  107|    163|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 163, False: 0]
  ------------------
  108|    163|      this->normal_prediction_mode_ = mode;
  109|    163|      return true;
  110|    163|    }
  111|      0|    return false;
  112|    180|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   209k|                             DataTypeT *prediction) override {
   42|   209k|    DRACO_DCHECK(this->IsInitialized());
   43|   209k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   209k|    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|   209k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   209k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   209k|    VectorD<int64_t, 3> normal;
   53|   209k|    CornerIndex c_next, c_prev;
   54|  1.45M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.24M, False: 209k]
  ------------------
   55|       |      // Getting corners.
   56|  1.24M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 102, False: 1.24M]
  ------------------
   57|    102|        c_next = corner_table->Next(corner_id);
   58|    102|        c_prev = corner_table->Previous(corner_id);
   59|  1.24M|      } else {
   60|  1.24M|        c_next = corner_table->Next(cit.Corner());
   61|  1.24M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.24M|      }
   63|  1.24M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.24M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.24M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.24M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.24M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.24M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.24M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.24M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.24M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.24M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.24M|      cit.Next();
   81|  1.24M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   209k|    constexpr int64_t upper_bound = 1 << 29;
   85|   209k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 68, False: 209k]
  ------------------
   86|     68|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     68|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 19, False: 49]
  ------------------
   88|     19|        const int64_t quotient = abs_sum / upper_bound;
   89|     19|        normal = normal / quotient;
   90|     19|      }
   91|   209k|    } else {
   92|   209k|      const int64_t abs_sum = normal.AbsSum();
   93|   209k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 86.5k, False: 123k]
  ------------------
   94|  86.5k|        const int64_t quotient = abs_sum / upper_bound;
   95|  86.5k|        normal = normal / quotient;
   96|  86.5k|      }
   97|   209k|    }
   98|   209k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   209k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   209k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   209k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   209k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    236|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    236|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 44, False: 192]
  ------------------
  105|     44|      this->normal_prediction_mode_ = mode;
  106|     44|      return true;
  107|    192|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 192, False: 0]
  ------------------
  108|    192|      this->normal_prediction_mode_ = mode;
  109|    192|      return true;
  110|    192|    }
  111|      0|    return false;
  112|    236|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   764k|                             DataTypeT *prediction) override {
   42|   764k|    DRACO_DCHECK(this->IsInitialized());
   43|   764k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   764k|    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|   764k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   764k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   764k|    VectorD<int64_t, 3> normal;
   53|   764k|    CornerIndex c_next, c_prev;
   54|  1.56M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 797k, False: 764k]
  ------------------
   55|       |      // Getting corners.
   56|   797k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 258, False: 796k]
  ------------------
   57|    258|        c_next = corner_table->Next(corner_id);
   58|    258|        c_prev = corner_table->Previous(corner_id);
   59|   796k|      } else {
   60|   796k|        c_next = corner_table->Next(cit.Corner());
   61|   796k|        c_prev = corner_table->Previous(cit.Corner());
   62|   796k|      }
   63|   797k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   797k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   797k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   797k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   797k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   797k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   797k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   797k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   797k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   797k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   797k|      cit.Next();
   81|   797k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   764k|    constexpr int64_t upper_bound = 1 << 29;
   85|   764k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 172, False: 764k]
  ------------------
   86|    172|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    172|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 27, False: 145]
  ------------------
   88|     27|        const int64_t quotient = abs_sum / upper_bound;
   89|     27|        normal = normal / quotient;
   90|     27|      }
   91|   764k|    } else {
   92|   764k|      const int64_t abs_sum = normal.AbsSum();
   93|   764k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.50k, False: 761k]
  ------------------
   94|  2.50k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.50k|        normal = normal / quotient;
   96|  2.50k|      }
   97|   764k|    }
   98|   764k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   764k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   764k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   764k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   764k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    171|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    171|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 23, False: 148]
  ------------------
  105|     23|      this->normal_prediction_mode_ = mode;
  106|     23|      return true;
  107|    148|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 148, False: 0]
  ------------------
  108|    148|      this->normal_prediction_mode_ = mode;
  109|    148|      return true;
  110|    148|    }
  111|      0|    return false;
  112|    171|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   209k|                             DataTypeT *prediction) override {
   42|   209k|    DRACO_DCHECK(this->IsInitialized());
   43|   209k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   209k|    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|   209k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   209k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   209k|    VectorD<int64_t, 3> normal;
   53|   209k|    CornerIndex c_next, c_prev;
   54|  1.45M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.24M, False: 209k]
  ------------------
   55|       |      // Getting corners.
   56|  1.24M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 132, False: 1.24M]
  ------------------
   57|    132|        c_next = corner_table->Next(corner_id);
   58|    132|        c_prev = corner_table->Previous(corner_id);
   59|  1.24M|      } else {
   60|  1.24M|        c_next = corner_table->Next(cit.Corner());
   61|  1.24M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.24M|      }
   63|  1.24M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.24M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.24M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.24M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.24M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.24M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.24M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.24M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.24M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.24M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.24M|      cit.Next();
   81|  1.24M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   209k|    constexpr int64_t upper_bound = 1 << 29;
   85|   209k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 88, False: 209k]
  ------------------
   86|     88|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     88|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 24, False: 64]
  ------------------
   88|     24|        const int64_t quotient = abs_sum / upper_bound;
   89|     24|        normal = normal / quotient;
   90|     24|      }
   91|   209k|    } else {
   92|   209k|      const int64_t abs_sum = normal.AbsSum();
   93|   209k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 88.6k, False: 120k]
  ------------------
   94|  88.6k|        const int64_t quotient = abs_sum / upper_bound;
   95|  88.6k|        normal = normal / quotient;
   96|  88.6k|      }
   97|   209k|    }
   98|   209k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   209k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   209k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   209k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   209k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    406|      : Base(md) {
   35|    406|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    406|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    598|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    598|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 162, False: 436]
  ------------------
  105|    162|      this->normal_prediction_mode_ = mode;
  106|    162|      return true;
  107|    436|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 436, False: 0]
  ------------------
  108|    436|      this->normal_prediction_mode_ = mode;
  109|    436|      return true;
  110|    436|    }
  111|      0|    return false;
  112|    598|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   697k|                             DataTypeT *prediction) override {
   42|   697k|    DRACO_DCHECK(this->IsInitialized());
   43|   697k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   697k|    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|   697k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   697k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   697k|    VectorD<int64_t, 3> normal;
   53|   697k|    CornerIndex c_next, c_prev;
   54|  1.95M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.26M, False: 697k]
  ------------------
   55|       |      // Getting corners.
   56|  1.26M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 354k, False: 906k]
  ------------------
   57|   354k|        c_next = corner_table->Next(corner_id);
   58|   354k|        c_prev = corner_table->Previous(corner_id);
   59|   906k|      } else {
   60|   906k|        c_next = corner_table->Next(cit.Corner());
   61|   906k|        c_prev = corner_table->Previous(cit.Corner());
   62|   906k|      }
   63|  1.26M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.26M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.26M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.26M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.26M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.26M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.26M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.26M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.26M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.26M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.26M|      cit.Next();
   81|  1.26M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   697k|    constexpr int64_t upper_bound = 1 << 29;
   85|   697k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 59.9k, False: 637k]
  ------------------
   86|  59.9k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  59.9k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 376, False: 59.5k]
  ------------------
   88|    376|        const int64_t quotient = abs_sum / upper_bound;
   89|    376|        normal = normal / quotient;
   90|    376|      }
   91|   637k|    } else {
   92|   637k|      const int64_t abs_sum = normal.AbsSum();
   93|   637k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.81k, False: 635k]
  ------------------
   94|  1.81k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.81k|        normal = normal / quotient;
   96|  1.81k|      }
   97|   637k|    }
   98|   697k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   697k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   697k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   697k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   697k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    402|      : Base(md) {
   35|    402|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    402|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    530|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    530|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 117, False: 413]
  ------------------
  105|    117|      this->normal_prediction_mode_ = mode;
  106|    117|      return true;
  107|    413|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 413, False: 0]
  ------------------
  108|    413|      this->normal_prediction_mode_ = mode;
  109|    413|      return true;
  110|    413|    }
  111|      0|    return false;
  112|    530|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   193k|                             DataTypeT *prediction) override {
   42|   193k|    DRACO_DCHECK(this->IsInitialized());
   43|   193k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   193k|    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|   193k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   193k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   193k|    VectorD<int64_t, 3> normal;
   53|   193k|    CornerIndex c_next, c_prev;
   54|  1.32M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.12M, False: 193k]
  ------------------
   55|       |      // Getting corners.
   56|  1.12M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 466k, False: 661k]
  ------------------
   57|   466k|        c_next = corner_table->Next(corner_id);
   58|   466k|        c_prev = corner_table->Previous(corner_id);
   59|   661k|      } else {
   60|   661k|        c_next = corner_table->Next(cit.Corner());
   61|   661k|        c_prev = corner_table->Previous(cit.Corner());
   62|   661k|      }
   63|  1.12M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.12M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.12M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.12M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.12M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.12M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.12M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.12M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.12M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.12M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.12M|      cit.Next();
   81|  1.12M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   193k|    constexpr int64_t upper_bound = 1 << 29;
   85|   193k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 78.6k, False: 114k]
  ------------------
   86|  78.6k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  78.6k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 263, False: 78.3k]
  ------------------
   88|    263|        const int64_t quotient = abs_sum / upper_bound;
   89|    263|        normal = normal / quotient;
   90|    263|      }
   91|   114k|    } else {
   92|   114k|      const int64_t abs_sum = normal.AbsSum();
   93|   114k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.26k, False: 112k]
  ------------------
   94|  2.26k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.26k|        normal = normal / quotient;
   96|  2.26k|      }
   97|   114k|    }
   98|   193k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   193k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   193k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   193k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   193k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    199|      : Base(md) {
   35|    199|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    199|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    161|      : Base(md) {
   35|    161|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    161|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    191|      : Base(md) {
   35|    191|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    191|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    147|      : Base(md) {
   35|    147|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    147|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.24M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.24M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.24M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.24M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.24M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.24M|    return GetPositionForDataId(data_id);
   77|  2.24M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.24M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.24M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.24M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.24M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.24M|    VectorD<int64_t, 3> pos;
   68|  2.24M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.24M|    return pos;
   70|  2.24M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    197|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    197|    pos_attribute_ = &position_attribute;
   43|    197|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    180|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    180|    entry_to_point_id_map_ = map;
   46|    180|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.70M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.70M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.70M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.70M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.70M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.70M|    return GetPositionForDataId(data_id);
   77|  2.70M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.70M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.70M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.70M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.70M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.70M|    VectorD<int64_t, 3> pos;
   68|  2.70M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.70M|    return pos;
   70|  2.70M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    156|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    156|    pos_attribute_ = &position_attribute;
   43|    156|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    145|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    145|    entry_to_point_id_map_ = map;
   46|    145|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.35M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.35M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.35M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.35M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.35M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.35M|    return GetPositionForDataId(data_id);
   77|  2.35M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.35M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.35M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.35M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.35M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.35M|    VectorD<int64_t, 3> pos;
   68|  2.35M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.35M|    return pos;
   70|  2.35M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    190|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    190|    pos_attribute_ = &position_attribute;
   43|    190|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    173|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    173|    entry_to_point_id_map_ = map;
   46|    173|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.70M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.70M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.70M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.70M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.70M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.70M|    return GetPositionForDataId(data_id);
   77|  2.70M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.70M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.70M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.70M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.70M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.70M|    VectorD<int64_t, 3> pos;
   68|  2.70M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.70M|    return pos;
   70|  2.70M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    145|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    145|    pos_attribute_ = &position_attribute;
   43|    145|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    134|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    134|    entry_to_point_id_map_ = map;
   46|    134|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    406|      : pos_attribute_(nullptr),
   36|    406|        entry_to_point_id_map_(nullptr),
   37|    406|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    406|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.22M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.22M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.22M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.22M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.22M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.22M|    return GetPositionForDataId(data_id);
   77|  3.22M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  3.22M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.22M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.22M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.22M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.22M|    VectorD<int64_t, 3> pos;
   68|  3.22M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.22M|    return pos;
   70|  3.22M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    402|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    402|    pos_attribute_ = &position_attribute;
   43|    402|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    340|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    340|    entry_to_point_id_map_ = map;
   46|    340|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    402|      : pos_attribute_(nullptr),
   36|    402|        entry_to_point_id_map_(nullptr),
   37|    402|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    402|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.44M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.44M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.44M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.44M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.44M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.44M|    return GetPositionForDataId(data_id);
   77|  2.44M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.44M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.44M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.44M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.44M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.44M|    VectorD<int64_t, 3> pos;
   68|  2.44M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.44M|    return pos;
   70|  2.44M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    399|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    399|    pos_attribute_ = &position_attribute;
   43|    399|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    330|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    330|    entry_to_point_id_map_ = map;
   46|    330|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    199|      : pos_attribute_(nullptr),
   36|    199|        entry_to_point_id_map_(nullptr),
   37|    199|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    199|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    161|      : pos_attribute_(nullptr),
   36|    161|        entry_to_point_id_map_(nullptr),
   37|    161|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    161|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    191|      : pos_attribute_(nullptr),
   36|    191|        entry_to_point_id_map_(nullptr),
   37|    191|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    191|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    147|      : pos_attribute_(nullptr),
   36|    147|        entry_to_point_id_map_(nullptr),
   37|    147|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    147|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    299|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    299|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    280|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    280|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    280|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    280|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    280|      new DataTypeT[num_components]());
   70|       |
   71|    280|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    280|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    280|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    280|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    280|  const int corner_map_size =
   78|    280|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   519k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 518k, False: 280]
  ------------------
   80|   518k|    const CornerIndex start_corner_id =
   81|   518k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   518k|    CornerIndex corner_id(start_corner_id);
   84|   518k|    int num_parallelograms = 0;
   85|  26.2M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 25.7M, False: 518k]
  ------------------
   86|  25.7M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  25.7M|    }
   88|  1.69M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 1.18M, False: 518k]
  ------------------
   89|  1.18M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 265k, False: 914k]
  ------------------
   90|  1.18M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  1.18M|              num_components, parallelogram_pred_vals.get())) {
   92|  22.3M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 22.0M, False: 265k]
  ------------------
   93|  22.0M|          pred_vals[c] =
   94|  22.0M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  22.0M|        }
   96|   265k|        ++num_parallelograms;
   97|   265k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  1.18M|      corner_id = table->SwingRight(corner_id);
  101|  1.18M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 131k, False: 1.04M]
  ------------------
  102|   131k|        corner_id = kInvalidCornerIndex;
  103|   131k|      }
  104|  1.18M|    }
  105|       |
  106|   518k|    const int dst_offset = p * num_components;
  107|   518k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 382k, False: 136k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|   382k|      const int src_offset = (p - 1) * num_components;
  111|   382k|      this->transform().ComputeOriginalValue(
  112|   382k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   382k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  11.4M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 11.2M, False: 136k]
  ------------------
  116|  11.2M|        pred_vals[c] /= num_parallelograms;
  117|  11.2M|      }
  118|   136k|      this->transform().ComputeOriginalValue(
  119|   136k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   136k|    }
  121|   518k|  }
  122|    280|  return true;
  123|    280|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    541|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    541|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    498|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    498|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    498|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    498|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    498|      new DataTypeT[num_components]());
   70|       |
   71|    498|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    498|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    498|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    498|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    498|  const int corner_map_size =
   78|    498|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   704k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 703k, False: 498]
  ------------------
   80|   703k|    const CornerIndex start_corner_id =
   81|   703k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   703k|    CornerIndex corner_id(start_corner_id);
   84|   703k|    int num_parallelograms = 0;
   85|  23.4M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 22.7M, False: 703k]
  ------------------
   86|  22.7M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  22.7M|    }
   88|  4.85M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 4.14M, False: 703k]
  ------------------
   89|  4.14M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 1.36M, False: 2.78M]
  ------------------
   90|  4.14M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  4.14M|              num_components, parallelogram_pred_vals.get())) {
   92|  45.6M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 44.2M, False: 1.36M]
  ------------------
   93|  44.2M|          pred_vals[c] =
   94|  44.2M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  44.2M|        }
   96|  1.36M|        ++num_parallelograms;
   97|  1.36M|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  4.14M|      corner_id = table->SwingRight(corner_id);
  101|  4.14M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 686k, False: 3.46M]
  ------------------
  102|   686k|        corner_id = kInvalidCornerIndex;
  103|   686k|      }
  104|  4.14M|    }
  105|       |
  106|   703k|    const int dst_offset = p * num_components;
  107|   703k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 2.58k, False: 701k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  2.58k|      const int src_offset = (p - 1) * num_components;
  111|  2.58k|      this->transform().ComputeOriginalValue(
  112|  2.58k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   701k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  23.3M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 22.6M, False: 701k]
  ------------------
  116|  22.6M|        pred_vals[c] /= num_parallelograms;
  117|  22.6M|      }
  118|   701k|      this->transform().ComputeOriginalValue(
  119|   701k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   701k|    }
  121|   703k|  }
  122|    498|  return true;
  123|    498|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  3.80M|    int num_components, DataTypeT *out_prediction) {
   49|  3.80M|  const CornerIndex oci = table->Opposite(ci);
   50|  3.80M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 2.46M, False: 1.33M]
  ------------------
   51|  2.46M|    return false;
   52|  2.46M|  }
   53|  1.33M|  int vert_opp, vert_next, vert_prev;
   54|  1.33M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  1.33M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  1.33M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 808k, False: 527k]
  |  Branch (56:35): [True: 663k, False: 145k]
  ------------------
   57|   663k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 652k, False: 10.7k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   652k|    const int v_opp_off = vert_opp * num_components;
   60|   652k|    const int v_next_off = vert_next * num_components;
   61|   652k|    const int v_prev_off = vert_prev * num_components;
   62|  37.5M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 36.9M, False: 652k]
  ------------------
   63|  36.9M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  36.9M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  36.9M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  36.9M|      const int64_t result =
   67|  36.9M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  36.9M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  36.9M|    }
   71|   652k|    return true;
   72|   652k|  }
   73|   682k|  return false;  // Not all data is available for prediction
   74|  1.33M|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  1.33M|    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.33M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  1.33M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  1.33M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  1.33M|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  5.36M|    int num_components, DataTypeT *out_prediction) {
   49|  5.36M|  const CornerIndex oci = table->Opposite(ci);
   50|  5.36M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 40.2k, False: 5.32M]
  ------------------
   51|  40.2k|    return false;
   52|  40.2k|  }
   53|  5.32M|  int vert_opp, vert_next, vert_prev;
   54|  5.32M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  5.32M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  5.32M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 2.75M, False: 2.57M]
  |  Branch (56:35): [True: 2.14M, False: 614k]
  ------------------
   57|  2.14M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 1.90M, False: 232k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  1.90M|    const int v_opp_off = vert_opp * num_components;
   60|  1.90M|    const int v_next_off = vert_next * num_components;
   61|  1.90M|    const int v_prev_off = vert_prev * num_components;
   62|  84.2M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 82.3M, False: 1.90M]
  ------------------
   63|  82.3M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  82.3M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  82.3M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  82.3M|      const int64_t result =
   67|  82.3M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  82.3M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  82.3M|    }
   71|  1.90M|    return true;
   72|  1.90M|  }
   73|  3.42M|  return false;  // Not all data is available for prediction
   74|  5.32M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  5.32M|    int *next_entry, int *prev_entry) {
   32|       |  // One vertex of the input |table| correspond to exactly one attribute value
   33|       |  // entry. The |table| can be either CornerTable for per-vertex attributes,
   34|       |  // or MeshAttributeCornerTable for attributes with interior seams.
   35|  5.32M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  5.32M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  5.32M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  5.32M|}

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

_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   36|    235|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   37|    235|            attribute, transform, mesh_data),
   38|    235|        predictor_(mesh_data) {}
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   60|    467|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   62|    235|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   63|    235|    DRACO_DCHECK_EQ(i, 0);
   64|    235|    (void)i;
   65|    235|    return GeometryAttribute::POSITION;
   66|    235|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   68|    233|  bool SetParentAttribute(const PointAttribute *att) override {
   69|    233|    if (!att || att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (69:9): [True: 0, False: 233]
  |  Branch (69:17): [True: 0, False: 233]
  ------------------
   70|      0|      return false;  // Invalid attribute type.
   71|      0|    }
   72|    233|    if (att->num_components() != 3) {
  ------------------
  |  Branch (72:9): [True: 1, False: 232]
  ------------------
   73|      1|      return false;  // Currently works only for 3 component positions.
   74|      1|    }
   75|    232|    predictor_.SetPositionAttribute(*att);
   76|    232|    return true;
   77|    233|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  118|    231|                                                                *buffer) {
  119|       |  // Decode the delta coded orientations.
  120|    231|  int32_t num_orientations = 0;
  121|    231|  if (!buffer->Decode(&num_orientations) || num_orientations < 0) {
  ------------------
  |  Branch (121:7): [True: 2, False: 229]
  |  Branch (121:45): [True: 6, False: 223]
  ------------------
  122|      8|    return false;
  123|      8|  }
  124|    223|  predictor_.ResizeOrientations(num_orientations);
  125|    223|  bool last_orientation = true;
  126|    223|  RAnsBitDecoder decoder;
  127|    223|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (127:7): [True: 18, False: 205]
  ------------------
  128|     18|    return false;
  129|     18|  }
  130|  2.05G|  for (int i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (130:19): [True: 2.05G, False: 205]
  ------------------
  131|  2.05G|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (131:9): [True: 558M, False: 1.49G]
  ------------------
  132|   558M|      last_orientation = !last_orientation;
  133|   558M|    }
  134|  2.05G|    predictor_.set_orientation(i, last_orientation);
  135|  2.05G|  }
  136|    205|  decoder.EndDecoding();
  137|    205|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  138|    205|                                     MeshDataT>::DecodePredictionData(buffer);
  139|    223|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   90|    194|                                      const PointIndex *entry_to_point_id_map) {
   91|    194|  if (num_components != MeshPredictionSchemeTexCoordsPortablePredictor<
  ------------------
  |  Branch (91:7): [True: 7, False: 187]
  ------------------
   92|    194|                            DataTypeT, MeshDataT>::kNumComponents) {
   93|      7|    return false;
   94|      7|  }
   95|    187|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
   96|    187|  this->transform().Init(num_components);
   97|       |
   98|    187|  const int corner_map_size =
   99|    187|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  100|   403k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (100:19): [True: 403k, False: 93]
  ------------------
  101|   403k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  102|   403k|    if (!predictor_.template ComputePredictedValue<false>(corner_id, out_data,
  ------------------
  |  Branch (102:9): [True: 94, False: 403k]
  ------------------
  103|   403k|                                                          p)) {
  104|     94|      return false;
  105|     94|    }
  106|       |
  107|   403k|    const int dst_offset = p * num_components;
  108|   403k|    this->transform().ComputeOriginalValue(predictor_.predicted_value(),
  109|   403k|                                           in_corr + dst_offset,
  110|   403k|                                           out_data + dst_offset);
  111|   403k|  }
  112|     93|  return true;
  113|    187|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   36|    247|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   37|    247|            attribute, transform, mesh_data),
   38|    247|        predictor_(mesh_data) {}
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   60|    491|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   62|    247|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   63|    247|    DRACO_DCHECK_EQ(i, 0);
   64|    247|    (void)i;
   65|    247|    return GeometryAttribute::POSITION;
   66|    247|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   68|    246|  bool SetParentAttribute(const PointAttribute *att) override {
   69|    246|    if (!att || att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (69:9): [True: 0, False: 246]
  |  Branch (69:17): [True: 0, False: 246]
  ------------------
   70|      0|      return false;  // Invalid attribute type.
   71|      0|    }
   72|    246|    if (att->num_components() != 3) {
  ------------------
  |  Branch (72:9): [True: 2, False: 244]
  ------------------
   73|      2|      return false;  // Currently works only for 3 component positions.
   74|      2|    }
   75|    244|    predictor_.SetPositionAttribute(*att);
   76|    244|    return true;
   77|    246|  }
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  118|    242|                                                                *buffer) {
  119|       |  // Decode the delta coded orientations.
  120|    242|  int32_t num_orientations = 0;
  121|    242|  if (!buffer->Decode(&num_orientations) || num_orientations < 0) {
  ------------------
  |  Branch (121:7): [True: 2, False: 240]
  |  Branch (121:45): [True: 2, False: 238]
  ------------------
  122|      4|    return false;
  123|      4|  }
  124|    238|  predictor_.ResizeOrientations(num_orientations);
  125|    238|  bool last_orientation = true;
  126|    238|  RAnsBitDecoder decoder;
  127|    238|  if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (127:7): [True: 8, False: 230]
  ------------------
  128|      8|    return false;
  129|      8|  }
  130|  8.27G|  for (int i = 0; i < num_orientations; ++i) {
  ------------------
  |  Branch (130:19): [True: 8.27G, False: 230]
  ------------------
  131|  8.27G|    if (!decoder.DecodeNextBit()) {
  ------------------
  |  Branch (131:9): [True: 1.52G, False: 6.75G]
  ------------------
  132|  1.52G|      last_orientation = !last_orientation;
  133|  1.52G|    }
  134|  8.27G|    predictor_.set_orientation(i, last_orientation);
  135|  8.27G|  }
  136|    230|  decoder.EndDecoding();
  137|    230|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  138|    230|                                     MeshDataT>::DecodePredictionData(buffer);
  139|    238|}
_ZN5draco44MeshPredictionSchemeTexCoordsPortableDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   90|    189|                                      const PointIndex *entry_to_point_id_map) {
   91|    189|  if (num_components != MeshPredictionSchemeTexCoordsPortablePredictor<
  ------------------
  |  Branch (91:7): [True: 4, False: 185]
  ------------------
   92|    189|                            DataTypeT, MeshDataT>::kNumComponents) {
   93|      4|    return false;
   94|      4|  }
   95|    185|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
   96|    185|  this->transform().Init(num_components);
   97|       |
   98|    185|  const int corner_map_size =
   99|    185|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  100|   172k|  for (int p = 0; p < corner_map_size; ++p) {
  ------------------
  |  Branch (100:19): [True: 172k, False: 111]
  ------------------
  101|   172k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
  102|   172k|    if (!predictor_.template ComputePredictedValue<false>(corner_id, out_data,
  ------------------
  |  Branch (102:9): [True: 74, False: 172k]
  ------------------
  103|   172k|                                                          p)) {
  104|     74|      return false;
  105|     74|    }
  106|       |
  107|   172k|    const int dst_offset = p * num_components;
  108|   172k|    this->transform().ComputeOriginalValue(predictor_.predicted_value(),
  109|   172k|                                           in_corr + dst_offset,
  110|   172k|                                           out_data + dst_offset);
  111|   172k|  }
  112|    111|  return true;
  113|    185|}

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    235|      : pos_attribute_(nullptr),
   39|    235|        entry_to_point_id_map_(nullptr),
   40|    235|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    232|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    232|    pos_attribute_ = &position_attribute;
   43|    232|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    223|  void ResizeOrientations(int num_orientations) {
   74|    223|    orientations_.resize(num_orientations);
   75|    223|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|  2.05G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    187|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    187|    entry_to_point_id_map_ = map;
   46|    187|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   403k|                                                 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|   403k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   403k|  const CornerIndex prev_corner_id =
   99|   403k|      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|   403k|  int next_data_id, prev_data_id;
  103|       |
  104|   403k|  int next_vert_id, prev_vert_id;
  105|   403k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   403k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   403k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   403k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   403k|  typedef VectorD<int64_t, 2> Vec2;
  112|   403k|  typedef VectorD<int64_t, 3> Vec3;
  113|   403k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   403k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 280k, False: 122k]
  |  Branch (115:33): [True: 157k, False: 122k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   157k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   157k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   157k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 142k, False: 14.7k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   142k|      predicted_value_[0] = p_uv[0];
  122|   142k|      predicted_value_[1] = p_uv[1];
  123|   142k|      return true;
  124|   142k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  14.7k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  14.7k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  14.7k|    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|  14.7k|    const Vec3 pn = prev_pos - next_pos;
  146|  14.7k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  14.7k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 789, False: 13.9k]
  ------------------
  148|       |      // Compute the projection of C onto PN by computing dot product of CN with
  149|       |      // PN and normalizing it by length of PN. This gives us a factor |s| where
  150|       |      // |s = PN.Dot(CN) / PN.SquaredNorm2()|. This factor can be used to
  151|       |      // compute X in UV space |X_UV| as |X_UV = N_UV + s * PN_UV|.
  152|    789|      const Vec3 cn = tip_pos - next_pos;
  153|    789|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|    789|      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|    789|      const int64_t n_uv_absmax_element =
  164|    789|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|    789|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 42, False: 747]
  ------------------
  166|    789|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     42|        return false;
  169|     42|      }
  170|    747|      const int64_t pn_uv_absmax_element =
  171|    747|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|    747|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 29, False: 718]
  ------------------
  173|    747|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     29|        return false;
  176|     29|      }
  177|    718|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|    718|      const int64_t pn_absmax_element =
  179|    718|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|    718|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 19, False: 699]
  ------------------
  181|    718|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|     19|        return false;
  184|     19|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|    699|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|    699|      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|    699|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|    699|      const uint64_t norm_squared =
  207|    699|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|    699|      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|    699|      Vec2 predicted_uv;
  214|    699|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 699]
  ------------------
  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|    699|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|    699|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 4, False: 695]
  ------------------
  233|      4|          return false;
  234|      4|        }
  235|    695|        const bool orientation = orientations_.back();
  236|    695|        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|    695|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 277, False: 418]
  ------------------
  240|    277|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    418|        } else {
  242|    418|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    418|        }
  244|    695|      }
  245|    695|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|    695|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|    695|      return true;
  248|    699|    }
  249|  14.7k|  }
  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|   259k|  int data_offset = 0;
  254|   259k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 136k, False: 122k]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|   136k|    data_offset = prev_data_id * kNumComponents;
  257|   136k|  }
  258|   259k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 13.9k, False: 245k]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  13.9k|    data_offset = next_data_id * kNumComponents;
  261|   245k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|   245k|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 245k, False: 187]
  ------------------
  265|   245k|      data_offset = (data_id - 1) * kNumComponents;
  266|   245k|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    561|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 374, False: 187]
  ------------------
  269|    374|        predicted_value_[i] = 0;
  270|    374|      }
  271|    187|      return true;
  272|    187|    }
  273|   245k|  }
  274|   778k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 519k, False: 259k]
  ------------------
  275|   519k|    predicted_value_[i] = data[data_offset + i];
  276|   519k|  }
  277|   259k|  return true;
  278|   259k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   315k|                                            const DataTypeT *data) const {
   59|   315k|    const int data_offset = entry_id * kNumComponents;
   60|   315k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   315k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  44.3k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  44.3k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  44.3k|    VectorD<int64_t, 3> pos;
   52|  44.3k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  44.3k|                                 &pos[0]);
   54|  44.3k|    return pos;
   55|  44.3k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|   403k|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    247|      : pos_attribute_(nullptr),
   39|    247|        entry_to_point_id_map_(nullptr),
   40|    247|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    244|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    244|    pos_attribute_ = &position_attribute;
   43|    244|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    238|  void ResizeOrientations(int num_orientations) {
   74|    238|    orientations_.resize(num_orientations);
   75|    238|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  8.27G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    185|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    185|    entry_to_point_id_map_ = map;
   46|    185|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   172k|                                                 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|   172k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   172k|  const CornerIndex prev_corner_id =
   99|   172k|      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|   172k|  int next_data_id, prev_data_id;
  103|       |
  104|   172k|  int next_vert_id, prev_vert_id;
  105|   172k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   172k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   172k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   172k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   172k|  typedef VectorD<int64_t, 2> Vec2;
  112|   172k|  typedef VectorD<int64_t, 3> Vec3;
  113|   172k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   172k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 171k, False: 265]
  |  Branch (115:33): [True: 171k, False: 268]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   171k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   171k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   171k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 163k, False: 8.59k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   163k|      predicted_value_[0] = p_uv[0];
  122|   163k|      predicted_value_[1] = p_uv[1];
  123|   163k|      return true;
  124|   163k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  8.59k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  8.59k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  8.59k|    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|  8.59k|    const Vec3 pn = prev_pos - next_pos;
  146|  8.59k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  8.59k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.53k, False: 7.05k]
  ------------------
  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.53k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.53k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.53k|      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.53k|      const int64_t n_uv_absmax_element =
  164|  1.53k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.53k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 25, False: 1.51k]
  ------------------
  166|  1.53k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     25|        return false;
  169|     25|      }
  170|  1.51k|      const int64_t pn_uv_absmax_element =
  171|  1.51k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.51k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 33, False: 1.48k]
  ------------------
  173|  1.51k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     33|        return false;
  176|     33|      }
  177|  1.48k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.48k|      const int64_t pn_absmax_element =
  179|  1.48k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.48k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 12, False: 1.46k]
  ------------------
  181|  1.48k|          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.46k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.46k|      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.46k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.46k|      const uint64_t norm_squared =
  207|  1.46k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.46k|      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.46k|      Vec2 predicted_uv;
  214|  1.46k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.46k]
  ------------------
  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.46k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.46k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 4, False: 1.46k]
  ------------------
  233|      4|          return false;
  234|      4|        }
  235|  1.46k|        const bool orientation = orientations_.back();
  236|  1.46k|        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.46k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 427, False: 1.03k]
  ------------------
  240|    427|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|  1.03k|        } else {
  242|  1.03k|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|  1.03k|        }
  244|  1.46k|      }
  245|  1.46k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.46k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.46k|      return true;
  248|  1.46k|    }
  249|  8.59k|  }
  250|       |  // Else we don't have available textures on both corners or the position data
  251|       |  // is invalid. For such cases we can't use positions for predicting the uv
  252|       |  // value and we resort to delta coding.
  253|  7.59k|  int data_offset = 0;
  254|  7.59k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 7.32k, False: 265]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  7.32k|    data_offset = prev_data_id * kNumComponents;
  257|  7.32k|  }
  258|  7.59k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 7.06k, False: 523]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  7.06k|    data_offset = next_data_id * kNumComponents;
  261|  7.06k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|    523|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 338, False: 185]
  ------------------
  265|    338|      data_offset = (data_id - 1) * kNumComponents;
  266|    338|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    555|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 370, False: 185]
  ------------------
  269|    370|        predicted_value_[i] = 0;
  270|    370|      }
  271|    185|      return true;
  272|    185|    }
  273|    523|  }
  274|  22.2k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 14.8k, False: 7.40k]
  ------------------
  275|  14.8k|    predicted_value_[i] = data[data_offset + i];
  276|  14.8k|  }
  277|  7.40k|  return true;
  278|  7.59k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   343k|                                            const DataTypeT *data) const {
   59|   343k|    const int data_offset = entry_id * kNumComponents;
   60|   343k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   343k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|  25.7k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  25.7k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  25.7k|    VectorD<int64_t, 3> pos;
   52|  25.7k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  25.7k|                                 &pos[0]);
   54|  25.7k|    return pos;
   55|  25.7k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   172k|  const DataTypeT *predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    188|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    525|  bool AreCorrectionsPositive() override {
   71|    525|    return transform_.AreCorrectionsPositive();
   72|    525|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    173|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    173|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 34, False: 139]
  ------------------
   50|     34|      return false;
   51|     34|    }
   52|    139|    return true;
   53|    173|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|  1.16M|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    230|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    551|  bool AreCorrectionsPositive() override {
   71|    551|    return transform_.AreCorrectionsPositive();
   72|    551|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    217|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    217|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 16, False: 201]
  ------------------
   50|     16|      return false;
   51|     16|    }
   52|    201|    return true;
   53|    217|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  1.39M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  5.23k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  3.55k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  4.99k|  bool AreCorrectionsPositive() override {
   71|  4.99k|    return transform_.AreCorrectionsPositive();
   72|  4.99k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  3.86k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  3.86k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 236, False: 3.62k]
  ------------------
   50|    236|      return false;
   51|    236|    }
   52|  3.62k|    return true;
   53|  3.86k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  7.03M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    548|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    568|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    548|                                 const PointCloudDecoder *decoder) {
  188|    548|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    548|      method, att_id, decoder, TransformT());
  190|    548|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    548|                                 const TransformT &transform) {
  156|    548|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 548]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    548|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    548|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 548, 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|    548|    const MeshDecoder *const mesh_decoder =
  167|    548|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    548|    auto ret = CreateMeshPredictionScheme<
  170|    548|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    548|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    548|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    548|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 360, False: 188]
  ------------------
  174|    360|      return ret;
  175|    360|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    548|  }
  178|       |  // Create delta decoder.
  179|    188|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    188|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    548|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    214|      uint16_t bitstream_version) {
  143|    214|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    214|        method, attribute, transform, mesh_data, bitstream_version);
  145|    214|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    214|        uint16_t bitstream_version) {
  127|    214|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 199, False: 15]
  ------------------
  128|    199|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    199|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    199|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    199|                                                  mesh_data));
  132|    199|      }
  133|     15|      return nullptr;
  134|    214|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    165|      uint16_t bitstream_version) {
  143|    165|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    165|        method, attribute, transform, mesh_data, bitstream_version);
  145|    165|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    165|        uint16_t bitstream_version) {
  127|    165|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 161, False: 4]
  ------------------
  128|    161|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    161|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    161|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    161|                                                  mesh_data));
  132|    161|      }
  133|      4|      return nullptr;
  134|    165|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    568|                                 const PointCloudDecoder *decoder) {
  188|    568|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    568|      method, att_id, decoder, TransformT());
  190|    568|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    568|                                 const TransformT &transform) {
  156|    568|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 568]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    568|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    568|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 568, 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|    568|    const MeshDecoder *const mesh_decoder =
  167|    568|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    568|    auto ret = CreateMeshPredictionScheme<
  170|    568|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    568|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    568|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    568|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 338, False: 230]
  ------------------
  174|    338|      return ret;
  175|    338|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    568|  }
  178|       |  // Create delta decoder.
  179|    230|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    230|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    568|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    193|      uint16_t bitstream_version) {
  143|    193|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    193|        method, attribute, transform, mesh_data, bitstream_version);
  145|    193|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    193|        uint16_t bitstream_version) {
  111|    193|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 191, False: 2]
  ------------------
  112|    191|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    191|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    191|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    191|                                                  mesh_data));
  116|    191|      }
  117|      2|      return nullptr;
  118|    193|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    150|      uint16_t bitstream_version) {
  143|    150|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    150|        method, attribute, transform, mesh_data, bitstream_version);
  145|    150|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    150|        uint16_t bitstream_version) {
  111|    150|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 147, False: 3]
  ------------------
  112|    147|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    147|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    147|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    147|                                                  mesh_data));
  116|    147|      }
  117|      3|      return nullptr;
  118|    150|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  5.23k|                                 const PointCloudDecoder *decoder) {
  188|  5.23k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  5.23k|      method, att_id, decoder, TransformT());
  190|  5.23k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  5.23k|                                 const TransformT &transform) {
  156|  5.23k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 5.23k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  5.23k|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|  5.23k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 5.23k, 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.23k|    const MeshDecoder *const mesh_decoder =
  167|  5.23k|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|  5.23k|    auto ret = CreateMeshPredictionScheme<
  170|  5.23k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  5.23k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  5.23k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  5.23k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 4.76k, False: 464]
  ------------------
  174|  4.76k|      return ret;
  175|  4.76k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  5.23k|  }
  178|       |  // Create delta decoder.
  179|    464|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    464|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  5.23k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.37k|      uint16_t bitstream_version) {
  143|  2.37k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.37k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.37k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.37k|        uint16_t bitstream_version) {
   53|  2.37k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 808, False: 1.56k]
  ------------------
   54|    808|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    808|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    808|                                                         MeshDataT>(
   57|    808|                attribute, transform, mesh_data));
   58|    808|      }
   59|  1.56k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.56k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 299, False: 1.26k]
  ------------------
   61|    299|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    299|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    299|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    299|                                                  mesh_data));
   65|    299|      }
   66|  1.26k|#endif
   67|  1.26k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 402, False: 862]
  ------------------
   68|    402|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    402|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    402|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    402|                                                  mesh_data));
   72|    402|      }
   73|    862|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    862|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 221, False: 641]
  ------------------
   75|    221|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    221|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    221|                                                     MeshDataT>(
   78|    221|                attribute, transform, mesh_data, bitstream_version));
   79|    221|      }
   80|    641|#endif
   81|    641|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 235, False: 406]
  ------------------
   82|    235|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    235|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    235|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    235|                                                  mesh_data));
   86|    235|      }
   87|    406|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    406|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 406, False: 0]
  ------------------
   89|    406|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    406|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    406|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    406|                                                  mesh_data));
   93|    406|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.37k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.39k|      uint16_t bitstream_version) {
  143|  2.39k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.39k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.39k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.39k|        uint16_t bitstream_version) {
   53|  2.39k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 578, False: 1.81k]
  ------------------
   54|    578|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    578|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    578|                                                         MeshDataT>(
   57|    578|                attribute, transform, mesh_data));
   58|    578|      }
   59|  1.81k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.81k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 541, False: 1.27k]
  ------------------
   61|    541|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    541|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    541|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    541|                                                  mesh_data));
   65|    541|      }
   66|  1.27k|#endif
   67|  1.27k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 463, False: 815]
  ------------------
   68|    463|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    463|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    463|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    463|                                                  mesh_data));
   72|    463|      }
   73|    815|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    815|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 166, False: 649]
  ------------------
   75|    166|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    166|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    166|                                                     MeshDataT>(
   78|    166|                attribute, transform, mesh_data, bitstream_version));
   79|    166|      }
   80|    649|#endif
   81|    649|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 247, False: 402]
  ------------------
   82|    247|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    247|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    247|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    247|                                                  mesh_data));
   86|    247|      }
   87|    402|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    402|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 402, False: 0]
  ------------------
   89|    402|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    402|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    402|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    402|                                                  mesh_data));
   93|    402|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.39k|    }

_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    139|    const PointIndex *) {
   50|    139|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    139|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    139|  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|   234k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 234k, False: 139]
  ------------------
   57|   234k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|   234k|                                           in_corr + i, out_data + i);
   59|   234k|  }
   60|    139|  return true;
   61|    139|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    201|    const PointIndex *) {
   50|    201|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    201|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    201|  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|   422k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 422k, False: 201]
  ------------------
   57|   422k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|   422k|                                           in_corr + i, out_data + i);
   59|   422k|  }
   60|    201|  return true;
   61|    201|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    464|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   49|    366|    const PointIndex *) {
   50|    366|  this->transform().Init(num_components);
   51|       |  // Decode the original value for the first element.
   52|    366|  std::unique_ptr<DataTypeT[]> zero_vals(new DataTypeT[num_components]());
   53|    366|  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|   817k|  for (int i = num_components; i < size; i += num_components) {
  ------------------
  |  Branch (56:32): [True: 816k, False: 366]
  ------------------
   57|   816k|    this->transform().ComputeOriginalValue(out_data + i - num_components,
   58|   816k|                                           in_corr + i, out_data + i);
   59|   816k|  }
   60|    366|  return true;
   61|    366|}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    188|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}
_ZN5draco28PredictionSchemeDeltaDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   35|    230|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform) {}

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    548|    uint16_t bitstream_version) {
   38|    548|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    548|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 548, False: 0]
  ------------------
   40|    548|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 93, False: 455]
  ------------------
   41|    455|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 5, False: 450]
  ------------------
   42|    450|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 3, False: 447]
  ------------------
   43|    447|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 1, False: 446]
  ------------------
   44|    446|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 392, False: 54]
  ------------------
   45|    496|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 2, False: 52]
  ------------------
   46|    496|    const CornerTable *const ct = source->GetCornerTable();
   47|    496|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    496|        source->GetAttributeEncodingData(att_id);
   49|    496|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 117, False: 379]
  |  Branch (49:26): [True: 0, False: 379]
  ------------------
   50|       |      // No connectivity data found.
   51|    117|      return nullptr;
   52|    117|    }
   53|       |    // Connectivity data exists.
   54|    379|    const MeshAttributeCornerTable *const att_ct =
   55|    379|        source->GetAttributeCornerTable(att_id);
   56|    379|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 214, False: 165]
  ------------------
   57|    214|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    214|      MeshData md;
   59|    214|      md.Set(source->mesh(), att_ct,
   60|    214|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    214|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    214|      MeshPredictionSchemeFactoryT factory;
   63|    214|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    214|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 199, False: 15]
  ------------------
   65|    199|        return ret;
   66|    199|      }
   67|    214|    } else {
   68|    165|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    165|      MeshData md;
   70|    165|      md.Set(source->mesh(), ct,
   71|    165|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    165|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    165|      MeshPredictionSchemeFactoryT factory;
   74|    165|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    165|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 161, False: 4]
  ------------------
   76|    161|        return ret;
   77|    161|      }
   78|    165|    }
   79|    379|  }
   80|     71|  return nullptr;
   81|    548|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    568|    uint16_t bitstream_version) {
   38|    568|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    568|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 568, False: 0]
  ------------------
   40|    568|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 9, False: 559]
  ------------------
   41|    559|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 27, False: 532]
  ------------------
   42|    532|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 2, False: 530]
  ------------------
   43|    530|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 18, False: 512]
  ------------------
   44|    512|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 393, False: 119]
  ------------------
   45|    495|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 46, False: 73]
  ------------------
   46|    495|    const CornerTable *const ct = source->GetCornerTable();
   47|    495|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    495|        source->GetAttributeEncodingData(att_id);
   49|    495|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 152, False: 343]
  |  Branch (49:26): [True: 0, False: 343]
  ------------------
   50|       |      // No connectivity data found.
   51|    152|      return nullptr;
   52|    152|    }
   53|       |    // Connectivity data exists.
   54|    343|    const MeshAttributeCornerTable *const att_ct =
   55|    343|        source->GetAttributeCornerTable(att_id);
   56|    343|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 193, False: 150]
  ------------------
   57|    193|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    193|      MeshData md;
   59|    193|      md.Set(source->mesh(), att_ct,
   60|    193|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    193|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    193|      MeshPredictionSchemeFactoryT factory;
   63|    193|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    193|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 191, False: 2]
  ------------------
   65|    191|        return ret;
   66|    191|      }
   67|    193|    } else {
   68|    150|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    150|      MeshData md;
   70|    150|      md.Set(source->mesh(), ct,
   71|    150|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    150|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    150|      MeshPredictionSchemeFactoryT factory;
   74|    150|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    150|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 147, False: 3]
  ------------------
   76|    147|        return ret;
   77|    147|      }
   78|    150|    }
   79|    343|  }
   80|     78|  return nullptr;
   81|    568|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  5.23k|    uint16_t bitstream_version) {
   38|  5.23k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  5.23k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 5.23k, False: 0]
  ------------------
   40|  5.23k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 1.49k, False: 3.73k]
  ------------------
   41|  3.73k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 916, False: 2.82k]
  ------------------
   42|  2.82k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 894, False: 1.92k]
  ------------------
   43|  1.92k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 491, False: 1.43k]
  ------------------
   44|  1.43k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 816, False: 622]
  ------------------
   45|  5.00k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 391, False: 231]
  ------------------
   46|  5.00k|    const CornerTable *const ct = source->GetCornerTable();
   47|  5.00k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  5.00k|        source->GetAttributeEncodingData(att_id);
   49|  5.00k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 233, False: 4.76k]
  |  Branch (49:26): [True: 0, False: 4.76k]
  ------------------
   50|       |      // No connectivity data found.
   51|    233|      return nullptr;
   52|    233|    }
   53|       |    // Connectivity data exists.
   54|  4.76k|    const MeshAttributeCornerTable *const att_ct =
   55|  4.76k|        source->GetAttributeCornerTable(att_id);
   56|  4.76k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 2.37k, False: 2.39k]
  ------------------
   57|  2.37k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  2.37k|      MeshData md;
   59|  2.37k|      md.Set(source->mesh(), att_ct,
   60|  2.37k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  2.37k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  2.37k|      MeshPredictionSchemeFactoryT factory;
   63|  2.37k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  2.37k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 2.37k, False: 0]
  ------------------
   65|  2.37k|        return ret;
   66|  2.37k|      }
   67|  2.39k|    } else {
   68|  2.39k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  2.39k|      MeshData md;
   70|  2.39k|      md.Set(source->mesh(), ct,
   71|  2.39k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  2.39k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  2.39k|      MeshPredictionSchemeFactoryT factory;
   74|  2.39k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  2.39k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 2.39k, False: 0]
  ------------------
   76|  2.39k|        return ret;
   77|  2.39k|      }
   78|  2.39k|    }
   79|  4.76k|  }
   80|    231|  return nullptr;
   81|  5.23k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  1.39M|  bool IsInBottomLeft(const Point2 &p) const {
   93|  1.39M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 1.03M, False: 365k]
  |  Branch (93:22): [True: 977k, False: 53.8k]
  ------------------
   94|   977k|      return true;
   95|   977k|    }
   96|   419k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 171k, False: 247k]
  |  Branch (96:25): [True: 124k, False: 47.2k]
  ------------------
   97|  1.39M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  1.39M|  int32_t GetRotationCount(Point2 pred) const {
   51|  1.39M|    const DataType sign_x = pred[0];
   52|  1.39M|    const DataType sign_y = pred[1];
   53|       |
   54|  1.39M|    int32_t rotation_count = 0;
   55|  1.39M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 1.03M, False: 365k]
  ------------------
   56|  1.03M|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 977k, False: 53.8k]
  ------------------
   57|   977k|        rotation_count = 0;
   58|   977k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 49.4k, False: 4.37k]
  ------------------
   59|  49.4k|        rotation_count = 3;
   60|  49.4k|      } else {
   61|  4.37k|        rotation_count = 1;
   62|  4.37k|      }
   63|  1.03M|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 194k, False: 171k]
  ------------------
   64|   194k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 106k, False: 87.4k]
  ------------------
   65|   106k|        rotation_count = 2;
   66|   106k|      } else {
   67|  87.4k|        rotation_count = 1;
   68|  87.4k|      }
   69|   194k|    } else {
   70|   171k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 124k, False: 47.2k]
  ------------------
   71|   124k|        rotation_count = 0;
   72|   124k|      } else {
   73|  47.2k|        rotation_count = 3;
   74|  47.2k|      }
   75|   171k|    }
   76|  1.39M|    return rotation_count;
   77|  1.39M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   590k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   590k|    switch (rotation_count) {
   81|   188k|      case 1:
  ------------------
  |  Branch (81:7): [True: 188k, False: 401k]
  ------------------
   82|   188k|        return Point2(p[1], -p[0]);
   83|   213k|      case 2:
  ------------------
  |  Branch (83:7): [True: 213k, False: 377k]
  ------------------
   84|   213k|        return Point2(-p[0], -p[1]);
   85|   188k|      case 3:
  ------------------
  |  Branch (85:7): [True: 188k, False: 401k]
  ------------------
   86|   188k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 590k]
  ------------------
   88|      0|        return p;
   89|   590k|    }
   90|   590k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    568|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

_ZN5draco37PredictionSchemeWrapDecodingTransformIiiE19DecodeTransformDataEPNS_13DecoderBufferE:
   66|  4.66k|  bool DecodeTransformData(DecoderBuffer *buffer) {
   67|  4.66k|    DataTypeT min_value, max_value;
   68|  4.66k|    if (!buffer->Decode(&min_value)) {
  ------------------
  |  Branch (68:9): [True: 55, False: 4.61k]
  ------------------
   69|     55|      return false;
   70|     55|    }
   71|  4.61k|    if (!buffer->Decode(&max_value)) {
  ------------------
  |  Branch (71:9): [True: 40, False: 4.57k]
  ------------------
   72|     40|      return false;
   73|     40|    }
   74|  4.57k|    if (min_value > max_value) {
  ------------------
  |  Branch (74:9): [True: 186, False: 4.38k]
  ------------------
   75|    186|      return false;
   76|    186|    }
   77|  4.38k|    this->set_min_value(min_value);
   78|  4.38k|    this->set_max_value(max_value);
   79|  4.38k|    if (!this->InitCorrectionBounds()) {
  ------------------
  |  Branch (79:9): [True: 24, False: 4.36k]
  ------------------
   80|     24|      return false;
   81|     24|    }
   82|  4.36k|    return true;
   83|  4.38k|  }
_ZNK5draco37PredictionSchemeWrapDecodingTransformIiiE20ComputeOriginalValueEPKiS3_Pi:
   38|  7.03M|                                   DataTypeT *out_original_vals) const {
   39|       |    // For now we assume both |DataTypeT| and |CorrTypeT| are equal.
   40|  7.03M|    static_assert(std::is_same<DataTypeT, CorrTypeT>::value,
   41|  7.03M|                  "Predictions and corrections must have the same type.");
   42|       |
   43|       |    // The only valid implementation right now is for int32_t.
   44|  7.03M|    static_assert(std::is_same<DataTypeT, int32_t>::value,
   45|  7.03M|                  "Only int32_t is supported for predicted values.");
   46|       |
   47|  7.03M|    predicted_vals = this->ClampPredictedValue(predicted_vals);
   48|       |
   49|       |    // Perform the wrapping using unsigned coordinates to avoid potential signed
   50|       |    // integer overflows caused by malformed input.
   51|  7.03M|    const uint32_t *const uint_predicted_vals =
   52|  7.03M|        reinterpret_cast<const uint32_t *>(predicted_vals);
   53|  7.03M|    const uint32_t *const uint_corr_vals =
   54|  7.03M|        reinterpret_cast<const uint32_t *>(corr_vals);
   55|   145M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (55:21): [True: 138M, False: 7.03M]
  ------------------
   56|   138M|      out_original_vals[i] =
   57|   138M|          static_cast<DataTypeT>(uint_predicted_vals[i] + uint_corr_vals[i]);
   58|   138M|      if (out_original_vals[i] > this->max_value()) {
  ------------------
  |  Branch (58:11): [True: 334k, False: 138M]
  ------------------
   59|   334k|        out_original_vals[i] -= this->max_dif();
   60|   138M|      } else if (out_original_vals[i] < this->min_value()) {
  ------------------
  |  Branch (60:18): [True: 400k, False: 137M]
  ------------------
   61|   400k|        out_original_vals[i] += this->max_dif();
   62|   400k|      }
   63|   138M|    }
   64|  7.03M|  }
_ZN5draco37PredictionSchemeWrapDecodingTransformIiiEC2Ev:
   32|  5.23k|  PredictionSchemeWrapDecodingTransform() {}

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

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

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  9.33k|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|  15.8M|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  6.34k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  34.4k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  10.4k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  10.4k|    portable_attribute_ = std::move(att);
   71|  10.4k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  36.9k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  25.1k|  virtual ~SequentialAttributeDecoder() = default;

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  33.1k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  9.14k|    DecoderBuffer *buffer) {
   30|  9.14k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 231, False: 8.91k]
  ------------------
   31|    231|    return false;
   32|    231|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  8.91k|  const int32_t num_attributes = GetNumAttributes();
   35|  8.91k|  sequential_decoders_.resize(num_attributes);
   36|  34.0k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 25.1k, False: 8.88k]
  ------------------
   37|  25.1k|    uint8_t decoder_type;
   38|  25.1k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 15, False: 25.1k]
  ------------------
   39|     15|      return false;
   40|     15|    }
   41|       |    // Create the decoder from the id.
   42|  25.1k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  25.1k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 11, False: 25.1k]
  ------------------
   44|     11|      return false;
   45|     11|    }
   46|  25.1k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 5, False: 25.1k]
  ------------------
   47|      5|      return false;
   48|      5|    }
   49|  25.1k|  }
   50|  8.88k|  return true;
   51|  8.91k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  5.81k|    DecoderBuffer *buffer) {
   55|  5.81k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 5.81k]
  |  Branch (55:22): [True: 9, False: 5.81k]
  ------------------
   56|      9|    return false;
   57|      9|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  5.81k|  const int32_t num_attributes = GetNumAttributes();
   60|  21.6k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 15.7k, False: 5.80k]
  ------------------
   61|  15.7k|    PointAttribute *const pa =
   62|  15.7k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  15.7k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 3, False: 15.7k]
  ------------------
   64|      3|      return false;
   65|      3|    }
   66|  15.7k|  }
   67|  5.80k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  5.81k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  5.80k|    DecoderBuffer *in_buffer) {
   72|  5.80k|  const int32_t num_attributes = GetNumAttributes();
   73|  15.1k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 11.7k, False: 3.42k]
  ------------------
   74|  11.7k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 2.38k, False: 9.32k]
  ------------------
   75|  11.7k|                                                          in_buffer)) {
   76|  2.38k|      return false;
   77|  2.38k|    }
   78|  11.7k|  }
   79|  3.42k|  return true;
   80|  5.80k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  3.42k|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|  3.42k|  const int32_t num_attributes = GetNumAttributes();
   85|  8.62k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 5.98k, False: 2.63k]
  ------------------
   86|  5.98k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 790, False: 5.19k]
  ------------------
   87|  5.98k|            point_ids_, in_buffer)) {
   88|    790|      return false;
   89|    790|    }
   90|  5.98k|  }
   91|  2.63k|  return true;
   92|  3.42k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  2.63k|    TransformAttributesToOriginalFormat() {
   96|  2.63k|  const int32_t num_attributes = GetNumAttributes();
   97|  6.78k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 4.54k, False: 2.24k]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  4.54k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 4.54k, False: 0]
  ------------------
  100|  4.54k|      const PointAttribute *const attribute =
  101|  4.54k|          sequential_decoders_[i]->attribute();
  102|  4.54k|      const PointAttribute *const portable_attribute =
  103|  4.54k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  4.54k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 4.19k, False: 357]
  |  Branch (104:11): [True: 708, False: 3.83k]
  ------------------
  105|  4.19k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 708, False: 3.48k]
  ------------------
  106|  4.19k|              attribute->attribute_type(), "skip_attribute_transform", false)) {
  107|       |        // Attribute transform should not be performed. In this case, we replace
  108|       |        // the output geometry attribute with the portable attribute.
  109|       |        // TODO(ostava): We can potentially avoid this copy by introducing a new
  110|       |        // mechanism that would allow to use the final attributes as portable
  111|       |        // attributes for predictors that may need them.
  112|    708|        sequential_decoders_[i]->attribute()->CopyFrom(*portable_attribute);
  113|    708|        continue;
  114|    708|      }
  115|  4.54k|    }
  116|  3.83k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 396, False: 3.44k]
  ------------------
  117|  3.83k|            point_ids_)) {
  118|    396|      return false;
  119|    396|    }
  120|  3.83k|  }
  121|  2.24k|  return true;
  122|  2.63k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  25.1k|    uint8_t decoder_type) {
  127|  25.1k|  switch (decoder_type) {
  128|  1.84k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 1.84k, False: 23.2k]
  ------------------
  129|  1.84k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  1.84k|          new SequentialAttributeDecoder());
  131|  21.3k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 21.3k, False: 3.76k]
  ------------------
  132|  21.3k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  21.3k|          new SequentialIntegerAttributeDecoder());
  134|    626|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 626, False: 24.4k]
  ------------------
  135|    626|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    626|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|  1.28k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 1.28k, False: 23.8k]
  ------------------
  139|  1.28k|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|  1.28k|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|     11|    default:
  ------------------
  |  Branch (142:5): [True: 11, False: 25.1k]
  ------------------
  143|     11|      break;
  144|  25.1k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|     11|  return nullptr;
  147|  25.1k|}

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

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

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

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

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

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

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  31.6k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  19.8k|                                const uint8_t *const buf, int offset) {
  301|  19.8k|  unsigned x;
  302|  19.8k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 34, False: 19.8k]
  ------------------
  303|     34|    return 1;
  304|     34|  }
  305|  19.8k|  ans->buf = buf;
  306|  19.8k|  x = buf[offset - 1] >> 6;
  307|  19.8k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 17.5k, False: 2.32k]
  ------------------
  308|  17.5k|    ans->buf_offset = offset - 1;
  309|  17.5k|    ans->state = buf[offset - 1] & 0x3F;
  310|  17.5k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 2.04k, False: 275]
  ------------------
  311|  2.04k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 3, False: 2.04k]
  ------------------
  312|      3|      return 1;
  313|      3|    }
  314|  2.04k|    ans->buf_offset = offset - 2;
  315|  2.04k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  2.04k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 265, False: 10]
  ------------------
  317|    265|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 2, False: 263]
  ------------------
  318|      2|      return 1;
  319|      2|    }
  320|    263|    ans->buf_offset = offset - 3;
  321|    263|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    263|  } else {
  323|     10|    return 1;
  324|     10|  }
  325|  19.8k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  19.8k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  19.8k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  19.8k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  19.8k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 2, False: 19.8k]
  ------------------
  327|      2|    return 1;
  328|      2|  }
  329|  19.8k|  return 0;
  330|  19.8k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  2.04k|static uint32_t mem_get_le16(const void *vmem) {
   68|  2.04k|  uint32_t val;
   69|  2.04k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  2.04k|  val = mem[1] << 8;
   72|  2.04k|  val |= mem[0];
   73|  2.04k|  return val;
   74|  2.04k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    263|static uint32_t mem_get_le24(const void *vmem) {
   77|    263|  uint32_t val;
   78|    263|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    263|  val = mem[2] << 16;
   81|    263|  val |= mem[1] << 8;
   82|    263|  val |= mem[0];
   83|    263|  return val;
   84|    263|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  10.4G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  10.4G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  10.4G|  unsigned quot, rem, x, xn;
  172|  10.4G|#endif
  173|  10.4G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  10.4G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  10.4G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  20.8G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 8.31G, False: 2.11G]
  |  Branch (174:40): [True: 162k, False: 8.31G]
  ------------------
  175|   162k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   162k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   162k|  }
  177|       |#if DRACO_ANS_IMPL1
  178|       |  val = ans->state % DRACO_ANS_P8_PRECISION < p;
  179|       |  l_s = val ? p : p0;
  180|       |  ans->state = (ans->state / DRACO_ANS_P8_PRECISION) * l_s +
  181|       |               ans->state % DRACO_ANS_P8_PRECISION - (!val * p);
  182|       |#else
  183|  10.4G|  x = ans->state;
  184|  10.4G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  10.4G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  10.4G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  10.4G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  10.4G|  xn = quot * p;
  187|  10.4G|  val = rem < p;
  188|  10.4G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  20.8G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 8.34G, False: 2.09G]
  |  |  ------------------
  ------------------
  189|  8.34G|    ans->state = xn + rem;
  190|  8.34G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|  2.09G|    ans->state = x - xn - p;
  193|  2.09G|  }
  194|  10.4G|#endif
  195|  10.4G|  return val;
  196|  10.4G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  43.5k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  43.5k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  43.5k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  43.5k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  4.40k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|  2.51k|                                       uint32_t num_symbols) {
  482|  2.51k|    lut_table_.resize(rans_precision);
  483|  2.51k|    probability_table_.resize(num_symbols);
  484|  2.51k|    uint32_t cum_prob = 0;
  485|  2.51k|    uint32_t act_prob = 0;
  486|  22.8k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 20.5k, False: 2.32k]
  ------------------
  487|  20.5k|      probability_table_[i].prob = token_probs[i];
  488|  20.5k|      probability_table_[i].cum_prob = cum_prob;
  489|  20.5k|      cum_prob += token_probs[i];
  490|  20.5k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 189, False: 20.3k]
  ------------------
  491|    189|        return false;
  492|    189|      }
  493|  8.54M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 8.51M, False: 20.3k]
  ------------------
  494|  8.51M|        lut_table_[j] = i;
  495|  8.51M|      }
  496|  20.3k|      act_prob = cum_prob;
  497|  20.3k|    }
  498|  2.32k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 303, False: 2.02k]
  ------------------
  499|    303|      return false;
  500|    303|    }
  501|  2.02k|    return true;
  502|  2.32k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.72k|  inline int read_init(const uint8_t *const buf, int offset) {
  422|  1.72k|    unsigned x;
  423|  1.72k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 176, False: 1.55k]
  ------------------
  424|    176|      return 1;
  425|    176|    }
  426|  1.55k|    ans_.buf = buf;
  427|  1.55k|    x = buf[offset - 1] >> 6;
  428|  1.55k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 923, False: 630]
  ------------------
  429|    923|      ans_.buf_offset = offset - 1;
  430|    923|      ans_.state = buf[offset - 1] & 0x3F;
  431|    923|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 277, False: 353]
  ------------------
  432|    277|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 67, False: 210]
  ------------------
  433|     67|        return 1;
  434|     67|      }
  435|    210|      ans_.buf_offset = offset - 2;
  436|    210|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    353|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 240, False: 113]
  ------------------
  438|    240|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 58, False: 182]
  ------------------
  439|     58|        return 1;
  440|     58|      }
  441|    182|      ans_.buf_offset = offset - 3;
  442|    182|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    182|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 113, False: 0]
  ------------------
  444|    113|      ans_.buf_offset = offset - 4;
  445|    113|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    113|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|  1.42k|    ans_.state += l_rans_base;
  450|  1.42k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.42k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 105, False: 1.32k]
  ------------------
  451|    105|      return 1;
  452|    105|    }
  453|  1.32k|    return 0;
  454|  1.42k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    377|static uint32_t mem_get_le16(const void *vmem) {
   68|    377|  uint32_t val;
   69|    377|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    377|  val = mem[1] << 8;
   72|    377|  val |= mem[0];
   73|    377|  return val;
   74|    377|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    297|static uint32_t mem_get_le24(const void *vmem) {
   77|    297|  uint32_t val;
   78|    297|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    297|  val = mem[2] << 16;
   81|    297|  val |= mem[1] << 8;
   82|    297|  val |= mem[0];
   83|    297|  return val;
   84|    297|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    414|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    414|  uint32_t val;
   88|    414|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    414|  val = mem[3] << 24;
   91|    414|  val |= mem[2] << 16;
   92|    414|  val |= mem[1] << 8;
   93|    414|  val |= mem[0];
   94|    414|  return val;
   95|    414|}
_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: 98.6M, False: 10.7M]
  |  Branch (466:40): [True: 31.7k, False: 98.6M]
  ------------------
  467|  31.7k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  31.7k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  31.7k|    }
  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.26k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    520|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|    388|                                       uint32_t num_symbols) {
  482|    388|    lut_table_.resize(rans_precision);
  483|    388|    probability_table_.resize(num_symbols);
  484|    388|    uint32_t cum_prob = 0;
  485|    388|    uint32_t act_prob = 0;
  486|  11.3k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 10.9k, False: 365]
  ------------------
  487|  10.9k|      probability_table_[i].prob = token_probs[i];
  488|  10.9k|      probability_table_[i].cum_prob = cum_prob;
  489|  10.9k|      cum_prob += token_probs[i];
  490|  10.9k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 23, False: 10.9k]
  ------------------
  491|     23|        return false;
  492|     23|      }
  493|  2.88M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 2.86M, False: 10.9k]
  ------------------
  494|  2.86M|        lut_table_[j] = i;
  495|  2.86M|      }
  496|  10.9k|      act_prob = cum_prob;
  497|  10.9k|    }
  498|    365|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 25, False: 340]
  ------------------
  499|     25|      return false;
  500|     25|    }
  501|    340|    return true;
  502|    365|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|    278|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    278|    unsigned x;
  423|    278|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 9, False: 269]
  ------------------
  424|      9|      return 1;
  425|      9|    }
  426|    269|    ans_.buf = buf;
  427|    269|    x = buf[offset - 1] >> 6;
  428|    269|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 166, False: 103]
  ------------------
  429|    166|      ans_.buf_offset = offset - 1;
  430|    166|      ans_.state = buf[offset - 1] & 0x3F;
  431|    166|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 41, False: 62]
  ------------------
  432|     41|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 13, False: 28]
  ------------------
  433|     13|        return 1;
  434|     13|      }
  435|     28|      ans_.buf_offset = offset - 2;
  436|     28|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     62|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 29, False: 33]
  ------------------
  438|     29|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 11, False: 18]
  ------------------
  439|     11|        return 1;
  440|     11|      }
  441|     18|      ans_.buf_offset = offset - 3;
  442|     18|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     33|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 33, False: 0]
  ------------------
  444|     33|      ans_.buf_offset = offset - 4;
  445|     33|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     33|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    245|    ans_.state += l_rans_base;
  450|    245|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    245|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 20, False: 225]
  ------------------
  451|     20|      return 1;
  452|     20|    }
  453|    225|    return 0;
  454|    245|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|  13.6M|  inline int rans_read() {
  463|  13.6M|    unsigned rem;
  464|  13.6M|    unsigned quo;
  465|  13.6M|    struct rans_dec_sym sym;
  466|  13.6M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 13.6M, False: 25.5k]
  |  Branch (466:40): [True: 4.48k, False: 13.6M]
  ------------------
  467|  4.48k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  4.48k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  4.48k|    }
  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|  13.6M|    quo = ans_.state / rans_precision;
  472|  13.6M|    rem = ans_.state % rans_precision;
  473|  13.6M|    fetch_sym(&sym, rem);
  474|  13.6M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  13.6M|    return sym.val;
  476|  13.6M|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|  13.6M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  13.6M|    uint32_t symbol = lut_table_[rem];
  507|  13.6M|    out->val = symbol;
  508|  13.6M|    out->prob = probability_table_[symbol].prob;
  509|  13.6M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  13.6M|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|    225|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    363|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_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.71k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 6.49k, False: 215]
  ------------------
  487|  6.49k|      probability_table_[i].prob = token_probs[i];
  488|  6.49k|      probability_table_[i].cum_prob = cum_prob;
  489|  6.49k|      cum_prob += token_probs[i];
  490|  6.49k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 29, False: 6.46k]
  ------------------
  491|     29|        return false;
  492|     29|      }
  493|  6.18M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 6.18M, False: 6.46k]
  ------------------
  494|  6.18M|        lut_table_[j] = i;
  495|  6.18M|      }
  496|  6.46k|      act_prob = cum_prob;
  497|  6.46k|    }
  498|    215|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 42, False: 173]
  ------------------
  499|     42|      return false;
  500|     42|    }
  501|    173|    return true;
  502|    215|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|    131|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    131|    unsigned x;
  423|    131|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 13, False: 118]
  ------------------
  424|     13|      return 1;
  425|     13|    }
  426|    118|    ans_.buf = buf;
  427|    118|    x = buf[offset - 1] >> 6;
  428|    118|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 29, False: 89]
  ------------------
  429|     29|      ans_.buf_offset = offset - 1;
  430|     29|      ans_.state = buf[offset - 1] & 0x3F;
  431|     89|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 20, False: 69]
  ------------------
  432|     20|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 11, False: 9]
  ------------------
  433|     11|        return 1;
  434|     11|      }
  435|      9|      ans_.buf_offset = offset - 2;
  436|      9|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     69|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 23, False: 46]
  ------------------
  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|     46|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 46, False: 0]
  ------------------
  444|     46|      ans_.buf_offset = offset - 4;
  445|     46|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     46|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     96|    ans_.state += l_rans_base;
  450|     96|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     96|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 31, False: 65]
  ------------------
  451|     31|      return 1;
  452|     31|    }
  453|     65|    return 0;
  454|     96|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|   553k|  inline int rans_read() {
  463|   553k|    unsigned rem;
  464|   553k|    unsigned quo;
  465|   553k|    struct rans_dec_sym sym;
  466|   553k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 214k, False: 339k]
  |  Branch (466:40): [True: 625, False: 213k]
  ------------------
  467|    625|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    625|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    625|    }
  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|   553k|    quo = ans_.state / rans_precision;
  472|   553k|    rem = ans_.state % rans_precision;
  473|   553k|    fetch_sym(&sym, rem);
  474|   553k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   553k|    return sym.val;
  476|   553k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|   553k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   553k|    uint32_t symbol = lut_table_[rem];
  507|   553k|    out->val = symbol;
  508|   553k|    out->prob = probability_table_[symbol].prob;
  509|   553k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   553k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     65|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    349|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|    219|                                       uint32_t num_symbols) {
  482|    219|    lut_table_.resize(rans_precision);
  483|    219|    probability_table_.resize(num_symbols);
  484|    219|    uint32_t cum_prob = 0;
  485|    219|    uint32_t act_prob = 0;
  486|  4.84k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 4.65k, False: 196]
  ------------------
  487|  4.65k|      probability_table_[i].prob = token_probs[i];
  488|  4.65k|      probability_table_[i].cum_prob = cum_prob;
  489|  4.65k|      cum_prob += token_probs[i];
  490|  4.65k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 23, False: 4.62k]
  ------------------
  491|     23|        return false;
  492|     23|      }
  493|  11.0M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 11.0M, False: 4.62k]
  ------------------
  494|  11.0M|        lut_table_[j] = i;
  495|  11.0M|      }
  496|  4.62k|      act_prob = cum_prob;
  497|  4.62k|    }
  498|    196|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 44, False: 152]
  ------------------
  499|     44|      return false;
  500|     44|    }
  501|    152|    return true;
  502|    196|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     85|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     85|    unsigned x;
  423|     85|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 11, False: 74]
  ------------------
  424|     11|      return 1;
  425|     11|    }
  426|     74|    ans_.buf = buf;
  427|     74|    x = buf[offset - 1] >> 6;
  428|     74|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 33, False: 41]
  ------------------
  429|     33|      ans_.buf_offset = offset - 1;
  430|     33|      ans_.state = buf[offset - 1] & 0x3F;
  431|     41|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 14, False: 27]
  ------------------
  432|     14|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 3, False: 11]
  ------------------
  433|      3|        return 1;
  434|      3|      }
  435|     11|      ans_.buf_offset = offset - 2;
  436|     11|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     27|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 12, False: 15]
  ------------------
  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|     15|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 15, False: 0]
  ------------------
  444|     15|      ans_.buf_offset = offset - 4;
  445|     15|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     15|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     71|    ans_.state += l_rans_base;
  450|     71|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     71|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 12, False: 59]
  ------------------
  451|     12|      return 1;
  452|     12|    }
  453|     59|    return 0;
  454|     71|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|   364k|  inline int rans_read() {
  463|   364k|    unsigned rem;
  464|   364k|    unsigned quo;
  465|   364k|    struct rans_dec_sym sym;
  466|   365k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 117k, False: 248k]
  |  Branch (466:40): [True: 1.38k, False: 115k]
  ------------------
  467|  1.38k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.38k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.38k|    }
  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|   364k|    quo = ans_.state / rans_precision;
  472|   364k|    rem = ans_.state % rans_precision;
  473|   364k|    fetch_sym(&sym, rem);
  474|   364k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   364k|    return sym.val;
  476|   364k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|   364k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   364k|    uint32_t symbol = lut_table_[rem];
  507|   364k|    out->val = symbol;
  508|   364k|    out->prob = probability_table_[symbol].prob;
  509|   364k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   364k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|     59|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    332|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|    218|                                       uint32_t num_symbols) {
  482|    218|    lut_table_.resize(rans_precision);
  483|    218|    probability_table_.resize(num_symbols);
  484|    218|    uint32_t cum_prob = 0;
  485|    218|    uint32_t act_prob = 0;
  486|  4.25k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 4.06k, False: 191]
  ------------------
  487|  4.06k|      probability_table_[i].prob = token_probs[i];
  488|  4.06k|      probability_table_[i].cum_prob = cum_prob;
  489|  4.06k|      cum_prob += token_probs[i];
  490|  4.06k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 27, False: 4.03k]
  ------------------
  491|     27|        return false;
  492|     27|      }
  493|  47.0M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 47.0M, False: 4.03k]
  ------------------
  494|  47.0M|        lut_table_[j] = i;
  495|  47.0M|      }
  496|  4.03k|      act_prob = cum_prob;
  497|  4.03k|    }
  498|    191|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 37, False: 154]
  ------------------
  499|     37|      return false;
  500|     37|    }
  501|    154|    return true;
  502|    191|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     83|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     83|    unsigned x;
  423|     83|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 2, False: 81]
  ------------------
  424|      2|      return 1;
  425|      2|    }
  426|     81|    ans_.buf = buf;
  427|     81|    x = buf[offset - 1] >> 6;
  428|     81|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 30, False: 51]
  ------------------
  429|     30|      ans_.buf_offset = offset - 1;
  430|     30|      ans_.state = buf[offset - 1] & 0x3F;
  431|     51|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 28, False: 23]
  ------------------
  432|     28|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 9, False: 19]
  ------------------
  433|      9|        return 1;
  434|      9|      }
  435|     19|      ans_.buf_offset = offset - 2;
  436|     19|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     23|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 11, False: 12]
  ------------------
  438|     11|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 3, False: 8]
  ------------------
  439|      3|        return 1;
  440|      3|      }
  441|      8|      ans_.buf_offset = offset - 3;
  442|      8|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     12|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 12, False: 0]
  ------------------
  444|     12|      ans_.buf_offset = offset - 4;
  445|     12|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     12|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     69|    ans_.state += l_rans_base;
  450|     69|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     69|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 5, False: 64]
  ------------------
  451|      5|      return 1;
  452|      5|    }
  453|     64|    return 0;
  454|     69|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|  66.6k|  inline int rans_read() {
  463|  66.6k|    unsigned rem;
  464|  66.6k|    unsigned quo;
  465|  66.6k|    struct rans_dec_sym sym;
  466|  67.3k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 58.5k, False: 8.84k]
  |  Branch (466:40): [True: 754, False: 57.7k]
  ------------------
  467|    754|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    754|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    754|    }
  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|  66.6k|    quo = ans_.state / rans_precision;
  472|  66.6k|    rem = ans_.state % rans_precision;
  473|  66.6k|    fetch_sym(&sym, rem);
  474|  66.6k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  66.6k|    return sym.val;
  476|  66.6k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|  66.6k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  66.6k|    uint32_t symbol = lut_table_[rem];
  507|  66.6k|    out->val = symbol;
  508|  66.6k|    out->prob = probability_table_[symbol].prob;
  509|  66.6k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  66.6k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|     64|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    414|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|    256|                                       uint32_t num_symbols) {
  482|    256|    lut_table_.resize(rans_precision);
  483|    256|    probability_table_.resize(num_symbols);
  484|    256|    uint32_t cum_prob = 0;
  485|    256|    uint32_t act_prob = 0;
  486|  17.4k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 17.2k, False: 230]
  ------------------
  487|  17.2k|      probability_table_[i].prob = token_probs[i];
  488|  17.2k|      probability_table_[i].cum_prob = cum_prob;
  489|  17.2k|      cum_prob += token_probs[i];
  490|  17.2k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 26, False: 17.1k]
  ------------------
  491|     26|        return false;
  492|     26|      }
  493|   103M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 103M, False: 17.1k]
  ------------------
  494|   103M|        lut_table_[j] = i;
  495|   103M|      }
  496|  17.1k|      act_prob = cum_prob;
  497|  17.1k|    }
  498|    230|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 52, False: 178]
  ------------------
  499|     52|      return false;
  500|     52|    }
  501|    178|    return true;
  502|    230|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|    111|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    111|    unsigned x;
  423|    111|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 105]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|    105|    ans_.buf = buf;
  427|    105|    x = buf[offset - 1] >> 6;
  428|    105|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 28, False: 77]
  ------------------
  429|     28|      ans_.buf_offset = offset - 1;
  430|     28|      ans_.state = buf[offset - 1] & 0x3F;
  431|     77|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 27, False: 50]
  ------------------
  432|     27|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 8, False: 19]
  ------------------
  433|      8|        return 1;
  434|      8|      }
  435|     19|      ans_.buf_offset = offset - 2;
  436|     19|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     50|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 7, False: 43]
  ------------------
  438|      7|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 1, False: 6]
  ------------------
  439|      1|        return 1;
  440|      1|      }
  441|      6|      ans_.buf_offset = offset - 3;
  442|      6|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     43|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 43, False: 0]
  ------------------
  444|     43|      ans_.buf_offset = offset - 4;
  445|     43|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     43|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     96|    ans_.state += l_rans_base;
  450|     96|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     96|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 10, False: 86]
  ------------------
  451|     10|      return 1;
  452|     10|    }
  453|     86|    return 0;
  454|     96|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|   150k|  inline int rans_read() {
  463|   150k|    unsigned rem;
  464|   150k|    unsigned quo;
  465|   150k|    struct rans_dec_sym sym;
  466|   152k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 124k, False: 28.1k]
  |  Branch (466:40): [True: 1.72k, False: 122k]
  ------------------
  467|  1.72k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.72k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.72k|    }
  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|   150k|    quo = ans_.state / rans_precision;
  472|   150k|    rem = ans_.state % rans_precision;
  473|   150k|    fetch_sym(&sym, rem);
  474|   150k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   150k|    return sym.val;
  476|   150k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|   150k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   150k|    uint32_t symbol = lut_table_[rem];
  507|   150k|    out->val = symbol;
  508|   150k|    out->prob = probability_table_[symbol].prob;
  509|   150k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   150k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     86|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.67k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|  1.03k|                                       uint32_t num_symbols) {
  482|  1.03k|    lut_table_.resize(rans_precision);
  483|  1.03k|    probability_table_.resize(num_symbols);
  484|  1.03k|    uint32_t cum_prob = 0;
  485|  1.03k|    uint32_t act_prob = 0;
  486|  30.7k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 29.7k, False: 995]
  ------------------
  487|  29.7k|      probability_table_[i].prob = token_probs[i];
  488|  29.7k|      probability_table_[i].cum_prob = cum_prob;
  489|  29.7k|      cum_prob += token_probs[i];
  490|  29.7k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 42, False: 29.6k]
  ------------------
  491|     42|        return false;
  492|     42|      }
  493|   962M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 961M, False: 29.6k]
  ------------------
  494|   961M|        lut_table_[j] = i;
  495|   961M|      }
  496|  29.6k|      act_prob = cum_prob;
  497|  29.6k|    }
  498|    995|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 110, False: 885]
  ------------------
  499|    110|      return false;
  500|    110|    }
  501|    885|    return true;
  502|    995|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    524|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    524|    unsigned x;
  423|    524|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 45, False: 479]
  ------------------
  424|     45|      return 1;
  425|     45|    }
  426|    479|    ans_.buf = buf;
  427|    479|    x = buf[offset - 1] >> 6;
  428|    479|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 125, False: 354]
  ------------------
  429|    125|      ans_.buf_offset = offset - 1;
  430|    125|      ans_.state = buf[offset - 1] & 0x3F;
  431|    354|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 105, False: 249]
  ------------------
  432|    105|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 24, False: 81]
  ------------------
  433|     24|        return 1;
  434|     24|      }
  435|     81|      ans_.buf_offset = offset - 2;
  436|     81|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    249|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 97, False: 152]
  ------------------
  438|     97|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 38, False: 59]
  ------------------
  439|     38|        return 1;
  440|     38|      }
  441|     59|      ans_.buf_offset = offset - 3;
  442|     59|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    152|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 152, False: 0]
  ------------------
  444|    152|      ans_.buf_offset = offset - 4;
  445|    152|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    152|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    417|    ans_.state += l_rans_base;
  450|    417|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    417|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 61, False: 356]
  ------------------
  451|     61|      return 1;
  452|     61|    }
  453|    356|    return 0;
  454|    417|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|   847k|  inline int rans_read() {
  463|   847k|    unsigned rem;
  464|   847k|    unsigned quo;
  465|   847k|    struct rans_dec_sym sym;
  466|   852k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 682k, False: 170k]
  |  Branch (466:40): [True: 4.98k, False: 677k]
  ------------------
  467|  4.98k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  4.98k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  4.98k|    }
  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|   847k|    quo = ans_.state / rans_precision;
  472|   847k|    rem = ans_.state % rans_precision;
  473|   847k|    fetch_sym(&sym, rem);
  474|   847k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   847k|    return sym.val;
  476|   847k|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|   847k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   847k|    uint32_t symbol = lut_table_[rem];
  507|   847k|    out->val = symbol;
  508|   847k|    out->prob = probability_table_[symbol].prob;
  509|   847k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   847k|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    356|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|  1.28k|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|  1.28k|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|  1.28k|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 1.28k]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|  1.28k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|  1.28k|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.28k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 124, False: 1.15k]
  ------------------
   67|    124|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 8, False: 116]
  ------------------
   68|      8|      return false;
   69|      8|    }
   70|       |
   71|    124|  } else
   72|  1.15k|#endif
   73|  1.15k|  {
   74|  1.15k|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 40, False: 1.11k]
  ------------------
   75|     40|      return false;
   76|     40|    }
   77|  1.15k|  }
   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.23k|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 110, False: 1.12k]
  ------------------
   83|    110|    return false;
   84|    110|  }
   85|  1.12k|  probability_table_.resize(num_symbols_);
   86|  1.12k|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 336, False: 788]
  ------------------
   87|    336|    return true;
   88|    336|  }
   89|       |  // Decode the table.
   90|   551k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 550k, False: 505]
  ------------------
   91|   550k|    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|   550k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 67, False: 550k]
  ------------------
   95|     67|      return false;
   96|     67|    }
   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|   550k|    const int token = prob_data & 3;
  102|   550k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 7.85k, False: 542k]
  ------------------
  103|  7.85k|      const uint32_t offset = prob_data >> 2;
  104|  7.85k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 192, False: 7.66k]
  ------------------
  105|    192|        return false;
  106|    192|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   245k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 237k, False: 7.66k]
  ------------------
  109|   237k|        probability_table_[i + j] = 0;
  110|   237k|      }
  111|  7.66k|      i += offset;
  112|   542k|    } else {
  113|   542k|      const int extra_bytes = token;
  114|   542k|      uint32_t prob = prob_data >> 2;
  115|   557k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 14.4k, False: 542k]
  ------------------
  116|  14.4k|        uint8_t eb;
  117|  14.4k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 24, False: 14.3k]
  ------------------
  118|     24|          return false;
  119|     24|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  14.3k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  14.3k|      }
  124|   542k|      probability_table_[i] = prob;
  125|   542k|    }
  126|   550k|  }
  127|    505|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 153, False: 352]
  ------------------
  128|    153|    return false;
  129|    153|  }
  130|    352|  return true;
  131|    505|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    650|    DecoderBuffer *buffer) {
  136|    650|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    650|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    650|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    650|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 55, False: 595]
  ------------------
  140|     55|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 52]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     55|  } else
  145|    595|#endif
  146|    595|  {
  147|    595|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 16, False: 579]
  ------------------
  148|     16|      return false;
  149|     16|    }
  150|    595|  }
  151|    631|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 103, False: 528]
  ------------------
  152|    103|    return false;
  153|    103|  }
  154|    528|  const uint8_t *const data_head =
  155|    528|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    528|  buffer->Advance(bytes_encoded);
  158|    528|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 148, False: 380]
  ------------------
  159|    148|    return false;
  160|    148|  }
  161|    380|  return true;
  162|    528|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    430|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  23.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    317|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    317|  ans_.read_end();
  167|    317|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    637|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    637|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    637|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 637]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    637|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    637|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    637|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 60, False: 577]
  ------------------
   67|     60|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 4, False: 56]
  ------------------
   68|      4|      return false;
   69|      4|    }
   70|       |
   71|     60|  } else
   72|    577|#endif
   73|    577|  {
   74|    577|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 21, False: 556]
  ------------------
   75|     21|      return false;
   76|     21|    }
   77|    577|  }
   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|    612|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 54, False: 558]
  ------------------
   83|     54|    return false;
   84|     54|  }
   85|    558|  probability_table_.resize(num_symbols_);
   86|    558|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 32, False: 526]
  ------------------
   87|     32|    return true;
   88|     32|  }
   89|       |  // Decode the table.
   90|  1.65M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.65M, False: 385]
  ------------------
   91|  1.65M|    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.65M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 52, False: 1.65M]
  ------------------
   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.65M|    const int token = prob_data & 3;
  102|  1.65M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.03M, False: 615k]
  ------------------
  103|  1.03M|      const uint32_t offset = prob_data >> 2;
  104|  1.03M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 69, False: 1.03M]
  ------------------
  105|     69|        return false;
  106|     69|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  54.8M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 53.7M, False: 1.03M]
  ------------------
  109|  53.7M|        probability_table_[i + j] = 0;
  110|  53.7M|      }
  111|  1.03M|      i += offset;
  112|  1.03M|    } else {
  113|   615k|      const int extra_bytes = token;
  114|   615k|      uint32_t prob = prob_data >> 2;
  115|  1.06M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 451k, False: 614k]
  ------------------
  116|   451k|        uint8_t eb;
  117|   451k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 451k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   451k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   451k|      }
  124|   614k|      probability_table_[i] = prob;
  125|   614k|    }
  126|  1.65M|  }
  127|    385|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 176, False: 209]
  ------------------
  128|    176|    return false;
  129|    176|  }
  130|    209|  return true;
  131|    385|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    241|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    209|    DecoderBuffer *buffer) {
  136|    209|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    209|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    209|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    209|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 5, False: 204]
  ------------------
  140|      5|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 5]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      5|  } else
  145|    204|#endif
  146|    204|  {
  147|    204|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 194]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    204|  }
  151|    199|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 35, False: 164]
  ------------------
  152|     35|    return false;
  153|     35|  }
  154|    164|  const uint8_t *const data_head =
  155|    164|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    164|  buffer->Advance(bytes_encoded);
  158|    164|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 44, False: 120]
  ------------------
  159|     44|    return false;
  160|     44|  }
  161|    120|  return true;
  162|    164|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  28.0M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    120|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    120|  ans_.read_end();
  167|    120|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    512|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    512|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    512|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 512]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    512|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    512|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    512|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 61, False: 451]
  ------------------
   67|     61|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 61]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     61|  } else
   72|    451|#endif
   73|    451|  {
   74|    451|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 14, False: 437]
  ------------------
   75|     14|      return false;
   76|     14|    }
   77|    451|  }
   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|    498|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 36, False: 462]
  ------------------
   83|     36|    return false;
   84|     36|  }
   85|    462|  probability_table_.resize(num_symbols_);
   86|    462|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 452]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|   376k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 375k, False: 331]
  ------------------
   91|   375k|    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|   375k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 40, False: 375k]
  ------------------
   95|     40|      return false;
   96|     40|    }
   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|   375k|    const int token = prob_data & 3;
  102|   375k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 145k, False: 230k]
  ------------------
  103|   145k|      const uint32_t offset = prob_data >> 2;
  104|   145k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 48, False: 145k]
  ------------------
  105|     48|        return false;
  106|     48|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  5.89M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 5.74M, False: 145k]
  ------------------
  109|  5.74M|        probability_table_[i + j] = 0;
  110|  5.74M|      }
  111|   145k|      i += offset;
  112|   230k|    } else {
  113|   230k|      const int extra_bytes = token;
  114|   230k|      uint32_t prob = prob_data >> 2;
  115|   442k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 212k, False: 230k]
  ------------------
  116|   212k|        uint8_t eb;
  117|   212k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 33, False: 211k]
  ------------------
  118|     33|          return false;
  119|     33|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   211k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   211k|      }
  124|   230k|      probability_table_[i] = prob;
  125|   230k|    }
  126|   375k|  }
  127|    331|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 31, False: 300]
  ------------------
  128|     31|    return false;
  129|     31|  }
  130|    300|  return true;
  131|    331|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    310|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    300|    DecoderBuffer *buffer) {
  136|    300|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    300|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    300|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    300|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 30, False: 270]
  ------------------
  140|     30|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 30]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     30|  } else
  145|    270|#endif
  146|    270|  {
  147|    270|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 12, False: 258]
  ------------------
  148|     12|      return false;
  149|     12|    }
  150|    270|  }
  151|    288|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 66, False: 222]
  ------------------
  152|     66|    return false;
  153|     66|  }
  154|    222|  const uint8_t *const data_head =
  155|    222|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    222|  buffer->Advance(bytes_encoded);
  158|    222|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 39, False: 183]
  ------------------
  159|     39|    return false;
  160|     39|  }
  161|    183|  return true;
  162|    222|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  4.36M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    183|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    183|  ans_.read_end();
  167|    183|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    466|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    466|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    466|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 466]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    466|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    466|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    466|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 77, False: 389]
  ------------------
   67|     77|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 77]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     77|  } else
   72|    389|#endif
   73|    389|  {
   74|    389|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 382]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    389|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    459|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 19, False: 440]
  ------------------
   83|     19|    return false;
   84|     19|  }
   85|    440|  probability_table_.resize(num_symbols_);
   86|    440|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 18, False: 422]
  ------------------
   87|     18|    return true;
   88|     18|  }
   89|       |  // Decode the table.
   90|  35.8k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 35.5k, False: 330]
  ------------------
   91|  35.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|  35.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 41, False: 35.5k]
  ------------------
   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|  35.5k|    const int token = prob_data & 3;
  102|  35.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 9.24k, False: 26.2k]
  ------------------
  103|  9.24k|      const uint32_t offset = prob_data >> 2;
  104|  9.24k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 35, False: 9.20k]
  ------------------
  105|     35|        return false;
  106|     35|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   400k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 391k, False: 9.20k]
  ------------------
  109|   391k|        probability_table_[i + j] = 0;
  110|   391k|      }
  111|  9.20k|      i += offset;
  112|  26.2k|    } else {
  113|  26.2k|      const int extra_bytes = token;
  114|  26.2k|      uint32_t prob = prob_data >> 2;
  115|  49.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 23.6k, False: 26.2k]
  ------------------
  116|  23.6k|        uint8_t eb;
  117|  23.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 23.5k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  23.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  23.5k|      }
  124|  26.2k|      probability_table_[i] = prob;
  125|  26.2k|    }
  126|  35.5k|  }
  127|    330|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 35, False: 295]
  ------------------
  128|     35|    return false;
  129|     35|  }
  130|    295|  return true;
  131|    330|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    313|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    295|    DecoderBuffer *buffer) {
  136|    295|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    295|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    295|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    295|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 58, False: 237]
  ------------------
  140|     58|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 58]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     58|  } else
  145|    237|#endif
  146|    237|  {
  147|    237|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 14, False: 223]
  ------------------
  148|     14|      return false;
  149|     14|    }
  150|    237|  }
  151|    281|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 89, False: 192]
  ------------------
  152|     89|    return false;
  153|     89|  }
  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: 41, False: 151]
  ------------------
  159|     41|    return false;
  160|     41|  }
  161|    151|  return true;
  162|    192|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  1.49M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    151|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    151|  ans_.read_end();
  167|    151|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    360|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    360|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    360|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 360]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    360|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    360|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    360|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 14, False: 346]
  ------------------
   67|     14|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 14]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     14|  } else
   72|    346|#endif
   73|    346|  {
   74|    346|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 340]
  ------------------
   75|      6|      return false;
   76|      6|    }
   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|    354|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 339]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    339|  probability_table_.resize(num_symbols_);
   86|    339|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 329]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|   832k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 832k, False: 237]
  ------------------
   91|   832k|    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|   832k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 37, False: 832k]
  ------------------
   95|     37|      return false;
   96|     37|    }
   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|   832k|    const int token = prob_data & 3;
  102|   832k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 707k, False: 124k]
  ------------------
  103|   707k|      const uint32_t offset = prob_data >> 2;
  104|   707k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 42, False: 707k]
  ------------------
  105|     42|        return false;
  106|     42|      }
  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: 707k]
  ------------------
  109|  39.6M|        probability_table_[i + j] = 0;
  110|  39.6M|      }
  111|   707k|      i += offset;
  112|   707k|    } else {
  113|   124k|      const int extra_bytes = token;
  114|   124k|      uint32_t prob = prob_data >> 2;
  115|   231k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 106k, False: 124k]
  ------------------
  116|   106k|        uint8_t eb;
  117|   106k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 106k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   106k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   106k|      }
  124|   124k|      probability_table_[i] = prob;
  125|   124k|    }
  126|   832k|  }
  127|    237|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 27, False: 210]
  ------------------
  128|     27|    return false;
  129|     27|  }
  130|    210|  return true;
  131|    237|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    220|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    210|    DecoderBuffer *buffer) {
  136|    210|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    210|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    210|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    210|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 209]
  ------------------
  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|    209|#endif
  146|    209|  {
  147|    209|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 204]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|    209|  }
  151|    205|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 12, False: 193]
  ------------------
  152|     12|    return false;
  153|     12|  }
  154|    193|  const uint8_t *const data_head =
  155|    193|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    193|  buffer->Advance(bytes_encoded);
  158|    193|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 38, False: 155]
  ------------------
  159|     38|    return false;
  160|     38|  }
  161|    155|  return true;
  162|    193|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  10.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|    155|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    155|  ans_.read_end();
  167|    155|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    386|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    386|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    386|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 386]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    386|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    386|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    386|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 85, False: 301]
  ------------------
   67|     85|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 85]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     85|  } else
   72|    301|#endif
   73|    301|  {
   74|    301|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 295]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    301|  }
   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|    380|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 34, False: 346]
  ------------------
   83|     34|    return false;
   84|     34|  }
   85|    346|  probability_table_.resize(num_symbols_);
   86|    346|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 336]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|  30.7k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 30.5k, False: 260]
  ------------------
   91|  30.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|  30.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 29, False: 30.4k]
  ------------------
   95|     29|      return false;
   96|     29|    }
   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|  30.4k|    const int token = prob_data & 3;
  102|  30.4k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 17.6k, False: 12.8k]
  ------------------
  103|  17.6k|      const uint32_t offset = prob_data >> 2;
  104|  17.6k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 17.5k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   530k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 512k, False: 17.5k]
  ------------------
  109|   512k|        probability_table_[i + j] = 0;
  110|   512k|      }
  111|  17.5k|      i += offset;
  112|  17.5k|    } else {
  113|  12.8k|      const int extra_bytes = token;
  114|  12.8k|      uint32_t prob = prob_data >> 2;
  115|  22.4k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 9.60k, False: 12.8k]
  ------------------
  116|  9.60k|        uint8_t eb;
  117|  9.60k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 9.58k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  9.58k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  9.58k|      }
  124|  12.8k|      probability_table_[i] = prob;
  125|  12.8k|    }
  126|  30.4k|  }
  127|    260|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 23, False: 237]
  ------------------
  128|     23|    return false;
  129|     23|  }
  130|    237|  return true;
  131|    260|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    247|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    237|    DecoderBuffer *buffer) {
  136|    237|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    237|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    237|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    237|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 54, False: 183]
  ------------------
  140|     54|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 52]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     54|  } else
  145|    183|#endif
  146|    183|  {
  147|    183|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 181]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    183|  }
  151|    233|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 83, False: 150]
  ------------------
  152|     83|    return false;
  153|     83|  }
  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: 33, False: 117]
  ------------------
  159|     33|    return false;
  160|     33|  }
  161|    117|  return true;
  162|    150|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  9.04M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|    117|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    117|  ans_.read_end();
  167|    117|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    355|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    355|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    355|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 355]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    355|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    355|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    355|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 50, False: 305]
  ------------------
   67|     50|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 50]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     50|  } else
   72|    305|#endif
   73|    305|  {
   74|    305|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 299]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    305|  }
   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|    349|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 340]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|    340|  probability_table_.resize(num_symbols_);
   86|    340|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 14, False: 326]
  ------------------
   87|     14|    return true;
   88|     14|  }
   89|       |  // Decode the table.
   90|  1.95M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.95M, False: 216]
  ------------------
   91|  1.95M|    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.95M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 51, False: 1.95M]
  ------------------
   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|  1.95M|    const int token = prob_data & 3;
  102|  1.95M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 539k, False: 1.41M]
  ------------------
  103|   539k|      const uint32_t offset = prob_data >> 2;
  104|   539k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 539k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  24.3M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 23.8M, False: 539k]
  ------------------
  109|  23.8M|        probability_table_[i + j] = 0;
  110|  23.8M|      }
  111|   539k|      i += offset;
  112|  1.41M|    } else {
  113|  1.41M|      const int extra_bytes = token;
  114|  1.41M|      uint32_t prob = prob_data >> 2;
  115|  2.27M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 861k, False: 1.41M]
  ------------------
  116|   861k|        uint8_t eb;
  117|   861k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 29, False: 861k]
  ------------------
  118|     29|          return false;
  119|     29|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   861k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   861k|      }
  124|  1.41M|      probability_table_[i] = prob;
  125|  1.41M|    }
  126|  1.95M|  }
  127|    216|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 23, False: 193]
  ------------------
  128|     23|    return false;
  129|     23|  }
  130|    193|  return true;
  131|    216|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    207|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    193|    DecoderBuffer *buffer) {
  136|    193|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    193|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    193|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    193|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 27, False: 166]
  ------------------
  140|     27|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 4, False: 23]
  ------------------
  141|      4|      return false;
  142|      4|    }
  143|       |
  144|     27|  } else
  145|    166|#endif
  146|    166|  {
  147|    166|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 13, False: 153]
  ------------------
  148|     13|      return false;
  149|     13|    }
  150|    166|  }
  151|    176|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 49, False: 127]
  ------------------
  152|     49|    return false;
  153|     49|  }
  154|    127|  const uint8_t *const data_head =
  155|    127|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    127|  buffer->Advance(bytes_encoded);
  158|    127|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 28, False: 99]
  ------------------
  159|     28|    return false;
  160|     28|  }
  161|     99|  return true;
  162|    127|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  11.7M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|     99|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     99|  ans_.read_end();
  167|     99|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    410|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    410|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    410|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 410]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    410|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    410|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    410|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 70, False: 340]
  ------------------
   67|     70|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 68]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     70|  } else
   72|    340|#endif
   73|    340|  {
   74|    340|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 331]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    340|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    399|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 38, False: 361]
  ------------------
   83|     38|    return false;
   84|     38|  }
   85|    361|  probability_table_.resize(num_symbols_);
   86|    361|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 352]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|   907k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 907k, False: 248]
  ------------------
   91|   907k|    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|   907k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 40, False: 907k]
  ------------------
   95|     40|      return false;
   96|     40|    }
   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|   907k|    const int token = prob_data & 3;
  102|   907k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 225k, False: 682k]
  ------------------
  103|   225k|      const uint32_t offset = prob_data >> 2;
  104|   225k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 43, False: 225k]
  ------------------
  105|     43|        return false;
  106|     43|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  10.7M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 10.5M, False: 225k]
  ------------------
  109|  10.5M|        probability_table_[i + j] = 0;
  110|  10.5M|      }
  111|   225k|      i += offset;
  112|   682k|    } else {
  113|   682k|      const int extra_bytes = token;
  114|   682k|      uint32_t prob = prob_data >> 2;
  115|  1.14M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 465k, False: 682k]
  ------------------
  116|   465k|        uint8_t eb;
  117|   465k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 465k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   465k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   465k|      }
  124|   682k|      probability_table_[i] = prob;
  125|   682k|    }
  126|   907k|  }
  127|    248|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 24, False: 224]
  ------------------
  128|     24|    return false;
  129|     24|  }
  130|    224|  return true;
  131|    248|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    233|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_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: 29, False: 195]
  ------------------
  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|    195|#endif
  146|    195|  {
  147|    195|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 193]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    195|  }
  151|    221|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 68, False: 153]
  ------------------
  152|     68|    return false;
  153|     68|  }
  154|    153|  const uint8_t *const data_head =
  155|    153|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    153|  buffer->Advance(bytes_encoded);
  158|    153|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 35, False: 118]
  ------------------
  159|     35|    return false;
  160|     35|  }
  161|    118|  return true;
  162|    153|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  20.7M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|    118|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    118|  ans_.read_end();
  167|    118|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    520|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    520|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    520|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 520]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    520|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    520|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    520|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 29, False: 491]
  ------------------
   67|     29|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 28]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     29|  } else
   72|    491|#endif
   73|    491|  {
   74|    491|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 481]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    491|  }
   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|    509|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 23, False: 486]
  ------------------
   83|     23|    return false;
   84|     23|  }
   85|    486|  probability_table_.resize(num_symbols_);
   86|    486|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 476]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|   192k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 191k, False: 388]
  ------------------
   91|   191k|    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|   191k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 43, False: 191k]
  ------------------
   95|     43|      return false;
   96|     43|    }
   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|   191k|    const int token = prob_data & 3;
  102|   191k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 33.2k, False: 158k]
  ------------------
  103|  33.2k|      const uint32_t offset = prob_data >> 2;
  104|  33.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 28, False: 33.2k]
  ------------------
  105|     28|        return false;
  106|     28|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.13M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.10M, False: 33.2k]
  ------------------
  109|  1.10M|        probability_table_[i + j] = 0;
  110|  1.10M|      }
  111|  33.2k|      i += offset;
  112|   158k|    } else {
  113|   158k|      const int extra_bytes = token;
  114|   158k|      uint32_t prob = prob_data >> 2;
  115|   280k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 121k, False: 158k]
  ------------------
  116|   121k|        uint8_t eb;
  117|   121k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 121k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   121k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   121k|      }
  124|   158k|      probability_table_[i] = prob;
  125|   158k|    }
  126|   191k|  }
  127|    388|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 48, False: 340]
  ------------------
  128|     48|    return false;
  129|     48|  }
  130|    340|  return true;
  131|    388|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    350|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|    340|    DecoderBuffer *buffer) {
  136|    340|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    340|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    340|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    340|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 10, False: 330]
  ------------------
  140|     10|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 10]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     10|  } else
  145|    330|#endif
  146|    330|  {
  147|    330|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 328]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    330|  }
  151|    338|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 60, False: 278]
  ------------------
  152|     60|    return false;
  153|     60|  }
  154|    278|  const uint8_t *const data_head =
  155|    278|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    278|  buffer->Advance(bytes_encoded);
  158|    278|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 53, False: 225]
  ------------------
  159|     53|    return false;
  160|     53|  }
  161|    225|  return true;
  162|    278|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|  13.6M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|    225|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    225|  ans_.read_end();
  167|    225|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    363|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    363|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    363|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 363]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    363|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    363|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    363|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 24, False: 339]
  ------------------
   67|     24|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 24]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     24|  } 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|    357|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 345]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    345|  probability_table_.resize(num_symbols_);
   86|    345|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 335]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|   399k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 398k, False: 244]
  ------------------
   91|   398k|    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|   398k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 55, False: 398k]
  ------------------
   95|     55|      return false;
   96|     55|    }
   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|   398k|    const int token = prob_data & 3;
  102|   398k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 46.8k, False: 351k]
  ------------------
  103|  46.8k|      const uint32_t offset = prob_data >> 2;
  104|  46.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 46.8k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.57M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.52M, False: 46.8k]
  ------------------
  109|  1.52M|        probability_table_[i + j] = 0;
  110|  1.52M|      }
  111|  46.8k|      i += offset;
  112|   351k|    } else {
  113|   351k|      const int extra_bytes = token;
  114|   351k|      uint32_t prob = prob_data >> 2;
  115|   703k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 352k, False: 351k]
  ------------------
  116|   352k|        uint8_t eb;
  117|   352k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 9, False: 352k]
  ------------------
  118|      9|          return false;
  119|      9|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   352k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   352k|      }
  124|   351k|      probability_table_[i] = prob;
  125|   351k|    }
  126|   398k|  }
  127|    244|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 71, False: 173]
  ------------------
  128|     71|    return false;
  129|     71|  }
  130|    173|  return true;
  131|    244|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    183|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    173|    DecoderBuffer *buffer) {
  136|    173|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    173|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    173|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    173|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 12, False: 161]
  ------------------
  140|     12|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 12]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     12|  } else
  145|    161|#endif
  146|    161|  {
  147|    161|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 158]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    161|  }
  151|    170|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 39, False: 131]
  ------------------
  152|     39|    return false;
  153|     39|  }
  154|    131|  const uint8_t *const data_head =
  155|    131|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    131|  buffer->Advance(bytes_encoded);
  158|    131|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 66, False: 65]
  ------------------
  159|     66|    return false;
  160|     66|  }
  161|     65|  return true;
  162|    131|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   553k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     65|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     65|  ans_.read_end();
  167|     65|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    349|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    349|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    349|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 349]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    349|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    349|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    349|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 30, False: 319]
  ------------------
   67|     30|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 30]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     30|  } else
   72|    319|#endif
   73|    319|  {
   74|    319|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 309]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    319|  }
   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|    339|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 19, False: 320]
  ------------------
   83|     19|    return false;
   84|     19|  }
   85|    320|  probability_table_.resize(num_symbols_);
   86|    320|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 7, False: 313]
  ------------------
   87|      7|    return true;
   88|      7|  }
   89|       |  // Decode the table.
   90|  1.22M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.22M, False: 219]
  ------------------
   91|  1.22M|    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.22M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 34, False: 1.22M]
  ------------------
   95|     34|      return false;
   96|     34|    }
   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.22M|    const int token = prob_data & 3;
  102|  1.22M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 861k, False: 362k]
  ------------------
  103|   861k|      const uint32_t offset = prob_data >> 2;
  104|   861k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 36, False: 861k]
  ------------------
  105|     36|        return false;
  106|     36|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  49.6M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 48.7M, False: 861k]
  ------------------
  109|  48.7M|        probability_table_[i + j] = 0;
  110|  48.7M|      }
  111|   861k|      i += offset;
  112|   861k|    } else {
  113|   362k|      const int extra_bytes = token;
  114|   362k|      uint32_t prob = prob_data >> 2;
  115|   609k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 247k, False: 362k]
  ------------------
  116|   247k|        uint8_t eb;
  117|   247k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 24, False: 247k]
  ------------------
  118|     24|          return false;
  119|     24|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   247k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   247k|      }
  124|   362k|      probability_table_[i] = prob;
  125|   362k|    }
  126|  1.22M|  }
  127|    219|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 67, False: 152]
  ------------------
  128|     67|    return false;
  129|     67|  }
  130|    152|  return true;
  131|    219|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|    159|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|    152|    DecoderBuffer *buffer) {
  136|    152|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    152|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    152|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    152|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 152]
  ------------------
  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|    152|#endif
  146|    152|  {
  147|    152|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 142]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    152|  }
  151|    142|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 57, False: 85]
  ------------------
  152|     57|    return false;
  153|     57|  }
  154|     85|  const uint8_t *const data_head =
  155|     85|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     85|  buffer->Advance(bytes_encoded);
  158|     85|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 26, False: 59]
  ------------------
  159|     26|    return false;
  160|     26|  }
  161|     59|  return true;
  162|     85|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|   364k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     59|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     59|  ans_.read_end();
  167|     59|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    332|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    332|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    332|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 332]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    332|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    332|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    332|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 42, False: 290]
  ------------------
   67|     42|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 42]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     42|  } else
   72|    290|#endif
   73|    290|  {
   74|    290|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 284]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    290|  }
   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|    326|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 13, False: 313]
  ------------------
   83|     13|    return false;
   84|     13|  }
   85|    313|  probability_table_.resize(num_symbols_);
   86|    313|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 313]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   646k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 646k, False: 218]
  ------------------
   91|   646k|    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|   646k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 42, False: 646k]
  ------------------
   95|     42|      return false;
   96|     42|    }
   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|   646k|    const int token = prob_data & 3;
  102|   646k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 287k, False: 359k]
  ------------------
  103|   287k|      const uint32_t offset = prob_data >> 2;
  104|   287k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 36, False: 287k]
  ------------------
  105|     36|        return false;
  106|     36|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  12.6M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 12.3M, False: 287k]
  ------------------
  109|  12.3M|        probability_table_[i + j] = 0;
  110|  12.3M|      }
  111|   287k|      i += offset;
  112|   359k|    } else {
  113|   359k|      const int extra_bytes = token;
  114|   359k|      uint32_t prob = prob_data >> 2;
  115|   611k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 251k, False: 359k]
  ------------------
  116|   251k|        uint8_t eb;
  117|   251k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 251k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   251k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   251k|      }
  124|   359k|      probability_table_[i] = prob;
  125|   359k|    }
  126|   646k|  }
  127|    218|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 64, False: 154]
  ------------------
  128|     64|    return false;
  129|     64|  }
  130|    154|  return true;
  131|    218|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    154|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    154|    DecoderBuffer *buffer) {
  136|    154|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    154|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    154|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    154|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 24, False: 130]
  ------------------
  140|     24|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 22]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     24|  } else
  145|    130|#endif
  146|    130|  {
  147|    130|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 127]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    130|  }
  151|    149|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 66, False: 83]
  ------------------
  152|     66|    return false;
  153|     66|  }
  154|     83|  const uint8_t *const data_head =
  155|     83|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     83|  buffer->Advance(bytes_encoded);
  158|     83|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 19, False: 64]
  ------------------
  159|     19|    return false;
  160|     19|  }
  161|     64|  return true;
  162|     83|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|  66.6k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     64|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     64|  ans_.read_end();
  167|     64|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    414|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    414|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    414|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 414]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    414|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    414|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    414|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 30, False: 384]
  ------------------
   67|     30|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 30]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     30|  } else
   72|    384|#endif
   73|    384|  {
   74|    384|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 13, False: 371]
  ------------------
   75|     13|      return false;
   76|     13|    }
   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|    401|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 24, False: 377]
  ------------------
   83|     24|    return false;
   84|     24|  }
   85|    377|  probability_table_.resize(num_symbols_);
   86|    377|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 365]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|  1.42M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.42M, False: 256]
  ------------------
   91|  1.42M|    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.42M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 49, False: 1.42M]
  ------------------
   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|  1.42M|    const int token = prob_data & 3;
  102|  1.42M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 690k, False: 731k]
  ------------------
  103|   690k|      const uint32_t offset = prob_data >> 2;
  104|   690k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 38, False: 690k]
  ------------------
  105|     38|        return false;
  106|     38|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  37.7M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 37.0M, False: 690k]
  ------------------
  109|  37.0M|        probability_table_[i + j] = 0;
  110|  37.0M|      }
  111|   690k|      i += offset;
  112|   731k|    } else {
  113|   731k|      const int extra_bytes = token;
  114|   731k|      uint32_t prob = prob_data >> 2;
  115|  1.19M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 460k, False: 731k]
  ------------------
  116|   460k|        uint8_t eb;
  117|   460k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 460k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   460k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   460k|      }
  124|   731k|      probability_table_[i] = prob;
  125|   731k|    }
  126|  1.42M|  }
  127|    256|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 78, False: 178]
  ------------------
  128|     78|    return false;
  129|     78|  }
  130|    178|  return true;
  131|    256|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|    190|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|    178|    DecoderBuffer *buffer) {
  136|    178|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    178|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    178|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    178|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 178]
  ------------------
  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|    178|#endif
  146|    178|  {
  147|    178|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 177]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    178|  }
  151|    177|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 66, False: 111]
  ------------------
  152|     66|    return false;
  153|     66|  }
  154|    111|  const uint8_t *const data_head =
  155|    111|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    111|  buffer->Advance(bytes_encoded);
  158|    111|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 25, False: 86]
  ------------------
  159|     25|    return false;
  160|     25|  }
  161|     86|  return true;
  162|    111|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|   150k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     86|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     86|  ans_.read_end();
  167|     86|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    361|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_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: 43, False: 318]
  ------------------
   67|     43|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 42]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     43|  } else
   72|    318|#endif
   73|    318|  {
   74|    318|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 312]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    318|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    354|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 19, False: 335]
  ------------------
   83|     19|    return false;
   84|     19|  }
   85|    335|  probability_table_.resize(num_symbols_);
   86|    335|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 326]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|   349k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 349k, False: 223]
  ------------------
   91|   349k|    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|   349k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 349k]
  ------------------
   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|   349k|    const int token = prob_data & 3;
  102|   349k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 237k, False: 111k]
  ------------------
  103|   237k|      const uint32_t offset = prob_data >> 2;
  104|   237k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 44, False: 237k]
  ------------------
  105|     44|        return false;
  106|     44|      }
  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.98M, False: 237k]
  ------------------
  109|  9.98M|        probability_table_[i + j] = 0;
  110|  9.98M|      }
  111|   237k|      i += offset;
  112|   237k|    } else {
  113|   111k|      const int extra_bytes = token;
  114|   111k|      uint32_t prob = prob_data >> 2;
  115|   182k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 71.0k, False: 111k]
  ------------------
  116|  71.0k|        uint8_t eb;
  117|  71.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 23, False: 70.9k]
  ------------------
  118|     23|          return false;
  119|     23|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  70.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  70.9k|      }
  124|   111k|      probability_table_[i] = prob;
  125|   111k|    }
  126|   349k|  }
  127|    223|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 34, False: 189]
  ------------------
  128|     34|    return false;
  129|     34|  }
  130|    189|  return true;
  131|    223|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    198|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    189|    DecoderBuffer *buffer) {
  136|    189|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    189|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    189|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    189|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 19, False: 170]
  ------------------
  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|    170|#endif
  146|    170|  {
  147|    170|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 14, False: 156]
  ------------------
  148|     14|      return false;
  149|     14|    }
  150|    170|  }
  151|    174|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 66, False: 108]
  ------------------
  152|     66|    return false;
  153|     66|  }
  154|    108|  const uint8_t *const data_head =
  155|    108|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    108|  buffer->Advance(bytes_encoded);
  158|    108|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 35, False: 73]
  ------------------
  159|     35|    return false;
  160|     35|  }
  161|     73|  return true;
  162|    108|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|   136k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     73|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     73|  ans_.read_end();
  167|     73|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    326|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    326|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    326|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 326]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    326|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    326|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    326|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 64, False: 262]
  ------------------
   67|     64|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 3, False: 61]
  ------------------
   68|      3|      return false;
   69|      3|    }
   70|       |
   71|     64|  } else
   72|    262|#endif
   73|    262|  {
   74|    262|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 259]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    262|  }
   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|    320|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 17, False: 303]
  ------------------
   83|     17|    return false;
   84|     17|  }
   85|    303|  probability_table_.resize(num_symbols_);
   86|    303|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 294]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  2.06M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 2.06M, False: 201]
  ------------------
   91|  2.06M|    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.06M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 35, False: 2.06M]
  ------------------
   95|     35|      return false;
   96|     35|    }
   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.06M|    const int token = prob_data & 3;
  102|  2.06M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.75M, False: 311k]
  ------------------
  103|  1.75M|      const uint32_t offset = prob_data >> 2;
  104|  1.75M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 38, False: 1.75M]
  ------------------
  105|     38|        return false;
  106|     38|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   102M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 100M, False: 1.75M]
  ------------------
  109|   100M|        probability_table_[i + j] = 0;
  110|   100M|      }
  111|  1.75M|      i += offset;
  112|  1.75M|    } else {
  113|   311k|      const int extra_bytes = token;
  114|   311k|      uint32_t prob = prob_data >> 2;
  115|   515k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 204k, False: 311k]
  ------------------
  116|   204k|        uint8_t eb;
  117|   204k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 204k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   204k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   204k|      }
  124|   311k|      probability_table_[i] = prob;
  125|   311k|    }
  126|  2.06M|  }
  127|    201|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 18, False: 183]
  ------------------
  128|     18|    return false;
  129|     18|  }
  130|    183|  return true;
  131|    201|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    192|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|    183|    DecoderBuffer *buffer) {
  136|    183|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    183|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    183|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    183|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 40, False: 143]
  ------------------
  140|     40|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 38]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     40|  } else
  145|    143|#endif
  146|    143|  {
  147|    143|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 138]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|    143|  }
  151|    176|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 60, False: 116]
  ------------------
  152|     60|    return false;
  153|     60|  }
  154|    116|  const uint8_t *const data_head =
  155|    116|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    116|  buffer->Advance(bytes_encoded);
  158|    116|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 44, False: 72]
  ------------------
  159|     44|    return false;
  160|     44|  }
  161|     72|  return true;
  162|    116|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|   306k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     72|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     72|  ans_.read_end();
  167|     72|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    335|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    335|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    335|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 335]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    335|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    335|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    335|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 26, False: 309]
  ------------------
   67|     26|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 26]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     26|  } else
   72|    309|#endif
   73|    309|  {
   74|    309|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 299]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    309|  }
   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|    325|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 310]
  ------------------
   83|     15|    return false;
   84|     15|  }
   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|   299k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 299k, False: 209]
  ------------------
   91|   299k|    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|   299k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 49, False: 299k]
  ------------------
   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|   299k|    const int token = prob_data & 3;
  102|   299k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 48.7k, False: 250k]
  ------------------
  103|  48.7k|      const uint32_t offset = prob_data >> 2;
  104|  48.7k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 48.7k]
  ------------------
  105|     24|        return false;
  106|     24|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.66M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.61M, False: 48.7k]
  ------------------
  109|  1.61M|        probability_table_[i + j] = 0;
  110|  1.61M|      }
  111|  48.7k|      i += offset;
  112|   250k|    } else {
  113|   250k|      const int extra_bytes = token;
  114|   250k|      uint32_t prob = prob_data >> 2;
  115|   466k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 215k, False: 250k]
  ------------------
  116|   215k|        uint8_t eb;
  117|   215k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 19, False: 215k]
  ------------------
  118|     19|          return false;
  119|     19|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   215k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   215k|      }
  124|   250k|      probability_table_[i] = prob;
  125|   250k|    }
  126|   299k|  }
  127|    209|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 42, False: 167]
  ------------------
  128|     42|    return false;
  129|     42|  }
  130|    167|  return true;
  131|    209|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    176|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    167|    DecoderBuffer *buffer) {
  136|    167|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    167|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    167|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    167|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 5, False: 162]
  ------------------
  140|      5|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 4]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      5|  } else
  145|    162|#endif
  146|    162|  {
  147|    162|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 160]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    162|  }
  151|    164|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 64, False: 100]
  ------------------
  152|     64|    return false;
  153|     64|  }
  154|    100|  const uint8_t *const data_head =
  155|    100|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    100|  buffer->Advance(bytes_encoded);
  158|    100|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 33, False: 67]
  ------------------
  159|     33|    return false;
  160|     33|  }
  161|     67|  return true;
  162|    100|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|   117k|  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|    330|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    330|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    330|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 330]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    330|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    330|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    330|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 50, False: 280]
  ------------------
   67|     50|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 48]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     50|  } else
   72|    280|#endif
   73|    280|  {
   74|    280|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 273]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    280|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    321|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 28, False: 293]
  ------------------
   83|     28|    return false;
   84|     28|  }
   85|    293|  probability_table_.resize(num_symbols_);
   86|    293|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 284]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  62.8k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 62.6k, False: 203]
  ------------------
   91|  62.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|  62.6k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 34, False: 62.6k]
  ------------------
   95|     34|      return false;
   96|     34|    }
   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|  62.6k|    const int token = prob_data & 3;
  102|  62.6k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 8.68k, False: 53.9k]
  ------------------
  103|  8.68k|      const uint32_t offset = prob_data >> 2;
  104|  8.68k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 26, False: 8.66k]
  ------------------
  105|     26|        return false;
  106|     26|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   332k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 323k, False: 8.66k]
  ------------------
  109|   323k|        probability_table_[i + j] = 0;
  110|   323k|      }
  111|  8.66k|      i += offset;
  112|  53.9k|    } else {
  113|  53.9k|      const int extra_bytes = token;
  114|  53.9k|      uint32_t prob = prob_data >> 2;
  115|   104k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 50.2k, False: 53.8k]
  ------------------
  116|  50.2k|        uint8_t eb;
  117|  50.2k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 50.2k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  50.2k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  50.2k|      }
  124|  53.8k|      probability_table_[i] = prob;
  125|  53.8k|    }
  126|  62.6k|  }
  127|    203|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 31, False: 172]
  ------------------
  128|     31|    return false;
  129|     31|  }
  130|    172|  return true;
  131|    203|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    181|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    172|    DecoderBuffer *buffer) {
  136|    172|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    172|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    172|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    172|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 25, False: 147]
  ------------------
  140|     25|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 23]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     25|  } else
  145|    147|#endif
  146|    147|  {
  147|    147|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 147]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    147|  }
  151|    170|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 64, False: 106]
  ------------------
  152|     64|    return false;
  153|     64|  }
  154|    106|  const uint8_t *const data_head =
  155|    106|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    106|  buffer->Advance(bytes_encoded);
  158|    106|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 30, False: 76]
  ------------------
  159|     30|    return false;
  160|     30|  }
  161|     76|  return true;
  162|    106|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|   212k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     76|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     76|  ans_.read_end();
  167|     76|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    327|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    327|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    327|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 327]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    327|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    327|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    327|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 69, False: 258]
  ------------------
   67|     69|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 67]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     69|  } else
   72|    258|#endif
   73|    258|  {
   74|    258|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 255]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    258|  }
   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|    322|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 25, False: 297]
  ------------------
   83|     25|    return false;
   84|     25|  }
   85|    297|  probability_table_.resize(num_symbols_);
   86|    297|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 292]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|  1.05M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.05M, False: 201]
  ------------------
   91|  1.05M|    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.05M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 40, False: 1.05M]
  ------------------
   95|     40|      return false;
   96|     40|    }
   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.05M|    const int token = prob_data & 3;
  102|  1.05M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 373k, False: 682k]
  ------------------
  103|   373k|      const uint32_t offset = prob_data >> 2;
  104|   373k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 373k]
  ------------------
  105|     24|        return false;
  106|     24|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  16.5M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 16.1M, False: 373k]
  ------------------
  109|  16.1M|        probability_table_[i + j] = 0;
  110|  16.1M|      }
  111|   373k|      i += offset;
  112|   682k|    } else {
  113|   682k|      const int extra_bytes = token;
  114|   682k|      uint32_t prob = prob_data >> 2;
  115|  1.32M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 641k, False: 682k]
  ------------------
  116|   641k|        uint8_t eb;
  117|   641k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 27, False: 641k]
  ------------------
  118|     27|          return false;
  119|     27|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   641k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   641k|      }
  124|   682k|      probability_table_[i] = prob;
  125|   682k|    }
  126|  1.05M|  }
  127|    201|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 27, False: 174]
  ------------------
  128|     27|    return false;
  129|     27|  }
  130|    174|  return true;
  131|    201|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    179|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    174|    DecoderBuffer *buffer) {
  136|    174|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    174|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    174|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    174|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 33, False: 141]
  ------------------
  140|     33|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 3, False: 30]
  ------------------
  141|      3|      return false;
  142|      3|    }
  143|       |
  144|     33|  } else
  145|    141|#endif
  146|    141|  {
  147|    141|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 141]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    141|  }
  151|    171|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 77, False: 94]
  ------------------
  152|     77|    return false;
  153|     77|  }
  154|     94|  const uint8_t *const data_head =
  155|     94|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     94|  buffer->Advance(bytes_encoded);
  158|     94|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 26, False: 68]
  ------------------
  159|     26|    return false;
  160|     26|  }
  161|     68|  return true;
  162|     94|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  74.3k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     68|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     68|  ans_.read_end();
  167|     68|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  11.9k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  11.9k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 41, False: 11.8k]
  ------------------
   35|     41|    return true;
   36|     41|  }
   37|       |  // Decode which scheme to use.
   38|  11.8k|  uint8_t scheme;
   39|  11.8k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 160, False: 11.7k]
  ------------------
   40|    160|    return false;
   41|    160|  }
   42|  11.7k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 1.07k, False: 10.6k]
  ------------------
   43|  1.07k|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|  1.07k|                                                  src_buffer, out_values);
   45|  10.6k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 7.53k, False: 3.12k]
  ------------------
   46|  7.53k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  7.53k|                                               out_values);
   48|  7.53k|  }
   49|  3.12k|  return false;
   50|  11.7k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|  1.07k|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|  1.07k|  SymbolDecoderT<5> tag_decoder;
   57|  1.07k|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 542, False: 532]
  ------------------
   58|    542|    return false;
   59|    542|  }
   60|       |
   61|    532|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 258, False: 274]
  ------------------
   62|    258|    return false;
   63|    258|  }
   64|       |
   65|    274|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 274, False: 0]
  |  Branch (65:25): [True: 48, False: 226]
  ------------------
   66|     48|    return false;  // Wrong number of symbols.
   67|     48|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    226|  src_buffer->StartBitDecoding(false, nullptr);
   72|    226|  int value_id = 0;
   73|  7.37M|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 7.37M, False: 211]
  ------------------
   74|       |    // Decode the tag.
   75|  7.37M|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  18.5M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 11.1M, False: 7.37M]
  ------------------
   78|  11.1M|      uint32_t val;
   79|  11.1M|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 15, False: 11.1M]
  ------------------
   80|     15|        return false;
   81|     15|      }
   82|  11.1M|      out_values[value_id++] = val;
   83|  11.1M|    }
   84|  7.37M|  }
   85|    211|  tag_decoder.EndDecoding();
   86|    211|  src_buffer->EndBitDecoding();
   87|    211|  return true;
   88|    226|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  7.53k|                      uint32_t *out_values) {
  117|  7.53k|  uint8_t max_bit_length;
  118|  7.53k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 57, False: 7.47k]
  ------------------
  119|     57|    return false;
  120|     57|  }
  121|  7.47k|  switch (max_bit_length) {
  122|    637|    case 1:
  ------------------
  |  Branch (122:5): [True: 637, False: 6.84k]
  ------------------
  123|    637|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    637|                                                         out_values);
  125|    512|    case 2:
  ------------------
  |  Branch (125:5): [True: 512, False: 6.96k]
  ------------------
  126|    512|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    512|                                                         out_values);
  128|    466|    case 3:
  ------------------
  |  Branch (128:5): [True: 466, False: 7.01k]
  ------------------
  129|    466|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    466|                                                         out_values);
  131|    360|    case 4:
  ------------------
  |  Branch (131:5): [True: 360, False: 7.11k]
  ------------------
  132|    360|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    360|                                                         out_values);
  134|    208|    case 5:
  ------------------
  |  Branch (134:5): [True: 208, False: 7.26k]
  ------------------
  135|    208|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    208|                                                         out_values);
  137|    386|    case 6:
  ------------------
  |  Branch (137:5): [True: 386, False: 7.09k]
  ------------------
  138|    386|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    386|                                                         out_values);
  140|    355|    case 7:
  ------------------
  |  Branch (140:5): [True: 355, False: 7.12k]
  ------------------
  141|    355|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    355|                                                         out_values);
  143|    410|    case 8:
  ------------------
  |  Branch (143:5): [True: 410, False: 7.06k]
  ------------------
  144|    410|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    410|                                                         out_values);
  146|    520|    case 9:
  ------------------
  |  Branch (146:5): [True: 520, False: 6.95k]
  ------------------
  147|    520|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    520|                                                         out_values);
  149|    363|    case 10:
  ------------------
  |  Branch (149:5): [True: 363, False: 7.11k]
  ------------------
  150|    363|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    363|          num_values, src_buffer, out_values);
  152|    349|    case 11:
  ------------------
  |  Branch (152:5): [True: 349, False: 7.12k]
  ------------------
  153|    349|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    349|          num_values, src_buffer, out_values);
  155|    332|    case 12:
  ------------------
  |  Branch (155:5): [True: 332, False: 7.14k]
  ------------------
  156|    332|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    332|          num_values, src_buffer, out_values);
  158|    414|    case 13:
  ------------------
  |  Branch (158:5): [True: 414, False: 7.06k]
  ------------------
  159|    414|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    414|          num_values, src_buffer, out_values);
  161|    361|    case 14:
  ------------------
  |  Branch (161:5): [True: 361, False: 7.11k]
  ------------------
  162|    361|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    361|          num_values, src_buffer, out_values);
  164|    326|    case 15:
  ------------------
  |  Branch (164:5): [True: 326, False: 7.15k]
  ------------------
  165|    326|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    326|          num_values, src_buffer, out_values);
  167|    335|    case 16:
  ------------------
  |  Branch (167:5): [True: 335, False: 7.14k]
  ------------------
  168|    335|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    335|          num_values, src_buffer, out_values);
  170|    330|    case 17:
  ------------------
  |  Branch (170:5): [True: 330, False: 7.14k]
  ------------------
  171|    330|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    330|          num_values, src_buffer, out_values);
  173|    327|    case 18:
  ------------------
  |  Branch (173:5): [True: 327, False: 7.15k]
  ------------------
  174|    327|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    327|          num_values, src_buffer, out_values);
  176|    486|    default:
  ------------------
  |  Branch (176:5): [True: 486, False: 6.99k]
  ------------------
  177|    486|      return false;
  178|  7.47k|  }
  179|  7.47k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    637|                              uint32_t *out_values) {
   93|    637|  SymbolDecoderT decoder;
   94|    637|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 396, False: 241]
  ------------------
   95|    396|    return false;
   96|    396|  }
   97|       |
   98|    241|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 241, False: 0]
  |  Branch (98:25): [True: 32, False: 209]
  ------------------
   99|     32|    return false;  // Wrong number of symbols.
  100|     32|  }
  101|       |
  102|    209|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 89, False: 120]
  ------------------
  103|     89|    return false;
  104|     89|  }
  105|  28.0M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 28.0M, False: 120]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  28.0M|    const uint32_t value = decoder.DecodeSymbol();
  108|  28.0M|    out_values[i] = value;
  109|  28.0M|  }
  110|    120|  decoder.EndDecoding();
  111|    120|  return true;
  112|    209|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    512|                              uint32_t *out_values) {
   93|    512|  SymbolDecoderT decoder;
   94|    512|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 202, False: 310]
  ------------------
   95|    202|    return false;
   96|    202|  }
   97|       |
   98|    310|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 310, False: 0]
  |  Branch (98:25): [True: 10, False: 300]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    300|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 117, False: 183]
  ------------------
  103|    117|    return false;
  104|    117|  }
  105|  4.36M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.36M, False: 183]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.36M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.36M|    out_values[i] = value;
  109|  4.36M|  }
  110|    183|  decoder.EndDecoding();
  111|    183|  return true;
  112|    300|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    466|                              uint32_t *out_values) {
   93|    466|  SymbolDecoderT decoder;
   94|    466|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 153, False: 313]
  ------------------
   95|    153|    return false;
   96|    153|  }
   97|       |
   98|    313|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 313, False: 0]
  |  Branch (98:25): [True: 18, False: 295]
  ------------------
   99|     18|    return false;  // Wrong number of symbols.
  100|     18|  }
  101|       |
  102|    295|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 144, False: 151]
  ------------------
  103|    144|    return false;
  104|    144|  }
  105|  1.49M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 1.49M, False: 151]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  1.49M|    const uint32_t value = decoder.DecodeSymbol();
  108|  1.49M|    out_values[i] = value;
  109|  1.49M|  }
  110|    151|  decoder.EndDecoding();
  111|    151|  return true;
  112|    295|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    360|                              uint32_t *out_values) {
   93|    360|  SymbolDecoderT decoder;
   94|    360|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 140, False: 220]
  ------------------
   95|    140|    return false;
   96|    140|  }
   97|       |
   98|    220|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 220, False: 0]
  |  Branch (98:25): [True: 10, False: 210]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    210|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 55, False: 155]
  ------------------
  103|     55|    return false;
  104|     55|  }
  105|  10.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 10.5M, False: 155]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  10.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  10.5M|    out_values[i] = value;
  109|  10.5M|  }
  110|    155|  decoder.EndDecoding();
  111|    155|  return true;
  112|    210|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    208|                              uint32_t *out_values) {
   93|    208|  SymbolDecoderT decoder;
   94|    208|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 52, False: 156]
  ------------------
   95|     52|    return false;
   96|     52|  }
   97|       |
   98|    156|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 156, False: 0]
  |  Branch (98:25): [True: 38, False: 118]
  ------------------
   99|     38|    return false;  // Wrong number of symbols.
  100|     38|  }
  101|       |
  102|    118|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 12, False: 106]
  ------------------
  103|     12|    return false;
  104|     12|  }
  105|  16.1M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 16.1M, False: 106]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  16.1M|    const uint32_t value = decoder.DecodeSymbol();
  108|  16.1M|    out_values[i] = value;
  109|  16.1M|  }
  110|    106|  decoder.EndDecoding();
  111|    106|  return true;
  112|    118|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    386|                              uint32_t *out_values) {
   93|    386|  SymbolDecoderT decoder;
   94|    386|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 139, False: 247]
  ------------------
   95|    139|    return false;
   96|    139|  }
   97|       |
   98|    247|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 247, False: 0]
  |  Branch (98:25): [True: 10, False: 237]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    237|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 120, False: 117]
  ------------------
  103|    120|    return false;
  104|    120|  }
  105|  9.04M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 9.04M, False: 117]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  9.04M|    const uint32_t value = decoder.DecodeSymbol();
  108|  9.04M|    out_values[i] = value;
  109|  9.04M|  }
  110|    117|  decoder.EndDecoding();
  111|    117|  return true;
  112|    237|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    355|                              uint32_t *out_values) {
   93|    355|  SymbolDecoderT decoder;
   94|    355|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 148, False: 207]
  ------------------
   95|    148|    return false;
   96|    148|  }
   97|       |
   98|    207|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 207, False: 0]
  |  Branch (98:25): [True: 14, False: 193]
  ------------------
   99|     14|    return false;  // Wrong number of symbols.
  100|     14|  }
  101|       |
  102|    193|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 94, False: 99]
  ------------------
  103|     94|    return false;
  104|     94|  }
  105|  11.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 11.7M, False: 99]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  11.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  11.7M|    out_values[i] = value;
  109|  11.7M|  }
  110|     99|  decoder.EndDecoding();
  111|     99|  return true;
  112|    193|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    410|                              uint32_t *out_values) {
   93|    410|  SymbolDecoderT decoder;
   94|    410|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 177, False: 233]
  ------------------
   95|    177|    return false;
   96|    177|  }
   97|       |
   98|    233|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 233, False: 0]
  |  Branch (98:25): [True: 9, False: 224]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    224|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 106, False: 118]
  ------------------
  103|    106|    return false;
  104|    106|  }
  105|  20.7M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 20.7M, False: 118]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  20.7M|    const uint32_t value = decoder.DecodeSymbol();
  108|  20.7M|    out_values[i] = value;
  109|  20.7M|  }
  110|    118|  decoder.EndDecoding();
  111|    118|  return true;
  112|    224|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    520|                              uint32_t *out_values) {
   93|    520|  SymbolDecoderT decoder;
   94|    520|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 170, False: 350]
  ------------------
   95|    170|    return false;
   96|    170|  }
   97|       |
   98|    350|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 350, False: 0]
  |  Branch (98:25): [True: 10, False: 340]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    340|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 115, False: 225]
  ------------------
  103|    115|    return false;
  104|    115|  }
  105|  13.6M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 13.6M, False: 225]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  13.6M|    const uint32_t value = decoder.DecodeSymbol();
  108|  13.6M|    out_values[i] = value;
  109|  13.6M|  }
  110|    225|  decoder.EndDecoding();
  111|    225|  return true;
  112|    340|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    363|                              uint32_t *out_values) {
   93|    363|  SymbolDecoderT decoder;
   94|    363|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 180, False: 183]
  ------------------
   95|    180|    return false;
   96|    180|  }
   97|       |
   98|    183|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 183, False: 0]
  |  Branch (98:25): [True: 10, False: 173]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    173|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 108, False: 65]
  ------------------
  103|    108|    return false;
  104|    108|  }
  105|   553k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 553k, False: 65]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   553k|    const uint32_t value = decoder.DecodeSymbol();
  108|   553k|    out_values[i] = value;
  109|   553k|  }
  110|     65|  decoder.EndDecoding();
  111|     65|  return true;
  112|    173|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    349|                              uint32_t *out_values) {
   93|    349|  SymbolDecoderT decoder;
   94|    349|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 190, False: 159]
  ------------------
   95|    190|    return false;
   96|    190|  }
   97|       |
   98|    159|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 159, False: 0]
  |  Branch (98:25): [True: 7, False: 152]
  ------------------
   99|      7|    return false;  // Wrong number of symbols.
  100|      7|  }
  101|       |
  102|    152|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 93, False: 59]
  ------------------
  103|     93|    return false;
  104|     93|  }
  105|   364k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 364k, False: 59]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   364k|    const uint32_t value = decoder.DecodeSymbol();
  108|   364k|    out_values[i] = value;
  109|   364k|  }
  110|     59|  decoder.EndDecoding();
  111|     59|  return true;
  112|    152|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    332|                              uint32_t *out_values) {
   93|    332|  SymbolDecoderT decoder;
   94|    332|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 178, False: 154]
  ------------------
   95|    178|    return false;
   96|    178|  }
   97|       |
   98|    154|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 154, False: 0]
  |  Branch (98:25): [True: 0, False: 154]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|    154|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 90, False: 64]
  ------------------
  103|     90|    return false;
  104|     90|  }
  105|  66.7k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 66.6k, False: 64]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  66.6k|    const uint32_t value = decoder.DecodeSymbol();
  108|  66.6k|    out_values[i] = value;
  109|  66.6k|  }
  110|     64|  decoder.EndDecoding();
  111|     64|  return true;
  112|    154|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    414|                              uint32_t *out_values) {
   93|    414|  SymbolDecoderT decoder;
   94|    414|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 224, False: 190]
  ------------------
   95|    224|    return false;
   96|    224|  }
   97|       |
   98|    190|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 190, False: 0]
  |  Branch (98:25): [True: 12, False: 178]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|    178|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 92, False: 86]
  ------------------
  103|     92|    return false;
  104|     92|  }
  105|   150k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 150k, False: 86]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   150k|    const uint32_t value = decoder.DecodeSymbol();
  108|   150k|    out_values[i] = value;
  109|   150k|  }
  110|     86|  decoder.EndDecoding();
  111|     86|  return true;
  112|    178|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    361|                              uint32_t *out_values) {
   93|    361|  SymbolDecoderT decoder;
   94|    361|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 163, False: 198]
  ------------------
   95|    163|    return false;
   96|    163|  }
   97|       |
   98|    198|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 198, False: 0]
  |  Branch (98:25): [True: 9, False: 189]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    189|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 116, False: 73]
  ------------------
  103|    116|    return false;
  104|    116|  }
  105|   136k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 136k, False: 73]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   136k|    const uint32_t value = decoder.DecodeSymbol();
  108|   136k|    out_values[i] = value;
  109|   136k|  }
  110|     73|  decoder.EndDecoding();
  111|     73|  return true;
  112|    189|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    326|                              uint32_t *out_values) {
   93|    326|  SymbolDecoderT decoder;
   94|    326|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 134, False: 192]
  ------------------
   95|    134|    return false;
   96|    134|  }
   97|       |
   98|    192|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 192, False: 0]
  |  Branch (98:25): [True: 9, False: 183]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    183|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 111, False: 72]
  ------------------
  103|    111|    return false;
  104|    111|  }
  105|   306k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 306k, False: 72]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   306k|    const uint32_t value = decoder.DecodeSymbol();
  108|   306k|    out_values[i] = value;
  109|   306k|  }
  110|     72|  decoder.EndDecoding();
  111|     72|  return true;
  112|    183|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    335|                              uint32_t *out_values) {
   93|    335|  SymbolDecoderT decoder;
   94|    335|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 159, False: 176]
  ------------------
   95|    159|    return false;
   96|    159|  }
   97|       |
   98|    176|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 176, False: 0]
  |  Branch (98:25): [True: 9, False: 167]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    167|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 100, False: 67]
  ------------------
  103|    100|    return false;
  104|    100|  }
  105|   117k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 117k, False: 67]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   117k|    const uint32_t value = decoder.DecodeSymbol();
  108|   117k|    out_values[i] = value;
  109|   117k|  }
  110|     67|  decoder.EndDecoding();
  111|     67|  return true;
  112|    167|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    330|                              uint32_t *out_values) {
   93|    330|  SymbolDecoderT decoder;
   94|    330|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 149, False: 181]
  ------------------
   95|    149|    return false;
   96|    149|  }
   97|       |
   98|    181|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 181, False: 0]
  |  Branch (98:25): [True: 9, False: 172]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    172|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 96, False: 76]
  ------------------
  103|     96|    return false;
  104|     96|  }
  105|   212k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 212k, False: 76]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   212k|    const uint32_t value = decoder.DecodeSymbol();
  108|   212k|    out_values[i] = value;
  109|   212k|  }
  110|     76|  decoder.EndDecoding();
  111|     76|  return true;
  112|    172|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    327|                              uint32_t *out_values) {
   93|    327|  SymbolDecoderT decoder;
   94|    327|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 148, False: 179]
  ------------------
   95|    148|    return false;
   96|    148|  }
   97|       |
   98|    179|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 179, False: 0]
  |  Branch (98:25): [True: 5, False: 174]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    174|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 106, False: 68]
  ------------------
  103|    106|    return false;
  104|    106|  }
  105|  74.4k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 74.3k, False: 68]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  74.3k|    const uint32_t value = decoder.DecodeSymbol();
  108|  74.3k|    out_values[i] = value;
  109|  74.3k|  }
  110|     68|  decoder.EndDecoding();
  111|     68|  return true;
  112|    174|}

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

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

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

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

_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEEC2Ev:
   48|  3.29k|    : decoder_(nullptr),
   49|  3.29k|      last_symbol_id_(-1),
   50|  3.29k|      last_vert_id_(-1),
   51|  3.29k|      last_face_id_(-1),
   52|  3.29k|      num_new_vertices_(0),
   53|  3.29k|      num_encoded_vertices_(0),
   54|  3.29k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  3.29k|    MeshEdgebreakerDecoder *decoder) {
   59|  3.29k|  decoder_ = decoder;
   60|  3.29k|  return true;
   61|  3.29k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23GetAttributeCornerTableEi:
   66|  3.43k|    int att_id) const {
   67|  4.69k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 3.91k, False: 783]
  ------------------
   68|  3.91k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  3.91k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.25k, False: 2.65k]
  |  Branch (69:27): [True: 0, False: 2.65k]
  ------------------
   70|  1.25k|      continue;
   71|  1.25k|    }
   72|  2.65k|    const AttributesDecoderInterface *const dec =
   73|  2.65k|        decoder_->attributes_decoder(decoder_id);
   74|  5.60k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 5.60k, False: 6]
  ------------------
   75|  5.60k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 2.65k, False: 2.95k]
  ------------------
   76|  2.65k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 1.79k, False: 857]
  ------------------
   77|  1.79k|          return &attribute_data_[i].connectivity_data;
   78|  1.79k|        }
   79|    857|        return nullptr;
   80|  2.65k|      }
   81|  5.60k|    }
   82|  2.65k|  }
   83|    783|  return nullptr;
   84|  3.43k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE24GetAttributeEncodingDataEi:
   89|  3.43k|    int att_id) const {
   90|  4.69k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 3.91k, False: 783]
  ------------------
   91|  3.91k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  3.91k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.25k, False: 2.65k]
  |  Branch (92:27): [True: 0, False: 2.65k]
  ------------------
   93|  1.25k|      continue;
   94|  1.25k|    }
   95|  2.65k|    const AttributesDecoderInterface *const dec =
   96|  2.65k|        decoder_->attributes_decoder(decoder_id);
   97|  5.60k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 5.60k, False: 6]
  ------------------
   98|  5.60k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 2.65k, False: 2.95k]
  ------------------
   99|  2.65k|        return &attribute_data_[i].encoding_data;
  100|  2.65k|      }
  101|  5.60k|    }
  102|  2.65k|  }
  103|    783|  return &pos_encoding_data_;
  104|  3.43k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23CreateAttributesDecoderEi:
  130|  2.74k|    int32_t att_decoder_id) {
  131|  2.74k|  int8_t att_data_id;
  132|  2.74k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 5, False: 2.73k]
  ------------------
  133|      5|    return false;
  134|      5|  }
  135|  2.73k|  uint8_t decoder_type;
  136|  2.73k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 9, False: 2.72k]
  ------------------
  137|      9|    return false;
  138|      9|  }
  139|       |
  140|  2.72k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 2.08k, False: 645]
  ------------------
  141|  2.08k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 62, False: 2.02k]
  ------------------
  142|     62|      return false;  // Unexpected attribute data.
  143|     62|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  2.02k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 3, False: 2.01k]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|       |
  151|  2.01k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  2.01k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    645|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 3, False: 642]
  ------------------
  155|      3|      return false;  // Some other decoder is already using the data. Error.
  156|      3|    }
  157|    642|    pos_data_decoder_id_ = att_decoder_id;
  158|    642|  }
  159|       |
  160|  2.66k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  2.66k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  2.66k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 2.65k, False: 7]
  ------------------
  162|  2.65k|    uint8_t traversal_method_encoded;
  163|  2.65k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 4, False: 2.65k]
  ------------------
  164|      4|      return false;
  165|      4|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  2.65k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 16, False: 2.63k]
  ------------------
  168|     16|      return false;
  169|     16|    }
  170|  2.63k|    traversal_method =
  171|  2.63k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  2.63k|  }
  173|       |
  174|  2.64k|  const Mesh *mesh = decoder_->mesh();
  175|  2.64k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  2.64k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 1.31k, False: 1.32k]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|  1.31k|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|  1.31k|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 624, False: 694]
  ------------------
  182|    624|      encoding_data = &pos_encoding_data_;
  183|    694|    } else {
  184|    694|      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|    694|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    694|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|  1.31k|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 204, False: 1.11k]
  ------------------
  191|    204|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    204|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    204|          AttTraverser;
  194|    204|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|  1.11k|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 1.11k, False: 0]
  ------------------
  196|  1.11k|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|  1.11k|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|  1.11k|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|  1.11k|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|  1.32k|  } else {
  203|  1.32k|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 15, False: 1.30k]
  ------------------
  204|     15|      return false;  // Unsupported method.
  205|     15|    }
  206|  1.30k|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 6, False: 1.30k]
  ------------------
  207|      6|      return false;  // Attribute data must be specified.
  208|      6|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|  1.30k|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|  1.30k|        AttObserver;
  214|  1.30k|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|  1.30k|        AttTraverser;
  216|       |
  217|  1.30k|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|  1.30k|        &attribute_data_[att_data_id].encoding_data;
  219|  1.30k|    const MeshAttributeCornerTable *const corner_table =
  220|  1.30k|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|  1.30k|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|  1.30k|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|  1.30k|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|  1.30k|                             encoding_data);
  227|       |
  228|  1.30k|    AttTraverser att_traverser;
  229|  1.30k|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|  1.30k|    traversal_sequencer->SetTraverser(att_traverser);
  232|  1.30k|    sequencer = std::move(traversal_sequencer);
  233|  1.30k|  }
  234|       |
  235|  2.62k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 2.62k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  2.62k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  2.62k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  2.62k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  2.62k|                                        std::move(att_controller));
  244|  2.62k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEv:
  247|  3.29k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  3.29k|  num_new_vertices_ = 0;
  249|  3.29k|  new_to_parent_vertex_map_.clear();
  250|  3.29k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  3.29k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.29k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 490, False: 2.80k]
  ------------------
  252|    490|    uint32_t num_new_verts;
  253|    490|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    490|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 185, False: 305]
  ------------------
  254|    185|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 185]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|    305|    } else {
  258|    305|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 305]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|    305|    }
  262|    490|    num_new_vertices_ = num_new_verts;
  263|    490|  }
  264|  3.29k|#endif
  265|       |
  266|  3.29k|  uint32_t num_encoded_vertices;
  267|  3.29k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  3.29k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.29k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 185, False: 3.10k]
  ------------------
  269|    185|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 185]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|    185|  } else
  274|  3.10k|#endif
  275|  3.10k|  {
  276|  3.10k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 1, False: 3.10k]
  ------------------
  277|      1|      return false;
  278|      1|    }
  279|  3.10k|  }
  280|  3.29k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  3.29k|  uint32_t num_faces;
  283|  3.29k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  3.29k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.29k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 185, False: 3.10k]
  ------------------
  285|    185|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 185]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|    185|  } else
  290|  3.10k|#endif
  291|  3.10k|  {
  292|  3.10k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 3.10k]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|  3.10k|  }
  296|  3.29k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 6, False: 3.28k]
  ------------------
  297|      6|    return false;  // Draco cannot handle this many faces.
  298|      6|  }
  299|       |
  300|  3.28k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 9, False: 3.27k]
  ------------------
  301|      9|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|      9|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  3.27k|  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.27k|  const uint64_t num_encoded_vertices_64 =
  311|  3.27k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  3.27k|  const uint64_t max_num_vertex_edges =
  313|  3.27k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  3.27k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 2, False: 3.27k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      2|    return false;
  317|      2|  }
  318|       |
  319|  3.27k|  uint8_t num_attribute_data;
  320|  3.27k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 3.27k]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|  3.27k|  uint32_t num_encoded_symbols;
  325|  3.27k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  3.27k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.27k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 173, False: 3.10k]
  ------------------
  327|    173|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 173]
  ------------------
  328|      0|      return false;
  329|      0|    }
  330|       |
  331|    173|  } else
  332|  3.10k|#endif
  333|  3.10k|  {
  334|  3.10k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 1, False: 3.10k]
  ------------------
  335|      1|      return false;
  336|      1|    }
  337|  3.10k|  }
  338|       |
  339|  3.27k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 8, False: 3.26k]
  ------------------
  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.26k|  const uint32_t max_encoded_faces =
  346|  3.26k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  3.26k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 13, False: 3.25k]
  ------------------
  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|     13|    return false;
  352|     13|  }
  353|       |
  354|  3.25k|  uint32_t num_encoded_split_symbols;
  355|  3.25k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  3.25k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.25k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 156, False: 3.09k]
  ------------------
  357|    156|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 156]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|    156|  } else
  362|  3.09k|#endif
  363|  3.09k|  {
  364|  3.09k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 3.09k]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|  3.09k|  }
  368|       |
  369|  3.25k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 12, False: 3.24k]
  ------------------
  370|     12|    return false;  // Split symbols are a sub-set of all symbols.
  371|     12|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  3.24k|  vertex_traversal_length_.clear();
  375|  3.24k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  3.24k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 3.24k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  3.24k|  processed_corner_ids_.clear();
  380|  3.24k|  processed_corner_ids_.reserve(num_faces);
  381|  3.24k|  processed_connectivity_corners_.clear();
  382|  3.24k|  processed_connectivity_corners_.reserve(num_faces);
  383|  3.24k|  topology_split_data_.clear();
  384|  3.24k|  hole_event_data_.clear();
  385|  3.24k|  init_face_configurations_.clear();
  386|  3.24k|  init_corners_.clear();
  387|       |
  388|  3.24k|  last_symbol_id_ = -1;
  389|  3.24k|  last_face_id_ = -1;
  390|  3.24k|  last_vert_id_ = -1;
  391|       |
  392|  3.24k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  3.24k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  3.24k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 1, False: 3.24k]
  ------------------
  397|  3.24k|          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.24k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  3.24k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  3.24k|  int32_t topology_split_decoded_bytes = -1;
  410|  3.24k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.24k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 449, False: 2.79k]
  ------------------
  411|    449|    uint32_t encoded_connectivity_size;
  412|    449|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    449|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 144, False: 305]
  ------------------
  413|    144|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 4, False: 140]
  ------------------
  414|      4|        return false;
  415|      4|      }
  416|    305|    } else {
  417|    305|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 305]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|    305|    }
  421|    445|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 4, False: 441]
  ------------------
  422|    441|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 24, False: 417]
  ------------------
  423|     28|      return false;
  424|     28|    }
  425|    417|    DecoderBuffer event_buffer;
  426|    417|    event_buffer.Init(
  427|    417|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    417|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    417|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    417|    topology_split_decoded_bytes =
  432|    417|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    417|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 116, False: 301]
  ------------------
  434|    116|      return false;
  435|    116|    }
  436|       |
  437|    417|  } else
  438|  2.79k|#endif
  439|  2.79k|  {
  440|  2.79k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 16, False: 2.77k]
  ------------------
  441|     16|      return false;
  442|     16|    }
  443|  2.79k|  }
  444|       |
  445|  3.07k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  3.07k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  3.07k|                                           num_encoded_split_symbols);
  449|  3.07k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  3.07k|  DecoderBuffer traversal_end_buffer;
  452|  3.07k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 87, False: 2.98k]
  ------------------
  453|     87|    return false;
  454|     87|  }
  455|       |
  456|  2.98k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  2.98k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 265, False: 2.72k]
  ------------------
  458|    265|    return false;
  459|    265|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  2.72k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  2.72k|                           traversal_end_buffer.remaining_size(),
  464|  2.72k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  2.72k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  2.72k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.72k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 220, False: 2.50k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|    220|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|    220|  }
  471|  2.72k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  2.72k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 2.68k, False: 41]
  ------------------
  475|  2.68k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  2.68k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.68k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 214, False: 2.46k]
  ------------------
  477|  1.35k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 1.13k, False: 214]
  ------------------
  478|  1.13k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 1.13k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  1.13k|      }
  482|       |
  483|    214|    } else
  484|  2.46k|#endif
  485|  2.46k|    {
  486|   211k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 208k, False: 2.46k]
  ------------------
  487|   208k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 208k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   208k|      }
  491|  2.46k|    }
  492|  2.68k|  }
  493|  2.72k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  7.51k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 4.79k, False: 2.72k]
  ------------------
  498|  4.79k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|   525k|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 525k, False: 4.79k]
  ------------------
  501|   525k|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|   525k|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  4.79k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 4.79k]
  ------------------
  505|  4.79k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  4.79k|  }
  509|       |
  510|  2.72k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  7.51k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 4.79k, False: 2.72k]
  ------------------
  512|       |    // For non-position attributes, preallocate the vertex to value mapping
  513|       |    // using the maximum number of vertices from the base corner table and the
  514|       |    // attribute corner table (since the attribute decoder may use either of
  515|       |    // it).
  516|  4.79k|    int32_t att_connectivity_verts =
  517|  4.79k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  4.79k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 430, False: 4.36k]
  ------------------
  519|    430|      att_connectivity_verts = corner_table_->num_vertices();
  520|    430|    }
  521|  4.79k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  4.79k|  }
  523|  2.72k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 3, False: 2.72k]
  ------------------
  524|      3|    return false;
  525|      3|  }
  526|  2.72k|  return true;
  527|  2.72k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE19OnAttributesDecodedEv:
  530|    620|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    620|  return true;
  532|    620|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEi:
  536|  2.98k|    int num_symbols) {
  537|       |  // Algorithm does the reverse decoding of the symbols encoded with the
  538|       |  // edgebreaker method. The reverse decoding always keeps track of the active
  539|       |  // edge identified by its opposite corner (active corner). New faces are
  540|       |  // always added to this active edge. There may be multiple active corners at
  541|       |  // one time that either correspond to separate mesh components or to
  542|       |  // sub-components of one mesh that are going to be merged together using the
  543|       |  // TOPOLOGY_S symbol. We can store these active edges on a stack, because the
  544|       |  // decoder always processes only the latest active edge. TOPOLOGY_S then
  545|       |  // removes the top edge from the stack and TOPOLOGY_E adds a new edge to the
  546|       |  // stack.
  547|  2.98k|  std::vector<CornerIndex> active_corner_stack;
  548|       |
  549|       |  // Additional active edges may be added as a result of topology split events.
  550|       |  // They can be added in arbitrary order, but we always know the split symbol
  551|       |  // id they belong to, so we can address them using this symbol id.
  552|  2.98k|  std::unordered_map<int, CornerIndex> topology_split_active_corners;
  553|       |
  554|       |  // Vector used for storing vertices that were marked as isolated during the
  555|       |  // decoding process. Currently used only when the mesh doesn't contain any
  556|       |  // non-position connectivity data.
  557|  2.98k|  std::vector<VertexIndex> invalid_vertices;
  558|  2.98k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  2.98k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  2.98k|  int num_faces = 0;
  562|  34.2M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 34.2M, False: 2.80k]
  ------------------
  563|  34.2M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  34.2M|    bool check_topology_split = false;
  566|  34.2M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  34.2M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 15.3M, False: 18.9M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  15.3M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 1, False: 15.3M]
  ------------------
  588|      1|        return -1;
  589|      1|      }
  590|       |
  591|  15.3M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  15.3M|      const VertexIndex vertex_x =
  593|  15.3M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  15.3M|      const CornerIndex corner_b =
  595|  15.3M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  15.3M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 126, False: 15.3M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    126|        return -1;
  600|    126|      }
  601|  15.3M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 15.3M]
  |  Branch (601:11): [True: 0, False: 15.3M]
  ------------------
  602|  15.3M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 15.3M]
  ------------------
  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.3M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  15.3M|      SetOppositeCorners(corner_a, corner + 1);
  612|  15.3M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  15.3M|      const VertexIndex vert_a_prev =
  616|  15.3M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  15.3M|      const VertexIndex vert_b_next =
  618|  15.3M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  15.3M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 15.3M]
  |  Branch (619:38): [True: 0, False: 15.3M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  15.3M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  15.3M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  15.3M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  15.3M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  15.3M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  15.3M|      active_corner_stack.back() = corner;
  631|  18.9M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 5.32M, False: 13.5M]
  |  Branch (631:40): [True: 3.58M, False: 9.99M]
  ------------------
  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|  8.90M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 0, False: 8.90M]
  ------------------
  647|      0|        return -1;
  648|      0|      }
  649|  8.90M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  8.90M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 8.90M]
  ------------------
  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|  8.90M|      const CornerIndex corner(3 * face.value());
  658|  8.90M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  8.90M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 5.32M, False: 3.58M]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  5.32M|        opp_corner = corner + 2;
  662|  5.32M|        corner_l = corner + 1;
  663|  5.32M|        corner_r = corner;
  664|  5.32M|      } else {
  665|       |        // "l" is the new first corner.
  666|  3.58M|        opp_corner = corner + 1;
  667|  3.58M|        corner_l = corner;
  668|  3.58M|        corner_r = corner + 2;
  669|  3.58M|      }
  670|  8.90M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  8.90M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  8.90M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 0, False: 8.90M]
  ------------------
  675|      0|        return -1;  // Unexpected number of decoded vertices.
  676|      0|      }
  677|       |
  678|  8.90M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  8.90M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  8.90M|      const VertexIndex vertex_r =
  682|  8.90M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  8.90M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  8.90M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  8.90M|      corner_table_->MapCornerToVertex(
  688|  8.90M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  8.90M|      active_corner_stack.back() = corner;
  690|  8.90M|      check_topology_split = true;
  691|  9.99M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 4.94M, False: 5.05M]
  ------------------
  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.94M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 0, False: 4.94M]
  ------------------
  703|      0|        return -1;
  704|      0|      }
  705|  4.94M|      const CornerIndex corner_b = active_corner_stack.back();
  706|  4.94M|      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.94M|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  4.94M|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 83, False: 4.94M]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     83|        active_corner_stack.push_back(it->second);
  714|     83|      }
  715|  4.94M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 17, False: 4.94M]
  ------------------
  716|     17|        return -1;
  717|     17|      }
  718|  4.94M|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  4.94M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 4.94M]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  4.94M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 4, False: 4.94M]
  |  Branch (724:11): [True: 4, False: 4.94M]
  ------------------
  725|  4.94M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 4.94M]
  ------------------
  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.94M|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  4.94M|      SetOppositeCorners(corner_a, corner + 2);
  735|  4.94M|      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.94M|      const VertexIndex vertex_p =
  739|  4.94M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  4.94M|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  4.94M|      corner_table_->MapCornerToVertex(
  742|  4.94M|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  4.94M|      const VertexIndex vert_b_prev =
  744|  4.94M|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  4.94M|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  4.94M|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  4.94M|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  4.94M|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  4.94M|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  4.94M|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  4.94M|                                       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.94M|      const CornerIndex first_corner = corner_n;
  757|  17.3M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 12.4M, False: 4.94M]
  ------------------
  758|  12.4M|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  12.4M|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  12.4M|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 0, False: 12.4M]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      0|          return -1;
  764|      0|        }
  765|  12.4M|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  4.94M|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  4.94M|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 1.47M, False: 3.47M]
  ------------------
  770|  1.47M|        invalid_vertices.push_back(vertex_n);
  771|  1.47M|      }
  772|  4.94M|      active_corner_stack.back() = corner;
  773|  5.05M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 5.05M, False: 0]
  ------------------
  774|  5.05M|      const CornerIndex corner(3 * face.value());
  775|  5.05M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  5.05M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  5.05M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  5.05M|                                       corner_table_->AddNewVertex());
  780|  5.05M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  5.05M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  5.05M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 3, False: 5.05M]
  ------------------
  784|      3|        return -1;  // Unexpected number of decoded vertices.
  785|      3|      }
  786|       |
  787|  5.05M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  5.05M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  5.05M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  5.05M|      active_corner_stack.push_back(corner);
  792|  5.05M|      check_topology_split = true;
  793|  5.05M|    } 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|  34.2M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  34.2M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 13.9M, False: 20.2M]
  ------------------
  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|  13.9M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  13.9M|      EdgeFaceName split_edge;
  812|  13.9M|      int encoder_split_symbol_id;
  813|  13.9M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.87k, False: 13.9M]
  ------------------
  814|  13.9M|                             &encoder_split_symbol_id)) {
  815|  1.87k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 32, False: 1.83k]
  ------------------
  816|     32|          return -1;  // Wrong split symbol id.
  817|     32|        }
  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.83k|        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.83k|        CornerIndex new_active_corner;
  831|  1.83k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 911, False: 927]
  ------------------
  832|    911|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    927|        } else {
  834|    927|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    927|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.83k|        const int decoder_split_symbol_id =
  839|  1.83k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.83k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.83k|            new_active_corner;
  842|  1.83k|      }
  843|  13.9M|    }
  844|  34.2M|  }
  845|  2.80k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 2.80k]
  ------------------
  846|      0|    return -1;  // Unexpected number of decoded vertices.
  847|      0|  }
  848|       |  // Decode start faces and connect them to the faces from the active stack.
  849|  27.9k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 25.1k, False: 2.73k]
  ------------------
  850|  25.1k|    const CornerIndex corner = active_corner_stack.back();
  851|  25.1k|    active_corner_stack.pop_back();
  852|  25.1k|    const bool interior_face =
  853|  25.1k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  25.1k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 16.6k, False: 8.49k]
  ------------------
  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|  16.6k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 19, False: 16.6k]
  ------------------
  877|     19|        return -1;  // More faces than expected added to the mesh.
  878|     19|      }
  879|       |
  880|  16.6k|      const CornerIndex corner_a = corner;
  881|  16.6k|      const VertexIndex vert_n =
  882|  16.6k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  16.6k|      const CornerIndex corner_b =
  884|  16.6k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  16.6k|      const VertexIndex vert_x =
  887|  16.6k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  16.6k|      const CornerIndex corner_c =
  889|  16.6k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  16.6k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 4, False: 16.6k]
  |  Branch (891:33): [True: 36, False: 16.6k]
  |  Branch (891:55): [True: 0, False: 16.6k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     40|        return -1;
  894|     40|      }
  895|  16.6k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 8, False: 16.6k]
  |  Branch (895:11): [True: 11, False: 16.6k]
  ------------------
  896|  16.6k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 2, False: 16.6k]
  ------------------
  897|  16.6k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 1, False: 16.6k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|     11|        return -1;
  901|     11|      }
  902|       |
  903|  16.6k|      const VertexIndex vert_p =
  904|  16.6k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  16.6k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  16.6k|      const CornerIndex new_corner(3 * face.value());
  909|  16.6k|      SetOppositeCorners(new_corner, corner);
  910|  16.6k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  16.6k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  16.6k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  16.6k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  16.6k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  66.4k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 49.8k, False: 16.6k]
  ------------------
  920|  49.8k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  49.8k|      }
  922|       |
  923|  16.6k|      init_face_configurations_.push_back(true);
  924|  16.6k|      init_corners_.push_back(new_corner);
  925|  16.6k|    } 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.49k|      init_face_configurations_.push_back(false);
  930|  8.49k|      init_corners_.push_back(corner);
  931|  8.49k|    }
  932|  25.1k|  }
  933|  2.73k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 11, False: 2.72k]
  ------------------
  934|     11|    return -1;  // Unexpected number of decoded faces.
  935|     11|  }
  936|       |
  937|  2.72k|  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|  7.51k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 7.51k, False: 2.72k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  7.51k|    VertexIndex src_vert(num_vertices - 1);
  943|  8.56k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 1.05k, False: 7.51k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|  1.05k|      src_vert = VertexIndex(--num_vertices - 1);
  946|  1.05k|    }
  947|  7.51k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 1.05k, False: 6.46k]
  ------------------
  948|  1.05k|      continue;  // No need to swap anything.
  949|  1.05k|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  6.46k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  68.2k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 61.8k, False: 6.46k]
  ------------------
  954|  61.8k|      const CornerIndex cid = vcit.Corner();
  955|  61.8k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 1, False: 61.8k]
  ------------------
  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|  61.8k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  61.8k|    }
  962|  6.46k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  6.46k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  6.46k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  6.46k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  6.46k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  6.46k|    num_vertices--;
  972|  6.46k|  }
  973|  2.72k|  return num_vertices;
  974|  2.72k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  3.20k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  3.20k|  uint32_t num_topology_splits;
  982|  3.20k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  3.20k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.20k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 114, False: 3.09k]
  ------------------
  984|    114|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 2, False: 112]
  ------------------
  985|      2|      return -1;
  986|      2|    }
  987|       |
  988|    114|  } else
  989|  3.09k|#endif
  990|  3.09k|  {
  991|  3.09k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 3.09k]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|  3.09k|  }
  995|  3.20k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 1.53k, False: 1.66k]
  ------------------
  996|  1.53k|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 9, False: 1.53k]
  ------------------
  997|  1.53k|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|      9|      return -1;
  999|      9|    }
 1000|  1.53k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|  1.53k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.53k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 45, False: 1.48k]
  ------------------
 1002|  26.8k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 26.8k, False: 23]
  ------------------
 1003|  26.8k|        TopologySplitEventData event_data;
 1004|  26.8k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 17, False: 26.8k]
  ------------------
 1005|     17|          return -1;
 1006|     17|        }
 1007|  26.8k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 3, False: 26.8k]
  ------------------
 1008|      3|          return -1;
 1009|      3|        }
 1010|  26.8k|        uint8_t edge_data;
 1011|  26.8k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 2, False: 26.8k]
  ------------------
 1012|      2|          return -1;
 1013|      2|        }
 1014|  26.8k|        event_data.source_edge = edge_data & 1;
 1015|  26.8k|        topology_split_data_.push_back(event_data);
 1016|  26.8k|      }
 1017|       |
 1018|     45|    } else
 1019|  1.48k|#endif
 1020|  1.48k|    {
 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.48k|      int last_source_symbol_id = 0;
 1024|  6.20k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 4.73k, False: 1.47k]
  ------------------
 1025|  4.73k|        TopologySplitEventData event_data;
 1026|  4.73k|        uint32_t delta;
 1027|  4.73k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 5, False: 4.72k]
  ------------------
 1028|      5|          return -1;
 1029|      5|        }
 1030|  4.72k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  4.72k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 1, False: 4.72k]
  ------------------
 1032|      1|          return -1;
 1033|      1|        }
 1034|  4.72k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 8, False: 4.72k]
  ------------------
 1035|      8|          return -1;
 1036|      8|        }
 1037|  4.72k|        event_data.split_symbol_id =
 1038|  4.72k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  4.72k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  4.72k|        topology_split_data_.push_back(event_data);
 1041|  4.72k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|  1.47k|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  5.77k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 4.30k, False: 1.47k]
  ------------------
 1045|  4.30k|        uint32_t edge_data;
 1046|  4.30k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.30k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 1.01k, False: 3.29k]
  ------------------
 1047|  1.01k|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  3.29k|        } else {
 1049|  3.29k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  3.29k|        }
 1051|  4.30k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  4.30k|        event_data.source_edge = edge_data & 1;
 1053|  4.30k|      }
 1054|  1.47k|      decoder_buffer->EndBitDecoding();
 1055|  1.47k|    }
 1056|  1.53k|  }
 1057|  3.16k|  uint32_t num_hole_events = 0;
 1058|  3.16k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  3.16k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.16k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 84, False: 3.07k]
  ------------------
 1060|     84|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 2, False: 82]
  ------------------
 1061|      2|      return -1;
 1062|      2|    }
 1063|  3.07k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  3.07k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 261, False: 2.81k]
  ------------------
 1064|    261|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 4, False: 257]
  ------------------
 1065|      4|      return -1;
 1066|      4|    }
 1067|    261|  }
 1068|  3.15k|#endif
 1069|  3.15k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 109, False: 3.04k]
  ------------------
 1070|    109|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|    109|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    109|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 64, False: 45]
  ------------------
 1072|   118k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 118k, False: 7]
  ------------------
 1073|   118k|        HoleEventData event_data;
 1074|   118k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 57, False: 118k]
  ------------------
 1075|     57|          return -1;
 1076|     57|        }
 1077|   118k|        hole_event_data_.push_back(event_data);
 1078|   118k|      }
 1079|       |
 1080|     64|    } else
 1081|     45|#endif
 1082|     45|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     45|      int last_symbol_id = 0;
 1085|   360k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 360k, False: 23]
  ------------------
 1086|   360k|        HoleEventData event_data;
 1087|   360k|        uint32_t delta;
 1088|   360k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 22, False: 360k]
  ------------------
 1089|     22|          return -1;
 1090|     22|        }
 1091|   360k|        event_data.symbol_id = delta + last_symbol_id;
 1092|   360k|        last_symbol_id = event_data.symbol_id;
 1093|   360k|        hole_event_data_.push_back(event_data);
 1094|   360k|      }
 1095|     45|    }
 1096|    109|  }
 1097|  3.07k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  3.15k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  1.13k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  1.13k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  1.13k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  4.54k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 3.40k, False: 1.13k]
  ------------------
 1109|  3.40k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  3.40k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 1.27k, False: 2.13k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  2.91k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 1.64k, False: 1.27k]
  ------------------
 1114|  1.64k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|  1.64k|      }
 1116|  1.27k|      continue;
 1117|  1.27k|    }
 1118|       |
 1119|  5.60k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 3.46k, False: 2.13k]
  ------------------
 1120|  3.46k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  3.46k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 1.94k, False: 1.52k]
  ------------------
 1122|  1.94k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  1.94k|      }
 1124|  3.46k|    }
 1125|  2.13k|  }
 1126|  1.13k|  return true;
 1127|  1.13k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   208k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   208k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   208k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   208k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|   835k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 626k, False: 208k]
  ------------------
 1139|   626k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   626k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 39.8k, False: 586k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   114k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 74.5k, False: 39.8k]
  ------------------
 1144|  74.5k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|  74.5k|      }
 1146|  39.8k|      continue;
 1147|  39.8k|    }
 1148|   586k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   586k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 293k, False: 293k]
  ------------------
 1151|   293k|      continue;
 1152|   293k|    }
 1153|       |
 1154|   873k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 580k, False: 293k]
  ------------------
 1155|   580k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|   580k|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 447k, False: 132k]
  ------------------
 1157|   447k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|   447k|      }
 1159|   580k|    }
 1160|   293k|  }
 1161|   208k|  return true;
 1162|   208k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE21AssignPointsToCornersEi:
 1166|  2.72k|    int num_connectivity_verts) {
 1167|       |  // Map between the existing and deduplicated point ids.
 1168|       |  // Note that at this point we have one point id for each corner of the
 1169|       |  // mesh so there is corner_table_->num_corners() point ids.
 1170|  2.72k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  2.72k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 41, False: 2.68k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|   138k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 138k, False: 41]
  ------------------
 1176|   138k|      Mesh::Face face;
 1177|   138k|      const CornerIndex start_corner(3 * f.value());
 1178|   553k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 414k, False: 138k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   414k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   414k|        face[c] = vert_id;
 1182|   414k|      }
 1183|   138k|      decoder_->mesh()->SetFace(f, face);
 1184|   138k|    }
 1185|     41|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     41|    return true;
 1187|     41|  }
 1188|       |  // Else we need to deduplicate multiple attributes.
 1189|       |
 1190|       |  // Map between point id and an associated corner id. Only one corner for
 1191|       |  // each point is stored. The corners are used to sample the attribute values
 1192|       |  // in the last stage of the deduplication.
 1193|  2.68k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  2.68k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   137k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 135k, False: 2.68k]
  ------------------
 1197|   135k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   135k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 13.0k, False: 122k]
  ------------------
 1199|  13.0k|      continue;  // Isolated vertex.
 1200|  13.0k|    }
 1201|   122k|    CornerIndex deduplication_first_corner = c;
 1202|   122k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 36.2k, False: 85.7k]
  ------------------
 1203|       |      // If the vertex is on a boundary, start deduplication from the left most
 1204|       |      // corner that is guaranteed to lie on the boundary.
 1205|  36.2k|      deduplication_first_corner = c;
 1206|  85.7k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   112k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 94.0k, False: 18.4k]
  ------------------
 1210|  94.0k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 16.4k, False: 77.5k]
  ------------------
 1211|  16.4k|          continue;  // No seam for this attribute, ignore it.
 1212|  16.4k|        }
 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|  77.5k|        const VertexIndex vert_id =
 1217|  77.5k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  77.5k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  77.5k|        bool seam_found = false;
 1220|   121k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 110k, False: 10.1k]
  ------------------
 1221|   110k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 3, False: 110k]
  ------------------
 1222|      3|            return false;
 1223|      3|          }
 1224|   110k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 67.3k, False: 43.5k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  67.3k|            deduplication_first_corner = act_c;
 1227|  67.3k|            seam_found = true;
 1228|  67.3k|            break;
 1229|  67.3k|          }
 1230|  43.5k|          act_c = corner_table_->SwingRight(act_c);
 1231|  43.5k|        }
 1232|  77.5k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 67.3k, False: 10.1k]
  ------------------
 1233|  67.3k|          break;  // No reason to process other attributes if we found a seam.
 1234|  67.3k|        }
 1235|  77.5k|      }
 1236|  85.7k|    }
 1237|       |
 1238|       |    // Do a deduplication pass over the corners on the processed vertex.
 1239|       |    // At this point each corner corresponds to one point id and our goal is to
 1240|       |    // merge similar points into a single point id.
 1241|       |    // We do a single pass in a clockwise direction over the corners and we add
 1242|       |    // a new point id whenever one of the attributes change.
 1243|   122k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   122k|    corner_to_point_map[c.value()] =
 1246|   122k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   122k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   122k|    CornerIndex prev_c = c;
 1250|   122k|    c = corner_table_->SwingRight(c);
 1251|   596k|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 559k, False: 36.7k]
  |  Branch (1251:40): [True: 474k, False: 85.2k]
  ------------------
 1252|   474k|      bool attribute_seam = false;
 1253|   647k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 551k, False: 96.2k]
  ------------------
 1254|   551k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 378k, False: 172k]
  ------------------
 1255|   551k|            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|   378k|          attribute_seam = true;
 1259|   378k|          break;
 1260|   378k|        }
 1261|   551k|      }
 1262|   474k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 378k, False: 96.2k]
  ------------------
 1263|   378k|        corner_to_point_map[c.value()] =
 1264|   378k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   378k|        point_to_corner_map.push_back(c.value());
 1266|   378k|      } else {
 1267|  96.2k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  96.2k|      }
 1269|   474k|      prev_c = c;
 1270|   474k|      c = corner_table_->SwingRight(c);
 1271|   474k|    }
 1272|   122k|  }
 1273|       |  // Add faces.
 1274|   198k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 196k, False: 2.68k]
  ------------------
 1275|   196k|    Mesh::Face face;
 1276|   784k|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 588k, False: 196k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   588k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   588k|    }
 1280|   196k|    decoder_->mesh()->SetFace(f, face);
 1281|   196k|  }
 1282|  2.68k|  decoder_->point_cloud()->set_num_points(
 1283|  2.68k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  2.68k|  return true;
 1285|  2.68k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEEC2Ev:
   48|  2.08k|    : decoder_(nullptr),
   49|  2.08k|      last_symbol_id_(-1),
   50|  2.08k|      last_vert_id_(-1),
   51|  2.08k|      last_face_id_(-1),
   52|  2.08k|      num_new_vertices_(0),
   53|  2.08k|      num_encoded_vertices_(0),
   54|  2.08k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.08k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.08k|  decoder_ = decoder;
   60|  2.08k|  return true;
   61|  2.08k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23GetAttributeCornerTableEi:
   66|  1.78k|    int att_id) const {
   67|  2.75k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 2.18k, False: 571]
  ------------------
   68|  2.18k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  2.18k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 968, False: 1.21k]
  |  Branch (69:27): [True: 0, False: 1.21k]
  ------------------
   70|    968|      continue;
   71|    968|    }
   72|  1.21k|    const AttributesDecoderInterface *const dec =
   73|  1.21k|        decoder_->attributes_decoder(decoder_id);
   74|  3.44k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 3.43k, False: 4]
  ------------------
   75|  3.43k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 1.21k, False: 2.22k]
  ------------------
   76|  1.21k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 949, False: 266]
  ------------------
   77|    949|          return &attribute_data_[i].connectivity_data;
   78|    949|        }
   79|    266|        return nullptr;
   80|  1.21k|      }
   81|  3.43k|    }
   82|  1.21k|  }
   83|    571|  return nullptr;
   84|  1.78k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE24GetAttributeEncodingDataEi:
   89|  1.78k|    int att_id) const {
   90|  2.75k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 2.18k, False: 571]
  ------------------
   91|  2.18k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  2.18k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 968, False: 1.21k]
  |  Branch (92:27): [True: 0, False: 1.21k]
  ------------------
   93|    968|      continue;
   94|    968|    }
   95|  1.21k|    const AttributesDecoderInterface *const dec =
   96|  1.21k|        decoder_->attributes_decoder(decoder_id);
   97|  3.44k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 3.43k, False: 4]
  ------------------
   98|  3.43k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 1.21k, False: 2.22k]
  ------------------
   99|  1.21k|        return &attribute_data_[i].encoding_data;
  100|  1.21k|      }
  101|  3.43k|    }
  102|  1.21k|  }
  103|    571|  return &pos_encoding_data_;
  104|  1.78k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23CreateAttributesDecoderEi:
  130|  1.44k|    int32_t att_decoder_id) {
  131|  1.44k|  int8_t att_data_id;
  132|  1.44k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 28, False: 1.41k]
  ------------------
  133|     28|    return false;
  134|     28|  }
  135|  1.41k|  uint8_t decoder_type;
  136|  1.41k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 22, False: 1.39k]
  ------------------
  137|     22|    return false;
  138|     22|  }
  139|       |
  140|  1.39k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 958, False: 433]
  ------------------
  141|    958|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 54, False: 904]
  ------------------
  142|     54|      return false;  // Unexpected attribute data.
  143|     54|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|    904|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 5, False: 899]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|       |
  151|    899|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|    899|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    433|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 1, False: 432]
  ------------------
  155|      1|      return false;  // Some other decoder is already using the data. Error.
  156|      1|    }
  157|    432|    pos_data_decoder_id_ = att_decoder_id;
  158|    432|  }
  159|       |
  160|  1.33k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  1.33k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.33k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 1.33k, False: 0]
  ------------------
  162|  1.33k|    uint8_t traversal_method_encoded;
  163|  1.33k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 15, False: 1.31k]
  ------------------
  164|     15|      return false;
  165|     15|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  1.31k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 23, False: 1.29k]
  ------------------
  168|     23|      return false;
  169|     23|    }
  170|  1.29k|    traversal_method =
  171|  1.29k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  1.29k|  }
  173|       |
  174|  1.29k|  const Mesh *mesh = decoder_->mesh();
  175|  1.29k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  1.29k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 611, False: 682]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    611|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    611|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 411, False: 200]
  ------------------
  182|    411|      encoding_data = &pos_encoding_data_;
  183|    411|    } else {
  184|    200|      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|    200|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    200|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    611|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 247, False: 364]
  ------------------
  191|    247|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    247|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    247|          AttTraverser;
  194|    247|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    364|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 364, False: 0]
  ------------------
  196|    364|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    364|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    364|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    364|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    682|  } else {
  203|    682|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 3, False: 679]
  ------------------
  204|      3|      return false;  // Unsupported method.
  205|      3|    }
  206|    679|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 1, False: 678]
  ------------------
  207|      1|      return false;  // Attribute data must be specified.
  208|      1|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    678|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    678|        AttObserver;
  214|    678|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    678|        AttTraverser;
  216|       |
  217|    678|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|    678|        &attribute_data_[att_data_id].encoding_data;
  219|    678|    const MeshAttributeCornerTable *const corner_table =
  220|    678|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    678|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    678|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    678|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    678|                             encoding_data);
  227|       |
  228|    678|    AttTraverser att_traverser;
  229|    678|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    678|    traversal_sequencer->SetTraverser(att_traverser);
  232|    678|    sequencer = std::move(traversal_sequencer);
  233|    678|  }
  234|       |
  235|  1.28k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 1.28k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  1.28k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  1.28k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  1.28k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  1.28k|                                        std::move(att_controller));
  244|  1.28k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEv:
  247|  2.08k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.08k|  num_new_vertices_ = 0;
  249|  2.08k|  new_to_parent_vertex_map_.clear();
  250|  2.08k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.08k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.08k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 590, False: 1.49k]
  ------------------
  252|    590|    uint32_t num_new_verts;
  253|    590|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    590|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 201, False: 389]
  ------------------
  254|    201|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 201]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|    389|    } else {
  258|    389|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 389]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|    389|    }
  262|    590|    num_new_vertices_ = num_new_verts;
  263|    590|  }
  264|  2.08k|#endif
  265|       |
  266|  2.08k|  uint32_t num_encoded_vertices;
  267|  2.08k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.08k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.08k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 201, False: 1.88k]
  ------------------
  269|    201|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 201]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|    201|  } else
  274|  1.88k|#endif
  275|  1.88k|  {
  276|  1.88k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 0, False: 1.88k]
  ------------------
  277|      0|      return false;
  278|      0|    }
  279|  1.88k|  }
  280|  2.08k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.08k|  uint32_t num_faces;
  283|  2.08k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.08k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.08k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 201, False: 1.88k]
  ------------------
  285|    201|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 201]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|    201|  } else
  290|  1.88k|#endif
  291|  1.88k|  {
  292|  1.88k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 1.88k]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|  1.88k|  }
  296|  2.08k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 0, False: 2.08k]
  ------------------
  297|      0|    return false;  // Draco cannot handle this many faces.
  298|      0|  }
  299|       |
  300|  2.08k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 3, False: 2.08k]
  ------------------
  301|      3|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|      3|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.08k|  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.08k|  const uint64_t num_encoded_vertices_64 =
  311|  2.08k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.08k|  const uint64_t max_num_vertex_edges =
  313|  2.08k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.08k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 2, False: 2.08k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      2|    return false;
  317|      2|  }
  318|       |
  319|  2.08k|  uint8_t num_attribute_data;
  320|  2.08k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 2.08k]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|  2.08k|  uint32_t num_encoded_symbols;
  325|  2.08k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.08k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.08k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 197, False: 1.88k]
  ------------------
  327|    197|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 197]
  ------------------
  328|      0|      return false;
  329|      0|    }
  330|       |
  331|    197|  } else
  332|  1.88k|#endif
  333|  1.88k|  {
  334|  1.88k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 1.88k]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|  1.88k|  }
  338|       |
  339|  2.08k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 8, False: 2.07k]
  ------------------
  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.07k|  const uint32_t max_encoded_faces =
  346|  2.07k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.07k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 20, False: 2.05k]
  ------------------
  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|     20|    return false;
  352|     20|  }
  353|       |
  354|  2.05k|  uint32_t num_encoded_split_symbols;
  355|  2.05k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.05k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.05k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 173, False: 1.88k]
  ------------------
  357|    173|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 173]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|    173|  } else
  362|  1.88k|#endif
  363|  1.88k|  {
  364|  1.88k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 1.88k]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|  1.88k|  }
  368|       |
  369|  2.05k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 11, False: 2.04k]
  ------------------
  370|     11|    return false;  // Split symbols are a sub-set of all symbols.
  371|     11|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.04k|  vertex_traversal_length_.clear();
  375|  2.04k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.04k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.04k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.04k|  processed_corner_ids_.clear();
  380|  2.04k|  processed_corner_ids_.reserve(num_faces);
  381|  2.04k|  processed_connectivity_corners_.clear();
  382|  2.04k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.04k|  topology_split_data_.clear();
  384|  2.04k|  hole_event_data_.clear();
  385|  2.04k|  init_face_configurations_.clear();
  386|  2.04k|  init_corners_.clear();
  387|       |
  388|  2.04k|  last_symbol_id_ = -1;
  389|  2.04k|  last_face_id_ = -1;
  390|  2.04k|  last_vert_id_ = -1;
  391|       |
  392|  2.04k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.04k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.04k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 1, False: 2.04k]
  ------------------
  397|  2.04k|          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.04k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.04k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.04k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.04k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.04k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 552, False: 1.48k]
  ------------------
  411|    552|    uint32_t encoded_connectivity_size;
  412|    552|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    552|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 166, False: 386]
  ------------------
  413|    166|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 2, False: 164]
  ------------------
  414|      2|        return false;
  415|      2|      }
  416|    386|    } else {
  417|    386|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 386]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|    386|    }
  421|    550|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 1, False: 549]
  ------------------
  422|    549|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 27, False: 522]
  ------------------
  423|     28|      return false;
  424|     28|    }
  425|    522|    DecoderBuffer event_buffer;
  426|    522|    event_buffer.Init(
  427|    522|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    522|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    522|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    522|    topology_split_decoded_bytes =
  432|    522|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    522|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 163, False: 359]
  ------------------
  434|    163|      return false;
  435|    163|    }
  436|       |
  437|    522|  } else
  438|  1.48k|#endif
  439|  1.48k|  {
  440|  1.48k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 32, False: 1.45k]
  ------------------
  441|     32|      return false;
  442|     32|    }
  443|  1.48k|  }
  444|       |
  445|  1.81k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  1.81k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  1.81k|                                           num_encoded_split_symbols);
  449|  1.81k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  1.81k|  DecoderBuffer traversal_end_buffer;
  452|  1.81k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 134, False: 1.68k]
  ------------------
  453|    134|    return false;
  454|    134|  }
  455|       |
  456|  1.68k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.68k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 197, False: 1.48k]
  ------------------
  458|    197|    return false;
  459|    197|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  1.48k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  1.48k|                           traversal_end_buffer.remaining_size(),
  464|  1.48k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  1.48k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  1.48k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.48k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 292, False: 1.19k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|    292|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|    292|  }
  471|  1.48k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  1.48k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 1.32k, False: 162]
  ------------------
  475|  1.32k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  1.32k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.32k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 224, False: 1.09k]
  ------------------
  477|   554k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 554k, False: 224]
  ------------------
  478|   554k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 554k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|   554k|      }
  482|       |
  483|    224|    } else
  484|  1.09k|#endif
  485|  1.09k|    {
  486|  8.95M|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 8.95M, False: 1.09k]
  ------------------
  487|  8.95M|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 8.95M]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|  8.95M|      }
  491|  1.09k|    }
  492|  1.32k|  }
  493|  1.48k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  3.35k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 1.87k, False: 1.48k]
  ------------------
  498|  1.87k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  14.6M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 14.6M, False: 1.87k]
  ------------------
  501|  14.6M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  14.6M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  1.87k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 1.87k]
  ------------------
  505|  1.87k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  1.87k|  }
  509|       |
  510|  1.48k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  3.35k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 1.87k, False: 1.48k]
  ------------------
  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.87k|    int32_t att_connectivity_verts =
  517|  1.87k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  1.87k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 424, False: 1.44k]
  ------------------
  519|    424|      att_connectivity_verts = corner_table_->num_vertices();
  520|    424|    }
  521|  1.87k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  1.87k|  }
  523|  1.48k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 5, False: 1.48k]
  ------------------
  524|      5|    return false;
  525|      5|  }
  526|  1.48k|  return true;
  527|  1.48k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE19OnAttributesDecodedEv:
  530|    303|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    303|  return true;
  532|    303|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEi:
  536|  1.68k|    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.68k|  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.68k|  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.68k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.68k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.68k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.68k|  int num_faces = 0;
  562|  66.6M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 66.6M, False: 1.57k]
  ------------------
  563|  66.6M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  66.6M|    bool check_topology_split = false;
  566|  66.6M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  66.6M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 32.5M, False: 34.1M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  32.5M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 0, False: 32.5M]
  ------------------
  588|      0|        return -1;
  589|      0|      }
  590|       |
  591|  32.5M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  32.5M|      const VertexIndex vertex_x =
  593|  32.5M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  32.5M|      const CornerIndex corner_b =
  595|  32.5M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  32.5M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 26, False: 32.5M]
  ------------------
  598|       |        // All matched corners must be different.
  599|     26|        return -1;
  600|     26|      }
  601|  32.5M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 32.5M]
  |  Branch (601:11): [True: 0, False: 32.5M]
  ------------------
  602|  32.5M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 32.5M]
  ------------------
  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|  32.5M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  32.5M|      SetOppositeCorners(corner_a, corner + 1);
  612|  32.5M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  32.5M|      const VertexIndex vert_a_prev =
  616|  32.5M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  32.5M|      const VertexIndex vert_b_next =
  618|  32.5M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  32.5M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 32.5M]
  |  Branch (619:38): [True: 0, False: 32.5M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  32.5M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  32.5M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  32.5M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  32.5M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  32.5M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  32.5M|      active_corner_stack.back() = corner;
  631|  34.1M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 34.0M, False: 74.4k]
  |  Branch (631:40): [True: 15.2k, False: 59.1k]
  ------------------
  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|  34.0M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 0, False: 34.0M]
  ------------------
  647|      0|        return -1;
  648|      0|      }
  649|  34.0M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  34.0M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 34.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|  34.0M|      const CornerIndex corner(3 * face.value());
  658|  34.0M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  34.0M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 34.0M, False: 15.2k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  34.0M|        opp_corner = corner + 2;
  662|  34.0M|        corner_l = corner + 1;
  663|  34.0M|        corner_r = corner;
  664|  34.0M|      } else {
  665|       |        // "l" is the new first corner.
  666|  15.2k|        opp_corner = corner + 1;
  667|  15.2k|        corner_l = corner;
  668|  15.2k|        corner_r = corner + 2;
  669|  15.2k|      }
  670|  34.0M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  34.0M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  34.0M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 8, False: 34.0M]
  ------------------
  675|      8|        return -1;  // Unexpected number of decoded vertices.
  676|      8|      }
  677|       |
  678|  34.0M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  34.0M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  34.0M|      const VertexIndex vertex_r =
  682|  34.0M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  34.0M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  34.0M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  34.0M|      corner_table_->MapCornerToVertex(
  688|  34.0M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  34.0M|      active_corner_stack.back() = corner;
  690|  34.0M|      check_topology_split = true;
  691|  34.0M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 13.8k, False: 45.3k]
  ------------------
  692|       |      // Create a new face that merges two last active edges from the active
  693|       |      // stack. No new vertex is created, but two vertices at corners "p" and
  694|       |      // "n" need to be merged into a single vertex.
  695|       |      //
  696|       |      // *-------v-------*
  697|       |      //  \a   p/x\n   b/
  698|       |      //   \   /   \   /
  699|       |      //    \ /  S  \ /
  700|       |      //     *.......*
  701|       |      //
  702|  13.8k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 0, False: 13.8k]
  ------------------
  703|      0|        return -1;
  704|      0|      }
  705|  13.8k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  13.8k|      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|  13.8k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  13.8k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 42, False: 13.7k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     42|        active_corner_stack.push_back(it->second);
  714|     42|      }
  715|  13.8k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 15, False: 13.7k]
  ------------------
  716|     15|        return -1;
  717|     15|      }
  718|  13.7k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  13.7k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 13.7k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  13.7k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 8, False: 13.7k]
  |  Branch (724:11): [True: 8, False: 13.7k]
  ------------------
  725|  13.7k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 13.7k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      8|        return -1;
  729|      8|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  13.7k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  13.7k|      SetOppositeCorners(corner_a, corner + 2);
  735|  13.7k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  13.7k|      const VertexIndex vertex_p =
  739|  13.7k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  13.7k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  13.7k|      corner_table_->MapCornerToVertex(
  742|  13.7k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  13.7k|      const VertexIndex vert_b_prev =
  744|  13.7k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  13.7k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  13.7k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  13.7k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  13.7k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  13.7k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  13.7k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  13.7k|                                       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|  13.7k|      const CornerIndex first_corner = corner_n;
  757|  65.5k|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 51.7k, False: 13.7k]
  ------------------
  758|  51.7k|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  51.7k|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  51.7k|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 3, False: 51.7k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      3|          return -1;
  764|      3|        }
  765|  51.7k|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  13.7k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  13.7k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 4.12k, False: 9.66k]
  ------------------
  770|  4.12k|        invalid_vertices.push_back(vertex_n);
  771|  4.12k|      }
  772|  13.7k|      active_corner_stack.back() = corner;
  773|  45.3k|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 45.3k, False: 0]
  ------------------
  774|  45.3k|      const CornerIndex corner(3 * face.value());
  775|  45.3k|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  45.3k|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  45.3k|      corner_table_->MapCornerToVertex(corner + 1,
  779|  45.3k|                                       corner_table_->AddNewVertex());
  780|  45.3k|      corner_table_->MapCornerToVertex(corner + 2,
  781|  45.3k|                                       corner_table_->AddNewVertex());
  782|       |
  783|  45.3k|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 3, False: 45.3k]
  ------------------
  784|      3|        return -1;  // Unexpected number of decoded vertices.
  785|      3|      }
  786|       |
  787|  45.3k|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  45.3k|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  45.3k|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  45.3k|      active_corner_stack.push_back(corner);
  792|  45.3k|      check_topology_split = true;
  793|  45.3k|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|      0|      return -1;
  796|      0|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  66.6M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  66.6M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 34.0M, False: 32.5M]
  ------------------
  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|  34.0M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  34.0M|      EdgeFaceName split_edge;
  812|  34.0M|      int encoder_split_symbol_id;
  813|  34.0M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.64k, False: 34.0M]
  ------------------
  814|  34.0M|                             &encoder_split_symbol_id)) {
  815|  1.64k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 48, False: 1.59k]
  ------------------
  816|     48|          return -1;  // Wrong split symbol id.
  817|     48|        }
  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.59k|        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.59k|        CornerIndex new_active_corner;
  831|  1.59k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 576, False: 1.02k]
  ------------------
  832|    576|          new_active_corner = corner_table_->Next(act_top_corner);
  833|  1.02k|        } else {
  834|  1.02k|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|  1.02k|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.59k|        const int decoder_split_symbol_id =
  839|  1.59k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.59k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.59k|            new_active_corner;
  842|  1.59k|      }
  843|  34.0M|    }
  844|  66.6M|  }
  845|  1.57k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 1.57k]
  ------------------
  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|  31.4k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 29.8k, False: 1.54k]
  ------------------
  850|  29.8k|    const CornerIndex corner = active_corner_stack.back();
  851|  29.8k|    active_corner_stack.pop_back();
  852|  29.8k|    const bool interior_face =
  853|  29.8k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  29.8k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 21.8k, False: 8.05k]
  ------------------
  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|  21.8k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 12, False: 21.8k]
  ------------------
  877|     12|        return -1;  // More faces than expected added to the mesh.
  878|     12|      }
  879|       |
  880|  21.8k|      const CornerIndex corner_a = corner;
  881|  21.8k|      const VertexIndex vert_n =
  882|  21.8k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  21.8k|      const CornerIndex corner_b =
  884|  21.8k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  21.8k|      const VertexIndex vert_x =
  887|  21.8k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  21.8k|      const CornerIndex corner_c =
  889|  21.8k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  21.8k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 2, False: 21.8k]
  |  Branch (891:33): [True: 9, False: 21.8k]
  |  Branch (891:55): [True: 0, False: 21.8k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     11|        return -1;
  894|     11|      }
  895|  21.8k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 6, False: 21.7k]
  |  Branch (895:11): [True: 6, False: 21.7k]
  ------------------
  896|  21.7k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 21.7k]
  ------------------
  897|  21.7k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 21.7k]
  ------------------
  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|  21.7k|      const VertexIndex vert_p =
  904|  21.7k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  21.7k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  21.7k|      const CornerIndex new_corner(3 * face.value());
  909|  21.7k|      SetOppositeCorners(new_corner, corner);
  910|  21.7k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  21.7k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  21.7k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  21.7k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  21.7k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  87.1k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 65.3k, False: 21.7k]
  ------------------
  920|  65.3k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  65.3k|      }
  922|       |
  923|  21.7k|      init_face_configurations_.push_back(true);
  924|  21.7k|      init_corners_.push_back(new_corner);
  925|  21.7k|    } 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.05k|      init_face_configurations_.push_back(false);
  930|  8.05k|      init_corners_.push_back(corner);
  931|  8.05k|    }
  932|  29.8k|  }
  933|  1.54k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 52, False: 1.49k]
  ------------------
  934|     52|    return -1;  // Unexpected number of decoded faces.
  935|     52|  }
  936|       |
  937|  1.49k|  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.72k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 1.72k, False: 1.48k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  1.72k|    VertexIndex src_vert(num_vertices - 1);
  943|  1.92k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 203, False: 1.72k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    203|      src_vert = VertexIndex(--num_vertices - 1);
  946|    203|    }
  947|  1.72k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 203, False: 1.51k]
  ------------------
  948|    203|      continue;  // No need to swap anything.
  949|    203|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  1.51k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  7.61k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 6.10k, False: 1.51k]
  ------------------
  954|  6.10k|      const CornerIndex cid = vcit.Corner();
  955|  6.10k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 5, False: 6.09k]
  ------------------
  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.09k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  6.09k|    }
  962|  1.51k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  1.51k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  1.51k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  1.51k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  1.51k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  1.51k|    num_vertices--;
  972|  1.51k|  }
  973|  1.48k|  return num_vertices;
  974|  1.49k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.01k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.01k|  uint32_t num_topology_splits;
  982|  2.01k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.01k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.01k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 139, False: 1.87k]
  ------------------
  984|    139|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 1, False: 138]
  ------------------
  985|      1|      return -1;
  986|      1|    }
  987|       |
  988|    139|  } else
  989|  1.87k|#endif
  990|  1.87k|  {
  991|  1.87k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 1.87k]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|  1.87k|  }
  995|  2.01k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 804, False: 1.20k]
  ------------------
  996|    804|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 50, False: 754]
  ------------------
  997|    804|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     50|      return -1;
  999|     50|    }
 1000|    754|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    754|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    754|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 71, False: 683]
  ------------------
 1002|   223k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 223k, False: 37]
  ------------------
 1003|   223k|        TopologySplitEventData event_data;
 1004|   223k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 24, False: 223k]
  ------------------
 1005|     24|          return -1;
 1006|     24|        }
 1007|   223k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 7, False: 223k]
  ------------------
 1008|      7|          return -1;
 1009|      7|        }
 1010|   223k|        uint8_t edge_data;
 1011|   223k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 3, False: 223k]
  ------------------
 1012|      3|          return -1;
 1013|      3|        }
 1014|   223k|        event_data.source_edge = edge_data & 1;
 1015|   223k|        topology_split_data_.push_back(event_data);
 1016|   223k|      }
 1017|       |
 1018|     71|    } else
 1019|    683|#endif
 1020|    683|    {
 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|    683|      int last_source_symbol_id = 0;
 1024|  35.4k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 34.8k, False: 662]
  ------------------
 1025|  34.8k|        TopologySplitEventData event_data;
 1026|  34.8k|        uint32_t delta;
 1027|  34.8k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 6, False: 34.8k]
  ------------------
 1028|      6|          return -1;
 1029|      6|        }
 1030|  34.8k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  34.8k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 4, False: 34.8k]
  ------------------
 1032|      4|          return -1;
 1033|      4|        }
 1034|  34.8k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 11, False: 34.8k]
  ------------------
 1035|     11|          return -1;
 1036|     11|        }
 1037|  34.8k|        event_data.split_symbol_id =
 1038|  34.8k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  34.8k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  34.8k|        topology_split_data_.push_back(event_data);
 1041|  34.8k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    662|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  34.9k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 34.2k, False: 662]
  ------------------
 1045|  34.2k|        uint32_t edge_data;
 1046|  34.2k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  34.2k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 1.79k, False: 32.4k]
  ------------------
 1047|  1.79k|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  32.4k|        } else {
 1049|  32.4k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  32.4k|        }
 1051|  34.2k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  34.2k|        event_data.source_edge = edge_data & 1;
 1053|  34.2k|      }
 1054|    662|      decoder_buffer->EndBitDecoding();
 1055|    662|    }
 1056|    754|  }
 1057|  1.90k|  uint32_t num_hole_events = 0;
 1058|  1.90k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  1.90k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.90k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 80, False: 1.82k]
  ------------------
 1060|     80|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 3, False: 77]
  ------------------
 1061|      3|      return -1;
 1062|      3|    }
 1063|  1.82k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.82k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 273, False: 1.55k]
  ------------------
 1064|    273|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 5, False: 268]
  ------------------
 1065|      5|      return -1;
 1066|      5|    }
 1067|    273|  }
 1068|  1.89k|#endif
 1069|  1.89k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 95, False: 1.80k]
  ------------------
 1070|     95|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     95|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     95|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 65, False: 30]
  ------------------
 1072|   784k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 784k, False: 3]
  ------------------
 1073|   784k|        HoleEventData event_data;
 1074|   784k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 62, False: 784k]
  ------------------
 1075|     62|          return -1;
 1076|     62|        }
 1077|   784k|        hole_event_data_.push_back(event_data);
 1078|   784k|      }
 1079|       |
 1080|     65|    } else
 1081|     30|#endif
 1082|     30|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     30|      int last_symbol_id = 0;
 1085|  2.54k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 2.53k, False: 11]
  ------------------
 1086|  2.53k|        HoleEventData event_data;
 1087|  2.53k|        uint32_t delta;
 1088|  2.53k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 19, False: 2.51k]
  ------------------
 1089|     19|          return -1;
 1090|     19|        }
 1091|  2.51k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  2.51k|        last_symbol_id = event_data.symbol_id;
 1093|  2.51k|        hole_event_data_.push_back(event_data);
 1094|  2.51k|      }
 1095|     30|    }
 1096|     95|  }
 1097|  1.81k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  1.89k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|   554k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|   554k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|   554k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  2.21M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 1.66M, False: 554k]
  ------------------
 1109|  1.66M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  1.66M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 6.67k, False: 1.65M]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  13.6k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 6.96k, False: 6.67k]
  ------------------
 1114|  6.96k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|  6.96k|      }
 1116|  6.67k|      continue;
 1117|  6.67k|    }
 1118|       |
 1119|  3.31M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 1.65M, False: 1.65M]
  ------------------
 1120|  1.65M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  1.65M|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 451k, False: 1.20M]
  ------------------
 1122|   451k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|   451k|      }
 1124|  1.65M|    }
 1125|  1.65M|  }
 1126|   554k|  return true;
 1127|   554k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|  8.95M|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|  8.95M|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|  8.95M|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|  8.95M|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  35.8M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 26.8M, False: 8.95M]
  ------------------
 1139|  26.8M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  26.8M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 108k, False: 26.7M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   265k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 157k, False: 108k]
  ------------------
 1144|   157k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   157k|      }
 1146|   108k|      continue;
 1147|   108k|    }
 1148|  26.7M|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|  26.7M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 13.3M, False: 13.3M]
  ------------------
 1151|  13.3M|      continue;
 1152|  13.3M|    }
 1153|       |
 1154|  30.1M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 16.8M, False: 13.3M]
  ------------------
 1155|  16.8M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  16.8M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 14.0M, False: 2.73M]
  ------------------
 1157|  14.0M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  14.0M|      }
 1159|  16.8M|    }
 1160|  13.3M|  }
 1161|  8.95M|  return true;
 1162|  8.95M|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE21AssignPointsToCornersEi:
 1166|  1.48k|    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.48k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  1.48k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 162, False: 1.32k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  1.67M|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 1.67M, False: 162]
  ------------------
 1176|  1.67M|      Mesh::Face face;
 1177|  1.67M|      const CornerIndex start_corner(3 * f.value());
 1178|  6.71M|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 5.03M, False: 1.67M]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  5.03M|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  5.03M|        face[c] = vert_id;
 1182|  5.03M|      }
 1183|  1.67M|      decoder_->mesh()->SetFace(f, face);
 1184|  1.67M|    }
 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.32k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  1.32k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|  4.80M|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 4.80M, False: 1.31k]
  ------------------
 1197|  4.80M|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|  4.80M|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 2.68k, False: 4.80M]
  ------------------
 1199|  2.68k|      continue;  // Isolated vertex.
 1200|  2.68k|    }
 1201|  4.80M|    CornerIndex deduplication_first_corner = c;
 1202|  4.80M|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 114k, False: 4.68M]
  ------------------
 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|   114k|      deduplication_first_corner = c;
 1206|  4.68M|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  5.37M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 4.81M, False: 559k]
  ------------------
 1210|  4.81M|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 674k, False: 4.13M]
  ------------------
 1211|   674k|          continue;  // No seam for this attribute, ignore it.
 1212|   674k|        }
 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.13M|        const VertexIndex vert_id =
 1217|  4.13M|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  4.13M|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  4.13M|        bool seam_found = false;
 1220|  4.22M|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 4.21M, False: 10.6k]
  ------------------
 1221|  4.21M|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 5, False: 4.21M]
  ------------------
 1222|      5|            return false;
 1223|      5|          }
 1224|  4.21M|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 4.12M, False: 87.3k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  4.12M|            deduplication_first_corner = act_c;
 1227|  4.12M|            seam_found = true;
 1228|  4.12M|            break;
 1229|  4.12M|          }
 1230|  87.3k|          act_c = corner_table_->SwingRight(act_c);
 1231|  87.3k|        }
 1232|  4.13M|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 4.12M, False: 10.6k]
  ------------------
 1233|  4.12M|          break;  // No reason to process other attributes if we found a seam.
 1234|  4.12M|        }
 1235|  4.13M|      }
 1236|  4.68M|    }
 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|  4.80M|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|  4.80M|    corner_to_point_map[c.value()] =
 1246|  4.80M|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|  4.80M|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|  4.80M|    CornerIndex prev_c = c;
 1250|  4.80M|    c = corner_table_->SwingRight(c);
 1251|  28.4M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 28.3M, False: 115k]
  |  Branch (1251:40): [True: 23.6M, False: 4.68M]
  ------------------
 1252|  23.6M|      bool attribute_seam = false;
 1253|  27.1M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 24.2M, False: 2.87M]
  ------------------
 1254|  24.2M|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 20.7M, False: 3.51M]
  ------------------
 1255|  24.2M|            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|  20.7M|          attribute_seam = true;
 1259|  20.7M|          break;
 1260|  20.7M|        }
 1261|  24.2M|      }
 1262|  23.6M|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 20.7M, False: 2.87M]
  ------------------
 1263|  20.7M|        corner_to_point_map[c.value()] =
 1264|  20.7M|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  20.7M|        point_to_corner_map.push_back(c.value());
 1266|  20.7M|      } else {
 1267|  2.87M|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  2.87M|      }
 1269|  23.6M|      prev_c = c;
 1270|  23.6M|      c = corner_table_->SwingRight(c);
 1271|  23.6M|    }
 1272|  4.80M|  }
 1273|       |  // Add faces.
 1274|  9.48M|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 9.47M, False: 1.31k]
  ------------------
 1275|  9.47M|    Mesh::Face face;
 1276|  37.9M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 28.4M, False: 9.47M]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  28.4M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  28.4M|    }
 1280|  9.47M|    decoder_->mesh()->SetFace(f, face);
 1281|  9.47M|  }
 1282|  1.31k|  decoder_->point_cloud()->set_num_points(
 1283|  1.31k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  1.31k|  return true;
 1285|  1.32k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEEC2Ev:
   48|  2.69k|    : decoder_(nullptr),
   49|  2.69k|      last_symbol_id_(-1),
   50|  2.69k|      last_vert_id_(-1),
   51|  2.69k|      last_face_id_(-1),
   52|  2.69k|      num_new_vertices_(0),
   53|  2.69k|      num_encoded_vertices_(0),
   54|  2.69k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.69k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.69k|  decoder_ = decoder;
   60|  2.69k|  return true;
   61|  2.69k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23GetAttributeCornerTableEi:
   66|    270|    int att_id) const {
   67|    381|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 167, False: 214]
  ------------------
   68|    167|    const int decoder_id = attribute_data_[i].decoder_id;
   69|    167|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 97, False: 70]
  |  Branch (69:27): [True: 0, False: 70]
  ------------------
   70|     97|      continue;
   71|     97|    }
   72|     70|    const AttributesDecoderInterface *const dec =
   73|     70|        decoder_->attributes_decoder(decoder_id);
   74|    138|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 124, False: 14]
  ------------------
   75|    124|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 56, False: 68]
  ------------------
   76|     56|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 35, False: 21]
  ------------------
   77|     35|          return &attribute_data_[i].connectivity_data;
   78|     35|        }
   79|     21|        return nullptr;
   80|     56|      }
   81|    124|    }
   82|     70|  }
   83|    214|  return nullptr;
   84|    270|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE24GetAttributeEncodingDataEi:
   89|    270|    int att_id) const {
   90|    381|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 167, False: 214]
  ------------------
   91|    167|    const int decoder_id = attribute_data_[i].decoder_id;
   92|    167|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 97, False: 70]
  |  Branch (92:27): [True: 0, False: 70]
  ------------------
   93|     97|      continue;
   94|     97|    }
   95|     70|    const AttributesDecoderInterface *const dec =
   96|     70|        decoder_->attributes_decoder(decoder_id);
   97|    138|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 124, False: 14]
  ------------------
   98|    124|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 56, False: 68]
  ------------------
   99|     56|        return &attribute_data_[i].encoding_data;
  100|     56|      }
  101|    124|    }
  102|     70|  }
  103|    214|  return &pos_encoding_data_;
  104|    270|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23CreateAttributesDecoderEi:
  130|    344|    int32_t att_decoder_id) {
  131|    344|  int8_t att_data_id;
  132|    344|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 14, False: 330]
  ------------------
  133|     14|    return false;
  134|     14|  }
  135|    330|  uint8_t decoder_type;
  136|    330|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 7, False: 323]
  ------------------
  137|      7|    return false;
  138|      7|  }
  139|       |
  140|    323|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 169, False: 154]
  ------------------
  141|    169|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 25, False: 144]
  ------------------
  142|     25|      return false;  // Unexpected attribute data.
  143|     25|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|    144|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 7, False: 137]
  ------------------
  148|      7|      return false;
  149|      7|    }
  150|       |
  151|    137|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|    154|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    154|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 1, False: 153]
  ------------------
  155|      1|      return false;  // Some other decoder is already using the data. Error.
  156|      1|    }
  157|    153|    pos_data_decoder_id_ = att_decoder_id;
  158|    153|  }
  159|       |
  160|    290|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|    290|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    290|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 290, False: 0]
  ------------------
  162|    290|    uint8_t traversal_method_encoded;
  163|    290|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 8, False: 282]
  ------------------
  164|      8|      return false;
  165|      8|    }
  166|       |    // Check that decoded traversal method is valid.
  167|    282|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 14, False: 268]
  ------------------
  168|     14|      return false;
  169|     14|    }
  170|    268|    traversal_method =
  171|    268|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|    268|  }
  173|       |
  174|    268|  const Mesh *mesh = decoder_->mesh();
  175|    268|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|    268|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 195, False: 73]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    195|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    195|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 136, False: 59]
  ------------------
  182|    136|      encoding_data = &pos_encoding_data_;
  183|    136|    } else {
  184|     59|      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|     59|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|     59|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    195|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 57, False: 138]
  ------------------
  191|     57|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|     57|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|     57|          AttTraverser;
  194|     57|      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|    195|  } else {
  203|     73|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 9, False: 64]
  ------------------
  204|      9|      return false;  // Unsupported method.
  205|      9|    }
  206|     64|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 1, False: 63]
  ------------------
  207|      1|      return false;  // Attribute data must be specified.
  208|      1|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|     63|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|     63|        AttObserver;
  214|     63|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|     63|        AttTraverser;
  216|       |
  217|     63|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|     63|        &attribute_data_[att_data_id].encoding_data;
  219|     63|    const MeshAttributeCornerTable *const corner_table =
  220|     63|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|     63|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|     63|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|     63|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|     63|                             encoding_data);
  227|       |
  228|     63|    AttTraverser att_traverser;
  229|     63|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|     63|    traversal_sequencer->SetTraverser(att_traverser);
  232|     63|    sequencer = std::move(traversal_sequencer);
  233|     63|  }
  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.69k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.69k|  num_new_vertices_ = 0;
  249|  2.69k|  new_to_parent_vertex_map_.clear();
  250|  2.69k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.69k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.69k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 447, False: 2.24k]
  ------------------
  252|    447|    uint32_t num_new_verts;
  253|    447|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    447|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 303, False: 144]
  ------------------
  254|    303|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 303]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|    303|    } else {
  258|    144|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 144]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|    144|    }
  262|    447|    num_new_vertices_ = num_new_verts;
  263|    447|  }
  264|  2.69k|#endif
  265|       |
  266|  2.69k|  uint32_t num_encoded_vertices;
  267|  2.69k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.69k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.69k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 303, False: 2.38k]
  ------------------
  269|    303|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 303]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|    303|  } else
  274|  2.38k|#endif
  275|  2.38k|  {
  276|  2.38k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 0, False: 2.38k]
  ------------------
  277|      0|      return false;
  278|      0|    }
  279|  2.38k|  }
  280|  2.69k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.69k|  uint32_t num_faces;
  283|  2.69k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.69k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.69k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 303, False: 2.38k]
  ------------------
  285|    303|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 303]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|    303|  } else
  290|  2.38k|#endif
  291|  2.38k|  {
  292|  2.38k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 2.38k]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|  2.38k|  }
  296|  2.69k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 2, False: 2.68k]
  ------------------
  297|      2|    return false;  // Draco cannot handle this many faces.
  298|      2|  }
  299|       |
  300|  2.68k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 2, False: 2.68k]
  ------------------
  301|      2|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|      2|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.68k|  const uint32_t min_num_face_edges = 3 * num_faces / 2;
  307|       |
  308|       |  // Maximum number of edges that can exist between |num_encoded_vertices_|.
  309|       |  // This is based on graph theory assuming simple connected graph.
  310|  2.68k|  const uint64_t num_encoded_vertices_64 =
  311|  2.68k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.68k|  const uint64_t max_num_vertex_edges =
  313|  2.68k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.68k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 1, False: 2.68k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      1|    return false;
  317|      1|  }
  318|       |
  319|  2.68k|  uint8_t num_attribute_data;
  320|  2.68k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 2.68k]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|  2.68k|  uint32_t num_encoded_symbols;
  325|  2.68k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.68k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.68k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 300, False: 2.38k]
  ------------------
  327|    300|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 1, False: 299]
  ------------------
  328|      1|      return false;
  329|      1|    }
  330|       |
  331|    300|  } else
  332|  2.38k|#endif
  333|  2.38k|  {
  334|  2.38k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 2.38k]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|  2.38k|  }
  338|       |
  339|  2.68k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 5, False: 2.67k]
  ------------------
  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|      5|    return false;
  344|      5|  }
  345|  2.67k|  const uint32_t max_encoded_faces =
  346|  2.67k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.67k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 12, False: 2.66k]
  ------------------
  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.66k|  uint32_t num_encoded_split_symbols;
  355|  2.66k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.66k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.66k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 291, False: 2.37k]
  ------------------
  357|    291|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 291]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|    291|  } else
  362|  2.37k|#endif
  363|  2.37k|  {
  364|  2.37k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 2.37k]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|  2.37k|  }
  368|       |
  369|  2.66k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 13, False: 2.65k]
  ------------------
  370|     13|    return false;  // Split symbols are a sub-set of all symbols.
  371|     13|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.65k|  vertex_traversal_length_.clear();
  375|  2.65k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.65k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.65k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.65k|  processed_corner_ids_.clear();
  380|  2.65k|  processed_corner_ids_.reserve(num_faces);
  381|  2.65k|  processed_connectivity_corners_.clear();
  382|  2.65k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.65k|  topology_split_data_.clear();
  384|  2.65k|  hole_event_data_.clear();
  385|  2.65k|  init_face_configurations_.clear();
  386|  2.65k|  init_corners_.clear();
  387|       |
  388|  2.65k|  last_symbol_id_ = -1;
  389|  2.65k|  last_face_id_ = -1;
  390|  2.65k|  last_vert_id_ = -1;
  391|       |
  392|  2.65k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.65k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.65k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.65k]
  ------------------
  397|  2.65k|          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.65k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.65k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.65k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.65k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.65k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 431, False: 2.22k]
  ------------------
  411|    431|    uint32_t encoded_connectivity_size;
  412|    431|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    431|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 287, False: 144]
  ------------------
  413|    287|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 5, False: 282]
  ------------------
  414|      5|        return false;
  415|      5|      }
  416|    287|    } else {
  417|    144|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 144]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|    144|    }
  421|    426|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 2, False: 424]
  ------------------
  422|    424|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 32, False: 392]
  ------------------
  423|     34|      return false;
  424|     34|    }
  425|    392|    DecoderBuffer event_buffer;
  426|    392|    event_buffer.Init(
  427|    392|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    392|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    392|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    392|    topology_split_decoded_bytes =
  432|    392|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    392|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 74, False: 318]
  ------------------
  434|     74|      return false;
  435|     74|    }
  436|       |
  437|    392|  } else
  438|  2.22k|#endif
  439|  2.22k|  {
  440|  2.22k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 27, False: 2.19k]
  ------------------
  441|     27|      return false;
  442|     27|    }
  443|  2.22k|  }
  444|       |
  445|  2.51k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.51k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.51k|                                           num_encoded_split_symbols);
  449|  2.51k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.51k|  DecoderBuffer traversal_end_buffer;
  452|  2.51k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 1.21k, False: 1.30k]
  ------------------
  453|  1.21k|    return false;
  454|  1.21k|  }
  455|       |
  456|  1.30k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.30k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 980, False: 324]
  ------------------
  458|    980|    return false;
  459|    980|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|    324|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|    324|                           traversal_end_buffer.remaining_size(),
  464|    324|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|    324|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|    324|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    324|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 4, False: 320]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|      4|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|      4|  }
  471|    324|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|    324|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 209, False: 115]
  ------------------
  475|    209|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|    209|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|    209|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 4, False: 205]
  ------------------
  477|     12|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 8, False: 4]
  ------------------
  478|      8|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 8]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|      8|      }
  482|       |
  483|      4|    } else
  484|    205|#endif
  485|    205|    {
  486|   826k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 826k, False: 205]
  ------------------
  487|   826k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 826k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   826k|      }
  491|    205|    }
  492|    209|  }
  493|    324|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  1.38k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 1.05k, False: 324]
  ------------------
  498|  1.05k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  1.98M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 1.98M, False: 1.05k]
  ------------------
  501|  1.98M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  1.98M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  1.05k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 1.05k]
  ------------------
  505|  1.05k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  1.05k|  }
  509|       |
  510|    324|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  1.38k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 1.05k, False: 324]
  ------------------
  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.05k|    int32_t att_connectivity_verts =
  517|  1.05k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  1.05k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 3, False: 1.05k]
  ------------------
  519|      3|      att_connectivity_verts = corner_table_->num_vertices();
  520|      3|    }
  521|  1.05k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  1.05k|  }
  523|    324|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 11, False: 313]
  ------------------
  524|     11|    return false;
  525|     11|  }
  526|    313|  return true;
  527|    324|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE19OnAttributesDecodedEv:
  530|     21|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|     21|  return true;
  532|     21|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEi:
  536|  1.30k|    int num_symbols) {
  537|       |  // Algorithm does the reverse decoding of the symbols encoded with the
  538|       |  // edgebreaker method. The reverse decoding always keeps track of the active
  539|       |  // edge identified by its opposite corner (active corner). New faces are
  540|       |  // always added to this active edge. There may be multiple active corners at
  541|       |  // one time that either correspond to separate mesh components or to
  542|       |  // sub-components of one mesh that are going to be merged together using the
  543|       |  // TOPOLOGY_S symbol. We can store these active edges on a stack, because the
  544|       |  // decoder always processes only the latest active edge. TOPOLOGY_S then
  545|       |  // removes the top edge from the stack and TOPOLOGY_E adds a new edge to the
  546|       |  // stack.
  547|  1.30k|  std::vector<CornerIndex> active_corner_stack;
  548|       |
  549|       |  // Additional active edges may be added as a result of topology split events.
  550|       |  // They can be added in arbitrary order, but we always know the split symbol
  551|       |  // id they belong to, so we can address them using this symbol id.
  552|  1.30k|  std::unordered_map<int, CornerIndex> topology_split_active_corners;
  553|       |
  554|       |  // Vector used for storing vertices that were marked as isolated during the
  555|       |  // decoding process. Currently used only when the mesh doesn't contain any
  556|       |  // non-position connectivity data.
  557|  1.30k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.30k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.30k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.30k|  int num_faces = 0;
  562|  62.8M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 62.8M, False: 474]
  ------------------
  563|  62.8M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  62.8M|    bool check_topology_split = false;
  566|  62.8M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  62.8M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 2.79M, False: 60.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|  2.79M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 109, False: 2.79M]
  ------------------
  588|    109|        return -1;
  589|    109|      }
  590|       |
  591|  2.79M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  2.79M|      const VertexIndex vertex_x =
  593|  2.79M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  2.79M|      const CornerIndex corner_b =
  595|  2.79M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  2.79M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 335, False: 2.79M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    335|        return -1;
  600|    335|      }
  601|  2.79M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 2.79M]
  |  Branch (601:11): [True: 0, False: 2.79M]
  ------------------
  602|  2.79M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 2.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|  2.79M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  2.79M|      SetOppositeCorners(corner_a, corner + 1);
  612|  2.79M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  2.79M|      const VertexIndex vert_a_prev =
  616|  2.79M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  2.79M|      const VertexIndex vert_b_next =
  618|  2.79M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  2.79M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 2.79M]
  |  Branch (619:38): [True: 0, False: 2.79M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  2.79M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  2.79M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  2.79M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  2.79M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  2.79M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  2.79M|      active_corner_stack.back() = corner;
  631|  60.0M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 1.68k, False: 60.0M]
  |  Branch (631:40): [True: 54.7M, False: 5.36M]
  ------------------
  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|  54.7M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 54.7M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  54.7M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  54.7M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 54.7M]
  ------------------
  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|  54.7M|      const CornerIndex corner(3 * face.value());
  658|  54.7M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  54.7M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 1.68k, False: 54.7M]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  1.68k|        opp_corner = corner + 2;
  662|  1.68k|        corner_l = corner + 1;
  663|  1.68k|        corner_r = corner;
  664|  54.7M|      } else {
  665|       |        // "l" is the new first corner.
  666|  54.7M|        opp_corner = corner + 1;
  667|  54.7M|        corner_l = corner;
  668|  54.7M|        corner_r = corner + 2;
  669|  54.7M|      }
  670|  54.7M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  54.7M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  54.7M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 7, False: 54.7M]
  ------------------
  675|      7|        return -1;  // Unexpected number of decoded vertices.
  676|      7|      }
  677|       |
  678|  54.7M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  54.7M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  54.7M|      const VertexIndex vertex_r =
  682|  54.7M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  54.7M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  54.7M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  54.7M|      corner_table_->MapCornerToVertex(
  688|  54.7M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  54.7M|      active_corner_stack.back() = corner;
  690|  54.7M|      check_topology_split = true;
  691|  54.7M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 38.2k, False: 5.32M]
  ------------------
  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|  38.2k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 1, False: 38.2k]
  ------------------
  703|      1|        return -1;
  704|      1|      }
  705|  38.2k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  38.2k|      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|  38.2k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  38.2k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 35, False: 38.2k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     35|        active_corner_stack.push_back(it->second);
  714|     35|      }
  715|  38.2k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 45, False: 38.2k]
  ------------------
  716|     45|        return -1;
  717|     45|      }
  718|  38.2k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  38.2k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 38.2k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  38.2k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 3, False: 38.2k]
  |  Branch (724:11): [True: 3, False: 38.2k]
  ------------------
  725|  38.2k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 38.2k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      3|        return -1;
  729|      3|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  38.2k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  38.2k|      SetOppositeCorners(corner_a, corner + 2);
  735|  38.2k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  38.2k|      const VertexIndex vertex_p =
  739|  38.2k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  38.2k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  38.2k|      corner_table_->MapCornerToVertex(
  742|  38.2k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  38.2k|      const VertexIndex vert_b_prev =
  744|  38.2k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  38.2k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  38.2k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  38.2k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  38.2k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  38.2k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  38.2k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  38.2k|                                       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|  38.2k|      const CornerIndex first_corner = corner_n;
  757|   345k|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 307k, False: 38.2k]
  ------------------
  758|   307k|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|   307k|        corner_n = corner_table_->SwingLeft(corner_n);
  760|   307k|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 1, False: 307k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      1|          return -1;
  764|      1|        }
  765|   307k|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  38.2k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  38.2k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 37.7k, False: 505]
  ------------------
  770|  37.7k|        invalid_vertices.push_back(vertex_n);
  771|  37.7k|      }
  772|  38.2k|      active_corner_stack.back() = corner;
  773|  5.32M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 5.32M, False: 259]
  ------------------
  774|  5.32M|      const CornerIndex corner(3 * face.value());
  775|  5.32M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  5.32M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  5.32M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  5.32M|                                       corner_table_->AddNewVertex());
  780|  5.32M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  5.32M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  5.32M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 12, False: 5.32M]
  ------------------
  784|     12|        return -1;  // Unexpected number of decoded vertices.
  785|     12|      }
  786|       |
  787|  5.32M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  5.32M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  5.32M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  5.32M|      active_corner_stack.push_back(corner);
  792|  5.32M|      check_topology_split = true;
  793|  5.32M|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|    259|      return -1;
  796|    259|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  62.8M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  62.8M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 60.0M, False: 2.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|  60.0M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  60.0M|      EdgeFaceName split_edge;
  812|  60.0M|      int encoder_split_symbol_id;
  813|  60.0M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.80k, False: 60.0M]
  ------------------
  814|  60.0M|                             &encoder_split_symbol_id)) {
  815|  1.80k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 57, False: 1.75k]
  ------------------
  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|  1.75k|        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.75k|        CornerIndex new_active_corner;
  831|  1.75k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 751, False: 1.00k]
  ------------------
  832|    751|          new_active_corner = corner_table_->Next(act_top_corner);
  833|  1.00k|        } else {
  834|  1.00k|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|  1.00k|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.75k|        const int decoder_split_symbol_id =
  839|  1.75k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.75k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.75k|            new_active_corner;
  842|  1.75k|      }
  843|  60.0M|    }
  844|  62.8M|  }
  845|    474|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 474]
  ------------------
  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.38M|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 4.38M, False: 405]
  ------------------
  850|  4.38M|    const CornerIndex corner = active_corner_stack.back();
  851|  4.38M|    active_corner_stack.pop_back();
  852|  4.38M|    const bool interior_face =
  853|  4.38M|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  4.38M|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 2.31M, False: 2.06M]
  ------------------
  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: 65, False: 2.31M]
  ------------------
  877|     65|        return -1;  // More faces than expected added to the mesh.
  878|     65|      }
  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: 3, False: 2.31M]
  |  Branch (891:55): [True: 0, False: 2.31M]
  ------------------
  892|       |        // All matched corners must be different.
  893|      4|        return -1;
  894|      4|      }
  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.27M|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 6.95M, False: 2.31M]
  ------------------
  920|  6.95M|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  6.95M|      }
  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.06M|      init_face_configurations_.push_back(false);
  930|  2.06M|      init_corners_.push_back(corner);
  931|  2.06M|    }
  932|  4.38M|  }
  933|    405|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 76, False: 329]
  ------------------
  934|     76|    return -1;  // Unexpected number of decoded faces.
  935|     76|  }
  936|       |
  937|    329|  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.15k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 3.15k, False: 324]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  3.15k|    VertexIndex src_vert(num_vertices - 1);
  943|  3.81k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 653, False: 3.15k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    653|      src_vert = VertexIndex(--num_vertices - 1);
  946|    653|    }
  947|  3.15k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 446, False: 2.71k]
  ------------------
  948|    446|      continue;  // No need to swap anything.
  949|    446|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  2.71k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  10.7k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 8.07k, False: 2.70k]
  ------------------
  954|  8.07k|      const CornerIndex cid = vcit.Corner();
  955|  8.07k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 5, False: 8.06k]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      5|        return -1;
  959|      5|      }
  960|  8.06k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  8.06k|    }
  962|  2.70k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  2.70k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  2.70k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  2.70k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  2.70k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  2.70k|    num_vertices--;
  972|  2.70k|  }
  973|    324|  return num_vertices;
  974|    329|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.61k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.61k|  uint32_t num_topology_splits;
  982|  2.61k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.61k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.61k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 250, False: 2.36k]
  ------------------
  984|    250|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 2, False: 248]
  ------------------
  985|      2|      return -1;
  986|      2|    }
  987|       |
  988|    250|  } else
  989|  2.36k|#endif
  990|  2.36k|  {
  991|  2.36k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 2.36k]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|  2.36k|  }
  995|  2.61k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 589, False: 2.02k]
  ------------------
  996|    589|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 21, False: 568]
  ------------------
  997|    589|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     21|      return -1;
  999|     21|    }
 1000|    568|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    568|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    568|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 38, False: 530]
  ------------------
 1002|   130k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 130k, False: 11]
  ------------------
 1003|   130k|        TopologySplitEventData event_data;
 1004|   130k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 17, False: 129k]
  ------------------
 1005|     17|          return -1;
 1006|     17|        }
 1007|   129k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 9, False: 129k]
  ------------------
 1008|      9|          return -1;
 1009|      9|        }
 1010|   129k|        uint8_t edge_data;
 1011|   129k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 1, False: 129k]
  ------------------
 1012|      1|          return -1;
 1013|      1|        }
 1014|   129k|        event_data.source_edge = edge_data & 1;
 1015|   129k|        topology_split_data_.push_back(event_data);
 1016|   129k|      }
 1017|       |
 1018|     38|    } else
 1019|    530|#endif
 1020|    530|    {
 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|    530|      int last_source_symbol_id = 0;
 1024|  4.79k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 4.28k, False: 514]
  ------------------
 1025|  4.28k|        TopologySplitEventData event_data;
 1026|  4.28k|        uint32_t delta;
 1027|  4.28k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 4, False: 4.27k]
  ------------------
 1028|      4|          return -1;
 1029|      4|        }
 1030|  4.27k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  4.27k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 4, False: 4.27k]
  ------------------
 1032|      4|          return -1;
 1033|      4|        }
 1034|  4.27k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 8, False: 4.26k]
  ------------------
 1035|      8|          return -1;
 1036|      8|        }
 1037|  4.26k|        event_data.split_symbol_id =
 1038|  4.26k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  4.26k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  4.26k|        topology_split_data_.push_back(event_data);
 1041|  4.26k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    514|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  4.23k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 3.71k, False: 514]
  ------------------
 1045|  3.71k|        uint32_t edge_data;
 1046|  3.71k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.71k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 641, False: 3.07k]
  ------------------
 1047|    641|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  3.07k|        } else {
 1049|  3.07k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  3.07k|        }
 1051|  3.71k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  3.71k|        event_data.source_edge = edge_data & 1;
 1053|  3.71k|      }
 1054|    514|      decoder_buffer->EndBitDecoding();
 1055|    514|    }
 1056|    568|  }
 1057|  2.54k|  uint32_t num_hole_events = 0;
 1058|  2.54k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.54k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.54k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 212, False: 2.33k]
  ------------------
 1060|    212|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 4, False: 208]
  ------------------
 1061|      4|      return -1;
 1062|      4|    }
 1063|  2.33k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.33k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 99, False: 2.23k]
  ------------------
 1064|     99|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 4, False: 95]
  ------------------
 1065|      4|      return -1;
 1066|      4|    }
 1067|     99|  }
 1068|  2.54k|#endif
 1069|  2.54k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 38, False: 2.50k]
  ------------------
 1070|     38|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     38|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     38|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 22, False: 16]
  ------------------
 1072|  84.8k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 84.8k, False: 2]
  ------------------
 1073|  84.8k|        HoleEventData event_data;
 1074|  84.8k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 20, False: 84.8k]
  ------------------
 1075|     20|          return -1;
 1076|     20|        }
 1077|  84.8k|        hole_event_data_.push_back(event_data);
 1078|  84.8k|      }
 1079|       |
 1080|     22|    } else
 1081|     16|#endif
 1082|     16|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     16|      int last_symbol_id = 0;
 1085|  17.0k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 17.0k, False: 9]
  ------------------
 1086|  17.0k|        HoleEventData event_data;
 1087|  17.0k|        uint32_t delta;
 1088|  17.0k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 7, False: 17.0k]
  ------------------
 1089|      7|          return -1;
 1090|      7|        }
 1091|  17.0k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  17.0k|        last_symbol_id = event_data.symbol_id;
 1093|  17.0k|        hole_event_data_.push_back(event_data);
 1094|  17.0k|      }
 1095|     16|    }
 1096|     38|  }
 1097|  2.51k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.54k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|      8|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|      8|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|      8|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|     32|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 24, False: 8]
  ------------------
 1109|     24|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|     24|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 8, False: 16]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|     16|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 8, False: 8]
  ------------------
 1114|      8|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|      8|      }
 1116|      8|      continue;
 1117|      8|    }
 1118|       |
 1119|     32|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 16, False: 16]
  ------------------
 1120|     16|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|     16|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 9, False: 7]
  ------------------
 1122|      9|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|      9|      }
 1124|     16|    }
 1125|     16|  }
 1126|      8|  return true;
 1127|      8|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   826k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   826k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   826k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   826k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  3.30M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 2.47M, False: 826k]
  ------------------
 1139|  2.47M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  2.47M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 391k, False: 2.08M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|  1.17M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 784k, False: 391k]
  ------------------
 1144|   784k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   784k|      }
 1146|   391k|      continue;
 1147|   391k|    }
 1148|  2.08M|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|  2.08M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 1.04M, False: 1.04M]
  ------------------
 1151|  1.04M|      continue;
 1152|  1.04M|    }
 1153|       |
 1154|  3.12M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 2.08M, False: 1.04M]
  ------------------
 1155|  2.08M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  2.08M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 1.20M, False: 881k]
  ------------------
 1157|  1.20M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  1.20M|      }
 1159|  2.08M|    }
 1160|  1.04M|  }
 1161|   826k|  return true;
 1162|   826k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE21AssignPointsToCornersEi:
 1166|    324|    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|    324|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|    324|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 115, False: 209]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  89.1k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 89.0k, False: 115]
  ------------------
 1176|  89.0k|      Mesh::Face face;
 1177|  89.0k|      const CornerIndex start_corner(3 * f.value());
 1178|   356k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 267k, False: 89.0k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   267k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   267k|        face[c] = vert_id;
 1182|   267k|      }
 1183|  89.0k|      decoder_->mesh()->SetFace(f, face);
 1184|  89.0k|    }
 1185|    115|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|    115|    return true;
 1187|    115|  }
 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|    209|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|    209|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   600k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 600k, False: 198]
  ------------------
 1197|   600k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   600k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 94, False: 600k]
  ------------------
 1199|     94|      continue;  // Isolated vertex.
 1200|     94|    }
 1201|   600k|    CornerIndex deduplication_first_corner = c;
 1202|   600k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 391k, False: 208k]
  ------------------
 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|   391k|      deduplication_first_corner = c;
 1206|   391k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   357k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 294k, False: 63.1k]
  ------------------
 1210|   294k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 144k, False: 149k]
  ------------------
 1211|   144k|          continue;  // No seam for this attribute, ignore it.
 1212|   144k|        }
 1213|       |        // Else there needs to be at least one seam edge.
 1214|       |
 1215|       |        // At this point, we use identity mapping between corners and point ids.
 1216|   149k|        const VertexIndex vert_id =
 1217|   149k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|   149k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|   149k|        bool seam_found = false;
 1220|   171k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 167k, False: 3.79k]
  ------------------
 1221|   167k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 11, False: 167k]
  ------------------
 1222|     11|            return false;
 1223|     11|          }
 1224|   167k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 145k, False: 21.6k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|   145k|            deduplication_first_corner = act_c;
 1227|   145k|            seam_found = true;
 1228|   145k|            break;
 1229|   145k|          }
 1230|  21.6k|          act_c = corner_table_->SwingRight(act_c);
 1231|  21.6k|        }
 1232|   149k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 145k, False: 3.79k]
  ------------------
 1233|   145k|          break;  // No reason to process other attributes if we found a seam.
 1234|   145k|        }
 1235|   149k|      }
 1236|   208k|    }
 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|   600k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   600k|    corner_to_point_map[c.value()] =
 1246|   600k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   600k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   600k|    CornerIndex prev_c = c;
 1250|   600k|    c = corner_table_->SwingRight(c);
 1251|  2.47M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 2.08M, False: 391k]
  |  Branch (1251:40): [True: 1.87M, False: 208k]
  ------------------
 1252|  1.87M|      bool attribute_seam = false;
 1253|  3.20M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 2.70M, False: 503k]
  ------------------
 1254|  2.70M|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 1.36M, False: 1.33M]
  ------------------
 1255|  2.70M|            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.36M|          attribute_seam = true;
 1259|  1.36M|          break;
 1260|  1.36M|        }
 1261|  2.70M|      }
 1262|  1.87M|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 1.36M, False: 503k]
  ------------------
 1263|  1.36M|        corner_to_point_map[c.value()] =
 1264|  1.36M|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  1.36M|        point_to_corner_map.push_back(c.value());
 1266|  1.36M|      } else {
 1267|   503k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|   503k|      }
 1269|  1.87M|      prev_c = c;
 1270|  1.87M|      c = corner_table_->SwingRight(c);
 1271|  1.87M|    }
 1272|   600k|  }
 1273|       |  // Add faces.
 1274|   774k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 774k, False: 198]
  ------------------
 1275|   774k|    Mesh::Face face;
 1276|  3.09M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 2.32M, False: 774k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  2.32M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  2.32M|    }
 1280|   774k|    decoder_->mesh()->SetFace(f, face);
 1281|   774k|  }
 1282|    198|  decoder_->point_cloud()->set_num_points(
 1283|    198|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|    198|  return true;
 1285|    209|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    204|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    204|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    204|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    204|  const Mesh *mesh = decoder_->mesh();
  115|    204|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    204|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    204|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    204|                           encoding_data);
  120|       |
  121|    204|  TraverserT att_traverser;
  122|    204|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    204|  traversal_sequencer->SetTraverser(att_traverser);
  125|    204|  return std::move(traversal_sequencer);
  126|    204|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|  1.11k|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|  1.11k|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|  1.11k|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|  1.11k|  const Mesh *mesh = decoder_->mesh();
  115|  1.11k|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|  1.11k|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|  1.11k|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|  1.11k|                           encoding_data);
  120|       |
  121|  1.11k|  TraverserT att_traverser;
  122|  1.11k|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|  1.11k|  traversal_sequencer->SetTraverser(att_traverser);
  125|  1.11k|  return std::move(traversal_sequencer);
  126|  1.11k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    247|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    247|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    247|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    247|  const Mesh *mesh = decoder_->mesh();
  115|    247|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    247|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    247|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    247|                           encoding_data);
  120|       |
  121|    247|  TraverserT att_traverser;
  122|    247|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    247|  traversal_sequencer->SetTraverser(att_traverser);
  125|    247|  return std::move(traversal_sequencer);
  126|    247|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    364|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    364|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    364|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    364|  const Mesh *mesh = decoder_->mesh();
  115|    364|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    364|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    364|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    364|                           encoding_data);
  120|       |
  121|    364|  TraverserT att_traverser;
  122|    364|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    364|  traversal_sequencer->SetTraverser(att_traverser);
  125|    364|  return std::move(traversal_sequencer);
  126|    364|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     57|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|     57|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     57|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     57|  const Mesh *mesh = decoder_->mesh();
  115|     57|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     57|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     57|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     57|                           encoding_data);
  120|       |
  121|     57|  TraverserT att_traverser;
  122|     57|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     57|  traversal_sequencer->SetTraverser(att_traverser);
  125|     57|  return std::move(traversal_sequencer);
  126|     57|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    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|  9.22k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  3.43k|  const CornerTable *GetCornerTable() const override {
   67|  3.43k|    return corner_table_.get();
   68|  3.43k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  13.9M|                       int *out_encoder_split_symbol_id) {
   87|  13.9M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 1.78M, False: 12.1M]
  ------------------
   88|  1.78M|      return false;
   89|  1.78M|    }
   90|  12.1M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 32, False: 12.1M]
  ------------------
   91|  12.1M|        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|     32|      *out_encoder_split_symbol_id = -1;
   98|     32|      return true;
   99|     32|    }
  100|  12.1M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 12.1M, False: 1.83k]
  ------------------
  101|  12.1M|      return false;
  102|  12.1M|    }
  103|  1.83k|    *out_face_edge =
  104|  1.83k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.83k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.83k|    topology_split_data_.pop_back();
  108|  1.83k|    return true;
  109|  12.1M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  49.4M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  49.4M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  49.4M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  49.4M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  10.2k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  5.44k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  3.60k|  const CornerTable *GetCornerTable() const override {
   67|  3.60k|    return corner_table_.get();
   68|  3.60k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  34.0M|                       int *out_encoder_split_symbol_id) {
   87|  34.0M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 33.5M, False: 594k]
  ------------------
   88|  33.5M|      return false;
   89|  33.5M|    }
   90|   594k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 48, False: 594k]
  ------------------
   91|   594k|        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|     48|      *out_encoder_split_symbol_id = -1;
   98|     48|      return true;
   99|     48|    }
  100|   594k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 593k, False: 1.59k]
  ------------------
  101|   593k|      return false;
  102|   593k|    }
  103|  1.59k|    *out_face_edge =
  104|  1.59k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.59k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.59k|    topology_split_data_.pop_back();
  108|  1.59k|    return true;
  109|   594k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  99.1M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  99.1M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  99.1M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  99.1M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  14.9k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  13.8k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  2.78k|  const CornerTable *GetCornerTable() const override {
   67|  2.78k|    return corner_table_.get();
   68|  2.78k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  60.0M|                       int *out_encoder_split_symbol_id) {
   87|  60.0M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 59.6M, False: 362k]
  ------------------
   88|  59.6M|      return false;
   89|  59.6M|    }
   90|   362k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 57, False: 362k]
  ------------------
   91|   362k|        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|   362k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 360k, False: 1.75k]
  ------------------
  101|   360k|      return false;
  102|   360k|    }
  103|  1.75k|    *out_face_edge =
  104|  1.75k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.75k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.75k|    topology_split_data_.pop_back();
  108|  1.75k|    return true;
  109|   362k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  67.3M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  67.3M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  67.3M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  67.3M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  7.26k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  8.06k|      : attribute_connectivity_decoders_(nullptr),
   34|  8.06k|        num_attribute_data_(0),
   35|  8.06k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  7.40k|  void Init(MeshEdgebreakerDecoderImplInterface *decoder) {
   37|  7.40k|    decoder_impl_ = decoder;
   38|  7.40k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  7.40k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  7.40k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  7.40k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  6.35k|  uint16_t BitstreamVersion() const {
   45|  6.35k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  6.35k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  3.07k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  7.40k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  4.89k|  bool Start(DecoderBuffer *out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  4.89k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 72, False: 4.82k]
  ------------------
   63|     72|      return false;
   64|     72|    }
   65|       |
   66|  4.82k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 87, False: 4.73k]
  ------------------
   67|     87|      return false;
   68|     87|    }
   69|       |
   70|  4.73k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 8, False: 4.72k]
  ------------------
   71|      8|      return false;
   72|      8|    }
   73|  4.72k|    *out_buffer = buffer_;
   74|  4.72k|    return true;
   75|  4.73k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  4.43M|  inline bool DecodeStartFaceConfiguration() {
   79|  4.43M|    uint32_t face_configuration;
   80|  4.43M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  4.43M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.43M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 1.29k, False: 4.43M]
  ------------------
   82|  1.29k|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|  1.29k|    } else
   85|  4.43M|#endif
   86|  4.43M|    {
   87|  4.43M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  4.43M|    }
   89|  4.43M|    return face_configuration;
   90|  4.43M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  34.3M|  inline uint32_t DecodeSymbol() {
   94|  34.3M|    uint32_t symbol;
   95|  34.3M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  34.3M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 15.3M, False: 19.0M]
  ------------------
   97|  15.3M|      return symbol;
   98|  15.3M|    }
   99|       |    // Else decode two additional bits.
  100|  19.0M|    uint32_t symbol_suffix;
  101|  19.0M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  19.0M|    symbol |= (symbol_suffix << 1);
  103|  19.0M|    return symbol;
  104|  34.3M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  34.2M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|  4.94M|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  21.1M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  21.1M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  21.1M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  4.53k|  void Done() {
  123|  4.53k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 4.21k, False: 320]
  ------------------
  124|  4.21k|      symbol_buffer_.EndBitDecoding();
  125|  4.21k|    }
  126|  4.53k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  4.53k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.53k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 516, False: 4.01k]
  ------------------
  128|    516|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    516|    } else
  131|  4.01k|#endif
  132|  4.01k|    {
  133|  4.01k|      start_face_decoder_.EndDecoding();
  134|  4.01k|    }
  135|  4.53k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|  2.35k|  DecoderBuffer *buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  5.21k|  bool DecodeTraversalSymbols() {
  141|  5.21k|    uint64_t traversal_size;
  142|  5.21k|    symbol_buffer_ = buffer_;
  143|  5.21k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 19, False: 5.19k]
  ------------------
  144|     19|      return false;
  145|     19|    }
  146|  5.19k|    buffer_ = symbol_buffer_;
  147|  5.19k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 107, False: 5.08k]
  ------------------
  148|    107|      return false;
  149|    107|    }
  150|  5.08k|    buffer_.Advance(traversal_size);
  151|  5.08k|    return true;
  152|  5.19k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  7.28k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  7.28k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  7.28k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  7.28k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 896, False: 6.38k]
  ------------------
  158|    896|      start_face_buffer_ = buffer_;
  159|    896|      uint64_t traversal_size;
  160|    896|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 3, False: 893]
  ------------------
  161|      3|        return false;
  162|      3|      }
  163|    893|      buffer_ = start_face_buffer_;
  164|    893|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 148, False: 745]
  ------------------
  165|    148|        return false;
  166|    148|      }
  167|    745|      buffer_.Advance(traversal_size);
  168|    745|      return true;
  169|    893|    }
  170|  6.38k|#endif
  171|  6.38k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  7.28k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  7.10k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  7.10k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 4.61k, False: 2.49k]
  ------------------
  177|  4.61k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  4.61k|          new BinaryDecoder[num_attribute_data_]);
  179|  13.1k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 8.60k, False: 4.59k]
  ------------------
  180|  8.60k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 24, False: 8.57k]
  ------------------
  181|     24|          return false;
  182|     24|        }
  183|  8.60k|      }
  184|  4.61k|    }
  185|  7.08k|    return true;
  186|  7.10k|  }

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

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

_ZN5draco21MeshSequentialDecoderC2Ev:
   27|  3.29k|MeshSequentialDecoder::MeshSequentialDecoder() {}
_ZN5draco21MeshSequentialDecoder18DecodeConnectivityEv:
   29|  2.97k|bool MeshSequentialDecoder::DecodeConnectivity() {
   30|  2.97k|  uint32_t num_faces;
   31|  2.97k|  uint32_t num_points;
   32|  2.97k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   33|  2.97k|  if (bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.97k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (33:7): [True: 597, False: 2.38k]
  ------------------
   34|    597|    if (!buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (34:9): [True: 0, False: 597]
  ------------------
   35|      0|      return false;
   36|      0|    }
   37|    597|    if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (37:9): [True: 0, False: 597]
  ------------------
   38|      0|      return false;
   39|      0|    }
   40|       |
   41|    597|  } else
   42|  2.38k|#endif
   43|  2.38k|  {
   44|  2.38k|    if (!DecodeVarint(&num_faces, buffer())) {
  ------------------
  |  Branch (44:9): [True: 0, False: 2.38k]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|  2.38k|    if (!DecodeVarint(&num_points, buffer())) {
  ------------------
  |  Branch (47:9): [True: 0, False: 2.38k]
  ------------------
   48|      0|      return false;
   49|      0|    }
   50|  2.38k|  }
   51|       |
   52|       |  // Check that num_faces and num_points are valid values.
   53|  2.97k|  const uint64_t faces_64 = static_cast<uint64_t>(num_faces);
   54|       |  // Compressed sequential encoding can only handle (2^32 - 1) / 3 indices.
   55|  2.97k|  if (faces_64 > 0xffffffff / 3) {
  ------------------
  |  Branch (55:7): [True: 0, False: 2.97k]
  ------------------
   56|      0|    return false;
   57|      0|  }
   58|  2.97k|  if (faces_64 > buffer()->remaining_size() / 3) {
  ------------------
  |  Branch (58:7): [True: 2, False: 2.97k]
  ------------------
   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|  2.97k|  uint8_t connectivity_method;
   64|  2.97k|  if (!buffer()->Decode(&connectivity_method)) {
  ------------------
  |  Branch (64:7): [True: 0, False: 2.97k]
  ------------------
   65|      0|    return false;
   66|      0|  }
   67|  2.97k|  if (connectivity_method == 0) {
  ------------------
  |  Branch (67:7): [True: 2.05k, False: 919]
  ------------------
   68|  2.05k|    if (!DecodeAndDecompressIndices(num_faces)) {
  ------------------
  |  Branch (68:9): [True: 1.91k, False: 142]
  ------------------
   69|  1.91k|      return false;
   70|  1.91k|    }
   71|  2.05k|  } else {
   72|    919|    if (num_points < 256) {
  ------------------
  |  Branch (72:9): [True: 633, False: 286]
  ------------------
   73|       |      // Decode indices as uint8_t.
   74|  34.6k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (74:28): [True: 34.0k, False: 630]
  ------------------
   75|  34.0k|        Mesh::Face face;
   76|   136k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (76:25): [True: 102k, False: 34.0k]
  ------------------
   77|   102k|          uint8_t val;
   78|   102k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (78:15): [True: 3, False: 102k]
  ------------------
   79|      3|            return false;
   80|      3|          }
   81|   102k|          face[j] = val;
   82|   102k|        }
   83|  34.0k|        mesh()->AddFace(face);
   84|  34.0k|      }
   85|    633|    } else if (num_points < (1 << 16)) {
  ------------------
  |  Branch (85:16): [True: 194, False: 92]
  ------------------
   86|       |      // Decode indices as uint16_t.
   87|   432k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (87:28): [True: 432k, False: 179]
  ------------------
   88|   432k|        Mesh::Face face;
   89|  1.73M|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (89:25): [True: 1.29M, False: 432k]
  ------------------
   90|  1.29M|          uint16_t val;
   91|  1.29M|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (91:15): [True: 15, False: 1.29M]
  ------------------
   92|     15|            return false;
   93|     15|          }
   94|  1.29M|          face[j] = val;
   95|  1.29M|        }
   96|   432k|        mesh()->AddFace(face);
   97|   432k|      }
   98|    194|    } else if (num_points < (1 << 21) &&
  ------------------
  |  Branch (98:16): [True: 24, False: 68]
  ------------------
   99|     24|               bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     24|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (99:16): [True: 19, False: 5]
  ------------------
  100|       |      // Decode indices as uint32_t.
  101|    788|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (101:28): [True: 778, False: 10]
  ------------------
  102|    778|        Mesh::Face face;
  103|  3.09k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (103:25): [True: 2.32k, False: 769]
  ------------------
  104|  2.32k|          uint32_t val;
  105|  2.32k|          if (!DecodeVarint(&val, buffer())) {
  ------------------
  |  Branch (105:15): [True: 9, False: 2.31k]
  ------------------
  106|      9|            return false;
  107|      9|          }
  108|  2.31k|          face[j] = val;
  109|  2.31k|        }
  110|    769|        mesh()->AddFace(face);
  111|    769|      }
  112|     73|    } 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: 55]
  ------------------
  115|  17.6k|        Mesh::Face face;
  116|  70.7k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (116:25): [True: 53.0k, False: 17.6k]
  ------------------
  117|  53.0k|          uint32_t val;
  118|  53.0k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (118:15): [True: 18, False: 53.0k]
  ------------------
  119|     18|            return false;
  120|     18|          }
  121|  53.0k|          face[j] = val;
  122|  53.0k|        }
  123|  17.6k|        mesh()->AddFace(face);
  124|  17.6k|      }
  125|     73|    }
  126|    919|  }
  127|  1.01k|  point_cloud()->set_num_points(num_points);
  128|  1.01k|  return true;
  129|  2.97k|}
_ZN5draco21MeshSequentialDecoder23CreateAttributesDecoderEi:
  131|  29.0k|bool MeshSequentialDecoder::CreateAttributesDecoder(int32_t att_decoder_id) {
  132|       |  // Always create the basic attribute decoder.
  133|  29.0k|  return SetAttributesDecoder(
  134|  29.0k|      att_decoder_id,
  135|  29.0k|      std::unique_ptr<AttributesDecoder>(
  136|  29.0k|          new SequentialAttributeDecodersController(
  137|  29.0k|              std::unique_ptr<PointsSequencer>(
  138|  29.0k|                  new LinearSequencer(point_cloud()->num_points())))));
  139|  29.0k|}
_ZN5draco21MeshSequentialDecoder26DecodeAndDecompressIndicesEj:
  141|  2.05k|bool MeshSequentialDecoder::DecodeAndDecompressIndices(uint32_t num_faces) {
  142|       |  // Get decoded indices differences that were encoded with an entropy code.
  143|  2.05k|  std::vector<uint32_t> indices_buffer(num_faces * 3);
  144|  2.05k|  if (!DecodeSymbols(num_faces * 3, 1, buffer(), indices_buffer.data())) {
  ------------------
  |  Branch (144:7): [True: 1.83k, False: 226]
  ------------------
  145|  1.83k|    return false;
  146|  1.83k|  }
  147|       |  // Reconstruct the indices from the differences.
  148|       |  // See MeshSequentialEncoder::CompressAndEncodeIndices() for more details.
  149|    226|  int32_t last_index_value = 0;  // This will always be >= 0.
  150|    226|  int vertex_index = 0;
  151|  5.09k|  for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (151:24): [True: 4.95k, False: 142]
  ------------------
  152|  4.95k|    Mesh::Face face;
  153|  19.6k|    for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (153:21): [True: 14.7k, False: 4.87k]
  ------------------
  154|  14.7k|      const uint32_t encoded_val = indices_buffer[vertex_index++];
  155|  14.7k|      int32_t index_diff = (encoded_val >> 1);
  156|  14.7k|      if (encoded_val & 1) {
  ------------------
  |  Branch (156:11): [True: 713, False: 14.0k]
  ------------------
  157|    713|        if (index_diff > last_index_value) {
  ------------------
  |  Branch (157:13): [True: 52, False: 661]
  ------------------
  158|       |          // Subtracting index_diff would result in a negative index.
  159|     52|          return false;
  160|     52|        }
  161|    661|        index_diff = -index_diff;
  162|  14.0k|      } else {
  163|  14.0k|        if (index_diff >
  ------------------
  |  Branch (163:13): [True: 32, False: 14.0k]
  ------------------
  164|  14.0k|            (std::numeric_limits<int32_t>::max() - last_index_value)) {
  165|       |          // Adding index_diff to last_index_value would overflow.
  166|     32|          return false;
  167|     32|        }
  168|  14.0k|      }
  169|  14.6k|      const int32_t index_value = index_diff + last_index_value;
  170|  14.6k|      face[j] = index_value;
  171|  14.6k|      last_index_value = index_value;
  172|  14.6k|    }
  173|  4.87k|    mesh()->AddFace(face);
  174|  4.87k|  }
  175|    142|  return true;
  176|    226|}

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.51k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  1.72M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  1.72M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.66M, False: 59.1k]
  ------------------
   61|  1.66M|      return true;  // Already traversed.
   62|  1.66M|    }
   63|       |
   64|  59.1k|    corner_traversal_stack_.clear();
   65|  59.1k|    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|  59.1k|    const VertexIndex next_vert =
   69|  59.1k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  59.1k|    const VertexIndex prev_vert =
   71|  59.1k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  59.1k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 59.1k]
  |  Branch (72:45): [True: 0, False: 59.1k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  59.1k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 58.2k, False: 918]
  ------------------
   76|  58.2k|      this->MarkVertexVisited(next_vert);
   77|  58.2k|      this->traversal_observer().OnNewVertexVisited(
   78|  58.2k|          next_vert, this->corner_table()->Next(corner_id));
   79|  58.2k|    }
   80|  59.1k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 3.69k, False: 55.5k]
  ------------------
   81|  3.69k|      this->MarkVertexVisited(prev_vert);
   82|  3.69k|      this->traversal_observer().OnNewVertexVisited(
   83|  3.69k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  3.69k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|   128k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 69.1k, False: 59.1k]
  ------------------
   88|       |      // Currently processed corner.
   89|  69.1k|      corner_id = corner_traversal_stack_.back();
   90|  69.1k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  69.1k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 69.1k]
  |  Branch (92:47): [True: 578, False: 68.5k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    578|        corner_traversal_stack_.pop_back();
   95|    578|        continue;
   96|    578|      }
   97|  1.72M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 1.72M, Folded]
  ------------------
   98|  1.72M|        this->MarkFaceVisited(face_id);
   99|  1.72M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  1.72M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  1.72M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 1.72M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  1.72M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 845k, False: 883k]
  ------------------
  105|   845k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|   845k|          this->MarkVertexVisited(vert_id);
  107|   845k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|   845k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 825k, False: 19.3k]
  ------------------
  109|   825k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   825k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   825k|            continue;
  112|   825k|          }
  113|   845k|        }
  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|   903k|        const CornerIndex right_corner_id =
  118|   903k|            this->corner_table()->GetRightCorner(corner_id);
  119|   903k|        const CornerIndex left_corner_id =
  120|   903k|            this->corner_table()->GetLeftCorner(corner_id);
  121|   903k|        const FaceIndex right_face_id(
  122|   903k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 14.3k, False: 888k]
  ------------------
  123|   903k|                 ? kInvalidFaceIndex
  124|   903k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|   903k|        const FaceIndex left_face_id(
  126|   903k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 63.0k, False: 840k]
  ------------------
  127|   903k|                 ? kInvalidFaceIndex
  128|   903k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|   903k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 857k, False: 45.7k]
  ------------------
  130|       |          // Right face has been already visited.
  131|   857k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 63.5k, False: 793k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  63.5k|            corner_traversal_stack_.pop_back();
  134|  63.5k|            break;  // Break from the while (true) loop.
  135|   793k|          } else {
  136|       |            // Go to the left face.
  137|   793k|            corner_id = left_corner_id;
  138|   793k|            face_id = left_face_id;
  139|   793k|          }
  140|   857k|        } else {
  141|       |          // Right face was not visited.
  142|  45.7k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 40.8k, False: 4.95k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  40.8k|            corner_id = right_corner_id;
  145|  40.8k|            face_id = right_face_id;
  146|  40.8k|          } 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|  4.95k|            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|  4.95k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  4.95k|            break;
  159|  4.95k|          }
  160|  45.7k|        }
  161|   903k|      }
  162|  68.5k|    }
  163|  59.1k|    return true;
  164|  59.1k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.51k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  3.23k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.96k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  4.55M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  4.55M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.48M, False: 3.06M]
  ------------------
   61|  1.48M|      return true;  // Already traversed.
   62|  1.48M|    }
   63|       |
   64|  3.06M|    corner_traversal_stack_.clear();
   65|  3.06M|    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.06M|    const VertexIndex next_vert =
   69|  3.06M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  3.06M|    const VertexIndex prev_vert =
   71|  3.06M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  3.06M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 3.06M]
  |  Branch (72:45): [True: 0, False: 3.06M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  3.06M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 3.06M, False: 1.45k]
  ------------------
   76|  3.06M|      this->MarkVertexVisited(next_vert);
   77|  3.06M|      this->traversal_observer().OnNewVertexVisited(
   78|  3.06M|          next_vert, this->corner_table()->Next(corner_id));
   79|  3.06M|    }
   80|  3.06M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 3.00M, False: 65.4k]
  ------------------
   81|  3.00M|      this->MarkVertexVisited(prev_vert);
   82|  3.00M|      this->traversal_observer().OnNewVertexVisited(
   83|  3.00M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  3.00M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  6.17M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 3.11M, False: 3.06M]
  ------------------
   88|       |      // Currently processed corner.
   89|  3.11M|      corner_id = corner_traversal_stack_.back();
   90|  3.11M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  3.11M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 3.11M]
  |  Branch (92:47): [True: 4.03k, False: 3.10M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  4.03k|        corner_traversal_stack_.pop_back();
   95|  4.03k|        continue;
   96|  4.03k|      }
   97|  4.55M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 4.55M, Folded]
  ------------------
   98|  4.55M|        this->MarkFaceVisited(face_id);
   99|  4.55M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  4.55M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  4.55M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 4.55M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  4.55M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 3.76M, False: 788k]
  ------------------
  105|  3.76M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  3.76M|          this->MarkVertexVisited(vert_id);
  107|  3.76M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  3.76M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 712k, False: 3.05M]
  ------------------
  109|   712k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   712k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   712k|            continue;
  112|   712k|          }
  113|  3.76M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  3.83M|        const CornerIndex right_corner_id =
  118|  3.83M|            this->corner_table()->GetRightCorner(corner_id);
  119|  3.83M|        const CornerIndex left_corner_id =
  120|  3.83M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  3.83M|        const FaceIndex right_face_id(
  122|  3.83M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 3.03M, False: 808k]
  ------------------
  123|  3.83M|                 ? kInvalidFaceIndex
  124|  3.83M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  3.83M|        const FaceIndex left_face_id(
  126|  3.83M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 3.08M, False: 751k]
  ------------------
  127|  3.83M|                 ? kInvalidFaceIndex
  128|  3.83M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  3.83M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 3.74M, False: 90.6k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  3.74M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 3.08M, False: 663k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  3.08M|            corner_traversal_stack_.pop_back();
  134|  3.08M|            break;  // Break from the while (true) loop.
  135|  3.08M|          } else {
  136|       |            // Go to the left face.
  137|   663k|            corner_id = left_corner_id;
  138|   663k|            face_id = left_face_id;
  139|   663k|          }
  140|  3.74M|        } else {
  141|       |          // Right face was not visited.
  142|  90.6k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 69.1k, False: 21.5k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  69.1k|            corner_id = right_corner_id;
  145|  69.1k|            face_id = right_face_id;
  146|  69.1k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  21.5k|            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|  21.5k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  21.5k|            break;
  159|  21.5k|          }
  160|  90.6k|        }
  161|  3.83M|      }
  162|  3.10M|    }
  163|  3.06M|    return true;
  164|  3.06M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.96k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  4.08k|  DepthFirstTraverser() {}

_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   58|    465|  void OnTraversalStart() {
   59|    465|    prediction_degree_.resize(this->corner_table()->num_vertices(), 0);
   60|    465|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  2.72M|  bool TraverseFromCorner(CornerIndex corner_id) {
   66|  2.72M|    if (prediction_degree_.size() == 0) {
  ------------------
  |  Branch (66:9): [True: 0, False: 2.72M]
  ------------------
   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.72M|    traversal_stacks_[0].push_back(corner_id);
   74|  2.72M|    best_priority_ = 0;
   75|       |    // For the first face, check the remaining corners as they may not be
   76|       |    // processed yet.
   77|  2.72M|    const VertexIndex next_vert =
   78|  2.72M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   79|  2.72M|    const VertexIndex prev_vert =
   80|  2.72M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   81|  2.72M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (81:9): [True: 16.1k, False: 2.71M]
  ------------------
   82|  16.1k|      this->MarkVertexVisited(next_vert);
   83|  16.1k|      this->traversal_observer().OnNewVertexVisited(
   84|  16.1k|          next_vert, this->corner_table()->Next(corner_id));
   85|  16.1k|    }
   86|  2.72M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (86:9): [True: 2.73k, False: 2.72M]
  ------------------
   87|  2.73k|      this->MarkVertexVisited(prev_vert);
   88|  2.73k|      this->traversal_observer().OnNewVertexVisited(
   89|  2.73k|          prev_vert, this->corner_table()->Previous(corner_id));
   90|  2.73k|    }
   91|  2.72M|    const VertexIndex tip_vertex = this->corner_table()->Vertex(corner_id);
   92|  2.72M|    if (!this->IsVertexVisited(tip_vertex)) {
  ------------------
  |  Branch (92:9): [True: 2.57k, False: 2.72M]
  ------------------
   93|  2.57k|      this->MarkVertexVisited(tip_vertex);
   94|  2.57k|      this->traversal_observer().OnNewVertexVisited(tip_vertex, corner_id);
   95|  2.57k|    }
   96|       |    // Start the actual traversal.
   97|  8.05M|    while ((corner_id = PopNextCornerToTraverse()) != kInvalidCornerIndex) {
  ------------------
  |  Branch (97:12): [True: 5.32M, False: 2.72M]
  ------------------
   98|  5.32M|      FaceIndex face_id(corner_id.value() / 3);
   99|       |      // Make sure the face hasn't been visited yet.
  100|  5.32M|      if (this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (100:11): [True: 4.04M, False: 1.27M]
  ------------------
  101|       |        // This face has been already traversed.
  102|  4.04M|        continue;
  103|  4.04M|      }
  104|       |
  105|  2.72M|      while (true) {
  ------------------
  |  Branch (105:14): [True: 2.72M, Folded]
  ------------------
  106|  2.72M|        face_id = FaceIndex(corner_id.value() / 3);
  107|  2.72M|        this->MarkFaceVisited(face_id);
  108|  2.72M|        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.72M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  113|  2.72M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (113:13): [True: 1.37M, False: 1.35M]
  ------------------
  114|  1.37M|          this->MarkVertexVisited(vert_id);
  115|  1.37M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  116|  1.37M|        }
  117|       |
  118|       |        // Check whether we can traverse to the right and left neighboring
  119|       |        // faces.
  120|  2.72M|        const CornerIndex right_corner_id =
  121|  2.72M|            this->corner_table()->GetRightCorner(corner_id);
  122|  2.72M|        const CornerIndex left_corner_id =
  123|  2.72M|            this->corner_table()->GetLeftCorner(corner_id);
  124|  2.72M|        const FaceIndex right_face_id(
  125|  2.72M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (125:14): [True: 21.7k, False: 2.70M]
  ------------------
  126|  2.72M|                 ? kInvalidFaceIndex
  127|  2.72M|                 : FaceIndex(right_corner_id.value() / 3)));
  128|  2.72M|        const FaceIndex left_face_id(
  129|  2.72M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (129:14): [True: 34.8k, False: 2.69M]
  ------------------
  130|  2.72M|                 ? kInvalidFaceIndex
  131|  2.72M|                 : FaceIndex(left_corner_id.value() / 3)));
  132|  2.72M|        const bool is_right_face_visited = this->IsFaceVisited(right_face_id);
  133|  2.72M|        const bool is_left_face_visited = this->IsFaceVisited(left_face_id);
  134|       |
  135|  2.72M|        if (!is_left_face_visited) {
  ------------------
  |  Branch (135:13): [True: 2.05M, False: 672k]
  ------------------
  136|       |          // We can go to the left face.
  137|  2.05M|          const int priority = ComputePriority(left_corner_id);
  138|  2.05M|          if (is_right_face_visited && priority <= best_priority_) {
  ------------------
  |  Branch (138:15): [True: 713k, False: 1.34M]
  |  Branch (138:40): [True: 685k, False: 27.8k]
  ------------------
  139|       |            // Right face has been already visited and the priority is equal or
  140|       |            // better than the best priority. We are sure that the left face
  141|       |            // would be traversed next so there is no need to put it onto the
  142|       |            // stack.
  143|   685k|            corner_id = left_corner_id;
  144|   685k|            continue;
  145|  1.36M|          } else {
  146|  1.36M|            AddCornerToTraversalStack(left_corner_id, priority);
  147|  1.36M|          }
  148|  2.05M|        }
  149|  2.04M|        if (!is_right_face_visited) {
  ------------------
  |  Branch (149:13): [True: 1.99M, False: 49.6k]
  ------------------
  150|       |          // Go to the right face.
  151|  1.99M|          const int priority = ComputePriority(right_corner_id);
  152|  1.99M|          if (priority <= best_priority_) {
  ------------------
  |  Branch (152:15): [True: 765k, False: 1.22M]
  ------------------
  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|   765k|            corner_id = right_corner_id;
  156|   765k|            continue;
  157|  1.22M|          } else {
  158|  1.22M|            AddCornerToTraversalStack(right_corner_id, priority);
  159|  1.22M|          }
  160|  1.99M|        }
  161|       |
  162|       |        // Couldn't proceed directly to the next corner
  163|  1.27M|        break;
  164|  2.04M|      }
  165|  1.27M|    }
  166|  2.72M|    return true;
  167|  2.72M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE23PopNextCornerToTraverseEv:
  173|  8.05M|  CornerIndex PopNextCornerToTraverse() {
  174|  16.8M|    for (int i = best_priority_; i < kMaxPriority; ++i) {
  ------------------
  |  Branch (174:34): [True: 14.1M, False: 2.72M]
  ------------------
  175|  14.1M|      if (!traversal_stacks_[i].empty()) {
  ------------------
  |  Branch (175:11): [True: 5.32M, False: 8.84M]
  ------------------
  176|  5.32M|        const CornerIndex ret = traversal_stacks_[i].back();
  177|  5.32M|        traversal_stacks_[i].pop_back();
  178|  5.32M|        best_priority_ = i;
  179|  5.32M|        return ret;
  180|  5.32M|      }
  181|  14.1M|    }
  182|  2.72M|    return kInvalidCornerIndex;
  183|  8.05M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15ComputePriorityENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  194|  4.04M|  inline int ComputePriority(CornerIndex corner_id) {
  195|  4.04M|    const VertexIndex v_tip = this->corner_table()->Vertex(corner_id);
  196|       |    // Priority 0 when traversing to already visited vertices.
  197|  4.04M|    int priority = 0;
  198|  4.04M|    if (!this->IsVertexVisited(v_tip)) {
  ------------------
  |  Branch (198:9): [True: 2.68M, False: 1.36M]
  ------------------
  199|  2.68M|      const int degree = ++prediction_degree_[v_tip];
  200|       |      // Priority 1 when prediction degree > 1, otherwise 2.
  201|  2.68M|      priority = (degree > 1 ? 1 : 2);
  ------------------
  |  Branch (201:19): [True: 1.31M, False: 1.37M]
  ------------------
  202|  2.68M|    }
  203|       |    // Clamp the priority to the maximum number of buckets.
  204|  4.04M|    if (priority >= kMaxPriority) {
  ------------------
  |  Branch (204:9): [True: 0, False: 4.04M]
  ------------------
  205|      0|      priority = kMaxPriority - 1;
  206|      0|    }
  207|  4.04M|    return priority;
  208|  4.04M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE25AddCornerToTraversalStackENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEi:
  185|  2.59M|  inline void AddCornerToTraversalStack(CornerIndex ci, int priority) {
  186|  2.59M|    traversal_stacks_[priority].push_back(ci);
  187|       |    // Make sure that the best available priority is up to date.
  188|  2.59M|    if (priority < best_priority_) {
  ------------------
  |  Branch (188:9): [True: 641k, False: 1.95M]
  ------------------
  189|   641k|      best_priority_ = priority;
  190|   641k|    }
  191|  2.59M|  }
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   63|    465|  void OnTraversalEnd() {}
_ZN5draco28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   55|  1.01k|  MaxPredictionDegreeTraverser() {}

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    508|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  1.79k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  1.79k|    const auto *corner_table = traverser_.corner_table();
   50|  1.79k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  1.79k|    const size_t num_faces = mesh_->num_faces();
   52|  1.79k|    const size_t num_points = mesh_->num_points();
   53|  4.44M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 4.44M, False: 1.79k]
  ------------------
   54|  4.44M|      const auto &face = mesh_->face(f);
   55|  17.7M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 13.3M, False: 4.44M]
  ------------------
   56|  13.3M|        const PointIndex point_id = face[p];
   57|  13.3M|        const VertexIndex vert_id =
   58|  13.3M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  13.3M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 13.3M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  13.3M|        const AttributeValueIndex att_entry_id(
   63|  13.3M|            encoding_data_
   64|  13.3M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  13.3M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 13.3M]
  |  Branch (65:13): [True: 0, False: 13.3M]
  |  Branch (65:39): [True: 0, False: 13.3M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  13.3M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  13.3M|      }
   71|  4.44M|    }
   72|  1.79k|    return true;
   73|  1.79k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    465|  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|    465|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    465|    traverser_.OnTraversalStart();
   82|    465|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 465]
  ------------------
   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|    465|    } else {
   89|    465|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.72M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.72M, False: 465]
  ------------------
   91|  2.72M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.72M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.72M|      }
   95|    465|    }
   96|    465|    traverser_.OnTraversalEnd();
   97|    465|    return true;
   98|    465|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.72M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.72M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.72M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    508|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.61k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  5.37k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  5.37k|    const auto *corner_table = traverser_.corner_table();
   50|  5.37k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  5.37k|    const size_t num_faces = mesh_->num_faces();
   52|  5.37k|    const size_t num_points = mesh_->num_points();
   53|  3.21M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 3.21M, False: 5.37k]
  ------------------
   54|  3.21M|      const auto &face = mesh_->face(f);
   55|  12.8M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 9.63M, False: 3.21M]
  ------------------
   56|  9.63M|        const PointIndex point_id = face[p];
   57|  9.63M|        const VertexIndex vert_id =
   58|  9.63M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  9.63M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 9.63M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  9.63M|        const AttributeValueIndex att_entry_id(
   63|  9.63M|            encoding_data_
   64|  9.63M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  9.63M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 9.63M]
  |  Branch (65:13): [True: 0, False: 9.63M]
  |  Branch (65:39): [True: 0, False: 9.63M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  9.63M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  9.63M|      }
   71|  3.21M|    }
   72|  5.37k|    return true;
   73|  5.37k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.51k|  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.51k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.51k|    traverser_.OnTraversalStart();
   82|  1.51k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.51k]
  ------------------
   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.51k|    } else {
   89|  1.51k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  1.73M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 1.72M, False: 1.51k]
  ------------------
   91|  1.72M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 1.72M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  1.72M|      }
   95|  1.51k|    }
   96|  1.51k|    traverser_.OnTraversalEnd();
   97|  1.51k|    return true;
   98|  1.51k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.72M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  1.72M|    return traverser_.TraverseFromCorner(corner_id);
  103|  1.72M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.61k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  2.04k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  5.89k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  5.89k|    const auto *corner_table = traverser_.corner_table();
   50|  5.89k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  5.89k|    const size_t num_faces = mesh_->num_faces();
   52|  5.89k|    const size_t num_points = mesh_->num_points();
   53|  7.57M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 7.56M, False: 5.89k]
  ------------------
   54|  7.56M|      const auto &face = mesh_->face(f);
   55|  30.2M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 22.7M, False: 7.56M]
  ------------------
   56|  22.7M|        const PointIndex point_id = face[p];
   57|  22.7M|        const VertexIndex vert_id =
   58|  22.7M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  22.7M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 22.7M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  22.7M|        const AttributeValueIndex att_entry_id(
   63|  22.7M|            encoding_data_
   64|  22.7M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  22.7M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 22.7M]
  |  Branch (65:13): [True: 3, False: 22.7M]
  |  Branch (65:39): [True: 3, False: 22.7M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      3|          return false;
   68|      3|        }
   69|  22.7M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  22.7M|      }
   71|  7.56M|    }
   72|  5.89k|    return true;
   73|  5.89k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.96k|  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.96k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.96k|    traverser_.OnTraversalStart();
   82|  1.96k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.96k]
  ------------------
   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.96k|    } else {
   89|  1.96k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  4.55M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 4.55M, False: 1.96k]
  ------------------
   91|  4.55M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 4.55M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  4.55M|      }
   95|  1.96k|    }
   96|  1.96k|    traverser_.OnTraversalEnd();
   97|  1.96k|    return true;
   98|  1.96k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  4.55M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  4.55M|    return traverser_.TraverseFromCorner(corner_id);
  103|  4.55M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  2.04k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  4.08k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  31.3M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  16.8M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  16.8M|    return is_vertex_visited_[vert_id.value()];
   65|  16.8M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  2.30M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  2.30M|    is_vertex_visited_[vert_id.value()] = true;
   68|  2.30M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  6.75M|  inline TraversalObserverT &traversal_observer() {
   75|  6.75M|    return traversal_observer_;
   76|  6.75M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_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: 134k, False: 12.5M]
  ------------------
   47|   134k|      return true;  // Invalid faces are always considered as visited.
   48|   134k|    }
   49|  12.5M|    return is_face_visited_[face_id.value()];
   50|  12.6M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  4.45M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  4.45M|    is_face_visited_[face_id.value()] = true;
   62|  4.45M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  4.24k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  4.24k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  2.12k|                    TraversalObserver traversal_observer) {
   37|  2.12k|    corner_table_ = corner_table;
   38|  2.12k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  2.12k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  2.12k|    traversal_observer_ = traversal_observer;
   41|  2.12k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  1.72M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  1.72M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 1.72M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  1.72M|    return is_face_visited_[corner_id.value() / 3];
   58|  1.72M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  35.0M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  4.55M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  4.55M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 4.55M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  4.55M|    return is_face_visited_[corner_id.value() / 3];
   58|  4.55M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  10.6M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  10.6M|    return is_vertex_visited_[vert_id.value()];
   65|  10.6M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  9.83M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  9.83M|    is_vertex_visited_[vert_id.value()] = true;
   68|  9.83M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  14.3M|  inline TraversalObserverT &traversal_observer() {
   75|  14.3M|    return traversal_observer_;
   76|  14.3M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  10.7M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  10.7M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 6.11M, False: 4.67M]
  ------------------
   47|  6.11M|      return true;  // Invalid faces are always considered as visited.
   48|  6.11M|    }
   49|  4.67M|    return is_face_visited_[face_id.value()];
   50|  10.7M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  4.55M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  4.55M|    is_face_visited_[face_id.value()] = true;
   62|  4.55M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  4.08k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  2.04k|                    TraversalObserver traversal_observer) {
   37|  2.04k|    corner_table_ = corner_table;
   38|  2.04k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  2.04k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  2.04k|    traversal_observer_ = traversal_observer;
   41|  2.04k|  }

_ZN5draco17PointCloudDecoderC2Ev:
   22|  11.6k|    : point_cloud_(nullptr),
   23|  11.6k|      buffer_(nullptr),
   24|  11.6k|      version_major_(0),
   25|  11.6k|      version_minor_(0),
   26|  11.6k|      options_(nullptr) {}
_ZN5draco17PointCloudDecoder12DecodeHeaderEPNS_13DecoderBufferEPNS_11DracoHeaderE:
   29|  23.2k|                                       DracoHeader *out_header) {
   30|  23.2k|  constexpr char kIoErrorMsg[] = "Failed to parse Draco header.";
   31|  23.2k|  if (!buffer->Decode(out_header->draco_string, 5)) {
  ------------------
  |  Branch (31:7): [True: 0, False: 23.2k]
  ------------------
   32|      0|    return Status(Status::IO_ERROR, kIoErrorMsg);
   33|      0|  }
   34|  23.2k|  if (memcmp(out_header->draco_string, "DRACO", 5) != 0) {
  ------------------
  |  Branch (34:7): [True: 1, False: 23.2k]
  ------------------
   35|      1|    return Status(Status::DRACO_ERROR, "Not a Draco file.");
   36|      1|  }
   37|  23.2k|  if (!buffer->Decode(&(out_header->version_major))) {
  ------------------
  |  Branch (37:7): [True: 0, False: 23.2k]
  ------------------
   38|      0|    return Status(Status::IO_ERROR, kIoErrorMsg);
   39|      0|  }
   40|  23.2k|  if (!buffer->Decode(&(out_header->version_minor))) {
  ------------------
  |  Branch (40:7): [True: 0, False: 23.2k]
  ------------------
   41|      0|    return Status(Status::IO_ERROR, kIoErrorMsg);
   42|      0|  }
   43|  23.2k|  if (!buffer->Decode(&(out_header->encoder_type))) {
  ------------------
  |  Branch (43:7): [True: 0, False: 23.2k]
  ------------------
   44|      0|    return Status(Status::IO_ERROR, kIoErrorMsg);
   45|      0|  }
   46|  23.2k|  if (!buffer->Decode(&(out_header->encoder_method))) {
  ------------------
  |  Branch (46:7): [True: 0, False: 23.2k]
  ------------------
   47|      0|    return Status(Status::IO_ERROR, kIoErrorMsg);
   48|      0|  }
   49|  23.2k|  if (!buffer->Decode(&(out_header->flags))) {
  ------------------
  |  Branch (49:7): [True: 0, False: 23.2k]
  ------------------
   50|      0|    return Status(Status::IO_ERROR, kIoErrorMsg);
   51|      0|  }
   52|  23.2k|  return OkStatus();
   53|  23.2k|}
_ZN5draco17PointCloudDecoder14DecodeMetadataEv:
   55|    779|Status PointCloudDecoder::DecodeMetadata() {
   56|    779|  std::unique_ptr<GeometryMetadata> metadata =
   57|    779|      std::unique_ptr<GeometryMetadata>(new GeometryMetadata());
   58|    779|  MetadataDecoder metadata_decoder;
   59|    779|  if (!metadata_decoder.DecodeGeometryMetadata(buffer_, metadata.get())) {
  ------------------
  |  Branch (59:7): [True: 583, False: 196]
  ------------------
   60|    583|    return Status(Status::DRACO_ERROR, "Failed to decode metadata.");
   61|    583|  }
   62|    196|  point_cloud_->AddMetadata(std::move(metadata));
   63|    196|  return OkStatus();
   64|    779|}
_ZN5draco17PointCloudDecoder6DecodeERKNS_12DracoOptionsINS_17GeometryAttribute4TypeEEEPNS_13DecoderBufferEPNS_10PointCloudE:
   68|  11.6k|                                 PointCloud *out_point_cloud) {
   69|  11.6k|  options_ = &options;
   70|  11.6k|  buffer_ = in_buffer;
   71|  11.6k|  point_cloud_ = out_point_cloud;
   72|  11.6k|  DracoHeader header;
   73|  11.6k|  DRACO_RETURN_IF_ERROR(DecodeHeader(buffer_, &header))
  ------------------
  |  |   74|  11.6k|  {                                                   \
  |  |   75|  11.6k|    const draco::Status _local_status = (expression); \
  |  |   76|  11.6k|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 0, False: 11.6k]
  |  |  ------------------
  |  |   77|      0|      return _local_status;                           \
  |  |   78|      0|    }                                                 \
  |  |   79|  11.6k|  }
  ------------------
   74|       |  // Sanity check that we are really using the right decoder (mostly for cases
   75|       |  // where the Decode method was called manually outside of our main API.
   76|  11.6k|  if (header.encoder_type != GetGeometryType()) {
  ------------------
  |  Branch (76:7): [True: 0, False: 11.6k]
  ------------------
   77|      0|    return Status(Status::DRACO_ERROR,
   78|      0|                  "Using incompatible decoder for the input geometry.");
   79|      0|  }
   80|       |  // TODO(ostava): We should check the method as well, but currently decoders
   81|       |  // don't expose the decoding method id.
   82|  11.6k|  version_major_ = header.version_major;
   83|  11.6k|  version_minor_ = header.version_minor;
   84|       |
   85|  11.6k|  const uint8_t max_supported_major_version =
   86|  11.6k|      header.encoder_type == POINT_CLOUD ? kDracoPointCloudBitstreamVersionMajor
  ------------------
  |  Branch (86:7): [True: 0, False: 11.6k]
  ------------------
   87|  11.6k|                                         : kDracoMeshBitstreamVersionMajor;
   88|  11.6k|  const uint8_t max_supported_minor_version =
   89|  11.6k|      header.encoder_type == POINT_CLOUD ? kDracoPointCloudBitstreamVersionMinor
  ------------------
  |  Branch (89:7): [True: 0, False: 11.6k]
  ------------------
   90|  11.6k|                                         : kDracoMeshBitstreamVersionMinor;
   91|       |
   92|       |  // Check for version compatibility.
   93|  11.6k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   94|  11.6k|  if (version_major_ < 1 || version_major_ > max_supported_major_version) {
  ------------------
  |  Branch (94:7): [True: 0, False: 11.6k]
  |  Branch (94:29): [True: 0, False: 11.6k]
  ------------------
   95|      0|    return Status(Status::UNKNOWN_VERSION, "Unknown major version.");
   96|      0|  }
   97|  11.6k|  if (version_major_ == max_supported_major_version &&
  ------------------
  |  Branch (97:7): [True: 10.3k, False: 1.30k]
  ------------------
   98|  10.3k|      version_minor_ > max_supported_minor_version) {
  ------------------
  |  Branch (98:7): [True: 0, False: 10.3k]
  ------------------
   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|  11.6k|  buffer_->set_bitstream_version(
  110|  11.6k|      DRACO_BITSTREAM_VERSION(version_major_, version_minor_));
  ------------------
  |  |  115|  11.6k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  111|       |
  112|  11.6k|  if (bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 3) &&
  ------------------
  |  |  115|  23.2k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (112:7): [True: 11.1k, False: 524]
  ------------------
  113|  11.1k|      (header.flags & METADATA_FLAG_MASK)) {
  ------------------
  |  |  151|  11.1k|#define METADATA_FLAG_MASK 0x8000
  ------------------
  |  Branch (113:7): [True: 779, False: 10.3k]
  ------------------
  114|    779|    DRACO_RETURN_IF_ERROR(DecodeMetadata())
  ------------------
  |  |   74|    779|  {                                                   \
  |  |   75|    779|    const draco::Status _local_status = (expression); \
  |  |   76|    779|    if (!_local_status.ok()) {                        \
  |  |  ------------------
  |  |  |  Branch (76:9): [True: 583, False: 196]
  |  |  ------------------
  |  |   77|    583|      return _local_status;                           \
  |  |   78|    583|    }                                                 \
  |  |   79|    779|  }
  ------------------
  115|    779|  }
  116|  11.0k|  if (!InitializeDecoder()) {
  ------------------
  |  Branch (116:7): [True: 0, False: 11.0k]
  ------------------
  117|      0|    return Status(Status::DRACO_ERROR, "Failed to initialize the decoder.");
  118|      0|  }
  119|  11.0k|  if (!DecodeGeometryData()) {
  ------------------
  |  Branch (119:7): [True: 5.51k, False: 5.53k]
  ------------------
  120|  5.51k|    return Status(Status::DRACO_ERROR, "Failed to decode geometry data.");
  121|  5.51k|  }
  122|  5.53k|  if (!DecodePointAttributes()) {
  ------------------
  |  Branch (122:7): [True: 4.36k, False: 1.16k]
  ------------------
  123|  4.36k|    return Status(Status::DRACO_ERROR, "Failed to decode point attributes.");
  124|  4.36k|  }
  125|  1.16k|  return OkStatus();
  126|  5.53k|}
_ZN5draco17PointCloudDecoder21DecodePointAttributesEv:
  128|  5.53k|bool PointCloudDecoder::DecodePointAttributes() {
  129|  5.53k|  uint8_t num_attributes_decoders;
  130|  5.53k|  if (!buffer_->Decode(&num_attributes_decoders)) {
  ------------------
  |  Branch (130:7): [True: 164, False: 5.36k]
  ------------------
  131|    164|    return false;
  132|    164|  }
  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|  38.5k|  for (int i = 0; i < num_attributes_decoders; ++i) {
  ------------------
  |  Branch (136:19): [True: 33.5k, False: 5.00k]
  ------------------
  137|  33.5k|    if (!CreateAttributesDecoder(i)) {
  ------------------
  |  Branch (137:9): [True: 361, False: 33.1k]
  ------------------
  138|    361|      return false;
  139|    361|    }
  140|  33.5k|  }
  141|       |
  142|       |  // Initialize all attributes decoders. No data is decoded here.
  143|  33.0k|  for (auto &att_dec : attributes_decoders_) {
  ------------------
  |  Branch (143:22): [True: 33.0k, False: 5.00k]
  ------------------
  144|  33.0k|    if (!att_dec->Init(this, point_cloud_)) {
  ------------------
  |  Branch (144:9): [True: 0, False: 33.0k]
  ------------------
  145|      0|      return false;
  146|      0|    }
  147|  33.0k|  }
  148|       |
  149|       |  // Decode any data needed by the attribute decoders.
  150|  13.8k|  for (int i = 0; i < num_attributes_decoders; ++i) {
  ------------------
  |  Branch (150:19): [True: 9.14k, False: 4.74k]
  ------------------
  151|  9.14k|    if (!attributes_decoders_[i]->DecodeAttributesDecoderData(buffer_)) {
  ------------------
  |  Branch (151:9): [True: 262, False: 8.88k]
  ------------------
  152|    262|      return false;
  153|    262|    }
  154|  9.14k|  }
  155|       |
  156|       |  // Create map between attribute and decoder ids.
  157|  12.0k|  for (int i = 0; i < num_attributes_decoders; ++i) {
  ------------------
  |  Branch (157:19): [True: 7.29k, False: 4.74k]
  ------------------
  158|  7.29k|    const int32_t num_attributes = attributes_decoders_[i]->GetNumAttributes();
  159|  29.7k|    for (int j = 0; j < num_attributes; ++j) {
  ------------------
  |  Branch (159:21): [True: 22.4k, False: 7.29k]
  ------------------
  160|  22.4k|      int att_id = attributes_decoders_[i]->GetAttributeId(j);
  161|  22.4k|      if (att_id >= attribute_to_decoder_map_.size()) {
  ------------------
  |  Branch (161:11): [True: 22.4k, False: 0]
  ------------------
  162|  22.4k|        attribute_to_decoder_map_.resize(att_id + 1);
  163|  22.4k|      }
  164|  22.4k|      attribute_to_decoder_map_[att_id] = i;
  165|  22.4k|    }
  166|  7.29k|  }
  167|       |
  168|       |  // Decode the actual attributes using the created attribute decoders.
  169|  4.74k|  if (!DecodeAllAttributes()) {
  ------------------
  |  Branch (169:7): [True: 3.57k, False: 1.16k]
  ------------------
  170|  3.57k|    return false;
  171|  3.57k|  }
  172|       |
  173|  1.16k|  if (!OnAttributesDecoded()) {
  ------------------
  |  Branch (173:7): [True: 0, False: 1.16k]
  ------------------
  174|      0|    return false;
  175|      0|  }
  176|  1.16k|  return true;
  177|  1.16k|}
_ZN5draco17PointCloudDecoder19DecodeAllAttributesEv:
  179|  4.74k|bool PointCloudDecoder::DecodeAllAttributes() {
  180|  5.81k|  for (auto &att_dec : attributes_decoders_) {
  ------------------
  |  Branch (180:22): [True: 5.81k, False: 1.16k]
  ------------------
  181|  5.81k|    if (!att_dec->DecodeAttributes(buffer_)) {
  ------------------
  |  Branch (181:9): [True: 3.57k, False: 2.24k]
  ------------------
  182|  3.57k|      return false;
  183|  3.57k|    }
  184|  5.81k|  }
  185|  1.16k|  return true;
  186|  4.74k|}
_ZN5draco17PointCloudDecoder20GetPortableAttributeEi:
  189|  2.36k|    int32_t parent_att_id) {
  190|  2.36k|  if (parent_att_id < 0 || parent_att_id >= point_cloud_->num_attributes()) {
  ------------------
  |  Branch (190:7): [True: 0, False: 2.36k]
  |  Branch (190:28): [True: 0, False: 2.36k]
  ------------------
  191|      0|    return nullptr;
  192|      0|  }
  193|  2.36k|  const int32_t parent_att_decoder_id =
  194|  2.36k|      attribute_to_decoder_map_[parent_att_id];
  195|  2.36k|  return attributes_decoders_[parent_att_decoder_id]->GetPortableAttribute(
  196|  2.36k|      parent_att_id);
  197|  2.36k|}

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  64.6M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  64.6M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 64.6M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  64.6M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  64.6M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|   915M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|   915M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 484, False: 915M]
  ------------------
   78|    484|      return false;  // Buffer overflow.
   79|    484|    }
   80|   915M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|   915M|    pos_ += size_to_decode;
   82|   915M|    return true;
   83|   915M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  29.1k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  11.6k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  45.0k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   381k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  7.40k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  64.6M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  4.50M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  8.95k|    inline void reset(const void *b, size_t s) {
  131|  8.95k|      bit_offset_ = 0;
  132|  8.95k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  8.95k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  8.95k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  7.58k|    inline uint64_t BitsDecoded() const {
  138|  7.58k|      return static_cast<uint64_t>(bit_offset_);
  139|  7.58k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  64.6M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  64.6M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 15, False: 64.6M]
  ------------------
  162|     15|        return false;
  163|     15|      }
  164|  64.6M|      uint32_t value = 0;
  165|   146M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 81.5M, False: 64.6M]
  ------------------
  166|  81.5M|        value |= GetBit() << bit;
  167|  81.5M|      }
  168|  64.6M|      *x = value;
  169|  64.6M|      return true;
  170|  64.6M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  81.5M|    inline int GetBit() {
  176|  81.5M|      const size_t off = bit_offset_;
  177|  81.5M|      const size_t byte_offset = off >> 3;
  178|  81.5M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  81.5M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 69.4M, False: 12.1M]
  ------------------
  180|  69.4M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  69.4M|        bit_offset_ = off + 1;
  182|  69.4M|        return bit;
  183|  69.4M|      }
  184|  12.1M|      return 0;
  185|  81.5M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  20.9M|  bool Decode(T *out_val) {
   69|  20.9M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 3.40k, False: 20.9M]
  ------------------
   70|  3.40k|      return false;
   71|  3.40k|    }
   72|  20.9M|    pos_ += sizeof(T);
   73|  20.9M|    return true;
   74|  20.9M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  20.9M|  bool Peek(T *out_val) {
   88|  20.9M|    const size_t size_to_decode = sizeof(T);
   89|  20.9M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 3.40k, False: 20.9M]
  ------------------
   90|  3.40k|      return false;  // Buffer overflow.
   91|  3.40k|    }
   92|  20.9M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  20.9M|    return true;
   94|  20.9M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  13.1k|  bool Decode(T *out_val) {
   69|  13.1k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 125, False: 13.0k]
  ------------------
   70|    125|      return false;
   71|    125|    }
   72|  13.0k|    pos_ += sizeof(T);
   73|  13.0k|    return true;
   74|  13.1k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  13.1k|  bool Peek(T *out_val) {
   88|  13.1k|    const size_t size_to_decode = sizeof(T);
   89|  13.1k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 125, False: 13.0k]
  ------------------
   90|    125|      return false;  // Buffer overflow.
   91|    125|    }
   92|  13.0k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  13.0k|    return true;
   94|  13.1k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   821k|  bool Decode(T *out_val) {
   69|   821k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 161, False: 821k]
  ------------------
   70|    161|      return false;
   71|    161|    }
   72|   821k|    pos_ += sizeof(T);
   73|   821k|    return true;
   74|   821k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   821k|  bool Peek(T *out_val) {
   88|   821k|    const size_t size_to_decode = sizeof(T);
   89|   821k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 161, False: 821k]
  ------------------
   90|    161|      return false;  // Buffer overflow.
   91|    161|    }
   92|   821k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   821k|    return true;
   94|   821k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  26.1k|  bool Decode(T *out_val) {
   69|  26.1k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 316, False: 25.8k]
  ------------------
   70|    316|      return false;
   71|    316|    }
   72|  25.8k|    pos_ += sizeof(T);
   73|  25.8k|    return true;
   74|  26.1k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  26.1k|  bool Peek(T *out_val) {
   88|  26.1k|    const size_t size_to_decode = sizeof(T);
   89|  26.1k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 316, False: 25.8k]
  ------------------
   90|    316|      return false;  // Buffer overflow.
   91|    316|    }
   92|  25.8k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  25.8k|    return true;
   94|  26.1k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|   988k|  bool Decode(T *out_val) {
   69|   988k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 139, False: 987k]
  ------------------
   70|    139|      return false;
   71|    139|    }
   72|   987k|    pos_ += sizeof(T);
   73|   987k|    return true;
   74|   988k|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|   988k|  bool Peek(T *out_val) {
   88|   988k|    const size_t size_to_decode = sizeof(T);
   89|   988k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 139, False: 987k]
  ------------------
   90|    139|      return false;  // Buffer overflow.
   91|    139|    }
   92|   987k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   987k|    return true;
   94|   988k|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  1.32M|  bool Decode(T *out_val) {
   69|  1.32M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 17, False: 1.32M]
  ------------------
   70|     17|      return false;
   71|     17|    }
   72|  1.32M|    pos_ += sizeof(T);
   73|  1.32M|    return true;
   74|  1.32M|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  1.32M|  bool Peek(T *out_val) {
   88|  1.32M|    const size_t size_to_decode = sizeof(T);
   89|  1.32M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 17, False: 1.32M]
  ------------------
   90|     17|      return false;  // Buffer overflow.
   91|     17|    }
   92|  1.32M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.32M|    return true;
   94|  1.32M|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  2.30k|  bool Decode(T *out_val) {
   69|  2.30k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 24, False: 2.27k]
  ------------------
   70|     24|      return false;
   71|     24|    }
   72|  2.27k|    pos_ += sizeof(T);
   73|  2.27k|    return true;
   74|  2.30k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  2.30k|  bool Peek(T *out_val) {
   88|  2.30k|    const size_t size_to_decode = sizeof(T);
   89|  2.30k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 24, False: 2.27k]
  ------------------
   90|     24|      return false;  // Buffer overflow.
   91|     24|    }
   92|  2.27k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  2.27k|    return true;
   94|  2.30k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    239|  bool Decode(T *out_val) {
   69|    239|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 27, False: 212]
  ------------------
   70|     27|      return false;
   71|     27|    }
   72|    212|    pos_ += sizeof(T);
   73|    212|    return true;
   74|    239|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    239|  bool Peek(T *out_val) {
   88|    239|    const size_t size_to_decode = sizeof(T);
   89|    239|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 27, False: 212]
  ------------------
   90|     27|      return false;  // Buffer overflow.
   91|     27|    }
   92|    212|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    212|    return true;
   94|    239|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|   103M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|   107M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  12.3M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  12.3M|    return value_ >= val;
  100|  12.3M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   310M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  3.91G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  27.5M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|   100M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   100M|    value_ = i.value_;
  153|   100M|    return *this;
  154|   100M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   943M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   943M|    value_ = i.value_;
  153|   943M|    return *this;
  154|   943M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  27.5M|  inline ThisIndexType &operator++() {
  103|  27.5M|    ++value_;
  104|  27.5M|    return *this;
  105|  27.5M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  2.84G|  constexpr bool operator==(const IndexType &i) const {
   76|  2.84G|    return value_ == i.value_;
   77|  2.84G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|  1.13G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  12.3k|  constexpr bool operator<(const IndexType &i) const {
   88|  12.3k|    return value_ < i.value_;
   89|  12.3k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   159M|  constexpr bool operator==(const IndexType &i) const {
   76|   159M|    return value_ == i.value_;
   77|   159M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   199M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   199M|    return ThisIndexType(value_ - val);
  133|   199M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   926M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   926M|    return ThisIndexType(value_ + val);
  127|   926M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  23.4M|  constexpr bool operator==(const IndexType &i) const {
   76|  23.4M|    return value_ == i.value_;
   77|  23.4M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   319M|  constexpr bool operator!=(const IndexType &i) const {
   82|   319M|    return value_ != i.value_;
   83|   319M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   424M|  constexpr bool operator!=(const IndexType &i) const {
   82|   424M|    return value_ != i.value_;
   83|   424M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   624M|  inline ThisIndexType &operator++() {
  103|   624M|    ++value_;
  104|   624M|    return *this;
  105|   624M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   552M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   552M|    value_ = i.value_;
  153|   552M|    return *this;
  154|   552M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|  1.34G|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  1.34G|    value_ = i.value_;
  153|  1.34G|    return *this;
  154|  1.34G|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  45.6M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  45.6M|    return value_ >= val;
  100|  45.6M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  10.5M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|  1.36G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  28.4G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   239M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  22.4G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   306M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  20.8M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  20.8M|    return ThisIndexType(value_ + val);
  127|  20.8M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   197M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  29.4M|  constexpr bool operator<(const IndexType &i) const {
   88|  29.4M|    return value_ < i.value_;
   89|  29.4M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   246M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   945M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  75.2M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|  80.0M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   295M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  5.83M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  5.83M|    value_ = i.value_;
  153|  5.83M|    return *this;
  154|  5.83M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  10.5M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  10.5M|    value_ += val;
  141|  10.5M|    return *this;
  142|  10.5M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  38.5M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  38.5M|    value_ = val;
  157|  38.5M|    return *this;
  158|  38.5M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|   906M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  7.51M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  7.50M|  inline ThisIndexType &operator++() {
  103|  7.50M|    ++value_;
  104|  7.50M|    return *this;
  105|  7.50M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  22.8M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|  22.8M|  inline ThisIndexType &operator++() {
  103|  22.8M|    ++value_;
  104|  22.8M|    return *this;
  105|  22.8M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  38.6M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  38.6M|    return vector_[index.value()];
   75|  38.6M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  22.8M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  13.2k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  17.5k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  68.5M|  inline reference operator[](const IndexTypeT &index) {
   71|  68.5M|    return vector_[index.value()];
   72|  68.5M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|   489k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  24.7M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  4.53k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   70|  12.3M|  inline reference operator[](const IndexTypeT &index) {
   71|  12.3M|    return vector_[index.value()];
   72|  12.3M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  27.3M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  27.3M|    return vector_[index.value()];
   75|  27.3M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   250M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  12.9M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   384M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   384M|    return vector_[index.value()];
   75|   384M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|  1.00G|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  1.00G|    return vector_[index.value()];
   75|  1.00G|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   511M|  inline reference operator[](const IndexTypeT &index) {
   71|   511M|    return vector_[index.value()];
   72|   511M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  74.2M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  74.2M|    return vector_[index.value()];
   75|  74.2M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   431M|  inline reference operator[](const IndexTypeT &index) {
   71|   431M|    return vector_[index.value()];
   72|   431M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|   128M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   292M|  inline reference operator[](const IndexTypeT &index) {
   71|   292M|    return vector_[index.value()];
   72|   292M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  2.81k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   251M|  inline reference operator[](const IndexTypeT &index) {
   71|   251M|    return vector_[index.value()];
   72|   251M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  59.7k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  2.72M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  56.0k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  7.93k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  7.93k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  7.93k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  7.93k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  15.6k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  15.6k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  15.6k|    vector_.swap(arg.vector_);
   57|  15.6k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  15.6k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  15.6k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  15.6k|    vector_.swap(arg.vector_);
   57|  15.6k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  7.93k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  7.93k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  7.93k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  11.6k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  46.8k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  78.7k|int32_t DataTypeLength(DataType dt) {
   20|  78.7k|  switch (dt) {
   21|  36.0k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 36.0k, False: 42.6k]
  ------------------
   22|  38.3k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 2.32k, False: 76.4k]
  ------------------
   23|  38.3k|      return 1;
   24|  1.89k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 1.89k, False: 76.8k]
  ------------------
   25|  2.21k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 322, False: 78.4k]
  ------------------
   26|  2.21k|      return 2;
   27|  31.4k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 31.4k, False: 47.2k]
  ------------------
   28|  32.4k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 929, False: 77.8k]
  ------------------
   29|  32.4k|      return 4;
   30|    511|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 511, False: 78.2k]
  ------------------
   31|    935|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 424, False: 78.3k]
  ------------------
   32|    935|      return 8;
   33|  4.14k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 4.14k, False: 74.6k]
  ------------------
   34|  4.14k|      return 4;
   35|    197|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 197, False: 78.5k]
  ------------------
   36|    197|      return 8;
   37|    441|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 441, False: 78.3k]
  ------------------
   38|    441|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 78.7k]
  ------------------
   40|      0|      return -1;
   41|  78.7k|  }
   42|  78.7k|}

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

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

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

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

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

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

_ZN5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  11.6k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_4MeshENS1_14default_deleteIS3_EEEEEC2ERKNS_6StatusE:
   37|  10.4k|  StatusOr(const Status &status) : status_(status) {}
_ZN5draco8StatusOrINSt3__110unique_ptrINS_4MeshENS1_14default_deleteIS3_EEEEEC2EOS6_:
   39|  1.16k|  StatusOr(T &&value) : status_(OkStatus()), value_(std::move(value)) {}
_ZNK5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE2okEv:
   53|  11.6k|  bool ok() const { return status_.ok(); }
_ZNO5draco8StatusOrINSt3__110unique_ptrINS_11MeshDecoderENS1_14default_deleteIS3_EEEEE5valueEv:
   46|  11.6k|  T &&value() && { return std::move(value_); }

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|   960k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|   960k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 960k, Folded]
  ------------------
   65|   960k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 1.26k, False: 959k]
  ------------------
   66|  1.26k|      return false;
   67|  1.26k|    }
   68|   960k|  } 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|   959k|  return true;
   77|   960k|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   539k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   539k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   539k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 105, False: 539k]
  ------------------
   33|    105|    return false;
   34|    105|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   539k|  uint8_t in;
   39|   539k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 801, False: 538k]
  ------------------
   40|    801|    return false;
   41|    801|  }
   42|   538k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 20.5k, False: 518k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  20.5k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 625, False: 19.9k]
  ------------------
   45|    625|      return false;
   46|    625|    }
   47|       |    // Append decoded info from this byte.
   48|  19.9k|    *out_val <<= 7;
   49|  19.9k|    *out_val |= in & ((1 << 7) - 1);
   50|   518k|  } else {
   51|       |    // Last byte reached
   52|   518k|    *out_val = in;
   53|   518k|  }
   54|   537k|  return true;
   55|   538k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  7.77k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  7.77k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  7.77k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 7.77k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  7.77k|  uint8_t in;
   39|  7.77k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 8, False: 7.76k]
  ------------------
   40|      8|    return false;
   41|      8|  }
   42|  7.76k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 686, False: 7.07k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    686|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 8, False: 678]
  ------------------
   45|      8|      return false;
   46|      8|    }
   47|       |    // Append decoded info from this byte.
   48|    678|    *out_val <<= 7;
   49|    678|    *out_val |= in & ((1 << 7) - 1);
   50|  7.07k|  } else {
   51|       |    // Last byte reached
   52|  7.07k|    *out_val = in;
   53|  7.07k|  }
   54|  7.75k|  return true;
   55|  7.76k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  8.00k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  8.00k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 8.00k, Folded]
  ------------------
   65|  8.00k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 133, False: 7.87k]
  ------------------
   66|    133|      return false;
   67|    133|    }
   68|  8.00k|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|      0|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|      0|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 0]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|      0|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|      0|  }
   76|  7.87k|  return true;
   77|  8.00k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  4.34k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.34k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.34k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 4.34k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.34k|  uint8_t in;
   39|  4.34k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 19, False: 4.32k]
  ------------------
   40|     19|    return false;
   41|     19|  }
   42|  4.32k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 111, False: 4.21k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    111|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 1, False: 110]
  ------------------
   45|      1|      return false;
   46|      1|    }
   47|       |    // Append decoded info from this byte.
   48|    110|    *out_val <<= 7;
   49|    110|    *out_val |= in & ((1 << 7) - 1);
   50|  4.21k|  } else {
   51|       |    // Last byte reached
   52|  4.21k|    *out_val = in;
   53|  4.21k|  }
   54|  4.32k|  return true;
   55|  4.32k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   361k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   361k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   361k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 9, False: 361k]
  ------------------
   33|      9|    return false;
   34|      9|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   361k|  uint8_t in;
   39|   361k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 55, False: 361k]
  ------------------
   40|     55|    return false;
   41|     55|  }
   42|   361k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.55k, False: 360k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.55k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 54, False: 1.50k]
  ------------------
   45|     54|      return false;
   46|     54|    }
   47|       |    // Append decoded info from this byte.
   48|  1.50k|    *out_val <<= 7;
   49|  1.50k|    *out_val |= in & ((1 << 7) - 1);
   50|   360k|  } else {
   51|       |    // Last byte reached
   52|   360k|    *out_val = in;
   53|   360k|  }
   54|   361k|  return true;
   55|   361k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  4.02k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  4.02k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  4.02k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 8, False: 4.02k]
  ------------------
   33|      8|    return false;
   34|      8|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  4.02k|  uint8_t in;
   39|  4.02k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 23, False: 3.99k]
  ------------------
   40|     23|    return false;
   41|     23|  }
   42|  3.99k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 762, False: 3.23k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    762|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 53, False: 709]
  ------------------
   45|     53|      return false;
   46|     53|    }
   47|       |    // Append decoded info from this byte.
   48|    709|    *out_val <<= 7;
   49|    709|    *out_val |= in & ((1 << 7) - 1);
   50|  3.23k|  } else {
   51|       |    // Last byte reached
   52|  3.23k|    *out_val = in;
   53|  3.23k|  }
   54|  3.94k|  return true;
   55|  3.99k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  18.9k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  18.9k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  18.9k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 9, False: 18.9k]
  ------------------
   33|      9|    return false;
   34|      9|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  18.9k|  uint8_t in;
   39|  18.9k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 23, False: 18.9k]
  ------------------
   40|     23|    return false;
   41|     23|  }
   42|  18.9k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 312, False: 18.6k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    312|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 45, False: 267]
  ------------------
   45|     45|      return false;
   46|     45|    }
   47|       |    // Append decoded info from this byte.
   48|    267|    *out_val <<= 7;
   49|    267|    *out_val |= in & ((1 << 7) - 1);
   50|  18.6k|  } else {
   51|       |    // Last byte reached
   52|  18.6k|    *out_val = in;
   53|  18.6k|  }
   54|  18.8k|  return true;
   55|  18.9k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  9.52k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  9.52k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  9.52k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 118, False: 9.40k]
  ------------------
   33|    118|    return false;
   34|    118|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  9.40k|  uint8_t in;
   39|  9.40k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 65, False: 9.33k]
  ------------------
   40|     65|    return false;
   41|     65|  }
   42|  9.33k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.40k, False: 6.93k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.40k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 611, False: 1.79k]
  ------------------
   45|    611|      return false;
   46|    611|    }
   47|       |    // Append decoded info from this byte.
   48|  1.79k|    *out_val <<= 7;
   49|  1.79k|    *out_val |= in & ((1 << 7) - 1);
   50|  6.93k|  } else {
   51|       |    // Last byte reached
   52|  6.93k|    *out_val = in;
   53|  6.93k|  }
   54|  8.72k|  return true;
   55|  9.33k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  7.72k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  7.72k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  7.72k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 66, False: 7.65k]
  ------------------
   33|     66|    return false;
   34|     66|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  7.65k|  uint8_t in;
   39|  7.65k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 48, False: 7.60k]
  ------------------
   40|     48|    return false;
   41|     48|  }
   42|  7.60k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 3.95k, False: 3.65k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  3.95k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 767, False: 3.18k]
  ------------------
   45|    767|      return false;
   46|    767|    }
   47|       |    // Append decoded info from this byte.
   48|  3.18k|    *out_val <<= 7;
   49|  3.18k|    *out_val |= in & ((1 << 7) - 1);
   50|  3.65k|  } else {
   51|       |    // Last byte reached
   52|  3.65k|    *out_val = in;
   53|  3.65k|  }
   54|  6.84k|  return true;
   55|  7.60k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  46.6k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  46.6k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  46.6k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 9, False: 46.6k]
  ------------------
   33|      9|    return false;
   34|      9|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  46.6k|  uint8_t in;
   39|  46.6k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 26, False: 46.6k]
  ------------------
   40|     26|    return false;
   41|     26|  }
   42|  46.6k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.41k, False: 45.1k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.41k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 54, False: 1.36k]
  ------------------
   45|     54|      return false;
   46|     54|    }
   47|       |    // Append decoded info from this byte.
   48|  1.36k|    *out_val <<= 7;
   49|  1.36k|    *out_val |= in & ((1 << 7) - 1);
   50|  45.1k|  } else {
   51|       |    // Last byte reached
   52|  45.1k|    *out_val = in;
   53|  45.1k|  }
   54|  46.5k|  return true;
   55|  46.6k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|   153k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|   198k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  16.5k|  Self operator-(const Self &o) const {
  138|  16.5k|    Self ret;
  139|  66.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 49.6k, False: 16.5k]
  ------------------
  140|  49.6k|      ret[i] = (*this)[i] - o[i];
  141|  49.6k|    }
  142|  16.5k|    return ret;
  143|  16.5k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  41.2k|  VectorD() {
   41|   164k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 123k, False: 41.2k]
  ------------------
   42|   123k|      (*this)[i] = Scalar(0);
   43|   123k|    }
   44|  41.2k|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|   155M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  12.9M|  Self operator-(const Self &o) const {
  138|  12.9M|    Self ret;
  139|  51.6M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 38.7M, False: 12.9M]
  ------------------
  140|  38.7M|      ret[i] = (*this)[i] - o[i];
  141|  38.7M|    }
  142|  12.9M|    return ret;
  143|  12.9M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  6.44M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  6.44M|  static_assert(std::is_signed<ScalarT>::value,
  321|  6.44M|                "ScalarT must be a signed type. ");
  322|  6.44M|  VectorD<ScalarT, 3> r;
  323|  6.44M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  6.44M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  6.44M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  6.44M|  return r;
  327|  6.44M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  6.44M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  6.44M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  2.79M|  Scalar AbsSum() const {
  238|  2.79M|    Scalar result(0);
  239|  11.1M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 8.38M, False: 2.78M]
  ------------------
  240|  8.38M|      Scalar next_value = std::abs(v_[i]);
  241|  8.38M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 12.8k, False: 8.37M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  12.8k|        return std::numeric_limits<Scalar>::max();
  244|  12.8k|      }
  245|  8.37M|      result += next_value;
  246|  8.37M|    }
  247|  2.78M|    return result;
  248|  2.79M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   188k|  Self operator/(const Scalar &o) const {
  183|   188k|    Self ret;
  184|   752k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 564k, False: 188k]
  ------------------
  185|   564k|      ret[i] = (*this)[i] / o;
  186|   564k|    }
  187|   188k|    return ret;
  188|   188k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   197M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  10.1M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  8.38M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  1.69M|  Self operator-() const {
  121|  1.69M|    Self ret;
  122|  6.79M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 5.09M, False: 1.69M]
  ------------------
  123|  5.09M|      ret[i] = -(*this)[i];
  124|  5.09M|    }
  125|  1.69M|    return ret;
  126|  1.69M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  5.09M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|  1.16M|  Self operator-(const Self &o) const {
  138|  1.16M|    Self ret;
  139|  3.50M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.33M, False: 1.16M]
  ------------------
  140|  2.33M|      ret[i] = (*this)[i] - o[i];
  141|  2.33M|    }
  142|  1.16M|    return ret;
  143|  1.16M|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  14.0M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  21.0M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  48.2M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  2.33M|  Self operator+(const Self &o) const {
  130|  2.33M|    Self ret;
  131|  7.00M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 4.66M, False: 2.33M]
  ------------------
  132|  4.66M|      ret[i] = (*this)[i] + o[i];
  133|  4.66M|    }
  134|  2.33M|    return ret;
  135|  2.33M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  45.2M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|  1.39M|  Self operator-(const Self &o) const {
  138|  1.39M|    Self ret;
  139|  4.18M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.79M, False: 1.39M]
  ------------------
  140|  2.79M|      ret[i] = (*this)[i] - o[i];
  141|  2.79M|    }
  142|  1.39M|    return ret;
  143|  1.39M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|  1.39M|  Self operator+(const Self &o) const {
  130|  1.39M|    Self ret;
  131|  4.18M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.79M, False: 1.39M]
  ------------------
  132|  2.79M|      ret[i] = (*this)[i] + o[i];
  133|  2.79M|    }
  134|  1.39M|    return ret;
  135|  1.39M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   423k|  bool operator==(const Self &o) const {
  207|  1.25M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 839k, False: 415k]
  ------------------
  208|   839k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 8.08k, False: 831k]
  ------------------
  209|  8.08k|        return false;
  210|  8.08k|      }
  211|   839k|    }
  212|   415k|    return true;
  213|   423k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  4.95M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  8.47k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  8.85k|  Scalar Dot(const Self &o) const {
  251|  8.85k|    Scalar ret(0);
  252|  35.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 26.5k, False: 8.85k]
  ------------------
  253|  26.5k|      ret += (*this)[i] * o[i];
  254|  26.5k|    }
  255|  8.85k|    return ret;
  256|  8.85k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    384|  Self operator*(const Scalar &o) const {
  175|    384|    Self ret;
  176|  1.53k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 1.15k, False: 384]
  ------------------
  177|  1.15k|      ret[i] = (*this)[i] * o;
  178|  1.15k|    }
  179|    384|    return ret;
  180|    384|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  8.08k|  Self operator-(const Self &o) const {
  138|  8.08k|    Self ret;
  139|  24.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 16.1k, False: 8.08k]
  ------------------
  140|  16.1k|      ret[i] = (*this)[i] - o[i];
  141|  16.1k|    }
  142|  8.08k|    return ret;
  143|  8.08k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  16.1k|  VectorD() {
   41|  48.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 32.3k, False: 16.1k]
  ------------------
   42|  32.3k|      (*this)[i] = Scalar(0);
   43|  32.3k|    }
   44|  16.1k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   854k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   854k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   854k|    v_[0] = c0;
   55|   854k|    v_[1] = c1;
   56|   854k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  64.6k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   329k|  bool operator==(const Self &o) const {
  207|   942k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 636k, False: 305k]
  ------------------
  208|   636k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 23.3k, False: 612k]
  ------------------
  209|  23.3k|        return false;
  210|  23.3k|      }
  211|   636k|    }
  212|   305k|    return true;
  213|   329k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  1.94M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  38.0M|  VectorD() {
   41|   152M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 114M, False: 38.0M]
  ------------------
   42|   114M|      (*this)[i] = Scalar(0);
   43|   114M|    }
   44|  38.0M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  25.5k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  27.8k|  Scalar Dot(const Self &o) const {
  251|  27.8k|    Scalar ret(0);
  252|   111k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 83.6k, False: 27.8k]
  ------------------
  253|  83.6k|      ret += (*this)[i] * o[i];
  254|  83.6k|    }
  255|  27.8k|    return ret;
  256|  27.8k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  2.32k|  Self operator-(const Self &o) const {
  138|  2.32k|    Self ret;
  139|  6.98k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 4.65k, False: 2.32k]
  ------------------
  140|  4.65k|      ret[i] = (*this)[i] - o[i];
  141|  4.65k|    }
  142|  2.32k|    return ret;
  143|  2.32k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  6.56k|  Self operator*(const Scalar &o) const {
  175|  6.56k|    Self ret;
  176|  19.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 13.1k, False: 6.56k]
  ------------------
  177|  13.1k|      ret[i] = (*this)[i] * o;
  178|  13.1k|    }
  179|  6.56k|    return ret;
  180|  6.56k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  2.19k|  Self operator+(const Self &o) const {
  130|  2.19k|    Self ret;
  131|  6.59k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 4.39k, False: 2.19k]
  ------------------
  132|  4.39k|      ret[i] = (*this)[i] + o[i];
  133|  4.39k|    }
  134|  2.19k|    return ret;
  135|  2.19k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.19k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.19k|  return v * o;
  294|  2.19k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  2.16k|  Self operator+(const Self &o) const {
  130|  2.16k|    Self ret;
  131|  8.66k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 6.50k, False: 2.16k]
  ------------------
  132|  6.50k|      ret[i] = (*this)[i] + o[i];
  133|  6.50k|    }
  134|  2.16k|    return ret;
  135|  2.16k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  2.16k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  2.16k|  return v * o;
  294|  2.16k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  2.16k|  Self operator*(const Scalar &o) const {
  175|  2.16k|    Self ret;
  176|  8.66k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 6.50k, False: 2.16k]
  ------------------
  177|  6.50k|      ret[i] = (*this)[i] * o;
  178|  6.50k|    }
  179|  2.16k|    return ret;
  180|  2.16k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   660k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   660k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   660k|    v_[0] = c0;
   55|   660k|    v_[1] = c1;
   56|   660k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  15.4k|  VectorD() {
   41|  46.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 30.8k, False: 15.4k]
  ------------------
   42|  30.8k|      (*this)[i] = Scalar(0);
   43|  30.8k|    }
   44|  15.4k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  4.31k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  12.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 8.63k, False: 4.31k]
  ------------------
  104|  8.63k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 8.63k, False: 0]
  ------------------
  105|  8.63k|        v_[i] = Scalar(src_vector[i]);
  106|  8.63k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  8.63k|    }
  110|  4.31k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|    704|  Self operator+(const Self &o) const {
  130|    704|    Self ret;
  131|  2.11k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.40k, False: 704]
  ------------------
  132|  1.40k|      ret[i] = (*this)[i] + o[i];
  133|  1.40k|    }
  134|    704|    return ret;
  135|    704|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  2.15k|  VectorD() {
   41|  6.47k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 4.31k, False: 2.15k]
  ------------------
   42|  4.31k|      (*this)[i] = Scalar(0);
   43|  4.31k|    }
   44|  2.15k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  12.9k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  8.63k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  2.15k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  6.47k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 4.31k, False: 2.15k]
  ------------------
  104|  4.31k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 4.31k, False: 0]
  ------------------
  105|  4.31k|        v_[i] = Scalar(src_vector[i]);
  106|  4.31k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  4.31k|    }
  110|  2.15k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  2.15k|  Self operator/(const Scalar &o) const {
  183|  2.15k|    Self ret;
  184|  6.47k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 4.31k, False: 2.15k]
  ------------------
  185|  4.31k|      ret[i] = (*this)[i] / o;
  186|  4.31k|    }
  187|  2.15k|    return ret;
  188|  2.15k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  1.45k|  Self operator-(const Self &o) const {
  138|  1.45k|    Self ret;
  139|  4.36k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.91k, False: 1.45k]
  ------------------
  140|  2.91k|      ret[i] = (*this)[i] - o[i];
  141|  2.91k|    }
  142|  1.45k|    return ret;
  143|  1.45k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  61.6k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  1.69M|  VectorD() {
   41|  6.79M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 5.09M, False: 1.69M]
  ------------------
   42|  5.09M|      (*this)[i] = Scalar(0);
   43|  5.09M|    }
   44|  1.69M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  9.67M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  9.67M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  9.67M|    v_[0] = c0;
   55|  9.67M|    v_[1] = c1;
   56|  9.67M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  7.00M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  21.0M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 14.0M, False: 7.00M]
  ------------------
  104|  14.0M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 14.0M, False: 0]
  ------------------
  105|  14.0M|        v_[i] = Scalar(src_vector[i]);
  106|  14.0M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  14.0M|    }
  110|  7.00M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  3.50M|  VectorD() {
   41|  10.5M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 7.00M, False: 3.50M]
  ------------------
   42|  7.00M|      (*this)[i] = Scalar(0);
   43|  7.00M|    }
   44|  3.50M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  3.50M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  10.5M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 7.00M, False: 3.50M]
  ------------------
  104|  7.00M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 7.00M, False: 0]
  ------------------
  105|  7.00M|        v_[i] = Scalar(src_vector[i]);
  106|  7.00M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  7.00M|    }
  110|  3.50M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  5.94M|  VectorD(const Self &o) {
   89|  17.8M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 11.8M, False: 5.94M]
  ------------------
   90|  11.8M|      (*this)[i] = o[i];
   91|  11.8M|    }
   92|  5.94M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  2.79M|  VectorD() {
   41|  8.37M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 5.58M, False: 2.79M]
  ------------------
   42|  5.58M|      (*this)[i] = Scalar(0);
   43|  5.58M|    }
   44|  2.79M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|   121M|  inline int num_vertices() const {
   74|   121M|    return static_cast<int>(vertex_corners_.size());
   75|   121M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  10.5M|  inline int num_corners() const {
   77|  10.5M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  10.5M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  2.38M|  inline int num_faces() const {
   80|  2.38M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  2.38M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   384M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   384M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 384M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   384M|    return opposite_corners_[corner];
   88|   384M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   642M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   642M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 17.4M, False: 624M]
  ------------------
   91|  17.4M|      return corner;
   92|  17.4M|    }
   93|   624M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 566M, False: 58.7M]
  ------------------
   94|   642M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   535M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   535M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 5.13M, False: 530M]
  ------------------
   97|  5.13M|      return corner;
   98|  5.13M|    }
   99|   530M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 140M, False: 389M]
  ------------------
  100|   535M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.00G|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|  1.00G|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 1.00G]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|  1.00G|    return ConfidentVertex(corner);
  106|  1.00G|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  1.00G|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|  1.00G|    DRACO_DCHECK_GE(corner.value(), 0);
  109|  1.00G|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|  1.00G|    return corner_to_vertex_map_[corner];
  111|  1.00G|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  39.4M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  39.4M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 39.4M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  39.4M|    return FaceIndex(corner.value() / 3);
  117|  39.4M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|  1.15G|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  74.2M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  74.2M|    return vertex_corners_[v];
  152|  74.2M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|   845k|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|   845k|    const CornerIndex corner = LeftMostCorner(vert);
  187|   845k|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 19.3k, False: 825k]
  ------------------
  188|  19.3k|      return true;
  189|  19.3k|    }
  190|   825k|    return false;
  191|   845k|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  82.1M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  82.1M|    return Previous(Opposite(Previous(corner)));
  202|  82.1M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  18.1M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  18.1M|    return Next(Opposite(Next(corner)));
  207|  18.1M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  3.63M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  3.63M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 3.63M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  3.63M|    return Opposite(Previous(corner_id));
  222|  3.63M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  4.45M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  4.45M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 4.45M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  4.45M|    return Opposite(Next(corner_id));
  228|  4.45M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   431M|                                CornerIndex opp_corner_id) {
  249|   431M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   431M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   431M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   511M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   511M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   511M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   511M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|   128M|  VertexIndex AddNewVertex() {
  271|   128M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|   128M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|   128M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|   128M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   287M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   287M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   287M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 287M, False: 0]
  ------------------
  295|   287M|      vertex_corners_[vert] = corner;
  296|   287M|    }
  297|   287M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|  5.00M|  void MakeVertexIsolated(VertexIndex vert) {
  329|  5.00M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|  5.00M|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|  5.00M|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  10.6k|      : corner_table_(table),
  229|  10.6k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  10.6k|        corner_(start_corner_),
  231|  10.6k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  4.32M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  75.9k|  VertexCornersIterator &operator++() {
  268|  75.9k|    Next();
  269|  75.9k|    return *this;
  270|  75.9k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.69M|  void Next() {
  248|  3.69M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.63M, False: 63.8k]
  ------------------
  249|  3.63M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.63M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 21.0k, False: 3.61M]
  ------------------
  251|       |        // Open boundary reached.
  252|  21.0k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  21.0k|        left_traversal_ = false;
  254|  3.61M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 601k, False: 3.01M]
  ------------------
  255|       |        // End reached.
  256|   601k|        corner_ = kInvalidCornerIndex;
  257|   601k|      }
  258|  3.63M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  63.8k|      corner_ = corner_table_->SwingRight(corner_);
  262|  63.8k|    }
  263|  3.69M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  6.39M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  5.00M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  4.92M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  2.81M|  void Next() {
  248|  2.81M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 2.79M, False: 25.6k]
  ------------------
  249|  2.79M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  2.79M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 2.06M, False: 728k]
  ------------------
  251|       |        // Open boundary reached.
  252|  2.06M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  2.06M|        left_traversal_ = false;
  254|  2.06M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 118k, False: 609k]
  ------------------
  255|       |        // End reached.
  256|   118k|        corner_ = kInvalidCornerIndex;
  257|   118k|      }
  258|  2.79M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  25.6k|      corner_ = corner_table_->SwingRight(corner_);
  262|  25.6k|    }
  263|  2.81M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  2.18M|      : corner_table_(table),
  236|  2.18M|        start_corner_(corner_id),
  237|  2.18M|        corner_(start_corner_),
  238|  2.18M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   612k|      : corner_table_(table),
  236|   612k|        start_corner_(corner_id),
  237|   612k|        corner_(start_corner_),
  238|   612k|        left_traversal_(true) {}

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

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

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

_ZNK5draco24MeshAttributeCornerTable26IsCornerOppositeToSeamEdgeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   45|  64.9M|  inline bool IsCornerOppositeToSeamEdge(CornerIndex corner) const {
   46|  64.9M|    return is_edge_on_seam_[corner.value()];
   47|  64.9M|  }
_ZNK5draco24MeshAttributeCornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   49|  30.6M|  inline CornerIndex Opposite(CornerIndex corner) const {
   50|  30.6M|    if (corner == kInvalidCornerIndex || IsCornerOppositeToSeamEdge(corner)) {
  ------------------
  |  Branch (50:9): [True: 0, False: 30.6M]
  |  Branch (50:42): [True: 24.4M, False: 6.18M]
  ------------------
   51|  24.4M|      return kInvalidCornerIndex;
   52|  24.4M|    }
   53|  6.18M|    return corner_table_->Opposite(corner);
   54|  30.6M|  }
_ZNK5draco24MeshAttributeCornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   56|  43.9M|  inline CornerIndex Next(CornerIndex corner) const {
   57|  43.9M|    return corner_table_->Next(corner);
   58|  43.9M|  }
_ZNK5draco24MeshAttributeCornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   60|  23.7M|  inline CornerIndex Previous(CornerIndex corner) const {
   61|  23.7M|    return corner_table_->Previous(corner);
   62|  23.7M|  }
_ZNK5draco24MeshAttributeCornerTable14IsCornerOnSeamENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   65|  5.20M|  inline bool IsCornerOnSeam(CornerIndex corner) const {
   66|  5.20M|    return is_vertex_on_seam_[corner_table_->Vertex(corner).value()];
   67|  5.20M|  }
_ZNK5draco24MeshAttributeCornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.83M|  inline CornerIndex GetLeftCorner(CornerIndex corner) const {
   72|  3.83M|    return Opposite(Previous(corner));
   73|  3.83M|  }
_ZNK5draco24MeshAttributeCornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   74|  4.55M|  inline CornerIndex GetRightCorner(CornerIndex corner) const {
   75|  4.55M|    return Opposite(Next(corner));
   76|  4.55M|  }
_ZNK5draco24MeshAttributeCornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   79|  4.36M|  inline CornerIndex SwingRight(CornerIndex corner) const {
   80|  4.36M|    return Previous(Opposite(Previous(corner)));
   81|  4.36M|  }
_ZNK5draco24MeshAttributeCornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   84|  14.0M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
   85|  14.0M|    return Next(Opposite(Next(corner)));
   86|  14.0M|  }
_ZNK5draco24MeshAttributeCornerTable12num_verticesEv:
   88|  11.7k|  int num_vertices() const {
   89|  11.7k|    return static_cast<int>(vertex_to_attribute_entry_id_map_.size());
   90|  11.7k|  }
_ZNK5draco24MeshAttributeCornerTable9num_facesEv:
   91|  4.00k|  int num_faces() const { return static_cast<int>(corner_table_->num_faces()); }
_ZNK5draco24MeshAttributeCornerTable11num_cornersEv:
   92|  1.56k|  int num_corners() const { return corner_table_->num_corners(); }
_ZNK5draco24MeshAttributeCornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   94|   111M|  VertexIndex Vertex(CornerIndex corner) const {
   95|   111M|    DRACO_DCHECK_LT(corner.value(), corner_to_vertex_map_.size());
   96|   111M|    return ConfidentVertex(corner);
   97|   111M|  }
_ZNK5draco24MeshAttributeCornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   98|   111M|  VertexIndex ConfidentVertex(CornerIndex corner) const {
   99|   111M|    return corner_to_vertex_map_[corner.value()];
  100|   111M|  }
_ZNK5draco24MeshAttributeCornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  106|  3.76M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  107|  3.76M|    return vertex_to_left_most_corner_map_[v.value()];
  108|  3.76M|  }
_ZNK5draco24MeshAttributeCornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  122|  3.76M|  inline bool IsOnBoundary(VertexIndex vert) const {
  123|  3.76M|    const CornerIndex corner = LeftMostCorner(vert);
  124|  3.76M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (124:9): [True: 0, False: 3.76M]
  ------------------
  125|      0|      return true;
  126|      0|    }
  127|  3.76M|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (127:9): [True: 3.05M, False: 712k]
  ------------------
  128|  3.05M|      return true;
  129|  3.05M|    }
  130|   712k|    return false;
  131|  3.76M|  }

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

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

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

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

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

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

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

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

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

