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

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

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

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

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

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

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

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

_ZNK5draco17GeometryAttribute10GetBytePosENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  118|  14.0M|  inline int64_t GetBytePos(AttributeValueIndex att_index) const {
  119|  14.0M|    return byte_offset_ + byte_stride_ * att_index.value();
  120|  14.0M|  }
_ZNK5draco17GeometryAttribute10GetAddressENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  122|  14.0M|  inline const uint8_t *GetAddress(AttributeValueIndex att_index) const {
  123|  14.0M|    const int64_t byte_pos = GetBytePos(att_index);
  124|  14.0M|    return buffer_->data() + byte_pos;
  125|  14.0M|  }
_ZN5draco17GeometryAttribute10GetAddressENS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEE:
  126|  12.3k|  inline uint8_t *GetAddress(AttributeValueIndex att_index) {
  127|  12.3k|    const int64_t byte_pos = GetBytePos(att_index);
  128|  12.3k|    return buffer_->data() + byte_pos;
  129|  12.3k|  }
_ZNK5draco17GeometryAttribute14IsAddressValidEPKh:
  130|  42.1M|  inline bool IsAddressValid(const uint8_t *address) const {
  131|  42.1M|    return ((buffer_->data() + buffer_->data_size()) > address);
  132|  42.1M|  }
_ZNK5draco17GeometryAttribute14attribute_typeEv:
  266|  82.1k|  Type attribute_type() const { return attribute_type_; }
_ZNK5draco17GeometryAttribute9data_typeEv:
  269|  24.9k|  DataType data_type() const { return data_type_; }
_ZNK5draco17GeometryAttribute14num_componentsEv:
  273|  45.8k|  uint8_t num_components() const { return num_components_; }
_ZNK5draco17GeometryAttribute11byte_strideEv:
  282|    572|  int64_t byte_stride() const { return byte_stride_; }
_ZNK5draco17GeometryAttribute9unique_idEv:
  287|  9.50k|  uint32_t unique_id() const { return unique_id_; }
_ZN5draco17GeometryAttribute13set_unique_idEj:
  288|   109k|  void set_unique_id(uint32_t id) { unique_id_ = id; }
_ZNK5draco17GeometryAttribute12ConvertValueIlEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPT_:
  229|  13.9M|  bool ConvertValue(AttributeValueIndex att_index, OutT *out_value) const {
  230|  13.9M|    return ConvertValue<OutT>(att_index, num_components_, out_value);
  231|  13.9M|  }
_ZNK5draco17GeometryAttribute12ConvertValueIlEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEaPT_:
  179|  13.9M|                    OutT *out_val) const {
  180|  13.9M|    if (out_val == nullptr) {
  ------------------
  |  Branch (180:9): [True: 0, False: 13.9M]
  ------------------
  181|      0|      return false;
  182|      0|    }
  183|  13.9M|    switch (data_type_) {
  184|      0|      case DT_INT8:
  ------------------
  |  Branch (184:7): [True: 0, False: 13.9M]
  ------------------
  185|      0|        return ConvertTypedValue<int8_t, OutT>(att_id, out_num_components,
  186|      0|                                               out_val);
  187|      0|      case DT_UINT8:
  ------------------
  |  Branch (187:7): [True: 0, False: 13.9M]
  ------------------
  188|      0|        return ConvertTypedValue<uint8_t, OutT>(att_id, out_num_components,
  189|      0|                                                out_val);
  190|      0|      case DT_INT16:
  ------------------
  |  Branch (190:7): [True: 0, False: 13.9M]
  ------------------
  191|      0|        return ConvertTypedValue<int16_t, OutT>(att_id, out_num_components,
  192|      0|                                                out_val);
  193|      0|      case DT_UINT16:
  ------------------
  |  Branch (193:7): [True: 0, False: 13.9M]
  ------------------
  194|      0|        return ConvertTypedValue<uint16_t, OutT>(att_id, out_num_components,
  195|      0|                                                 out_val);
  196|  13.9M|      case DT_INT32:
  ------------------
  |  Branch (196:7): [True: 13.9M, False: 0]
  ------------------
  197|  13.9M|        return ConvertTypedValue<int32_t, OutT>(att_id, out_num_components,
  198|  13.9M|                                                out_val);
  199|      0|      case DT_UINT32:
  ------------------
  |  Branch (199:7): [True: 0, False: 13.9M]
  ------------------
  200|      0|        return ConvertTypedValue<uint32_t, OutT>(att_id, out_num_components,
  201|      0|                                                 out_val);
  202|      0|      case DT_INT64:
  ------------------
  |  Branch (202:7): [True: 0, False: 13.9M]
  ------------------
  203|      0|        return ConvertTypedValue<int64_t, OutT>(att_id, out_num_components,
  204|      0|                                                out_val);
  205|      0|      case DT_UINT64:
  ------------------
  |  Branch (205:7): [True: 0, False: 13.9M]
  ------------------
  206|      0|        return ConvertTypedValue<uint64_t, OutT>(att_id, out_num_components,
  207|      0|                                                 out_val);
  208|      0|      case DT_FLOAT32:
  ------------------
  |  Branch (208:7): [True: 0, False: 13.9M]
  ------------------
  209|      0|        return ConvertTypedValue<float, OutT>(att_id, out_num_components,
  210|      0|                                              out_val);
  211|      0|      case DT_FLOAT64:
  ------------------
  |  Branch (211:7): [True: 0, False: 13.9M]
  ------------------
  212|      0|        return ConvertTypedValue<double, OutT>(att_id, out_num_components,
  213|      0|                                               out_val);
  214|      0|      case DT_BOOL:
  ------------------
  |  Branch (214:7): [True: 0, False: 13.9M]
  ------------------
  215|      0|        return ConvertTypedValue<bool, OutT>(att_id, out_num_components,
  216|      0|                                             out_val);
  217|      0|      default:
  ------------------
  |  Branch (217:7): [True: 0, False: 13.9M]
  ------------------
  218|       |        // Wrong attribute type.
  219|      0|        return false;
  220|  13.9M|    }
  221|  13.9M|  }
_ZNK5draco17GeometryAttribute17ConvertTypedValueIilEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEhPT0_:
  306|  13.9M|                         OutT *out_value) const {
  307|  13.9M|    const uint8_t *src_address = GetAddress(att_id);
  308|       |
  309|       |    // Convert all components available in both the original and output formats.
  310|  55.9M|    for (int i = 0; i < std::min(num_components_, out_num_components); ++i) {
  ------------------
  |  Branch (310:21): [True: 41.9M, False: 13.9M]
  ------------------
  311|  41.9M|      if (!IsAddressValid(src_address)) {
  ------------------
  |  Branch (311:11): [True: 0, False: 41.9M]
  ------------------
  312|      0|        return false;
  313|      0|      }
  314|  41.9M|      const T in_value = *reinterpret_cast<const T *>(src_address);
  315|  41.9M|      if (!ConvertComponentValue<T, OutT>(in_value, normalized_,
  ------------------
  |  Branch (315:11): [True: 0, False: 41.9M]
  ------------------
  316|  41.9M|                                          out_value + i)) {
  317|      0|        return false;
  318|      0|      }
  319|  41.9M|      src_address += sizeof(T);
  320|  41.9M|    }
  321|       |    // Fill empty data for unused output components if needed.
  322|  13.9M|    for (int i = num_components_; i < out_num_components; ++i) {
  ------------------
  |  Branch (322:35): [True: 0, False: 13.9M]
  ------------------
  323|      0|      out_value[i] = static_cast<OutT>(0);
  324|      0|    }
  325|  13.9M|    return true;
  326|  13.9M|  }
_ZN5draco17GeometryAttribute21ConvertComponentValueIilEEbRKT_bPT0_:
  364|  41.9M|                                    OutT *out_value) {
  365|       |    // Make sure the |in_value| can be represented as an integral type OutT.
  366|  41.9M|    if (std::is_integral<OutT>::value) {
  ------------------
  |  Branch (366:9): [True: 41.9M, Folded]
  ------------------
  367|       |      // Make sure the |in_value| fits within the range of values that OutT
  368|       |      // is able to represent. Perform the check only for integral types.
  369|  41.9M|      if (!std::is_same<T, bool>::value && std::is_integral<T>::value) {
  ------------------
  |  Branch (369:11): [True: 0, Folded]
  |  Branch (369:44): [True: 0, Folded]
  ------------------
  370|  41.9M|        static constexpr OutT kOutMin =
  371|  41.9M|            std::is_signed<T>::value ? std::numeric_limits<OutT>::min() : 0;
  ------------------
  |  Branch (371:13): [True: 0, Folded]
  ------------------
  372|  41.9M|        if (in_value < kOutMin || in_value > std::numeric_limits<OutT>::max()) {
  ------------------
  |  Branch (372:13): [True: 0, False: 41.9M]
  |  Branch (372:35): [True: 0, False: 41.9M]
  ------------------
  373|      0|          return false;
  374|      0|        }
  375|  41.9M|      }
  376|       |
  377|       |      // Check conversion of floating point |in_value| to integral value OutT.
  378|  41.9M|      if (std::is_floating_point<T>::value) {
  ------------------
  |  Branch (378:11): [Folded, False: 41.9M]
  ------------------
  379|       |        // Make sure the floating point |in_value| is not NaN and not Inf as
  380|       |        // integral type OutT is unable to represent these values.
  381|      0|        if (sizeof(in_value) > sizeof(double)) {
  ------------------
  |  Branch (381:13): [Folded, False: 0]
  ------------------
  382|      0|          if (std::isnan(static_cast<long double>(in_value)) ||
  ------------------
  |  Branch (382:15): [True: 0, False: 0]
  ------------------
  383|      0|              std::isinf(static_cast<long double>(in_value))) {
  ------------------
  |  Branch (383:15): [True: 0, False: 0]
  ------------------
  384|      0|            return false;
  385|      0|          }
  386|      0|        } else if (sizeof(in_value) > sizeof(float)) {
  ------------------
  |  Branch (386:20): [Folded, False: 0]
  ------------------
  387|      0|          if (std::isnan(static_cast<double>(in_value)) ||
  ------------------
  |  Branch (387:15): [True: 0, False: 0]
  ------------------
  388|      0|              std::isinf(static_cast<double>(in_value))) {
  ------------------
  |  Branch (388:15): [True: 0, False: 0]
  ------------------
  389|      0|            return false;
  390|      0|          }
  391|      0|        } else {
  392|      0|          if (std::isnan(static_cast<float>(in_value)) ||
  ------------------
  |  Branch (392:15): [True: 0, False: 0]
  ------------------
  393|      0|              std::isinf(static_cast<float>(in_value))) {
  ------------------
  |  Branch (393:15): [True: 0, False: 0]
  ------------------
  394|      0|            return false;
  395|      0|          }
  396|      0|        }
  397|       |
  398|       |        // Make sure the floating point |in_value| fits within the range of
  399|       |        // values that integral type OutT is able to represent.
  400|      0|        if (in_value < std::numeric_limits<OutT>::min() ||
  ------------------
  |  Branch (400:13): [True: 0, False: 0]
  ------------------
  401|      0|            in_value >= std::numeric_limits<OutT>::max()) {
  ------------------
  |  Branch (401:13): [True: 0, False: 0]
  ------------------
  402|      0|          return false;
  403|      0|        }
  404|      0|      }
  405|  41.9M|    }
  406|       |
  407|  41.9M|    if (std::is_integral<T>::value && std::is_floating_point<OutT>::value &&
  ------------------
  |  Branch (407:9): [True: 0, Folded]
  |  Branch (407:39): [Folded, False: 0]
  ------------------
  408|      0|        normalized) {
  ------------------
  |  Branch (408:9): [True: 0, False: 0]
  ------------------
  409|       |      // When converting integer to floating point, normalize the value if
  410|       |      // necessary.
  411|      0|      *out_value = static_cast<OutT>(in_value);
  412|      0|      *out_value /= static_cast<OutT>(std::numeric_limits<T>::max());
  413|  41.9M|    } else if (std::is_floating_point<T>::value &&
  ------------------
  |  Branch (413:16): [Folded, False: 41.9M]
  ------------------
  414|      0|               std::is_integral<OutT>::value && normalized) {
  ------------------
  |  Branch (414:16): [True: 0, Folded]
  |  Branch (414:49): [True: 0, False: 0]
  ------------------
  415|       |      // Converting from floating point to a normalized integer.
  416|      0|      if (in_value > 1 || in_value < 0) {
  ------------------
  |  Branch (416:11): [True: 0, False: 0]
  |  Branch (416:27): [True: 0, False: 0]
  ------------------
  417|       |        // Normalized float values need to be between 0 and 1.
  418|      0|        return false;
  419|      0|      }
  420|       |      // TODO(ostava): Consider allowing float to normalized integer conversion
  421|       |      // for 64-bit integer types. Currently it doesn't work because we don't
  422|       |      // have a floating point type that could store all 64 bit integers.
  423|      0|      if (sizeof(OutT) > 4) {
  ------------------
  |  Branch (423:11): [True: 0, Folded]
  ------------------
  424|      0|        return false;
  425|      0|      }
  426|       |      // Expand the float to the range of the output integer and round it to the
  427|       |      // nearest representable value. Use doubles for the math to ensure the
  428|       |      // integer values are represented properly during the conversion process.
  429|      0|      *out_value = static_cast<OutT>(std::floor(
  430|      0|          in_value * static_cast<double>(std::numeric_limits<OutT>::max()) +
  431|      0|          0.5));
  432|  41.9M|    } else {
  433|  41.9M|      *out_value = static_cast<OutT>(in_value);
  434|  41.9M|    }
  435|       |
  436|       |    // TODO(ostava): Add handling of normalized attributes when converting
  437|       |    // between different integer representations. If the attribute is
  438|       |    // normalized, integer values should be converted as if they represent 0-1
  439|       |    // range. E.g. when we convert uint16 to uint8, the range <0, 2^16 - 1>
  440|       |    // should be converted to range <0, 2^8 - 1>.
  441|  41.9M|    return true;
  442|  41.9M|  }
_ZNK5draco17GeometryAttribute12ConvertValueIfEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEPT_:
  229|  50.2k|  bool ConvertValue(AttributeValueIndex att_index, OutT *out_value) const {
  230|  50.2k|    return ConvertValue<OutT>(att_index, num_components_, out_value);
  231|  50.2k|  }
_ZNK5draco17GeometryAttribute12ConvertValueIfEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEaPT_:
  179|  50.2k|                    OutT *out_val) const {
  180|  50.2k|    if (out_val == nullptr) {
  ------------------
  |  Branch (180:9): [True: 0, False: 50.2k]
  ------------------
  181|      0|      return false;
  182|      0|    }
  183|  50.2k|    switch (data_type_) {
  184|      0|      case DT_INT8:
  ------------------
  |  Branch (184:7): [True: 0, False: 50.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: 50.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: 50.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: 50.2k]
  ------------------
  194|      0|        return ConvertTypedValue<uint16_t, OutT>(att_id, out_num_components,
  195|      0|                                                 out_val);
  196|  50.2k|      case DT_INT32:
  ------------------
  |  Branch (196:7): [True: 50.2k, False: 0]
  ------------------
  197|  50.2k|        return ConvertTypedValue<int32_t, OutT>(att_id, out_num_components,
  198|  50.2k|                                                out_val);
  199|      0|      case DT_UINT32:
  ------------------
  |  Branch (199:7): [True: 0, False: 50.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: 50.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: 50.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: 50.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: 50.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: 50.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: 50.2k]
  ------------------
  218|       |        // Wrong attribute type.
  219|      0|        return false;
  220|  50.2k|    }
  221|  50.2k|  }
_ZNK5draco17GeometryAttribute17ConvertTypedValueIifEEbNS_9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEEhPT0_:
  306|  50.2k|                         OutT *out_value) const {
  307|  50.2k|    const uint8_t *src_address = GetAddress(att_id);
  308|       |
  309|       |    // Convert all components available in both the original and output formats.
  310|   201k|    for (int i = 0; i < std::min(num_components_, out_num_components); ++i) {
  ------------------
  |  Branch (310:21): [True: 150k, False: 50.2k]
  ------------------
  311|   150k|      if (!IsAddressValid(src_address)) {
  ------------------
  |  Branch (311:11): [True: 0, False: 150k]
  ------------------
  312|      0|        return false;
  313|      0|      }
  314|   150k|      const T in_value = *reinterpret_cast<const T *>(src_address);
  315|   150k|      if (!ConvertComponentValue<T, OutT>(in_value, normalized_,
  ------------------
  |  Branch (315:11): [True: 0, False: 150k]
  ------------------
  316|   150k|                                          out_value + i)) {
  317|      0|        return false;
  318|      0|      }
  319|   150k|      src_address += sizeof(T);
  320|   150k|    }
  321|       |    // Fill empty data for unused output components if needed.
  322|  50.2k|    for (int i = num_components_; i < out_num_components; ++i) {
  ------------------
  |  Branch (322:35): [True: 0, False: 50.2k]
  ------------------
  323|      0|      out_value[i] = static_cast<OutT>(0);
  324|      0|    }
  325|  50.2k|    return true;
  326|  50.2k|  }
_ZN5draco17GeometryAttribute21ConvertComponentValueIifEEbRKT_bPT0_:
  364|   150k|                                    OutT *out_value) {
  365|       |    // Make sure the |in_value| can be represented as an integral type OutT.
  366|   150k|    if (std::is_integral<OutT>::value) {
  ------------------
  |  Branch (366:9): [Folded, False: 150k]
  ------------------
  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|   150k|    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|   150k|        normalized) {
  ------------------
  |  Branch (408:9): [True: 0, False: 150k]
  ------------------
  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|   150k|    } else if (std::is_floating_point<T>::value &&
  ------------------
  |  Branch (413:16): [Folded, False: 150k]
  ------------------
  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|   150k|    } else {
  433|   150k|      *out_value = static_cast<OutT>(in_value);
  434|   150k|    }
  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|   150k|    return true;
  442|   150k|  }

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

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

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

_ZNK5draco17AttributesDecoder14GetAttributeIdEi:
   44|  68.2k|  int32_t GetAttributeId(int i) const override {
   45|  68.2k|    return point_attribute_ids_[i];
   46|  68.2k|  }
_ZNK5draco17AttributesDecoder16GetNumAttributesEv:
   47|  47.1k|  int32_t GetNumAttributes() const override {
   48|  47.1k|    return static_cast<int32_t>(point_attribute_ids_.size());
   49|  47.1k|  }
_ZNK5draco17AttributesDecoder10GetDecoderEv:
   50|  42.4k|  PointCloudDecoder *GetDecoder() const override {
   51|  42.4k|    return point_cloud_decoder_;
   52|  42.4k|  }
_ZN5draco17AttributesDecoder16DecodeAttributesEPNS_13DecoderBufferE:
   55|  5.17k|  bool DecodeAttributes(DecoderBuffer *in_buffer) override {
   56|  5.17k|    if (!DecodePortableAttributes(in_buffer)) {
  ------------------
  |  Branch (56:9): [True: 2.12k, False: 3.05k]
  ------------------
   57|  2.12k|      return false;
   58|  2.12k|    }
   59|  3.05k|    if (!DecodeDataNeededByPortableTransforms(in_buffer)) {
  ------------------
  |  Branch (59:9): [True: 693, False: 2.35k]
  ------------------
   60|    693|      return false;
   61|    693|    }
   62|  2.35k|    if (!TransformAttributesToOriginalFormat()) {
  ------------------
  |  Branch (62:9): [True: 320, False: 2.03k]
  ------------------
   63|    320|      return false;
   64|    320|    }
   65|  2.03k|    return true;
   66|  2.35k|  }
_ZNK5draco17AttributesDecoder27GetLocalIdForPointAttributeEi:
   69|  2.15k|  int32_t GetLocalIdForPointAttribute(int32_t point_attribute_id) const {
   70|  2.15k|    const int id_map_size =
   71|  2.15k|        static_cast<int>(point_attribute_to_local_id_map_.size());
   72|  2.15k|    if (point_attribute_id >= id_map_size) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.15k]
  ------------------
   73|      0|      return -1;
   74|      0|    }
   75|  2.15k|    return point_attribute_to_local_id_map_[point_attribute_id];
   76|  2.15k|  }
_ZN5draco17AttributesDecoderD2Ev:
   35|  27.6k|  virtual ~AttributesDecoder() = default;

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  2.77k|      : quantization_bits_(-1),
   54|  2.77k|        max_quantized_value_(-1),
   55|  2.77k|        max_value_(-1),
   56|  2.77k|        dequantization_scale_(1.f),
   57|  2.77k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  2.48k|  bool SetQuantizationBits(int32_t q) {
   60|  2.48k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 730, False: 1.75k]
  |  Branch (60:18): [True: 156, False: 1.60k]
  ------------------
   61|    886|      return false;
   62|    886|    }
   63|  1.60k|    quantization_bits_ = q;
   64|  1.60k|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|  1.60k|    max_value_ = max_quantized_value_ - 1;
   66|  1.60k|    dequantization_scale_ = 2.f / max_value_;
   67|  1.60k|    center_value_ = max_value_ / 2;
   68|  1.60k|    return true;
   69|  2.48k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  2.30M|                                           int32_t *out_t) const {
   77|  2.30M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 1.91k, False: 2.29M]
  |  Branch (77:20): [True: 0, False: 1.91k]
  |  Branch (77:32): [True: 1.91k, False: 2.29M]
  |  Branch (77:42): [True: 0, False: 1.91k]
  ------------------
   78|  2.30M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 1.62M, False: 678k]
  |  Branch (78:29): [True: 3.84k, False: 1.61M]
  ------------------
   79|  3.84k|      s = max_value_;
   80|  3.84k|      t = max_value_;
   81|  2.29M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 1.91k, False: 2.29M]
  |  Branch (81:26): [True: 535, False: 1.38k]
  ------------------
   82|    535|      t = center_value_ - (t - center_value_);
   83|  2.29M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 1.61M, False: 678k]
  |  Branch (83:35): [True: 3.88k, False: 1.61M]
  ------------------
   84|  3.88k|      t = center_value_ + (center_value_ - t);
   85|  2.29M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 1.61M, False: 675k]
  |  Branch (85:35): [True: 170, False: 1.61M]
  ------------------
   86|    170|      s = center_value_ + (center_value_ - s);
   87|  2.29M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 3.33k, False: 2.28M]
  |  Branch (87:26): [True: 1.58k, False: 1.74k]
  ------------------
   88|  1.58k|      s = center_value_ - (s - center_value_);
   89|  1.58k|    }
   90|       |
   91|  2.30M|    *out_s = s;
   92|  2.30M|    *out_t = t;
   93|  2.30M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  2.30M|                                                       int32_t *out_t) const {
  100|  2.30M|    DRACO_DCHECK_EQ(
  101|  2.30M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  2.30M|        center_value_);
  103|  2.30M|    int32_t s, t;
  104|  2.30M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 946k, False: 1.35M]
  ------------------
  105|       |      // Right hemisphere.
  106|   946k|      s = (int_vec[1] + center_value_);
  107|   946k|      t = (int_vec[2] + center_value_);
  108|  1.35M|    } else {
  109|       |      // Left hemisphere.
  110|  1.35M|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 29.2k, False: 1.32M]
  ------------------
  111|  29.2k|        s = std::abs(int_vec[2]);
  112|  1.32M|      } else {
  113|  1.32M|        s = (max_value_ - std::abs(int_vec[2]));
  114|  1.32M|      }
  115|  1.35M|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 34.3k, False: 1.31M]
  ------------------
  116|  34.3k|        t = std::abs(int_vec[1]);
  117|  1.31M|      } else {
  118|  1.31M|        t = (max_value_ - std::abs(int_vec[1]));
  119|  1.31M|      }
  120|  1.35M|    }
  121|  2.30M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  2.30M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|   210k|                                                    float *out_vector) const {
  199|   210k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|   210k|                                 in_t * dequantization_scale_ - 1.f,
  201|   210k|                                 out_vector);
  202|   210k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  2.27M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  2.27M|    DRACO_DCHECK_LE(s, center_value_);
  208|  2.27M|    DRACO_DCHECK_LE(t, center_value_);
  209|  2.27M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  2.27M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  2.27M|    const uint32_t st =
  212|  2.27M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  2.27M|    return st <= center_value_;
  214|  2.27M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  2.87M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  2.87M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  2.87M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  2.87M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  2.87M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  2.87M|    int32_t sign_s = 0;
  223|  2.87M|    int32_t sign_t = 0;
  224|  2.87M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 2.65M, False: 227k]
  |  Branch (224:20): [True: 2.52M, False: 125k]
  ------------------
  225|  2.52M|      sign_s = 1;
  226|  2.52M|      sign_t = 1;
  227|  2.52M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 260k, False: 92.1k]
  |  Branch (227:27): [True: 219k, False: 41.6k]
  ------------------
  228|   219k|      sign_s = -1;
  229|   219k|      sign_t = -1;
  230|   219k|    } else {
  231|   133k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 92.1k, False: 41.6k]
  ------------------
  232|   133k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 41.6k, False: 92.1k]
  ------------------
  233|   133k|    }
  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.87M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  2.87M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  2.87M|    uint32_t us = *s;
  241|  2.87M|    uint32_t ut = *t;
  242|  2.87M|    us = us + us - corner_point_s;
  243|  2.87M|    ut = ut + ut - corner_point_t;
  244|  2.87M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 2.74M, False: 133k]
  ------------------
  245|  2.74M|      uint32_t temp = us;
  246|  2.74M|      us = -ut;
  247|  2.74M|      ut = -temp;
  248|  2.74M|    } else {
  249|   133k|      std::swap(us, ut);
  250|   133k|    }
  251|  2.87M|    us = us + corner_point_s;
  252|  2.87M|    ut = ut + corner_point_t;
  253|       |
  254|  2.87M|    *s = us;
  255|  2.87M|    *t = ut;
  256|  2.87M|    *s /= 2;
  257|  2.87M|    *t /= 2;
  258|  2.87M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  4.55M|  int32_t ModMax(int32_t x) const {
  273|  4.55M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 4.29k, False: 4.54M]
  ------------------
  274|  4.29k|      return x - this->max_quantized_value();
  275|  4.29k|    }
  276|  4.54M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 2.29k, False: 4.54M]
  ------------------
  277|  2.29k|      return x + this->max_quantized_value();
  278|  2.29k|    }
  279|  4.54M|    return x;
  280|  4.54M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|  1.46k|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  6.58k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  13.6M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|   210k|                                           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|   210k|    float y = in_s_scaled;
  329|   210k|    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|   210k|    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|   210k|    float x_offset = -x;
  342|   210k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 15, False: 210k]
  ------------------
  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|   210k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 47.4k, False: 162k]
  ------------------
  348|   210k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 47.4k, False: 162k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|   210k|    const float norm_squared = x * x + y * y + z * z;
  352|   210k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 210k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|   210k|    } else {
  357|   210k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|   210k|      out_vector[0] = x * d;
  359|   210k|      out_vector[1] = y * d;
  360|   210k|      out_vector[2] = z * d;
  361|   210k|    }
  362|   210k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  2.30M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  2.30M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  2.30M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  2.30M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  2.30M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  2.30M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  2.30M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 2.13M, False: 167k]
  ------------------
  181|  2.13M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  2.13M|    } else {
  183|   167k|      vec[0] =
  184|   167k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   167k|          abs_sum;
  186|   167k|      vec[1] =
  187|   167k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   167k|          abs_sum;
  189|   167k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 89.0k, False: 78.1k]
  ------------------
  190|  89.0k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|  89.0k|      } else {
  192|  78.1k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|  78.1k|      }
  194|   167k|    }
  195|  2.30M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    372|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    372|            attribute, transform, mesh_data),
   52|    372|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    359|                                                                *buffer) {
  194|    359|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    359|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    359|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 17, False: 342]
  ------------------
  196|       |    // Decode prediction mode.
  197|     17|    uint8_t mode;
  198|     17|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 1, False: 16]
  ------------------
  199|      1|      return false;
  200|      1|    }
  201|       |
  202|     16|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 14, False: 2]
  ------------------
  203|       |      // Unsupported mode.
  204|     14|      return false;
  205|     14|    }
  206|     16|  }
  207|    344|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.50k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.25k, False: 246]
  ------------------
  211|  1.25k|    uint32_t num_flags;
  212|  1.25k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 14, False: 1.24k]
  ------------------
  213|     14|      return false;
  214|     14|    }
  215|  1.24k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 55, False: 1.18k]
  ------------------
  216|     55|      return false;
  217|     55|    }
  218|  1.18k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 501, False: 684]
  ------------------
  219|    501|      is_crease_edge_[i].resize(num_flags);
  220|    501|      RAnsBitDecoder decoder;
  221|    501|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 29, False: 472]
  ------------------
  222|     29|        return false;
  223|     29|      }
  224|  1.08M|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 1.08M, False: 472]
  ------------------
  225|  1.08M|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|  1.08M|      }
  227|    472|      decoder.EndDecoding();
  228|    472|    }
  229|  1.18k|  }
  230|    246|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    246|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    344|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    231|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    231|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    231|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.15k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 924, False: 231]
  ------------------
   93|    924|    pred_vals[i].resize(num_components, 0);
   94|    924|  }
   95|    231|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    231|                                         out_data);
   97|       |
   98|    231|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    231|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    231|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    231|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    231|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    231|  const int corner_map_size =
  109|    231|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   817k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 817k, False: 130]
  ------------------
  111|   817k|    const CornerIndex start_corner_id =
  112|   817k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   817k|    CornerIndex corner_id(start_corner_id);
  115|   817k|    int num_parallelograms = 0;
  116|   817k|    bool first_pass = true;
  117|  1.77M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 983k, False: 791k]
  ------------------
  118|   983k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 64.2k, False: 919k]
  ------------------
  119|   983k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   983k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  64.2k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  64.2k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 436, False: 63.7k]
  ------------------
  127|    436|          break;
  128|    436|        }
  129|  64.2k|      }
  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|   983k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 960k, False: 23.1k]
  ------------------
  134|   960k|        corner_id = table->SwingLeft(corner_id);
  135|   960k|      } else {
  136|  23.1k|        corner_id = table->SwingRight(corner_id);
  137|  23.1k|      }
  138|   983k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 25.5k, False: 957k]
  ------------------
  139|  25.5k|        break;
  140|  25.5k|      }
  141|   957k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 803k, False: 154k]
  |  Branch (141:47): [True: 791k, False: 12.0k]
  ------------------
  142|   791k|        first_pass = false;
  143|   791k|        corner_id = table->SwingRight(start_corner_id);
  144|   791k|      }
  145|   957k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   817k|    int num_used_parallelograms = 0;
  150|   817k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 38.9k, False: 778k]
  ------------------
  151|  6.31M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 6.27M, False: 38.9k]
  ------------------
  152|  6.27M|        multi_pred_vals[i] = 0;
  153|  6.27M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   103k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 64.1k, False: 38.8k]
  ------------------
  156|  64.1k|        const int context = num_parallelograms - 1;
  157|  64.1k|        const int pos = is_crease_edge_pos[context]++;
  158|  64.1k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 101, False: 64.0k]
  ------------------
  159|    101|          return false;
  160|    101|        }
  161|  64.0k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  64.0k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 8.87k, False: 55.2k]
  ------------------
  163|  8.87k|          ++num_used_parallelograms;
  164|   879k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 871k, False: 8.87k]
  ------------------
  165|   871k|            multi_pred_vals[j] =
  166|   871k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|   871k|          }
  168|  8.87k|        }
  169|  64.0k|      }
  170|  38.9k|    }
  171|   817k|    const int dst_offset = p * num_components;
  172|   817k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 813k, False: 4.04k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   813k|      const int src_offset = (p - 1) * num_components;
  176|   813k|      this->transform().ComputeOriginalValue(
  177|   813k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   813k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   409k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 405k, False: 4.04k]
  ------------------
  181|   405k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   405k|      }
  183|  4.04k|      this->transform().ComputeOriginalValue(
  184|  4.04k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  4.04k|    }
  186|   817k|  }
  187|    130|  return true;
  188|    231|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    424|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    424|            attribute, transform, mesh_data),
   52|    424|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    412|                                                                *buffer) {
  194|    412|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    412|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    412|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 3, False: 409]
  ------------------
  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|    410|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|  1.75k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 1.45k, False: 300]
  ------------------
  211|  1.45k|    uint32_t num_flags;
  212|  1.45k|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 14, False: 1.44k]
  ------------------
  213|     14|      return false;
  214|     14|    }
  215|  1.44k|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 64, False: 1.37k]
  ------------------
  216|     64|      return false;
  217|     64|    }
  218|  1.37k|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 531, False: 848]
  ------------------
  219|    531|      is_crease_edge_[i].resize(num_flags);
  220|    531|      RAnsBitDecoder decoder;
  221|    531|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 32, False: 499]
  ------------------
  222|     32|        return false;
  223|     32|      }
  224|   682k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 681k, False: 499]
  ------------------
  225|   681k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|   681k|      }
  227|    499|      decoder.EndDecoding();
  228|    499|    }
  229|  1.37k|  }
  230|    300|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    300|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    410|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    267|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    267|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    267|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|  1.33k|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 1.06k, False: 267]
  ------------------
   93|  1.06k|    pred_vals[i].resize(num_components, 0);
   94|  1.06k|  }
   95|    267|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    267|                                         out_data);
   97|       |
   98|    267|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    267|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    267|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    267|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    267|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    267|  const int corner_map_size =
  109|    267|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  96.9k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 96.8k, False: 149]
  ------------------
  111|  96.8k|    const CornerIndex start_corner_id =
  112|  96.8k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  96.8k|    CornerIndex corner_id(start_corner_id);
  115|  96.8k|    int num_parallelograms = 0;
  116|  96.8k|    bool first_pass = true;
  117|   633k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 622k, False: 11.1k]
  ------------------
  118|   622k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 178k, False: 443k]
  ------------------
  119|   622k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   622k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|   178k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|   178k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 556, False: 178k]
  ------------------
  127|    556|          break;
  128|    556|        }
  129|   178k|      }
  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|   621k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 571k, False: 49.8k]
  ------------------
  134|   571k|        corner_id = table->SwingLeft(corner_id);
  135|   571k|      } else {
  136|  49.8k|        corner_id = table->SwingRight(corner_id);
  137|  49.8k|      }
  138|   621k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 85.1k, False: 536k]
  ------------------
  139|  85.1k|        break;
  140|  85.1k|      }
  141|   536k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 19.7k, False: 516k]
  |  Branch (141:47): [True: 11.1k, False: 8.56k]
  ------------------
  142|  11.1k|        first_pass = false;
  143|  11.1k|        corner_id = table->SwingRight(start_corner_id);
  144|  11.1k|      }
  145|   536k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  96.8k|    int num_used_parallelograms = 0;
  150|  96.8k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 94.9k, False: 1.85k]
  ------------------
  151|  7.31M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 7.22M, False: 94.9k]
  ------------------
  152|  7.22M|        multi_pred_vals[i] = 0;
  153|  7.22M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   273k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 178k, False: 94.8k]
  ------------------
  156|   178k|        const int context = num_parallelograms - 1;
  157|   178k|        const int pos = is_crease_edge_pos[context]++;
  158|   178k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 118, False: 178k]
  ------------------
  159|    118|          return false;
  160|    118|        }
  161|   178k|        const bool is_crease = is_crease_edge_[context][pos];
  162|   178k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 7.93k, False: 170k]
  ------------------
  163|  7.93k|          ++num_used_parallelograms;
  164|   726k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 718k, False: 7.93k]
  ------------------
  165|   718k|            multi_pred_vals[j] =
  166|   718k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|   718k|          }
  168|  7.93k|        }
  169|   178k|      }
  170|  94.9k|    }
  171|  96.7k|    const int dst_offset = p * num_components;
  172|  96.7k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 93.2k, False: 3.51k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  93.2k|      const int src_offset = (p - 1) * num_components;
  176|  93.2k|      this->transform().ComputeOriginalValue(
  177|  93.2k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  93.2k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   371k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 368k, False: 3.51k]
  ------------------
  181|   368k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   368k|      }
  183|  3.51k|      this->transform().ComputeOriginalValue(
  184|  3.51k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  3.51k|    }
  186|  96.7k|  }
  187|    149|  return true;
  188|    267|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  2.47k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  2.47k|    mesh_ = mesh;
   39|  2.47k|    corner_table_ = table;
   40|  2.47k|    data_to_corner_map_ = data_to_corner_map;
   41|  2.47k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  2.47k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  10.0M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  7.26M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  7.26M|    return vertex_to_data_map_;
   48|  7.26M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  4.94M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  4.94M|    return data_to_corner_map_;
   51|  4.94M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  2.45k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  2.45k|    mesh_ = mesh;
   39|  2.45k|    corner_table_ = table;
   40|  2.45k|    data_to_corner_map_ = data_to_corner_map;
   41|  2.45k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  2.45k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  9.88M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  8.52M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  8.52M|    return vertex_to_data_map_;
   48|  8.52M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  1.92M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  1.92M|    return data_to_corner_map_;
   51|  1.92M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  2.47k|      : mesh_(nullptr),
   31|  2.47k|        corner_table_(nullptr),
   32|  2.47k|        vertex_to_data_map_(nullptr),
   33|  2.47k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  2.45k|      : mesh_(nullptr),
   31|  2.45k|        corner_table_(nullptr),
   32|  2.45k|        vertex_to_data_map_(nullptr),
   33|  2.45k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   728k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   277k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   644k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   140k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.10k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.10k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  5.16M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  2.16k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  2.16k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  2.77M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    197|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    197|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    153|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    153|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    161|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    161|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    131|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    131|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    391|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    197|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    197|    DRACO_DCHECK_EQ(i, 0);
   70|    197|    (void)i;
   71|    197|    return GeometryAttribute::POSITION;
   72|    197|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    196|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    196|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 196]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    196|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 194]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    194|    predictor_.SetPositionAttribute(*att);
   82|    194|    return true;
   83|    196|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    193|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    193|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 7, False: 186]
  ------------------
  145|      7|    return false;
  146|      7|  }
  147|       |
  148|    186|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    186|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    186|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 57, False: 129]
  ------------------
  150|     57|    uint8_t prediction_mode;
  151|     57|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 56]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     56|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 55]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     55|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 55]
  ------------------
  160|     55|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     55|  }
  164|    184|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    184|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 8, False: 176]
  ------------------
  168|      8|    return false;
  169|      8|  }
  170|       |
  171|    176|  return true;
  172|    184|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    176|                                      const PointIndex *entry_to_point_id_map) {
  103|    176|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    176|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    176|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    176|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    176|  const int corner_map_size =
  111|    176|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    176|  VectorD<int32_t, 3> pred_normal_3d;
  114|    176|  int32_t pred_normal_oct[2];
  115|       |
  116|   728k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 728k, False: 176]
  ------------------
  117|   728k|    const CornerIndex corner_id =
  118|   728k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   728k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   728k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   728k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   728k|                    octahedron_tool_box_.center_value());
  125|   728k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 646k, False: 81.8k]
  ------------------
  126|   646k|      pred_normal_3d = -pred_normal_3d;
  127|   646k|    }
  128|   728k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   728k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   728k|    const int data_offset = data_id * 2;
  132|   728k|    this->transform().ComputeOriginalValue(
  133|   728k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   728k|  }
  135|    176|  flip_normal_bit_decoder_.EndDecoding();
  136|    176|  return true;
  137|    176|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    176|  void SetQuantizationBits(int q) {
   85|    176|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    176|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    302|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    153|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    153|    DRACO_DCHECK_EQ(i, 0);
   70|    153|    (void)i;
   71|    153|    return GeometryAttribute::POSITION;
   72|    153|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    151|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    151|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 151]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    151|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 149]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    149|    predictor_.SetPositionAttribute(*att);
   82|    149|    return true;
   83|    151|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    148|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    148|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 6, False: 142]
  ------------------
  145|      6|    return false;
  146|      6|  }
  147|       |
  148|    142|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    142|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    142|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 27, False: 115]
  ------------------
  150|     27|    uint8_t prediction_mode;
  151|     27|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 26]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     26|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 25]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     25|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 25]
  ------------------
  160|     25|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     25|  }
  164|    140|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    140|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 5, False: 135]
  ------------------
  168|      5|    return false;
  169|      5|  }
  170|       |
  171|    135|  return true;
  172|    140|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    135|                                      const PointIndex *entry_to_point_id_map) {
  103|    135|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    135|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    135|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    135|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    135|  const int corner_map_size =
  111|    135|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    135|  VectorD<int32_t, 3> pred_normal_3d;
  114|    135|  int32_t pred_normal_oct[2];
  115|       |
  116|   277k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 277k, False: 135]
  ------------------
  117|   277k|    const CornerIndex corner_id =
  118|   277k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   277k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   277k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   277k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   277k|                    octahedron_tool_box_.center_value());
  125|   277k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 201k, False: 76.4k]
  ------------------
  126|   201k|      pred_normal_3d = -pred_normal_3d;
  127|   201k|    }
  128|   277k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   277k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   277k|    const int data_offset = data_id * 2;
  132|   277k|    this->transform().ComputeOriginalValue(
  133|   277k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   277k|  }
  135|    135|  flip_normal_bit_decoder_.EndDecoding();
  136|    135|  return true;
  137|    135|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    135|  void SetQuantizationBits(int q) {
   85|    135|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    135|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    319|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   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_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    160|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    160|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 160]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    160|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 158]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    158|    predictor_.SetPositionAttribute(*att);
   82|    158|    return true;
   83|    160|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    157|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    157|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 9, False: 148]
  ------------------
  145|      9|    return false;
  146|      9|  }
  147|       |
  148|    148|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    148|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    148|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 37, False: 111]
  ------------------
  150|     37|    uint8_t prediction_mode;
  151|     37|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 36]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     36|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 4, False: 32]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      4|      return false;
  157|      4|    }
  158|       |
  159|     32|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 32]
  ------------------
  160|     32|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     32|  }
  164|    143|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    143|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 3, False: 140]
  ------------------
  168|      3|    return false;
  169|      3|  }
  170|       |
  171|    140|  return true;
  172|    143|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    140|                                      const PointIndex *entry_to_point_id_map) {
  103|    140|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    140|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    140|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    140|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    140|  const int corner_map_size =
  111|    140|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    140|  VectorD<int32_t, 3> pred_normal_3d;
  114|    140|  int32_t pred_normal_oct[2];
  115|       |
  116|   644k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 644k, False: 140]
  ------------------
  117|   644k|    const CornerIndex corner_id =
  118|   644k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   644k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   644k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   644k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   644k|                    octahedron_tool_box_.center_value());
  125|   644k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 284k, False: 359k]
  ------------------
  126|   284k|      pred_normal_3d = -pred_normal_3d;
  127|   284k|    }
  128|   644k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   644k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   644k|    const int data_offset = data_id * 2;
  132|   644k|    this->transform().ComputeOriginalValue(
  133|   644k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   644k|  }
  135|    140|  flip_normal_bit_decoder_.EndDecoding();
  136|    140|  return true;
  137|    140|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    140|  void SetQuantizationBits(int q) {
   85|    140|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    140|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    260|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    131|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    131|    DRACO_DCHECK_EQ(i, 0);
   70|    131|    (void)i;
   71|    131|    return GeometryAttribute::POSITION;
   72|    131|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    130|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    130|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 130]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    130|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 129]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    129|    predictor_.SetPositionAttribute(*att);
   82|    129|    return true;
   83|    130|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    129|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    129|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 7, False: 122]
  ------------------
  145|      7|    return false;
  146|      7|  }
  147|       |
  148|    122|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    122|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    122|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 16, False: 106]
  ------------------
  150|     16|    uint8_t prediction_mode;
  151|     16|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 0, False: 16]
  ------------------
  152|      0|      return false;
  153|      0|    }
  154|     16|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 15]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     15|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 15]
  ------------------
  160|     15|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     15|  }
  164|    121|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    121|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 4, False: 117]
  ------------------
  168|      4|    return false;
  169|      4|  }
  170|       |
  171|    117|  return true;
  172|    121|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    117|                                      const PointIndex *entry_to_point_id_map) {
  103|    117|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    117|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    117|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    117|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    117|  const int corner_map_size =
  111|    117|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    117|  VectorD<int32_t, 3> pred_normal_3d;
  114|    117|  int32_t pred_normal_oct[2];
  115|       |
  116|   140k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 140k, False: 117]
  ------------------
  117|   140k|    const CornerIndex corner_id =
  118|   140k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   140k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   140k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   140k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   140k|                    octahedron_tool_box_.center_value());
  125|   140k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 132k, False: 7.37k]
  ------------------
  126|   132k|      pred_normal_3d = -pred_normal_3d;
  127|   132k|    }
  128|   140k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   140k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   140k|    const int data_offset = data_id * 2;
  132|   140k|    this->transform().ComputeOriginalValue(
  133|   140k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   140k|  }
  135|    117|  flip_normal_bit_decoder_.EndDecoding();
  136|    117|  return true;
  137|    117|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    117|  void SetQuantizationBits(int q) {
   85|    117|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    117|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    364|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    364|            attribute, transform, mesh_data),
   37|    364|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    724|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    364|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    364|    DRACO_DCHECK_EQ(i, 0);
   70|    364|    (void)i;
   71|    364|    return GeometryAttribute::POSITION;
   72|    364|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    362|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    362|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 362]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    362|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 2, False: 360]
  ------------------
   79|      2|      return false;  // Currently works only for 3 component positions.
   80|      2|    }
   81|    360|    predictor_.SetPositionAttribute(*att);
   82|    360|    return true;
   83|    362|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    359|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    359|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 25, False: 334]
  ------------------
  145|     25|    return false;
  146|     25|  }
  147|       |
  148|    334|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    334|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    334|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 185, False: 149]
  ------------------
  150|    185|    uint8_t prediction_mode;
  151|    185|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 2, False: 183]
  ------------------
  152|      2|      return false;
  153|      2|    }
  154|    183|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 3, False: 180]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      3|      return false;
  157|      3|    }
  158|       |
  159|    180|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 180]
  ------------------
  160|    180|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|    180|  }
  164|    329|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    329|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 15, False: 314]
  ------------------
  168|     15|    return false;
  169|     15|  }
  170|       |
  171|    314|  return true;
  172|    329|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    314|                                      const PointIndex *entry_to_point_id_map) {
  103|    314|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    314|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    314|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    314|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    314|  const int corner_map_size =
  111|    314|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    314|  VectorD<int32_t, 3> pred_normal_3d;
  114|    314|  int32_t pred_normal_oct[2];
  115|       |
  116|   322k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 322k, False: 314]
  ------------------
  117|   322k|    const CornerIndex corner_id =
  118|   322k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   322k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   322k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   322k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   322k|                    octahedron_tool_box_.center_value());
  125|   322k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 198k, False: 124k]
  ------------------
  126|   198k|      pred_normal_3d = -pred_normal_3d;
  127|   198k|    }
  128|   322k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   322k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   322k|    const int data_offset = data_id * 2;
  132|   322k|    this->transform().ComputeOriginalValue(
  133|   322k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   322k|  }
  135|    314|  flip_normal_bit_decoder_.EndDecoding();
  136|    314|  return true;
  137|    314|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    314|  void SetQuantizationBits(int q) {
   85|    314|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    314|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    380|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    380|            attribute, transform, mesh_data),
   37|    380|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    755|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    380|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    380|    DRACO_DCHECK_EQ(i, 0);
   70|    380|    (void)i;
   71|    380|    return GeometryAttribute::POSITION;
   72|    380|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    378|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    378|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 378]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    378|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 3, False: 375]
  ------------------
   79|      3|      return false;  // Currently works only for 3 component positions.
   80|      3|    }
   81|    375|    predictor_.SetPositionAttribute(*att);
   82|    375|    return true;
   83|    378|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    370|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    370|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 42, False: 328]
  ------------------
  145|     42|    return false;
  146|     42|  }
  147|       |
  148|    328|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    328|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    328|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 117, False: 211]
  ------------------
  150|    117|    uint8_t prediction_mode;
  151|    117|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 116]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|    116|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 115]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|    115|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 115]
  ------------------
  160|    115|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|    115|  }
  164|    326|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    326|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 19, False: 307]
  ------------------
  168|     19|    return false;
  169|     19|  }
  170|       |
  171|    307|  return true;
  172|    326|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    307|                                      const PointIndex *entry_to_point_id_map) {
  103|    307|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    307|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    307|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    307|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    307|  const int corner_map_size =
  111|    307|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    307|  VectorD<int32_t, 3> pred_normal_3d;
  114|    307|  int32_t pred_normal_oct[2];
  115|       |
  116|   187k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 187k, False: 307]
  ------------------
  117|   187k|    const CornerIndex corner_id =
  118|   187k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   187k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   187k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   187k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   187k|                    octahedron_tool_box_.center_value());
  125|   187k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 138k, False: 49.1k]
  ------------------
  126|   138k|      pred_normal_3d = -pred_normal_3d;
  127|   138k|    }
  128|   187k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   187k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   187k|    const int data_offset = data_id * 2;
  132|   187k|    this->transform().ComputeOriginalValue(
  133|   187k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   187k|  }
  135|    307|  flip_normal_bit_decoder_.EndDecoding();
  136|    307|  return true;
  137|    307|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    307|  void SetQuantizationBits(int q) {
   85|    307|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    307|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    197|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    197|            attribute, transform, mesh_data),
   37|    197|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    153|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    153|            attribute, transform, mesh_data),
   37|    153|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    161|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    161|            attribute, transform, mesh_data),
   37|    161|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    131|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    131|            attribute, transform, mesh_data),
   37|    131|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    252|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    252|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 51, False: 201]
  ------------------
  105|     51|      this->normal_prediction_mode_ = mode;
  106|     51|      return true;
  107|    201|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 201, False: 0]
  ------------------
  108|    201|      this->normal_prediction_mode_ = mode;
  109|    201|      return true;
  110|    201|    }
  111|      0|    return false;
  112|    252|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   728k|                             DataTypeT *prediction) override {
   42|   728k|    DRACO_DCHECK(this->IsInitialized());
   43|   728k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   728k|    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|   728k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   728k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   728k|    VectorD<int64_t, 3> normal;
   53|   728k|    CornerIndex c_next, c_prev;
   54|  1.52M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 799k, False: 728k]
  ------------------
   55|       |      // Getting corners.
   56|   799k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 282, False: 798k]
  ------------------
   57|    282|        c_next = corner_table->Next(corner_id);
   58|    282|        c_prev = corner_table->Previous(corner_id);
   59|   798k|      } else {
   60|   798k|        c_next = corner_table->Next(cit.Corner());
   61|   798k|        c_prev = corner_table->Previous(cit.Corner());
   62|   798k|      }
   63|   799k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   799k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   799k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   799k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   799k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   799k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   799k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   799k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   799k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   799k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   799k|      cit.Next();
   81|   799k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   728k|    constexpr int64_t upper_bound = 1 << 29;
   85|   728k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 188, False: 727k]
  ------------------
   86|    188|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    188|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 70, False: 118]
  ------------------
   88|     70|        const int64_t quotient = abs_sum / upper_bound;
   89|     70|        normal = normal / quotient;
   90|     70|      }
   91|   727k|    } else {
   92|   727k|      const int64_t abs_sum = normal.AbsSum();
   93|   727k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.90k, False: 724k]
  ------------------
   94|  2.90k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.90k|        normal = normal / quotient;
   96|  2.90k|      }
   97|   727k|    }
   98|   728k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   728k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   728k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   728k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   728k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    178|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    178|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 23, False: 155]
  ------------------
  105|     23|      this->normal_prediction_mode_ = mode;
  106|     23|      return true;
  107|    155|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 155, False: 0]
  ------------------
  108|    155|      this->normal_prediction_mode_ = mode;
  109|    155|      return true;
  110|    155|    }
  111|      0|    return false;
  112|    178|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   277k|                             DataTypeT *prediction) override {
   42|   277k|    DRACO_DCHECK(this->IsInitialized());
   43|   277k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   277k|    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|   277k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   277k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   277k|    VectorD<int64_t, 3> normal;
   53|   277k|    CornerIndex c_next, c_prev;
   54|  1.93M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.65M, False: 277k]
  ------------------
   55|       |      // Getting corners.
   56|  1.65M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 138, False: 1.65M]
  ------------------
   57|    138|        c_next = corner_table->Next(corner_id);
   58|    138|        c_prev = corner_table->Previous(corner_id);
   59|  1.65M|      } else {
   60|  1.65M|        c_next = corner_table->Next(cit.Corner());
   61|  1.65M|        c_prev = corner_table->Previous(cit.Corner());
   62|  1.65M|      }
   63|  1.65M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.65M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.65M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.65M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.65M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.65M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.65M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.65M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.65M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.65M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.65M|      cit.Next();
   81|  1.65M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   277k|    constexpr int64_t upper_bound = 1 << 29;
   85|   277k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 92, False: 277k]
  ------------------
   86|     92|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     92|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 22, False: 70]
  ------------------
   88|     22|        const int64_t quotient = abs_sum / upper_bound;
   89|     22|        normal = normal / quotient;
   90|     22|      }
   91|   277k|    } else {
   92|   277k|      const int64_t abs_sum = normal.AbsSum();
   93|   277k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 82.7k, False: 194k]
  ------------------
   94|  82.7k|        const int64_t quotient = abs_sum / upper_bound;
   95|  82.7k|        normal = normal / quotient;
   96|  82.7k|      }
   97|   277k|    }
   98|   277k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   277k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   277k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   277k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   277k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    193|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    193|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 31, False: 162]
  ------------------
  105|     31|      this->normal_prediction_mode_ = mode;
  106|     31|      return true;
  107|    162|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 162, False: 0]
  ------------------
  108|    162|      this->normal_prediction_mode_ = mode;
  109|    162|      return true;
  110|    162|    }
  111|      0|    return false;
  112|    193|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   644k|                             DataTypeT *prediction) override {
   42|   644k|    DRACO_DCHECK(this->IsInitialized());
   43|   644k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   644k|    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|   644k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   644k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   644k|    VectorD<int64_t, 3> normal;
   53|   644k|    CornerIndex c_next, c_prev;
   54|  1.31M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 672k, False: 644k]
  ------------------
   55|       |      // Getting corners.
   56|   672k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 180, False: 671k]
  ------------------
   57|    180|        c_next = corner_table->Next(corner_id);
   58|    180|        c_prev = corner_table->Previous(corner_id);
   59|   671k|      } else {
   60|   671k|        c_next = corner_table->Next(cit.Corner());
   61|   671k|        c_prev = corner_table->Previous(cit.Corner());
   62|   671k|      }
   63|   672k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   672k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   672k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   672k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   672k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   672k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   672k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   672k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   672k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   672k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   672k|      cit.Next();
   81|   672k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   644k|    constexpr int64_t upper_bound = 1 << 29;
   85|   644k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 120, False: 644k]
  ------------------
   86|    120|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    120|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 24, False: 96]
  ------------------
   88|     24|        const int64_t quotient = abs_sum / upper_bound;
   89|     24|        normal = normal / quotient;
   90|     24|      }
   91|   644k|    } else {
   92|   644k|      const int64_t abs_sum = normal.AbsSum();
   93|   644k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.20k, False: 642k]
  ------------------
   94|  2.20k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.20k|        normal = normal / quotient;
   96|  2.20k|      }
   97|   644k|    }
   98|   644k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   644k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   644k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   644k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   644k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    146|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    146|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 14, False: 132]
  ------------------
  105|     14|      this->normal_prediction_mode_ = mode;
  106|     14|      return true;
  107|    132|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 132, False: 0]
  ------------------
  108|    132|      this->normal_prediction_mode_ = mode;
  109|    132|      return true;
  110|    132|    }
  111|      0|    return false;
  112|    146|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   140k|                             DataTypeT *prediction) override {
   42|   140k|    DRACO_DCHECK(this->IsInitialized());
   43|   140k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   140k|    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|   140k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   140k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   140k|    VectorD<int64_t, 3> normal;
   53|   140k|    CornerIndex c_next, c_prev;
   54|   974k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 834k, False: 140k]
  ------------------
   55|       |      // Getting corners.
   56|   834k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 78, False: 834k]
  ------------------
   57|     78|        c_next = corner_table->Next(corner_id);
   58|     78|        c_prev = corner_table->Previous(corner_id);
   59|   834k|      } else {
   60|   834k|        c_next = corner_table->Next(cit.Corner());
   61|   834k|        c_prev = corner_table->Previous(cit.Corner());
   62|   834k|      }
   63|   834k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   834k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   834k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   834k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   834k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   834k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   834k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   834k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   834k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   834k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   834k|      cit.Next();
   81|   834k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   140k|    constexpr int64_t upper_bound = 1 << 29;
   85|   140k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 52, False: 140k]
  ------------------
   86|     52|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     52|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 16, False: 36]
  ------------------
   88|     16|        const int64_t quotient = abs_sum / upper_bound;
   89|     16|        normal = normal / quotient;
   90|     16|      }
   91|   140k|    } else {
   92|   140k|      const int64_t abs_sum = normal.AbsSum();
   93|   140k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 55.2k, False: 84.9k]
  ------------------
   94|  55.2k|        const int64_t quotient = abs_sum / upper_bound;
   95|  55.2k|        normal = normal / quotient;
   96|  55.2k|      }
   97|   140k|    }
   98|   140k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   140k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   140k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   140k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   140k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    364|      : Base(md) {
   35|    364|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    364|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    544|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    544|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 159, False: 385]
  ------------------
  105|    159|      this->normal_prediction_mode_ = mode;
  106|    159|      return true;
  107|    385|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 385, False: 0]
  ------------------
  108|    385|      this->normal_prediction_mode_ = mode;
  109|    385|      return true;
  110|    385|    }
  111|      0|    return false;
  112|    544|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   322k|                             DataTypeT *prediction) override {
   42|   322k|    DRACO_DCHECK(this->IsInitialized());
   43|   322k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   322k|    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|   322k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   322k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   322k|    VectorD<int64_t, 3> normal;
   53|   322k|    CornerIndex c_next, c_prev;
   54|  1.07M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 755k, False: 322k]
  ------------------
   55|       |      // Getting corners.
   56|   755k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 298k, False: 456k]
  ------------------
   57|   298k|        c_next = corner_table->Next(corner_id);
   58|   298k|        c_prev = corner_table->Previous(corner_id);
   59|   456k|      } else {
   60|   456k|        c_next = corner_table->Next(cit.Corner());
   61|   456k|        c_prev = corner_table->Previous(cit.Corner());
   62|   456k|      }
   63|   755k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   755k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   755k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   755k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   755k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   755k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   755k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   755k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   755k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   755k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   755k|      cit.Next();
   81|   755k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   322k|    constexpr int64_t upper_bound = 1 << 29;
   85|   322k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 50.5k, False: 271k]
  ------------------
   86|  50.5k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  50.5k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 293, False: 50.2k]
  ------------------
   88|    293|        const int64_t quotient = abs_sum / upper_bound;
   89|    293|        normal = normal / quotient;
   90|    293|      }
   91|   271k|    } else {
   92|   271k|      const int64_t abs_sum = normal.AbsSum();
   93|   271k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.39k, False: 270k]
  ------------------
   94|  1.39k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.39k|        normal = normal / quotient;
   96|  1.39k|      }
   97|   271k|    }
   98|   322k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   322k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   322k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   322k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   322k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    380|      : Base(md) {
   35|    380|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    380|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    495|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    495|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 107, False: 388]
  ------------------
  105|    107|      this->normal_prediction_mode_ = mode;
  106|    107|      return true;
  107|    388|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 388, False: 0]
  ------------------
  108|    388|      this->normal_prediction_mode_ = mode;
  109|    388|      return true;
  110|    388|    }
  111|      0|    return false;
  112|    495|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   187k|                             DataTypeT *prediction) override {
   42|   187k|    DRACO_DCHECK(this->IsInitialized());
   43|   187k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   187k|    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|   187k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   187k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   187k|    VectorD<int64_t, 3> normal;
   53|   187k|    CornerIndex c_next, c_prev;
   54|  1.27M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 1.09M, False: 187k]
  ------------------
   55|       |      // Getting corners.
   56|  1.09M|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 336k, False: 755k]
  ------------------
   57|   336k|        c_next = corner_table->Next(corner_id);
   58|   336k|        c_prev = corner_table->Previous(corner_id);
   59|   755k|      } else {
   60|   755k|        c_next = corner_table->Next(cit.Corner());
   61|   755k|        c_prev = corner_table->Previous(cit.Corner());
   62|   755k|      }
   63|  1.09M|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|  1.09M|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|  1.09M|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|  1.09M|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|  1.09M|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|  1.09M|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|  1.09M|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|  1.09M|      normal_data[0] = normal_data[0] + cross_data[0];
   77|  1.09M|      normal_data[1] = normal_data[1] + cross_data[1];
   78|  1.09M|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|  1.09M|      cit.Next();
   81|  1.09M|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   187k|    constexpr int64_t upper_bound = 1 << 29;
   85|   187k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 56.8k, False: 130k]
  ------------------
   86|  56.8k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  56.8k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 198, False: 56.6k]
  ------------------
   88|    198|        const int64_t quotient = abs_sum / upper_bound;
   89|    198|        normal = normal / quotient;
   90|    198|      }
   91|   130k|    } else {
   92|   130k|      const int64_t abs_sum = normal.AbsSum();
   93|   130k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.57k, False: 127k]
  ------------------
   94|  2.57k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.57k|        normal = normal / quotient;
   96|  2.57k|      }
   97|   130k|    }
   98|   187k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   187k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   187k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   187k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   187k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    197|      : Base(md) {
   35|    197|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    197|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    153|      : Base(md) {
   35|    153|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    153|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    161|      : Base(md) {
   35|    161|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    161|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    131|      : Base(md) {
   35|    131|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    131|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.32M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.32M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.32M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.32M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.32M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.32M|    return GetPositionForDataId(data_id);
   77|  2.32M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.32M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.32M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.32M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.32M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.32M|    VectorD<int64_t, 3> pos;
   68|  2.32M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.32M|    return pos;
   70|  2.32M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    194|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    194|    pos_attribute_ = &position_attribute;
   43|    194|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    176|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    176|    entry_to_point_id_map_ = map;
   46|    176|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  3.59M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  3.59M|    DRACO_DCHECK(this->IsInitialized());
   73|  3.59M|    const auto corner_table = mesh_data_.corner_table();
   74|  3.59M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  3.59M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  3.59M|    return GetPositionForDataId(data_id);
   77|  3.59M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  3.59M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  3.59M|    DRACO_DCHECK(this->IsInitialized());
   65|  3.59M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  3.59M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  3.59M|    VectorD<int64_t, 3> pos;
   68|  3.59M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  3.59M|    return pos;
   70|  3.59M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    149|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    149|    pos_attribute_ = &position_attribute;
   43|    149|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    135|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    135|    entry_to_point_id_map_ = map;
   46|    135|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.98M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.98M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.98M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.98M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.98M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.98M|    return GetPositionForDataId(data_id);
   77|  1.98M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.98M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.98M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.98M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.98M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.98M|    VectorD<int64_t, 3> pos;
   68|  1.98M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.98M|    return pos;
   70|  1.98M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    158|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    158|    pos_attribute_ = &position_attribute;
   43|    158|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    140|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    140|    entry_to_point_id_map_ = map;
   46|    140|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.80M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.80M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.80M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.80M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.80M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.80M|    return GetPositionForDataId(data_id);
   77|  1.80M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.80M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.80M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.80M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.80M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.80M|    VectorD<int64_t, 3> pos;
   68|  1.80M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.80M|    return pos;
   70|  1.80M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    129|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    129|    pos_attribute_ = &position_attribute;
   43|    129|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    117|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    117|    entry_to_point_id_map_ = map;
   46|    117|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    364|      : pos_attribute_(nullptr),
   36|    364|        entry_to_point_id_map_(nullptr),
   37|    364|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    364|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.83M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.83M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.83M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.83M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.83M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.83M|    return GetPositionForDataId(data_id);
   77|  1.83M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.83M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.83M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.83M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.83M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.83M|    VectorD<int64_t, 3> pos;
   68|  1.83M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.83M|    return pos;
   70|  1.83M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    360|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    360|    pos_attribute_ = &position_attribute;
   43|    360|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    314|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    314|    entry_to_point_id_map_ = map;
   46|    314|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    380|      : pos_attribute_(nullptr),
   36|    380|        entry_to_point_id_map_(nullptr),
   37|    380|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    380|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.37M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.37M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.37M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.37M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.37M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.37M|    return GetPositionForDataId(data_id);
   77|  2.37M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  2.37M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.37M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.37M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.37M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.37M|    VectorD<int64_t, 3> pos;
   68|  2.37M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.37M|    return pos;
   70|  2.37M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    375|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    375|    pos_attribute_ = &position_attribute;
   43|    375|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    307|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    307|    entry_to_point_id_map_ = map;
   46|    307|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    197|      : pos_attribute_(nullptr),
   36|    197|        entry_to_point_id_map_(nullptr),
   37|    197|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    197|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    153|      : pos_attribute_(nullptr),
   36|    153|        entry_to_point_id_map_(nullptr),
   37|    153|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    153|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    161|      : pos_attribute_(nullptr),
   36|    161|        entry_to_point_id_map_(nullptr),
   37|    161|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    161|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    131|      : pos_attribute_(nullptr),
   36|    131|        entry_to_point_id_map_(nullptr),
   37|    131|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    131|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    261|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    261|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    238|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    238|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    238|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    238|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    238|      new DataTypeT[num_components]());
   70|       |
   71|    238|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    238|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    238|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    238|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    238|  const int corner_map_size =
   78|    238|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   749k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 749k, False: 238]
  ------------------
   80|   749k|    const CornerIndex start_corner_id =
   81|   749k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   749k|    CornerIndex corner_id(start_corner_id);
   84|   749k|    int num_parallelograms = 0;
   85|  27.0M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 26.2M, False: 749k]
  ------------------
   86|  26.2M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  26.2M|    }
   88|  2.19M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 1.44M, False: 749k]
  ------------------
   89|  1.44M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 280k, False: 1.16M]
  ------------------
   90|  1.44M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  1.44M|              num_components, parallelogram_pred_vals.get())) {
   92|  15.8M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 15.5M, False: 280k]
  ------------------
   93|  15.5M|          pred_vals[c] =
   94|  15.5M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  15.5M|        }
   96|   280k|        ++num_parallelograms;
   97|   280k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  1.44M|      corner_id = table->SwingRight(corner_id);
  101|  1.44M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 137k, False: 1.30M]
  ------------------
  102|   137k|        corner_id = kInvalidCornerIndex;
  103|   137k|      }
  104|  1.44M|    }
  105|       |
  106|   749k|    const int dst_offset = p * num_components;
  107|   749k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 603k, False: 145k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|   603k|      const int src_offset = (p - 1) * num_components;
  111|   603k|      this->transform().ComputeOriginalValue(
  112|   603k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   603k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  8.08M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 7.94M, False: 145k]
  ------------------
  116|  7.94M|        pred_vals[c] /= num_parallelograms;
  117|  7.94M|      }
  118|   145k|      this->transform().ComputeOriginalValue(
  119|   145k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   145k|    }
  121|   749k|  }
  122|    238|  return true;
  123|    238|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    456|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    456|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    425|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    425|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    425|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    425|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    425|      new DataTypeT[num_components]());
   70|       |
   71|    425|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    425|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    425|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    425|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    425|  const int corner_map_size =
   78|    425|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   655k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 654k, False: 425]
  ------------------
   80|   654k|    const CornerIndex start_corner_id =
   81|   654k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   654k|    CornerIndex corner_id(start_corner_id);
   84|   654k|    int num_parallelograms = 0;
   85|  20.9M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 20.3M, False: 654k]
  ------------------
   86|  20.3M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  20.3M|    }
   88|  4.51M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 3.85M, False: 654k]
  ------------------
   89|  3.85M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 1.27M, False: 2.58M]
  ------------------
   90|  3.85M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  3.85M|              num_components, parallelogram_pred_vals.get())) {
   92|  40.6M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 39.4M, False: 1.27M]
  ------------------
   93|  39.4M|          pred_vals[c] =
   94|  39.4M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  39.4M|        }
   96|  1.27M|        ++num_parallelograms;
   97|  1.27M|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  3.85M|      corner_id = table->SwingRight(corner_id);
  101|  3.85M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 638k, False: 3.22M]
  ------------------
  102|   638k|        corner_id = kInvalidCornerIndex;
  103|   638k|      }
  104|  3.85M|    }
  105|       |
  106|   654k|    const int dst_offset = p * num_components;
  107|   654k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 2.39k, False: 652k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  2.39k|      const int src_offset = (p - 1) * num_components;
  111|  2.39k|      this->transform().ComputeOriginalValue(
  112|  2.39k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   652k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  20.8M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 20.2M, False: 652k]
  ------------------
  116|  20.2M|        pred_vals[c] /= num_parallelograms;
  117|  20.2M|      }
  118|   652k|      this->transform().ComputeOriginalValue(
  119|   652k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   652k|    }
  121|   654k|  }
  122|    425|  return true;
  123|    425|}

_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   40|    723|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   41|    723|            attribute, transform, mesh_data) {}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   60|    669|                          const PointIndex * /* entry_to_point_id_map */) {
   61|    669|  this->transform().Init(num_components);
   62|       |
   63|    669|  const CornerTable *const table = this->mesh_data().corner_table();
   64|    669|  const std::vector<int32_t> *const vertex_to_data_map =
   65|    669|      this->mesh_data().vertex_to_data_map();
   66|       |
   67|       |  // For storage of prediction values (already initialized to zero).
   68|    669|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   69|       |
   70|       |  // Restore the first value.
   71|    669|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    669|  const int corner_map_size =
   74|    669|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   75|  1.12M|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (75:19): [True: 1.12M, False: 669]
  ------------------
   76|  1.12M|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
   77|  1.12M|    const int dst_offset = p * num_components;
   78|  1.12M|    if (!ComputeParallelogramPrediction(p, corner_id, table,
  ------------------
  |  Branch (78:9): [True: 898k, False: 221k]
  ------------------
   79|  1.12M|                                        *vertex_to_data_map, out_data,
   80|  1.12M|                                        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|   898k|      const int src_offset = (p - 1) * num_components;
   85|   898k|      this->transform().ComputeOriginalValue(
   86|   898k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
   87|   898k|    } else {
   88|       |      // Apply the parallelogram prediction.
   89|   221k|      this->transform().ComputeOriginalValue(
   90|   221k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
   91|   221k|    }
   92|  1.12M|  }
   93|    669|  return true;
   94|    669|}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   40|    509|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   41|    509|            attribute, transform, mesh_data) {}
_ZN5draco40MeshPredictionSchemeParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   60|    466|                          const PointIndex * /* entry_to_point_id_map */) {
   61|    466|  this->transform().Init(num_components);
   62|       |
   63|    466|  const CornerTable *const table = this->mesh_data().corner_table();
   64|    466|  const std::vector<int32_t> *const vertex_to_data_map =
   65|    466|      this->mesh_data().vertex_to_data_map();
   66|       |
   67|       |  // For storage of prediction values (already initialized to zero).
   68|    466|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   69|       |
   70|       |  // Restore the first value.
   71|    466|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    466|  const int corner_map_size =
   74|    466|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   75|   193k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (75:19): [True: 193k, False: 466]
  ------------------
   76|   193k|    const CornerIndex corner_id = this->mesh_data().data_to_corner_map()->at(p);
   77|   193k|    const int dst_offset = p * num_components;
   78|   193k|    if (!ComputeParallelogramPrediction(p, corner_id, table,
  ------------------
  |  Branch (78:9): [True: 2.34k, False: 190k]
  ------------------
   79|   193k|                                        *vertex_to_data_map, out_data,
   80|   193k|                                        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.34k|      const int src_offset = (p - 1) * num_components;
   85|  2.34k|      this->transform().ComputeOriginalValue(
   86|  2.34k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
   87|   190k|    } else {
   88|       |      // Apply the parallelogram prediction.
   89|   190k|      this->transform().ComputeOriginalValue(
   90|   190k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
   91|   190k|    }
   92|   193k|  }
   93|    466|  return true;
   94|    466|}

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  3.54M|    int num_components, DataTypeT *out_prediction) {
   49|  3.54M|  const CornerIndex oci = table->Opposite(ci);
   50|  3.54M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 2.30M, False: 1.24M]
  ------------------
   51|  2.30M|    return false;
   52|  2.30M|  }
   53|  1.24M|  int vert_opp, vert_next, vert_prev;
   54|  1.24M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  1.24M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  1.24M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 722k, False: 524k]
  |  Branch (56:35): [True: 576k, False: 145k]
  ------------------
   57|   576k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 566k, False: 10.5k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   566k|    const int v_opp_off = vert_opp * num_components;
   60|   566k|    const int v_next_off = vert_next * num_components;
   61|   566k|    const int v_prev_off = vert_prev * num_components;
   62|  32.4M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 31.8M, False: 566k]
  ------------------
   63|  31.8M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  31.8M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  31.8M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  31.8M|      const int64_t result =
   67|  31.8M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  31.8M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  31.8M|    }
   71|   566k|    return true;
   72|   566k|  }
   73|   680k|  return false;  // Not all data is available for prediction
   74|  1.24M|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  1.24M|    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.24M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  1.24M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  1.24M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  1.24M|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  4.67M|    int num_components, DataTypeT *out_prediction) {
   49|  4.67M|  const CornerIndex oci = table->Opposite(ci);
   50|  4.67M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 24.6k, False: 4.64M]
  ------------------
   51|  24.6k|    return false;
   52|  24.6k|  }
   53|  4.64M|  int vert_opp, vert_next, vert_prev;
   54|  4.64M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  4.64M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  4.64M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 2.37M, False: 2.27M]
  |  Branch (56:35): [True: 1.86M, False: 508k]
  ------------------
   57|  1.86M|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 1.64M, False: 225k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|  1.64M|    const int v_opp_off = vert_opp * num_components;
   60|  1.64M|    const int v_next_off = vert_next * num_components;
   61|  1.64M|    const int v_prev_off = vert_prev * num_components;
   62|  63.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 62.1M, False: 1.64M]
  ------------------
   63|  62.1M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  62.1M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  62.1M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  62.1M|      const int64_t result =
   67|  62.1M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  62.1M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  62.1M|    }
   71|  1.64M|    return true;
   72|  1.64M|  }
   73|  3.00M|  return false;  // Not all data is available for prediction
   74|  4.64M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  4.64M|    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|  4.64M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  4.64M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  4.64M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  4.64M|}

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

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

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    221|      : pos_attribute_(nullptr),
   39|    221|        entry_to_point_id_map_(nullptr),
   40|    221|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    217|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    217|    pos_attribute_ = &position_attribute;
   43|    217|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    206|  void ResizeOrientations(int num_orientations) {
   74|    206|    orientations_.resize(num_orientations);
   75|    206|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|  2.02G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    165|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    165|    entry_to_point_id_map_ = map;
   46|    165|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   295k|                                                 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|   295k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   295k|  const CornerIndex prev_corner_id =
   99|   295k|      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|   295k|  int next_data_id, prev_data_id;
  103|       |
  104|   295k|  int next_vert_id, prev_vert_id;
  105|   295k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   295k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   295k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   295k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   295k|  typedef VectorD<int64_t, 2> Vec2;
  112|   295k|  typedef VectorD<int64_t, 3> Vec3;
  113|   295k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   295k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 205k, False: 90.0k]
  |  Branch (115:33): [True: 115k, False: 90.0k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   115k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   115k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   115k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 104k, False: 10.7k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   104k|      predicted_value_[0] = p_uv[0];
  122|   104k|      predicted_value_[1] = p_uv[1];
  123|   104k|      return true;
  124|   104k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  10.7k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  10.7k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  10.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|  10.7k|    const Vec3 pn = prev_pos - next_pos;
  146|  10.7k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  10.7k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 706, False: 9.99k]
  ------------------
  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|    706|      const Vec3 cn = tip_pos - next_pos;
  153|    706|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|    706|      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|    706|      const int64_t n_uv_absmax_element =
  164|    706|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|    706|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 32, False: 674]
  ------------------
  166|    706|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     32|        return false;
  169|     32|      }
  170|    674|      const int64_t pn_uv_absmax_element =
  171|    674|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|    674|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 26, False: 648]
  ------------------
  173|    674|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     26|        return false;
  176|     26|      }
  177|    648|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|    648|      const int64_t pn_absmax_element =
  179|    648|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|    648|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 12, False: 636]
  ------------------
  181|    648|          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|    636|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|    636|      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|    636|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|    636|      const uint64_t norm_squared =
  207|    636|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|    636|      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|    636|      Vec2 predicted_uv;
  214|    636|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 636]
  ------------------
  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|    636|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|    636|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 3, False: 633]
  ------------------
  233|      3|          return false;
  234|      3|        }
  235|    633|        const bool orientation = orientations_.back();
  236|    633|        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|    633|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 397, False: 236]
  ------------------
  240|    397|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    397|        } else {
  242|    236|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    236|        }
  244|    633|      }
  245|    633|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|    633|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|    633|      return true;
  248|    636|    }
  249|  10.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|   190k|  int data_offset = 0;
  254|   190k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 100k, False: 90.0k]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|   100k|    data_offset = prev_data_id * kNumComponents;
  257|   100k|  }
  258|   190k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 9.99k, False: 180k]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  9.99k|    data_offset = next_data_id * kNumComponents;
  261|   180k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|   180k|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 179k, False: 165]
  ------------------
  265|   179k|      data_offset = (data_id - 1) * kNumComponents;
  266|   179k|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    495|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 330, False: 165]
  ------------------
  269|    330|        predicted_value_[i] = 0;
  270|    330|      }
  271|    165|      return true;
  272|    165|    }
  273|   180k|  }
  274|   569k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 379k, False: 189k]
  ------------------
  275|   379k|    predicted_value_[i] = data[data_offset + i];
  276|   379k|  }
  277|   189k|  return true;
  278|   190k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   230k|                                            const DataTypeT *data) const {
   59|   230k|    const int data_offset = entry_id * kNumComponents;
   60|   230k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   230k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  32.1k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  32.1k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  32.1k|    VectorD<int64_t, 3> pos;
   52|  32.1k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  32.1k|                                 &pos[0]);
   54|  32.1k|    return pos;
   55|  32.1k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|   295k|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    226|      : pos_attribute_(nullptr),
   39|    226|        entry_to_point_id_map_(nullptr),
   40|    226|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    225|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    225|    pos_attribute_ = &position_attribute;
   43|    225|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    220|  void ResizeOrientations(int num_orientations) {
   74|    220|    orientations_.resize(num_orientations);
   75|    220|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  7.40G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    178|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    178|    entry_to_point_id_map_ = map;
   46|    178|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   165k|                                                 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|   165k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   165k|  const CornerIndex prev_corner_id =
   99|   165k|      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|   165k|  int next_data_id, prev_data_id;
  103|       |
  104|   165k|  int next_vert_id, prev_vert_id;
  105|   165k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   165k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   165k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   165k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   165k|  typedef VectorD<int64_t, 2> Vec2;
  112|   165k|  typedef VectorD<int64_t, 3> Vec3;
  113|   165k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   165k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 164k, False: 253]
  |  Branch (115:33): [True: 164k, False: 259]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   164k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   164k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   164k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 154k, False: 10.4k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   154k|      predicted_value_[0] = p_uv[0];
  122|   154k|      predicted_value_[1] = p_uv[1];
  123|   154k|      return true;
  124|   154k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  10.4k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  10.4k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  10.4k|    const Vec3 prev_pos = GetPositionForEntryId(prev_data_id);
  130|       |    // We use the positions of the above triangle to predict the texture
  131|       |    // coordinate on the tip corner C.
  132|       |    // To convert the triangle into the UV coordinate system we first compute
  133|       |    // position X on the vector |prev_pos - next_pos| that is the projection of
  134|       |    // point C onto vector |prev_pos - next_pos|:
  135|       |    //
  136|       |    //              C
  137|       |    //             /.  \
  138|       |    //            / .     \
  139|       |    //           /  .        \
  140|       |    //          N---X----------P
  141|       |    //
  142|       |    // Where next_pos is point (N), prev_pos is point (P) and tip_pos is the
  143|       |    // position of predicted coordinate (C).
  144|       |    //
  145|  10.4k|    const Vec3 pn = prev_pos - next_pos;
  146|  10.4k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  10.4k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.25k, False: 9.17k]
  ------------------
  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.25k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.25k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.25k|      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.25k|      const int64_t n_uv_absmax_element =
  164|  1.25k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.25k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 24, False: 1.23k]
  ------------------
  166|  1.25k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     24|        return false;
  169|     24|      }
  170|  1.23k|      const int64_t pn_uv_absmax_element =
  171|  1.23k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.23k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 27, False: 1.20k]
  ------------------
  173|  1.23k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     27|        return false;
  176|     27|      }
  177|  1.20k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.20k|      const int64_t pn_absmax_element =
  179|  1.20k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.20k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 8, False: 1.19k]
  ------------------
  181|  1.20k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|      8|        return false;
  184|      8|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.19k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.19k|      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.19k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.19k|      const uint64_t norm_squared =
  207|  1.19k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.19k|      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.19k|      Vec2 predicted_uv;
  214|  1.19k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.19k]
  ------------------
  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.19k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.19k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 4, False: 1.19k]
  ------------------
  233|      4|          return false;
  234|      4|        }
  235|  1.19k|        const bool orientation = orientations_.back();
  236|  1.19k|        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.19k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 454, False: 741]
  ------------------
  240|    454|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    741|        } else {
  242|    741|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    741|        }
  244|  1.19k|      }
  245|  1.19k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.19k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.19k|      return true;
  248|  1.19k|    }
  249|  10.4k|  }
  250|       |  // Else we don't have available textures on both corners or the position data
  251|       |  // is invalid. For such cases we can't use positions for predicting the uv
  252|       |  // value and we resort to delta coding.
  253|  9.69k|  int data_offset = 0;
  254|  9.69k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 9.43k, False: 253]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  9.43k|    data_offset = prev_data_id * kNumComponents;
  257|  9.43k|  }
  258|  9.69k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 9.18k, False: 502]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  9.18k|    data_offset = next_data_id * kNumComponents;
  261|  9.18k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|    502|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 324, False: 178]
  ------------------
  265|    324|      data_offset = (data_id - 1) * kNumComponents;
  266|    324|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    534|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 356, False: 178]
  ------------------
  269|    356|        predicted_value_[i] = 0;
  270|    356|      }
  271|    178|      return true;
  272|    178|    }
  273|    502|  }
  274|  28.5k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 19.0k, False: 9.51k]
  ------------------
  275|  19.0k|    predicted_value_[i] = data[data_offset + i];
  276|  19.0k|  }
  277|  9.51k|  return true;
  278|  9.69k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   329k|                                            const DataTypeT *data) const {
   59|   329k|    const int data_offset = entry_id * kNumComponents;
   60|   329k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   329k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|  31.3k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  31.3k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  31.3k|    VectorD<int64_t, 3> pos;
   52|  31.3k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  31.3k|                                 &pos[0]);
   54|  31.3k|    return pos;
   55|  31.3k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   165k|  const DataTypeT *predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    162|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    488|  bool AreCorrectionsPositive() override {
   71|    488|    return transform_.AreCorrectionsPositive();
   72|    488|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    147|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    147|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 30, False: 117]
  ------------------
   50|     30|      return false;
   51|     30|    }
   52|    117|    return true;
   53|    147|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|  1.13M|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|    217|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    489|  bool AreCorrectionsPositive() override {
   71|    489|    return transform_.AreCorrectionsPositive();
   72|    489|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|    203|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|    203|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 25, False: 178]
  ------------------
   50|     25|      return false;
   51|     25|    }
   52|    178|    return true;
   53|    203|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|  1.14M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  4.66k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  3.14k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  4.44k|  bool AreCorrectionsPositive() override {
   71|  4.44k|    return transform_.AreCorrectionsPositive();
   72|  4.44k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  3.41k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  3.41k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 216, False: 3.20k]
  ------------------
   50|    216|      return false;
   51|    216|    }
   52|  3.20k|    return true;
   53|  3.41k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  6.30M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    512|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    509|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    512|                                 const PointCloudDecoder *decoder) {
  188|    512|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    512|      method, att_id, decoder, TransformT());
  190|    512|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    512|                                 const TransformT &transform) {
  156|    512|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 512]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    512|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    512|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 512, 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|    512|    const MeshDecoder *const mesh_decoder =
  167|    512|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    512|    auto ret = CreateMeshPredictionScheme<
  170|    512|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    512|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    512|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    512|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 350, False: 162]
  ------------------
  174|    350|      return ret;
  175|    350|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    512|  }
  178|       |  // Create delta decoder.
  179|    162|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    162|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    512|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    209|      uint16_t bitstream_version) {
  143|    209|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    209|        method, attribute, transform, mesh_data, bitstream_version);
  145|    209|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    209|        uint16_t bitstream_version) {
  127|    209|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 197, False: 12]
  ------------------
  128|    197|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    197|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    197|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    197|                                                  mesh_data));
  132|    197|      }
  133|     12|      return nullptr;
  134|    209|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    157|      uint16_t bitstream_version) {
  143|    157|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    157|        method, attribute, transform, mesh_data, bitstream_version);
  145|    157|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    157|        uint16_t bitstream_version) {
  127|    157|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 153, False: 4]
  ------------------
  128|    153|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    153|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    153|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    153|                                                  mesh_data));
  132|    153|      }
  133|      4|      return nullptr;
  134|    157|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    509|                                 const PointCloudDecoder *decoder) {
  188|    509|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    509|      method, att_id, decoder, TransformT());
  190|    509|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    509|                                 const TransformT &transform) {
  156|    509|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 509]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    509|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    509|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 509, 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|    509|    const MeshDecoder *const mesh_decoder =
  167|    509|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    509|    auto ret = CreateMeshPredictionScheme<
  170|    509|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    509|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    509|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    509|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 292, False: 217]
  ------------------
  174|    292|      return ret;
  175|    292|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    509|  }
  178|       |  // Create delta decoder.
  179|    217|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    217|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    509|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    162|      uint16_t bitstream_version) {
  143|    162|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    162|        method, attribute, transform, mesh_data, bitstream_version);
  145|    162|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    162|        uint16_t bitstream_version) {
  111|    162|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 161, False: 1]
  ------------------
  112|    161|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    161|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    161|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    161|                                                  mesh_data));
  116|    161|      }
  117|      1|      return nullptr;
  118|    162|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    134|      uint16_t bitstream_version) {
  143|    134|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    134|        method, attribute, transform, mesh_data, bitstream_version);
  145|    134|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    134|        uint16_t bitstream_version) {
  111|    134|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 131, False: 3]
  ------------------
  112|    131|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    131|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    131|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    131|                                                  mesh_data));
  116|    131|      }
  117|      3|      return nullptr;
  118|    134|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  4.66k|                                 const PointCloudDecoder *decoder) {
  188|  4.66k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  4.66k|      method, att_id, decoder, TransformT());
  190|  4.66k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  4.66k|                                 const TransformT &transform) {
  156|  4.66k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 4.66k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  4.66k|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|  4.66k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 4.66k, 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|  4.66k|    const MeshDecoder *const mesh_decoder =
  167|  4.66k|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|  4.66k|    auto ret = CreateMeshPredictionScheme<
  170|  4.66k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  4.66k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  4.66k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  4.66k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 4.26k, False: 397]
  ------------------
  174|  4.26k|      return ret;
  175|  4.26k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  4.66k|  }
  178|       |  // Create delta decoder.
  179|    397|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    397|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  4.66k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.10k|      uint16_t bitstream_version) {
  143|  2.10k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.10k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.10k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.10k|        uint16_t bitstream_version) {
   53|  2.10k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 723, False: 1.38k]
  ------------------
   54|    723|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    723|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    723|                                                         MeshDataT>(
   57|    723|                attribute, transform, mesh_data));
   58|    723|      }
   59|  1.38k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.38k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 261, False: 1.11k]
  ------------------
   61|    261|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    261|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    261|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    261|                                                  mesh_data));
   65|    261|      }
   66|  1.11k|#endif
   67|  1.11k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 372, False: 747]
  ------------------
   68|    372|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    372|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    372|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    372|                                                  mesh_data));
   72|    372|      }
   73|    747|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    747|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 162, False: 585]
  ------------------
   75|    162|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    162|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    162|                                                     MeshDataT>(
   78|    162|                attribute, transform, mesh_data, bitstream_version));
   79|    162|      }
   80|    585|#endif
   81|    585|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 221, False: 364]
  ------------------
   82|    221|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    221|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    221|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    221|                                                  mesh_data));
   86|    221|      }
   87|    364|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    364|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 364, False: 0]
  ------------------
   89|    364|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    364|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    364|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    364|                                                  mesh_data));
   93|    364|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.10k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  2.16k|      uint16_t bitstream_version) {
  143|  2.16k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  2.16k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  2.16k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  2.16k|        uint16_t bitstream_version) {
   53|  2.16k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 509, False: 1.65k]
  ------------------
   54|    509|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    509|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    509|                                                         MeshDataT>(
   57|    509|                attribute, transform, mesh_data));
   58|    509|      }
   59|  1.65k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.65k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 456, False: 1.19k]
  ------------------
   61|    456|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    456|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    456|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    456|                                                  mesh_data));
   65|    456|      }
   66|  1.19k|#endif
   67|  1.19k|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 424, False: 773]
  ------------------
   68|    424|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    424|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    424|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    424|                                                  mesh_data));
   72|    424|      }
   73|    773|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    773|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 167, False: 606]
  ------------------
   75|    167|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    167|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    167|                                                     MeshDataT>(
   78|    167|                attribute, transform, mesh_data, bitstream_version));
   79|    167|      }
   80|    606|#endif
   81|    606|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 226, False: 380]
  ------------------
   82|    226|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    226|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    226|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    226|                                                  mesh_data));
   86|    226|      }
   87|    380|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    380|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 380, False: 0]
  ------------------
   89|    380|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    380|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    380|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    380|                                                  mesh_data));
   93|    380|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  2.16k|    }

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

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    512|    uint16_t bitstream_version) {
   38|    512|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    512|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 512, False: 0]
  ------------------
   40|    512|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 78, False: 434]
  ------------------
   41|    434|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 4, False: 430]
  ------------------
   42|    430|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 2, False: 428]
  ------------------
   43|    428|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 0, False: 428]
  ------------------
   44|    428|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 378, False: 50]
  ------------------
   45|    468|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 6, False: 44]
  ------------------
   46|    468|    const CornerTable *const ct = source->GetCornerTable();
   47|    468|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    468|        source->GetAttributeEncodingData(att_id);
   49|    468|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 102, False: 366]
  |  Branch (49:26): [True: 0, False: 366]
  ------------------
   50|       |      // No connectivity data found.
   51|    102|      return nullptr;
   52|    102|    }
   53|       |    // Connectivity data exists.
   54|    366|    const MeshAttributeCornerTable *const att_ct =
   55|    366|        source->GetAttributeCornerTable(att_id);
   56|    366|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 209, False: 157]
  ------------------
   57|    209|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    209|      MeshData md;
   59|    209|      md.Set(source->mesh(), att_ct,
   60|    209|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    209|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    209|      MeshPredictionSchemeFactoryT factory;
   63|    209|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    209|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 197, False: 12]
  ------------------
   65|    197|        return ret;
   66|    197|      }
   67|    209|    } else {
   68|    157|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    157|      MeshData md;
   70|    157|      md.Set(source->mesh(), ct,
   71|    157|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    157|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    157|      MeshPredictionSchemeFactoryT factory;
   74|    157|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    157|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 153, False: 4]
  ------------------
   76|    153|        return ret;
   77|    153|      }
   78|    157|    }
   79|    366|  }
   80|     60|  return nullptr;
   81|    512|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    509|    uint16_t bitstream_version) {
   38|    509|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    509|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 509, False: 0]
  ------------------
   40|    509|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 18, False: 491]
  ------------------
   41|    491|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 25, False: 466]
  ------------------
   42|    466|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 2, False: 464]
  ------------------
   43|    464|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 11, False: 453]
  ------------------
   44|    453|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 344, False: 109]
  ------------------
   45|    427|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 27, False: 82]
  ------------------
   46|    427|    const CornerTable *const ct = source->GetCornerTable();
   47|    427|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    427|        source->GetAttributeEncodingData(att_id);
   49|    427|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 131, False: 296]
  |  Branch (49:26): [True: 0, False: 296]
  ------------------
   50|       |      // No connectivity data found.
   51|    131|      return nullptr;
   52|    131|    }
   53|       |    // Connectivity data exists.
   54|    296|    const MeshAttributeCornerTable *const att_ct =
   55|    296|        source->GetAttributeCornerTable(att_id);
   56|    296|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 162, False: 134]
  ------------------
   57|    162|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    162|      MeshData md;
   59|    162|      md.Set(source->mesh(), att_ct,
   60|    162|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    162|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    162|      MeshPredictionSchemeFactoryT factory;
   63|    162|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    162|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 161, False: 1]
  ------------------
   65|    161|        return ret;
   66|    161|      }
   67|    162|    } else {
   68|    134|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|    134|      MeshData md;
   70|    134|      md.Set(source->mesh(), ct,
   71|    134|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|    134|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|    134|      MeshPredictionSchemeFactoryT factory;
   74|    134|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|    134|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 131, False: 3]
  ------------------
   76|    131|        return ret;
   77|    131|      }
   78|    134|    }
   79|    296|  }
   80|     86|  return nullptr;
   81|    509|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  4.66k|    uint16_t bitstream_version) {
   38|  4.66k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  4.66k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 4.66k, False: 0]
  ------------------
   40|  4.66k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 1.31k, False: 3.34k]
  ------------------
   41|  3.34k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 774, False: 2.56k]
  ------------------
   42|  2.56k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 819, False: 1.75k]
  ------------------
   43|  1.75k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 451, False: 1.29k]
  ------------------
   44|  1.29k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 757, False: 542]
  ------------------
   45|  4.44k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 329, False: 213]
  ------------------
   46|  4.44k|    const CornerTable *const ct = source->GetCornerTable();
   47|  4.44k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  4.44k|        source->GetAttributeEncodingData(att_id);
   49|  4.44k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 184, False: 4.26k]
  |  Branch (49:26): [True: 0, False: 4.26k]
  ------------------
   50|       |      // No connectivity data found.
   51|    184|      return nullptr;
   52|    184|    }
   53|       |    // Connectivity data exists.
   54|  4.26k|    const MeshAttributeCornerTable *const att_ct =
   55|  4.26k|        source->GetAttributeCornerTable(att_id);
   56|  4.26k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 2.10k, False: 2.16k]
  ------------------
   57|  2.10k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  2.10k|      MeshData md;
   59|  2.10k|      md.Set(source->mesh(), att_ct,
   60|  2.10k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  2.10k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  2.10k|      MeshPredictionSchemeFactoryT factory;
   63|  2.10k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  2.10k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 2.10k, False: 0]
  ------------------
   65|  2.10k|        return ret;
   66|  2.10k|      }
   67|  2.16k|    } else {
   68|  2.16k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  2.16k|      MeshData md;
   70|  2.16k|      md.Set(source->mesh(), ct,
   71|  2.16k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  2.16k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  2.16k|      MeshPredictionSchemeFactoryT factory;
   74|  2.16k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  2.16k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 2.16k, False: 0]
  ------------------
   76|  2.16k|        return ret;
   77|  2.16k|      }
   78|  2.16k|    }
   79|  4.26k|  }
   80|    213|  return nullptr;
   81|  4.66k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|  1.13M|  bool IsInBottomLeft(const Point2 &p) const {
   93|  1.13M|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 889k, False: 249k]
  |  Branch (93:22): [True: 819k, False: 70.2k]
  ------------------
   94|   819k|      return true;
   95|   819k|    }
   96|   319k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 135k, False: 184k]
  |  Branch (96:25): [True: 104k, False: 31.4k]
  ------------------
   97|  1.13M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|  1.13M|  int32_t GetRotationCount(Point2 pred) const {
   51|  1.13M|    const DataType sign_x = pred[0];
   52|  1.13M|    const DataType sign_y = pred[1];
   53|       |
   54|  1.13M|    int32_t rotation_count = 0;
   55|  1.13M|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 889k, False: 249k]
  ------------------
   56|   889k|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 819k, False: 70.2k]
  ------------------
   57|   819k|        rotation_count = 0;
   58|   819k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 36.1k, False: 34.0k]
  ------------------
   59|  36.1k|        rotation_count = 3;
   60|  36.1k|      } else {
   61|  34.0k|        rotation_count = 1;
   62|  34.0k|      }
   63|   889k|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 113k, False: 135k]
  ------------------
   64|   113k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 74.2k, False: 39.6k]
  ------------------
   65|  74.2k|        rotation_count = 2;
   66|  74.2k|      } else {
   67|  39.6k|        rotation_count = 1;
   68|  39.6k|      }
   69|   135k|    } else {
   70|   135k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 104k, False: 31.4k]
  ------------------
   71|   104k|        rotation_count = 0;
   72|   104k|      } else {
   73|  31.4k|        rotation_count = 3;
   74|  31.4k|      }
   75|   135k|    }
   76|  1.13M|    return rotation_count;
   77|  1.13M|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   431k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   431k|    switch (rotation_count) {
   81|   141k|      case 1:
  ------------------
  |  Branch (81:7): [True: 141k, False: 289k]
  ------------------
   82|   141k|        return Point2(p[1], -p[0]);
   83|   148k|      case 2:
  ------------------
  |  Branch (83:7): [True: 148k, False: 282k]
  ------------------
   84|   148k|        return Point2(-p[0], -p[1]);
   85|   141k|      case 3:
  ------------------
  |  Branch (85:7): [True: 141k, False: 289k]
  ------------------
   86|   141k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 431k]
  ------------------
   88|      0|        return p;
   89|   431k|    }
   90|   431k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    509|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|  4.44k|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|  3.88k|  inline void set_min_value(const DataTypeT &v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|  3.88k|  inline void set_max_value(const DataTypeT &v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|  3.88k|  bool InitCorrectionBounds() {
   84|  3.88k|    const int64_t dif =
   85|  3.88k|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|  3.88k|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 3.88k]
  |  Branch (86:20): [True: 19, False: 3.86k]
  ------------------
   87|     19|      return false;
   88|     19|    }
   89|  3.86k|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|  3.86k|    max_correction_ = max_dif_ / 2;
   91|  3.86k|    min_correction_ = -max_correction_;
   92|  3.86k|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 1.64k, False: 2.21k]
  ------------------
   93|  1.64k|      max_correction_ -= 1;
   94|  1.64k|    }
   95|  3.86k|    return true;
   96|  3.88k|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|  3.17k|  void Init(int num_components) {
   56|  3.17k|    num_components_ = num_components;
   57|  3.17k|    clamped_value_.resize(num_components);
   58|  3.17k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|  6.29M|      const DataTypeT *predicted_val) const {
   64|   141M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 135M, False: 6.29M]
  ------------------
   65|   135M|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 190k, False: 135M]
  ------------------
   66|   190k|        clamped_value_[i] = max_value_;
   67|   135M|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 9.17M, False: 126M]
  ------------------
   68|  9.17M|        clamped_value_[i] = min_value_;
   69|   126M|      } else {
   70|   126M|        clamped_value_[i] = predicted_val[i];
   71|   126M|      }
   72|   135M|    }
   73|  6.29M|    return clamped_value_.data();
   74|  6.29M|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|   283M|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|   135M|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|   390k|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|   135M|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|    621|  int quantization_bits() const {
   78|    621|    DRACO_DCHECK(false);
   79|    621|    return -1;
   80|    621|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   44|  4.66k|      : num_components_(0),
   45|  4.66k|        min_value_(0),
   46|  4.66k|        max_value_(0),
   47|  4.66k|        max_dif_(0),
   48|  4.66k|        max_correction_(0),
   49|  4.66k|        min_correction_(0) {}

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

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  8.45k|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|  9.56M|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  5.68k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  30.8k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  9.50k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  9.50k|    portable_attribute_ = std::move(att);
   71|  9.50k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  33.4k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  19.5k|  virtual ~SequentialAttributeDecoder() = default;

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  27.6k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  8.11k|    DecoderBuffer *buffer) {
   30|  8.11k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 188, False: 7.92k]
  ------------------
   31|    188|    return false;
   32|    188|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  7.92k|  const int32_t num_attributes = GetNumAttributes();
   35|  7.92k|  sequential_decoders_.resize(num_attributes);
   36|  27.4k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 19.5k, False: 7.90k]
  ------------------
   37|  19.5k|    uint8_t decoder_type;
   38|  19.5k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 10, False: 19.5k]
  ------------------
   39|     10|      return false;
   40|     10|    }
   41|       |    // Create the decoder from the id.
   42|  19.5k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  19.5k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 7, False: 19.5k]
  ------------------
   44|      7|      return false;
   45|      7|    }
   46|  19.5k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 4, False: 19.5k]
  ------------------
   47|      4|      return false;
   48|      4|    }
   49|  19.5k|  }
   50|  7.90k|  return true;
   51|  7.92k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  5.18k|    DecoderBuffer *buffer) {
   55|  5.18k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 5.18k]
  |  Branch (55:22): [True: 9, False: 5.18k]
  ------------------
   56|      9|    return false;
   57|      9|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  5.18k|  const int32_t num_attributes = GetNumAttributes();
   60|  20.3k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 15.1k, False: 5.17k]
  ------------------
   61|  15.1k|    PointAttribute *const pa =
   62|  15.1k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  15.1k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 2, False: 15.1k]
  ------------------
   64|      2|      return false;
   65|      2|    }
   66|  15.1k|  }
   67|  5.17k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  5.18k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  5.17k|    DecoderBuffer *in_buffer) {
   72|  5.17k|  const int32_t num_attributes = GetNumAttributes();
   73|  13.6k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 10.6k, False: 3.05k]
  ------------------
   74|  10.6k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 2.12k, False: 8.47k]
  ------------------
   75|  10.6k|                                                          in_buffer)) {
   76|  2.12k|      return false;
   77|  2.12k|    }
   78|  10.6k|  }
   79|  3.05k|  return true;
   80|  5.17k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  3.05k|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|  3.05k|  const int32_t num_attributes = GetNumAttributes();
   85|  7.74k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 5.38k, False: 2.35k]
  ------------------
   86|  5.38k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 693, False: 4.69k]
  ------------------
   87|  5.38k|            point_ids_, in_buffer)) {
   88|    693|      return false;
   89|    693|    }
   90|  5.38k|  }
   91|  2.35k|  return true;
   92|  3.05k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  2.35k|    TransformAttributesToOriginalFormat() {
   96|  2.35k|  const int32_t num_attributes = GetNumAttributes();
   97|  6.11k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 4.07k, False: 2.03k]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  4.07k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 4.07k, False: 0]
  ------------------
  100|  4.07k|      const PointAttribute *const attribute =
  101|  4.07k|          sequential_decoders_[i]->attribute();
  102|  4.07k|      const PointAttribute *const portable_attribute =
  103|  4.07k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  4.07k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 3.73k, False: 340]
  |  Branch (104:11): [True: 677, False: 3.39k]
  ------------------
  105|  3.73k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 677, False: 3.05k]
  ------------------
  106|  3.73k|              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|    677|        sequential_decoders_[i]->attribute()->CopyFrom(*portable_attribute);
  113|    677|        continue;
  114|    677|      }
  115|  4.07k|    }
  116|  3.39k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 320, False: 3.07k]
  ------------------
  117|  3.39k|            point_ids_)) {
  118|    320|      return false;
  119|    320|    }
  120|  3.39k|  }
  121|  2.03k|  return true;
  122|  2.35k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  19.5k|    uint8_t decoder_type) {
  127|  19.5k|  switch (decoder_type) {
  128|  1.70k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 1.70k, False: 17.8k]
  ------------------
  129|  1.70k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  1.70k|          new SequentialAttributeDecoder());
  131|  16.0k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 16.0k, False: 3.45k]
  ------------------
  132|  16.0k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  16.0k|          new SequentialIntegerAttributeDecoder());
  134|    546|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 546, False: 18.9k]
  ------------------
  135|    546|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    546|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|  1.20k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 1.20k, False: 18.3k]
  ------------------
  139|  1.20k|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|  1.20k|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|      7|    default:
  ------------------
  |  Branch (142:5): [True: 7, False: 19.5k]
  ------------------
  143|      7|      break;
  144|  19.5k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|      7|  return nullptr;
  147|  19.5k|}

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  17.8k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() {}
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   26|  17.8k|                                             int attribute_id) {
   27|  17.8k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (27:7): [True: 0, False: 17.8k]
  ------------------
   28|      0|    return false;
   29|      0|  }
   30|  17.8k|  return true;
   31|  17.8k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   34|  3.05k|    const std::vector<PointIndex> &point_ids) {
   35|  3.05k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  3.05k|  if (decoder() &&
  ------------------
  |  Branch (36:7): [True: 3.05k, False: 0]
  ------------------
   37|  3.05k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.05k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (37:7): [True: 1, False: 3.05k]
  ------------------
   38|      1|    return true;  // Don't revert the transform here for older files.
   39|      1|  }
   40|  3.05k|#endif
   41|  3.05k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   42|  3.05k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   45|  10.0k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   46|       |  // Decode prediction scheme.
   47|  10.0k|  int8_t prediction_scheme_method;
   48|  10.0k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (48:7): [True: 176, False: 9.85k]
  ------------------
   49|    176|    return false;
   50|    176|  }
   51|       |  // Check that decoded prediction scheme method type is valid.
   52|  9.85k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (52:7): [True: 49, False: 9.80k]
  ------------------
   53|  9.80k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (53:7): [True: 120, False: 9.68k]
  ------------------
   54|    169|    return false;
   55|    169|  }
   56|  9.68k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (56:7): [True: 9.41k, False: 268]
  ------------------
   57|  9.41k|    int8_t prediction_transform_type;
   58|  9.41k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (58:9): [True: 57, False: 9.35k]
  ------------------
   59|     57|      return false;
   60|     57|    }
   61|       |    // Check that decoded prediction scheme transform type is valid.
   62|  9.35k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (62:9): [True: 16, False: 9.34k]
  ------------------
   63|  9.34k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (63:9): [True: 66, False: 9.27k]
  ------------------
   64|     82|      return false;
   65|     82|    }
   66|  9.27k|    prediction_scheme_ = CreateIntPredictionScheme(
   67|  9.27k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   68|  9.27k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   69|  9.27k|  }
   70|       |
   71|  9.54k|  if (prediction_scheme_) {
  ------------------
  |  Branch (71:7): [True: 5.68k, False: 3.86k]
  ------------------
   72|  5.68k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (72:9): [True: 32, False: 5.65k]
  ------------------
   73|     32|      return false;
   74|     32|    }
   75|  5.68k|  }
   76|       |
   77|  9.51k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (77:7): [True: 1.50k, False: 8.00k]
  ------------------
   78|  1.50k|    return false;
   79|  1.50k|  }
   80|       |
   81|  8.00k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   82|  8.00k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   83|  8.00k|  if (decoder() &&
  ------------------
  |  Branch (83:7): [True: 8.00k, False: 0]
  ------------------
   84|  8.00k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  8.00k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:7): [True: 26, False: 7.98k]
  ------------------
   85|       |    // For older files, revert the transform right after we decode the data.
   86|     26|    if (!StoreValues(num_values)) {
  ------------------
  |  Branch (86:9): [True: 1, False: 25]
  ------------------
   87|      1|      return false;
   88|      1|    }
   89|     26|  }
   90|  8.00k|#endif
   91|  8.00k|  return true;
   92|  8.00k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   97|  8.21k|    PredictionSchemeTransformType transform_type) {
   98|  8.21k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (98:7): [True: 3.55k, False: 4.66k]
  ------------------
   99|  3.55k|    return nullptr;  // For now we support only wrap transform.
  100|  3.55k|  }
  101|  4.66k|  return CreatePredictionSchemeForDecoder<
  102|  4.66k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  103|  4.66k|      method, attribute_id(), decoder());
  104|  8.21k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  107|  9.50k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  108|  9.50k|  const int num_components = GetNumValueComponents();
  109|  9.50k|  if (num_components <= 0) {
  ------------------
  |  Branch (109:7): [True: 0, False: 9.50k]
  ------------------
  110|      0|    return false;
  111|      0|  }
  112|  9.50k|  const size_t num_entries = point_ids.size();
  113|  9.50k|  const size_t num_values = num_entries * num_components;
  114|  9.50k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  115|  9.50k|  int32_t *const portable_attribute_data = GetPortableAttributeData();
  116|  9.50k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (116:7): [True: 14, False: 9.49k]
  ------------------
  117|     14|    return false;
  118|     14|  }
  119|  9.49k|  uint8_t compressed;
  120|  9.49k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (120:7): [True: 30, False: 9.46k]
  ------------------
  121|     30|    return false;
  122|     30|  }
  123|  9.46k|  if (compressed > 0) {
  ------------------
  |  Branch (123:7): [True: 607, False: 8.85k]
  ------------------
  124|       |    // Decode compressed values.
  125|    607|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (125:9): [True: 264, False: 343]
  ------------------
  126|    607|                       in_buffer,
  127|    607|                       reinterpret_cast<uint32_t *>(portable_attribute_data))) {
  128|    264|      return false;
  129|    264|    }
  130|  8.85k|  } else {
  131|       |    // Decode the integer data directly.
  132|       |    // Get the number of bytes for a given entry.
  133|  8.85k|    uint8_t num_bytes;
  134|  8.85k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (134:9): [True: 11, False: 8.84k]
  ------------------
  135|     11|      return false;
  136|     11|    }
  137|  8.84k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (137:9): [True: 332, False: 8.51k]
  ------------------
  138|    332|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (138:11): [True: 0, False: 332]
  ------------------
  139|    332|          sizeof(int32_t) * num_values) {
  140|      0|        return false;
  141|      0|      }
  142|    332|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (142:11): [True: 2, False: 330]
  ------------------
  143|    332|                             sizeof(int32_t) * num_values)) {
  144|      2|        return false;
  145|      2|      }
  146|  8.51k|    } else {
  147|  8.51k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (147:11): [True: 17, False: 8.49k]
  ------------------
  148|  8.51k|          num_bytes * num_values) {
  149|     17|        return false;
  150|     17|      }
  151|  8.49k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (151:11): [True: 16, False: 8.47k]
  ------------------
  152|  8.49k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  153|     16|        return false;
  154|     16|      }
  155|   889M|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (155:26): [True: 889M, False: 8.47k]
  ------------------
  156|   889M|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (156:13): [True: 0, False: 889M]
  ------------------
  157|      0|          return false;
  158|      0|        }
  159|   889M|      }
  160|  8.47k|    }
  161|  8.84k|  }
  162|       |
  163|  9.15k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (163:7): [True: 9.15k, False: 0]
  |  Branch (163:26): [True: 3.73k, False: 5.41k]
  ------------------
  164|  8.17k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (164:26): [True: 4.44k, False: 977]
  ------------------
  165|       |    // Convert the values back to the original signed format.
  166|  8.17k|    ConvertSymbolsToSignedInts(
  167|  8.17k|        reinterpret_cast<const uint32_t *>(portable_attribute_data),
  168|  8.17k|        static_cast<int>(num_values), portable_attribute_data);
  169|  8.17k|  }
  170|       |
  171|       |  // If the data was encoded with a prediction scheme, we must revert it.
  172|  9.15k|  if (prediction_scheme_) {
  ------------------
  |  Branch (172:7): [True: 5.41k, False: 3.73k]
  ------------------
  173|  5.41k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (173:9): [True: 734, False: 4.68k]
  ------------------
  174|    734|      return false;
  175|    734|    }
  176|       |
  177|  4.68k|    if (num_values > 0) {
  ------------------
  |  Branch (177:9): [True: 4.68k, False: 0]
  ------------------
  178|  4.68k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (178:11): [True: 412, False: 4.27k]
  ------------------
  179|  4.68k|              portable_attribute_data, portable_attribute_data,
  180|  4.68k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  181|    412|        return false;
  182|    412|      }
  183|  4.68k|    }
  184|  4.68k|  }
  185|  8.00k|  return true;
  186|  9.15k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  188|  2.62k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  189|  2.62k|  switch (attribute()->data_type()) {
  190|    158|    case DT_UINT8:
  ------------------
  |  Branch (190:5): [True: 158, False: 2.46k]
  ------------------
  191|    158|      StoreTypedValues<uint8_t>(num_values);
  192|    158|      break;
  193|  1.84k|    case DT_INT8:
  ------------------
  |  Branch (193:5): [True: 1.84k, False: 774]
  ------------------
  194|  1.84k|      StoreTypedValues<int8_t>(num_values);
  195|  1.84k|      break;
  196|     74|    case DT_UINT16:
  ------------------
  |  Branch (196:5): [True: 74, False: 2.54k]
  ------------------
  197|     74|      StoreTypedValues<uint16_t>(num_values);
  198|     74|      break;
  199|    140|    case DT_INT16:
  ------------------
  |  Branch (199:5): [True: 140, False: 2.48k]
  ------------------
  200|    140|      StoreTypedValues<int16_t>(num_values);
  201|    140|      break;
  202|    125|    case DT_UINT32:
  ------------------
  |  Branch (202:5): [True: 125, False: 2.49k]
  ------------------
  203|    125|      StoreTypedValues<uint32_t>(num_values);
  204|    125|      break;
  205|    187|    case DT_INT32:
  ------------------
  |  Branch (205:5): [True: 187, False: 2.43k]
  ------------------
  206|    187|      StoreTypedValues<int32_t>(num_values);
  207|    187|      break;
  208|     90|    default:
  ------------------
  |  Branch (208:5): [True: 90, False: 2.53k]
  ------------------
  209|     90|      return false;
  210|  2.62k|  }
  211|  2.53k|  return true;
  212|  2.62k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  236|  9.50k|    int num_entries, int num_components) {
  237|  9.50k|  GeometryAttribute ga;
  238|  9.50k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  239|  9.50k|          false, num_components * DataTypeLength(DT_INT32), 0);
  240|  9.50k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  241|  9.50k|  port_att->SetIdentityMapping();
  242|  9.50k|  port_att->Reset(num_entries);
  243|  9.50k|  port_att->set_unique_id(attribute()->unique_id());
  244|  9.50k|  SetPortableAttribute(std::move(port_att));
  245|  9.50k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  215|    158|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    158|  const int num_components = attribute()->num_components();
  217|    158|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    158|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    158|      new AttributeTypeT[num_components]);
  220|    158|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    158|  int val_id = 0;
  222|    158|  int out_byte_pos = 0;
  223|   550k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 550k, False: 158]
  ------------------
  224|  10.4M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 9.89M, False: 550k]
  ------------------
  225|  9.89M|      const AttributeTypeT value =
  226|  9.89M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  9.89M|      att_val[c] = value;
  228|  9.89M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   550k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   550k|    out_byte_pos += entry_size;
  232|   550k|  }
  233|    158|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  215|  1.84k|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|  1.84k|  const int num_components = attribute()->num_components();
  217|  1.84k|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|  1.84k|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|  1.84k|      new AttributeTypeT[num_components]);
  220|  1.84k|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|  1.84k|  int val_id = 0;
  222|  1.84k|  int out_byte_pos = 0;
  223|  6.39M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 6.39M, False: 1.84k]
  ------------------
  224|   440M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 433M, False: 6.39M]
  ------------------
  225|   433M|      const AttributeTypeT value =
  226|   433M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   433M|      att_val[c] = value;
  228|   433M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  6.39M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  6.39M|    out_byte_pos += entry_size;
  232|  6.39M|  }
  233|  1.84k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  215|     74|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     74|  const int num_components = attribute()->num_components();
  217|     74|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     74|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     74|      new AttributeTypeT[num_components]);
  220|     74|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     74|  int val_id = 0;
  222|     74|  int out_byte_pos = 0;
  223|   287k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 287k, False: 74]
  ------------------
  224|  13.7M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 13.4M, False: 287k]
  ------------------
  225|  13.4M|      const AttributeTypeT value =
  226|  13.4M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  13.4M|      att_val[c] = value;
  228|  13.4M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   287k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   287k|    out_byte_pos += entry_size;
  232|   287k|  }
  233|     74|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  215|    140|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    140|  const int num_components = attribute()->num_components();
  217|    140|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    140|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    140|      new AttributeTypeT[num_components]);
  220|    140|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    140|  int val_id = 0;
  222|    140|  int out_byte_pos = 0;
  223|   407k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 407k, False: 140]
  ------------------
  224|  18.8M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 18.3M, False: 407k]
  ------------------
  225|  18.3M|      const AttributeTypeT value =
  226|  18.3M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  18.3M|      att_val[c] = value;
  228|  18.3M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   407k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   407k|    out_byte_pos += entry_size;
  232|   407k|  }
  233|    140|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  215|    125|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    125|  const int num_components = attribute()->num_components();
  217|    125|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    125|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    125|      new AttributeTypeT[num_components]);
  220|    125|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    125|  int val_id = 0;
  222|    125|  int out_byte_pos = 0;
  223|   875k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 875k, False: 125]
  ------------------
  224|   171M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 170M, False: 875k]
  ------------------
  225|   170M|      const AttributeTypeT value =
  226|   170M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|   170M|      att_val[c] = value;
  228|   170M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   875k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   875k|    out_byte_pos += entry_size;
  232|   875k|  }
  233|    125|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  215|    187|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|    187|  const int num_components = attribute()->num_components();
  217|    187|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|    187|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|    187|      new AttributeTypeT[num_components]);
  220|    187|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|    187|  int val_id = 0;
  222|    187|  int out_byte_pos = 0;
  223|  1.01M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 1.01M, False: 187]
  ------------------
  224|  55.8M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 54.8M, False: 1.01M]
  ------------------
  225|  54.8M|      const AttributeTypeT value =
  226|  54.8M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  54.8M|      att_val[c] = value;
  228|  54.8M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  1.01M|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  1.01M|    out_byte_pos += entry_size;
  232|  1.01M|  }
  233|    187|}

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

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

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

_ZN5draco38SequentialQuantizationAttributeDecoderC2Ev:
   22|    546|    SequentialQuantizationAttributeDecoder() {}
_ZN5draco38SequentialQuantizationAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   25|    546|                                                  int attribute_id) {
   26|    546|  if (!SequentialIntegerAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (26:7): [True: 0, False: 546]
  ------------------
   27|      0|    return false;
   28|      0|  }
   29|    546|  const PointAttribute *const attribute =
   30|    546|      decoder->point_cloud()->attribute(attribute_id);
   31|       |  // Currently we can quantize only floating point arguments.
   32|    546|  if (attribute->data_type() != DT_FLOAT32) {
  ------------------
  |  Branch (32:7): [True: 2, False: 544]
  ------------------
   33|      2|    return false;
   34|      2|  }
   35|    544|  return true;
   36|    546|}
_ZN5draco38SequentialQuantizationAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   39|    479|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   40|    479|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   41|    479|  if (decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0) &&
  ------------------
  |  |  115|    958|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (41:7): [True: 11, False: 468]
  ------------------
   42|     11|      !DecodeQuantizedDataInfo()) {
  ------------------
  |  Branch (42:7): [True: 7, False: 4]
  ------------------
   43|      7|    return false;
   44|      7|  }
   45|    472|#endif
   46|    472|  return SequentialIntegerAttributeDecoder::DecodeIntegerValues(point_ids,
   47|    472|                                                                in_buffer);
   48|    479|}
_ZN5draco38SequentialQuantizationAttributeDecoder35DecodeDataNeededByPortableTransformERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   52|    321|        const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   53|    321|  if (decoder()->bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    321|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (53:7): [True: 321, False: 0]
  ------------------
   54|       |    // Decode quantization data here only for files with bitstream version 2.0+
   55|    321|    if (!DecodeQuantizedDataInfo()) {
  ------------------
  |  Branch (55:9): [True: 232, False: 89]
  ------------------
   56|    232|      return false;
   57|    232|    }
   58|    321|  }
   59|       |
   60|       |  // Store the decoded transform data in portable attribute;
   61|     89|  return quantization_transform_.TransferToAttribute(portable_attribute());
   62|    321|}
_ZN5draco38SequentialQuantizationAttributeDecoder11StoreValuesEj:
   64|     89|bool SequentialQuantizationAttributeDecoder::StoreValues(uint32_t num_points) {
   65|     89|  return DequantizeValues(num_points);
   66|     89|}
_ZN5draco38SequentialQuantizationAttributeDecoder23DecodeQuantizedDataInfoEv:
   68|    332|bool SequentialQuantizationAttributeDecoder::DecodeQuantizedDataInfo() {
   69|       |  // Get attribute used as source for decoding.
   70|    332|  auto att = GetPortableAttribute();
   71|    332|  if (att == nullptr) {
  ------------------
  |  Branch (71:7): [True: 11, False: 321]
  ------------------
   72|       |    // This should happen only in the backward compatibility mode. It will still
   73|       |    // work fine for this case because the only thing the quantization transform
   74|       |    // cares about is the number of components that is the same for both source
   75|       |    // and target attributes.
   76|     11|    att = attribute();
   77|     11|  }
   78|    332|  return quantization_transform_.DecodeParameters(*att, decoder()->buffer());
   79|    332|}
_ZN5draco38SequentialQuantizationAttributeDecoder16DequantizeValuesEj:
   82|     89|    uint32_t num_values) {
   83|       |  // Convert all quantized values back to floats.
   84|     89|  return quantization_transform_.InverseTransformAttribute(
   85|     89|      *GetPortableAttribute(), attribute());
   86|     89|}

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  28.3k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  17.5k|                                const uint8_t *const buf, int offset) {
  301|  17.5k|  unsigned x;
  302|  17.5k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 19, False: 17.5k]
  ------------------
  303|     19|    return 1;
  304|     19|  }
  305|  17.5k|  ans->buf = buf;
  306|  17.5k|  x = buf[offset - 1] >> 6;
  307|  17.5k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 15.4k, False: 2.11k]
  ------------------
  308|  15.4k|    ans->buf_offset = offset - 1;
  309|  15.4k|    ans->state = buf[offset - 1] & 0x3F;
  310|  15.4k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 1.86k, False: 255]
  ------------------
  311|  1.86k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 3, False: 1.85k]
  ------------------
  312|      3|      return 1;
  313|      3|    }
  314|  1.85k|    ans->buf_offset = offset - 2;
  315|  1.85k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  1.85k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 249, False: 6]
  ------------------
  317|    249|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 0, False: 249]
  ------------------
  318|      0|      return 1;
  319|      0|    }
  320|    249|    ans->buf_offset = offset - 3;
  321|    249|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    249|  } else {
  323|      6|    return 1;
  324|      6|  }
  325|  17.5k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  17.5k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  17.5k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  17.5k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  17.5k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 3, False: 17.5k]
  ------------------
  327|      3|    return 1;
  328|      3|  }
  329|  17.5k|  return 0;
  330|  17.5k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  1.85k|static uint32_t mem_get_le16(const void *vmem) {
   68|  1.85k|  uint32_t val;
   69|  1.85k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  1.85k|  val = mem[1] << 8;
   72|  1.85k|  val |= mem[0];
   73|  1.85k|  return val;
   74|  1.85k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    249|static uint32_t mem_get_le24(const void *vmem) {
   77|    249|  uint32_t val;
   78|    249|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    249|  val = mem[2] << 16;
   81|    249|  val |= mem[1] << 8;
   82|    249|  val |= mem[0];
   83|    249|  return val;
   84|    249|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  9.53G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  9.53G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  9.53G|  unsigned quot, rem, x, xn;
  172|  9.53G|#endif
  173|  9.53G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  9.53G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  9.53G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  19.0G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 8.64G, False: 884M]
  |  Branch (174:40): [True: 143k, False: 8.64G]
  ------------------
  175|   143k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   143k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   143k|  }
  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|  9.53G|  x = ans->state;
  184|  9.53G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  9.53G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  9.53G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  9.53G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  9.53G|  xn = quot * p;
  187|  9.53G|  val = rem < p;
  188|  9.53G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  19.0G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 8.67G, False: 856M]
  |  |  ------------------
  ------------------
  189|  8.67G|    ans->state = xn + rem;
  190|  8.67G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   856M|    ans->state = x - xn - p;
  193|   856M|  }
  194|  9.53G|#endif
  195|  9.53G|  return val;
  196|  9.53G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  38.6k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  38.6k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  38.6k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  38.6k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  4.10k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|  2.33k|                                       uint32_t num_symbols) {
  482|  2.33k|    lut_table_.resize(rans_precision);
  483|  2.33k|    probability_table_.resize(num_symbols);
  484|  2.33k|    uint32_t cum_prob = 0;
  485|  2.33k|    uint32_t act_prob = 0;
  486|  23.8k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 21.6k, False: 2.17k]
  ------------------
  487|  21.6k|      probability_table_[i].prob = token_probs[i];
  488|  21.6k|      probability_table_[i].cum_prob = cum_prob;
  489|  21.6k|      cum_prob += token_probs[i];
  490|  21.6k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 157, False: 21.5k]
  ------------------
  491|    157|        return false;
  492|    157|      }
  493|  8.08M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 8.06M, False: 21.5k]
  ------------------
  494|  8.06M|        lut_table_[j] = i;
  495|  8.06M|      }
  496|  21.5k|      act_prob = cum_prob;
  497|  21.5k|    }
  498|  2.17k|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 263, False: 1.91k]
  ------------------
  499|    263|      return false;
  500|    263|    }
  501|  1.91k|    return true;
  502|  2.17k|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|  1.64k|  inline int read_init(const uint8_t *const buf, int offset) {
  422|  1.64k|    unsigned x;
  423|  1.64k|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 184, False: 1.46k]
  ------------------
  424|    184|      return 1;
  425|    184|    }
  426|  1.46k|    ans_.buf = buf;
  427|  1.46k|    x = buf[offset - 1] >> 6;
  428|  1.46k|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 833, False: 630]
  ------------------
  429|    833|      ans_.buf_offset = offset - 1;
  430|    833|      ans_.state = buf[offset - 1] & 0x3F;
  431|    833|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 275, False: 355]
  ------------------
  432|    275|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 70, False: 205]
  ------------------
  433|     70|        return 1;
  434|     70|      }
  435|    205|      ans_.buf_offset = offset - 2;
  436|    205|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    355|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 240, False: 115]
  ------------------
  438|    240|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 71, False: 169]
  ------------------
  439|     71|        return 1;
  440|     71|      }
  441|    169|      ans_.buf_offset = offset - 3;
  442|    169|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    169|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 115, False: 0]
  ------------------
  444|    115|      ans_.buf_offset = offset - 4;
  445|    115|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    115|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|  1.32k|    ans_.state += l_rans_base;
  450|  1.32k|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  1.32k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 109, False: 1.21k]
  ------------------
  451|    109|      return 1;
  452|    109|    }
  453|  1.21k|    return 0;
  454|  1.32k|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    350|static uint32_t mem_get_le16(const void *vmem) {
   68|    350|  uint32_t val;
   69|    350|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    350|  val = mem[1] << 8;
   72|    350|  val |= mem[0];
   73|    350|  return val;
   74|    350|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    266|static uint32_t mem_get_le24(const void *vmem) {
   77|    266|  uint32_t val;
   78|    266|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    266|  val = mem[2] << 16;
   81|    266|  val |= mem[1] << 8;
   82|    266|  val |= mem[0];
   83|    266|  return val;
   84|    266|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    416|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    416|  uint32_t val;
   88|    416|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    416|  val = mem[3] << 24;
   91|    416|  val |= mem[2] << 16;
   92|    416|  val |= mem[1] << 8;
   93|    416|  val |= mem[0];
   94|    416|  return val;
   95|    416|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|  85.2M|  inline int rans_read() {
  463|  85.2M|    unsigned rem;
  464|  85.2M|    unsigned quo;
  465|  85.2M|    struct rans_dec_sym sym;
  466|  85.2M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 74.6M, False: 10.6M]
  |  Branch (466:40): [True: 24.2k, False: 74.6M]
  ------------------
  467|  24.2k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  24.2k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  24.2k|    }
  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|  85.2M|    quo = ans_.state / rans_precision;
  472|  85.2M|    rem = ans_.state % rans_precision;
  473|  85.2M|    fetch_sym(&sym, rem);
  474|  85.2M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  85.2M|    return sym.val;
  476|  85.2M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|  85.2M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  85.2M|    uint32_t symbol = lut_table_[rem];
  507|  85.2M|    out->val = symbol;
  508|  85.2M|    out->prob = probability_table_[symbol].prob;
  509|  85.2M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  85.2M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|  1.14k|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    426|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|    319|                                       uint32_t num_symbols) {
  482|    319|    lut_table_.resize(rans_precision);
  483|    319|    probability_table_.resize(num_symbols);
  484|    319|    uint32_t cum_prob = 0;
  485|    319|    uint32_t act_prob = 0;
  486|  11.1k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 10.8k, False: 299]
  ------------------
  487|  10.8k|      probability_table_[i].prob = token_probs[i];
  488|  10.8k|      probability_table_[i].cum_prob = cum_prob;
  489|  10.8k|      cum_prob += token_probs[i];
  490|  10.8k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 20, False: 10.8k]
  ------------------
  491|     20|        return false;
  492|     20|      }
  493|  2.33M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 2.32M, False: 10.8k]
  ------------------
  494|  2.32M|        lut_table_[j] = i;
  495|  2.32M|      }
  496|  10.8k|      act_prob = cum_prob;
  497|  10.8k|    }
  498|    299|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 26, False: 273]
  ------------------
  499|     26|      return false;
  500|     26|    }
  501|    273|    return true;
  502|    299|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|    208|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    208|    unsigned x;
  423|    208|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 9, False: 199]
  ------------------
  424|      9|      return 1;
  425|      9|    }
  426|    199|    ans_.buf = buf;
  427|    199|    x = buf[offset - 1] >> 6;
  428|    199|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 109, False: 90]
  ------------------
  429|    109|      ans_.buf_offset = offset - 1;
  430|    109|      ans_.state = buf[offset - 1] & 0x3F;
  431|    109|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 32, False: 58]
  ------------------
  432|     32|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 13, False: 19]
  ------------------
  433|     13|        return 1;
  434|     13|      }
  435|     19|      ans_.buf_offset = offset - 2;
  436|     19|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     58|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 26, False: 32]
  ------------------
  438|     26|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 11, False: 15]
  ------------------
  439|     11|        return 1;
  440|     11|      }
  441|     15|      ans_.buf_offset = offset - 3;
  442|     15|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     32|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 32, False: 0]
  ------------------
  444|     32|      ans_.buf_offset = offset - 4;
  445|     32|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     32|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    175|    ans_.state += l_rans_base;
  450|    175|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    175|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 21, False: 154]
  ------------------
  451|     21|      return 1;
  452|     21|    }
  453|    154|    return 0;
  454|    175|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|  6.74M|  inline int rans_read() {
  463|  6.74M|    unsigned rem;
  464|  6.74M|    unsigned quo;
  465|  6.74M|    struct rans_dec_sym sym;
  466|  6.74M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 6.73M, False: 9.29k]
  |  Branch (466:40): [True: 2.43k, False: 6.73M]
  ------------------
  467|  2.43k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  2.43k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  2.43k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  6.74M|    quo = ans_.state / rans_precision;
  472|  6.74M|    rem = ans_.state % rans_precision;
  473|  6.74M|    fetch_sym(&sym, rem);
  474|  6.74M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  6.74M|    return sym.val;
  476|  6.74M|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|  6.74M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  6.74M|    uint32_t symbol = lut_table_[rem];
  507|  6.74M|    out->val = symbol;
  508|  6.74M|    out->prob = probability_table_[symbol].prob;
  509|  6.74M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  6.74M|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|    154|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|    373|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|    251|                                       uint32_t num_symbols) {
  482|    251|    lut_table_.resize(rans_precision);
  483|    251|    probability_table_.resize(num_symbols);
  484|    251|    uint32_t cum_prob = 0;
  485|    251|    uint32_t act_prob = 0;
  486|  10.6k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 10.4k, False: 229]
  ------------------
  487|  10.4k|      probability_table_[i].prob = token_probs[i];
  488|  10.4k|      probability_table_[i].cum_prob = cum_prob;
  489|  10.4k|      cum_prob += token_probs[i];
  490|  10.4k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 22, False: 10.3k]
  ------------------
  491|     22|        return false;
  492|     22|      }
  493|  6.60M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 6.59M, False: 10.3k]
  ------------------
  494|  6.59M|        lut_table_[j] = i;
  495|  6.59M|      }
  496|  10.3k|      act_prob = cum_prob;
  497|  10.3k|    }
  498|    229|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 41, False: 188]
  ------------------
  499|     41|      return false;
  500|     41|    }
  501|    188|    return true;
  502|    229|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|    126|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    126|    unsigned x;
  423|    126|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 12, False: 114]
  ------------------
  424|     12|      return 1;
  425|     12|    }
  426|    114|    ans_.buf = buf;
  427|    114|    x = buf[offset - 1] >> 6;
  428|    114|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 26, False: 88]
  ------------------
  429|     26|      ans_.buf_offset = offset - 1;
  430|     26|      ans_.state = buf[offset - 1] & 0x3F;
  431|     88|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 20, False: 68]
  ------------------
  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|     68|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 25, False: 43]
  ------------------
  438|     25|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 12, False: 13]
  ------------------
  439|     12|        return 1;
  440|     12|      }
  441|     13|      ans_.buf_offset = offset - 3;
  442|     13|      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|     91|    ans_.state += l_rans_base;
  450|     91|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     91|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 28, False: 63]
  ------------------
  451|     28|      return 1;
  452|     28|    }
  453|     63|    return 0;
  454|     91|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|   535k|  inline int rans_read() {
  463|   535k|    unsigned rem;
  464|   535k|    unsigned quo;
  465|   535k|    struct rans_dec_sym sym;
  466|   535k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 171k, False: 364k]
  |  Branch (466:40): [True: 233, False: 171k]
  ------------------
  467|    233|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    233|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    233|    }
  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|   535k|    quo = ans_.state / rans_precision;
  472|   535k|    rem = ans_.state % rans_precision;
  473|   535k|    fetch_sym(&sym, rem);
  474|   535k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   535k|    return sym.val;
  476|   535k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|   535k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   535k|    uint32_t symbol = lut_table_[rem];
  507|   535k|    out->val = symbol;
  508|   535k|    out->prob = probability_table_[symbol].prob;
  509|   535k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   535k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     63|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    313|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|    193|                                       uint32_t num_symbols) {
  482|    193|    lut_table_.resize(rans_precision);
  483|    193|    probability_table_.resize(num_symbols);
  484|    193|    uint32_t cum_prob = 0;
  485|    193|    uint32_t act_prob = 0;
  486|  14.9k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 14.7k, False: 175]
  ------------------
  487|  14.7k|      probability_table_[i].prob = token_probs[i];
  488|  14.7k|      probability_table_[i].cum_prob = cum_prob;
  489|  14.7k|      cum_prob += token_probs[i];
  490|  14.7k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 18, False: 14.7k]
  ------------------
  491|     18|        return false;
  492|     18|      }
  493|  9.82M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 9.81M, False: 14.7k]
  ------------------
  494|  9.81M|        lut_table_[j] = i;
  495|  9.81M|      }
  496|  14.7k|      act_prob = cum_prob;
  497|  14.7k|    }
  498|    175|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 39, False: 136]
  ------------------
  499|     39|      return false;
  500|     39|    }
  501|    136|    return true;
  502|    175|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     78|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     78|    unsigned x;
  423|     78|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 10, False: 68]
  ------------------
  424|     10|      return 1;
  425|     10|    }
  426|     68|    ans_.buf = buf;
  427|     68|    x = buf[offset - 1] >> 6;
  428|     68|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 29, False: 39]
  ------------------
  429|     29|      ans_.buf_offset = offset - 1;
  430|     29|      ans_.state = buf[offset - 1] & 0x3F;
  431|     39|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 14, False: 25]
  ------------------
  432|     14|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 2, False: 12]
  ------------------
  433|      2|        return 1;
  434|      2|      }
  435|     12|      ans_.buf_offset = offset - 2;
  436|     12|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     25|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 12, False: 13]
  ------------------
  438|     12|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 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|     13|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 13, False: 0]
  ------------------
  444|     13|      ans_.buf_offset = offset - 4;
  445|     13|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     13|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     66|    ans_.state += l_rans_base;
  450|     66|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     66|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 10, False: 56]
  ------------------
  451|     10|      return 1;
  452|     10|    }
  453|     56|    return 0;
  454|     66|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|   381k|  inline int rans_read() {
  463|   381k|    unsigned rem;
  464|   381k|    unsigned quo;
  465|   381k|    struct rans_dec_sym sym;
  466|   382k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 129k, False: 253k]
  |  Branch (466:40): [True: 994, False: 128k]
  ------------------
  467|    994|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    994|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    994|    }
  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|   381k|    quo = ans_.state / rans_precision;
  472|   381k|    rem = ans_.state % rans_precision;
  473|   381k|    fetch_sym(&sym, rem);
  474|   381k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   381k|    return sym.val;
  476|   381k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|   381k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   381k|    uint32_t symbol = lut_table_[rem];
  507|   381k|    out->val = symbol;
  508|   381k|    out->prob = probability_table_[symbol].prob;
  509|   381k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   381k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|     56|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    347|  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.13k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 3.94k, False: 190]
  ------------------
  487|  3.94k|      probability_table_[i].prob = token_probs[i];
  488|  3.94k|      probability_table_[i].cum_prob = cum_prob;
  489|  3.94k|      cum_prob += token_probs[i];
  490|  3.94k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 28, False: 3.91k]
  ------------------
  491|     28|        return false;
  492|     28|      }
  493|  44.4M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 44.4M, False: 3.91k]
  ------------------
  494|  44.4M|        lut_table_[j] = i;
  495|  44.4M|      }
  496|  3.91k|      act_prob = cum_prob;
  497|  3.91k|    }
  498|    190|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 37, False: 153]
  ------------------
  499|     37|      return false;
  500|     37|    }
  501|    153|    return true;
  502|    190|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     86|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     86|    unsigned x;
  423|     86|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 3, False: 83]
  ------------------
  424|      3|      return 1;
  425|      3|    }
  426|     83|    ans_.buf = buf;
  427|     83|    x = buf[offset - 1] >> 6;
  428|     83|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 25, False: 58]
  ------------------
  429|     25|      ans_.buf_offset = offset - 1;
  430|     25|      ans_.state = buf[offset - 1] & 0x3F;
  431|     58|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 26, False: 32]
  ------------------
  432|     26|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 10, False: 16]
  ------------------
  433|     10|        return 1;
  434|     10|      }
  435|     16|      ans_.buf_offset = offset - 2;
  436|     16|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     32|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 9, False: 23]
  ------------------
  438|      9|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 6, False: 3]
  ------------------
  439|      6|        return 1;
  440|      6|      }
  441|      3|      ans_.buf_offset = offset - 3;
  442|      3|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     23|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 23, False: 0]
  ------------------
  444|     23|      ans_.buf_offset = offset - 4;
  445|     23|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     23|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     67|    ans_.state += l_rans_base;
  450|     67|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     67|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 10, False: 57]
  ------------------
  451|     10|      return 1;
  452|     10|    }
  453|     57|    return 0;
  454|     67|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|  62.5k|  inline int rans_read() {
  463|  62.5k|    unsigned rem;
  464|  62.5k|    unsigned quo;
  465|  62.5k|    struct rans_dec_sym sym;
  466|  63.5k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 52.0k, False: 11.4k]
  |  Branch (466:40): [True: 986, False: 51.0k]
  ------------------
  467|    986|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    986|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    986|    }
  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|  62.5k|    quo = ans_.state / rans_precision;
  472|  62.5k|    rem = ans_.state % rans_precision;
  473|  62.5k|    fetch_sym(&sym, rem);
  474|  62.5k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  62.5k|    return sym.val;
  476|  62.5k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|  62.5k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  62.5k|    uint32_t symbol = lut_table_[rem];
  507|  62.5k|    out->val = symbol;
  508|  62.5k|    out->prob = probability_table_[symbol].prob;
  509|  62.5k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  62.5k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|     57|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    357|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|    232|                                       uint32_t num_symbols) {
  482|    232|    lut_table_.resize(rans_precision);
  483|    232|    probability_table_.resize(num_symbols);
  484|    232|    uint32_t cum_prob = 0;
  485|    232|    uint32_t act_prob = 0;
  486|  3.13k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 2.92k, False: 211]
  ------------------
  487|  2.92k|      probability_table_[i].prob = token_probs[i];
  488|  2.92k|      probability_table_[i].cum_prob = cum_prob;
  489|  2.92k|      cum_prob += token_probs[i];
  490|  2.92k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 21, False: 2.90k]
  ------------------
  491|     21|        return false;
  492|     21|      }
  493|  89.2M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 89.2M, False: 2.90k]
  ------------------
  494|  89.2M|        lut_table_[j] = i;
  495|  89.2M|      }
  496|  2.90k|      act_prob = cum_prob;
  497|  2.90k|    }
  498|    211|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 56, False: 155]
  ------------------
  499|     56|      return false;
  500|     56|    }
  501|    155|    return true;
  502|    211|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     96|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     96|    unsigned x;
  423|     96|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 7, False: 89]
  ------------------
  424|      7|      return 1;
  425|      7|    }
  426|     89|    ans_.buf = buf;
  427|     89|    x = buf[offset - 1] >> 6;
  428|     89|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 22, False: 67]
  ------------------
  429|     22|      ans_.buf_offset = offset - 1;
  430|     22|      ans_.state = buf[offset - 1] & 0x3F;
  431|     67|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 28, False: 39]
  ------------------
  432|     28|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 8, False: 20]
  ------------------
  433|      8|        return 1;
  434|      8|      }
  435|     20|      ans_.buf_offset = offset - 2;
  436|     20|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     39|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 7, False: 32]
  ------------------
  438|      7|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 3, False: 4]
  ------------------
  439|      3|        return 1;
  440|      3|      }
  441|      4|      ans_.buf_offset = offset - 3;
  442|      4|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     32|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 32, False: 0]
  ------------------
  444|     32|      ans_.buf_offset = offset - 4;
  445|     32|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     32|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     78|    ans_.state += l_rans_base;
  450|     78|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     78|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 8, False: 70]
  ------------------
  451|      8|      return 1;
  452|      8|    }
  453|     70|    return 0;
  454|     78|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|  78.5k|  inline int rans_read() {
  463|  78.5k|    unsigned rem;
  464|  78.5k|    unsigned quo;
  465|  78.5k|    struct rans_dec_sym sym;
  466|  79.4k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 66.2k, False: 13.2k]
  |  Branch (466:40): [True: 927, False: 65.2k]
  ------------------
  467|    927|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    927|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    927|    }
  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|  78.5k|    quo = ans_.state / rans_precision;
  472|  78.5k|    rem = ans_.state % rans_precision;
  473|  78.5k|    fetch_sym(&sym, rem);
  474|  78.5k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  78.5k|    return sym.val;
  476|  78.5k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|  78.5k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  78.5k|    uint32_t symbol = lut_table_[rem];
  507|  78.5k|    out->val = symbol;
  508|  78.5k|    out->prob = probability_table_[symbol].prob;
  509|  78.5k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  78.5k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     70|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|  1.53k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|    952|                                       uint32_t num_symbols) {
  482|    952|    lut_table_.resize(rans_precision);
  483|    952|    probability_table_.resize(num_symbols);
  484|    952|    uint32_t cum_prob = 0;
  485|    952|    uint32_t act_prob = 0;
  486|  50.8k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 49.9k, False: 902]
  ------------------
  487|  49.9k|      probability_table_[i].prob = token_probs[i];
  488|  49.9k|      probability_table_[i].cum_prob = cum_prob;
  489|  49.9k|      cum_prob += token_probs[i];
  490|  49.9k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 50, False: 49.9k]
  ------------------
  491|     50|        return false;
  492|     50|      }
  493|   879M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 879M, False: 49.9k]
  ------------------
  494|   879M|        lut_table_[j] = i;
  495|   879M|      }
  496|  49.9k|      act_prob = cum_prob;
  497|  49.9k|    }
  498|    902|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 107, False: 795]
  ------------------
  499|    107|      return false;
  500|    107|    }
  501|    795|    return true;
  502|    902|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    504|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    504|    unsigned x;
  423|    504|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 48, False: 456]
  ------------------
  424|     48|      return 1;
  425|     48|    }
  426|    456|    ans_.buf = buf;
  427|    456|    x = buf[offset - 1] >> 6;
  428|    456|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 115, False: 341]
  ------------------
  429|    115|      ans_.buf_offset = offset - 1;
  430|    115|      ans_.state = buf[offset - 1] & 0x3F;
  431|    341|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 97, False: 244]
  ------------------
  432|     97|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 28, False: 69]
  ------------------
  433|     28|        return 1;
  434|     28|      }
  435|     69|      ans_.buf_offset = offset - 2;
  436|     69|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    244|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 86, False: 158]
  ------------------
  438|     86|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 36, False: 50]
  ------------------
  439|     36|        return 1;
  440|     36|      }
  441|     50|      ans_.buf_offset = offset - 3;
  442|     50|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|    158|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 158, False: 0]
  ------------------
  444|    158|      ans_.buf_offset = offset - 4;
  445|    158|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|    158|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    392|    ans_.state += l_rans_base;
  450|    392|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    392|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 64, False: 328]
  ------------------
  451|     64|      return 1;
  452|     64|    }
  453|    328|    return 0;
  454|    392|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|   880k|  inline int rans_read() {
  463|   880k|    unsigned rem;
  464|   880k|    unsigned quo;
  465|   880k|    struct rans_dec_sym sym;
  466|   884k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 681k, False: 202k]
  |  Branch (466:40): [True: 4.14k, False: 677k]
  ------------------
  467|  4.14k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  4.14k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  4.14k|    }
  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|   880k|    quo = ans_.state / rans_precision;
  472|   880k|    rem = ans_.state % rans_precision;
  473|   880k|    fetch_sym(&sym, rem);
  474|   880k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   880k|    return sym.val;
  476|   880k|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|   880k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   880k|    uint32_t symbol = lut_table_[rem];
  507|   880k|    out->val = symbol;
  508|   880k|    out->prob = probability_table_[symbol].prob;
  509|   880k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   880k|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    328|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|  1.21k|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|  1.21k|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|  1.21k|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 1.21k]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|  1.21k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|  1.21k|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.21k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 131, False: 1.08k]
  ------------------
   67|    131|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 9, False: 122]
  ------------------
   68|      9|      return false;
   69|      9|    }
   70|       |
   71|    131|  } else
   72|  1.08k|#endif
   73|  1.08k|  {
   74|  1.08k|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 37, False: 1.04k]
  ------------------
   75|     37|      return false;
   76|     37|    }
   77|  1.08k|  }
   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.17k|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 119, False: 1.05k]
  ------------------
   83|    119|    return false;
   84|    119|  }
   85|  1.05k|  probability_table_.resize(num_symbols_);
   86|  1.05k|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 310, False: 742]
  ------------------
   87|    310|    return true;
   88|    310|  }
   89|       |  // Decode the table.
   90|   103k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 102k, False: 450]
  ------------------
   91|   102k|    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|   102k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 63, False: 102k]
  ------------------
   95|     63|      return false;
   96|     63|    }
   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|   102k|    const int token = prob_data & 3;
  102|   102k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 21.2k, False: 81.4k]
  ------------------
  103|  21.2k|      const uint32_t offset = prob_data >> 2;
  104|  21.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 198, False: 21.0k]
  ------------------
  105|    198|        return false;
  106|    198|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   990k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 969k, False: 21.0k]
  ------------------
  109|   969k|        probability_table_[i + j] = 0;
  110|   969k|      }
  111|  21.0k|      i += offset;
  112|  81.4k|    } else {
  113|  81.4k|      const int extra_bytes = token;
  114|  81.4k|      uint32_t prob = prob_data >> 2;
  115|   156k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 74.8k, False: 81.3k]
  ------------------
  116|  74.8k|        uint8_t eb;
  117|  74.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 31, False: 74.8k]
  ------------------
  118|     31|          return false;
  119|     31|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  74.8k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  74.8k|      }
  124|  81.3k|      probability_table_[i] = prob;
  125|  81.3k|    }
  126|   102k|  }
  127|    450|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 132, False: 318]
  ------------------
  128|    132|    return false;
  129|    132|  }
  130|    318|  return true;
  131|    450|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    585|    DecoderBuffer *buffer) {
  136|    585|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    585|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    585|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    585|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 47, False: 538]
  ------------------
  140|     47|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 4, False: 43]
  ------------------
  141|      4|      return false;
  142|      4|    }
  143|       |
  144|     47|  } else
  145|    538|#endif
  146|    538|  {
  147|    538|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 16, False: 522]
  ------------------
  148|     16|      return false;
  149|     16|    }
  150|    538|  }
  151|    565|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 67, False: 498]
  ------------------
  152|     67|    return false;
  153|     67|  }
  154|    498|  const uint8_t *const data_head =
  155|    498|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    498|  buffer->Advance(bytes_encoded);
  158|    498|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 146, False: 352]
  ------------------
  159|    146|    return false;
  160|    146|  }
  161|    352|  return true;
  162|    498|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    408|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  12.4M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    288|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    288|  ans_.read_end();
  167|    288|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    527|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    527|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    527|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 527]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    527|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    527|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    527|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 47, False: 480]
  ------------------
   67|     47|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 6, False: 41]
  ------------------
   68|      6|      return false;
   69|      6|    }
   70|       |
   71|     47|  } else
   72|    480|#endif
   73|    480|  {
   74|    480|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 12, False: 468]
  ------------------
   75|     12|      return false;
   76|     12|    }
   77|    480|  }
   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: 44, False: 465]
  ------------------
   83|     44|    return false;
   84|     44|  }
   85|    465|  probability_table_.resize(num_symbols_);
   86|    465|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 25, False: 440]
  ------------------
   87|     25|    return true;
   88|     25|  }
   89|       |  // Decode the table.
   90|   867k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 867k, False: 314]
  ------------------
   91|   867k|    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|   867k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 53, False: 867k]
  ------------------
   95|     53|      return false;
   96|     53|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   867k|    const int token = prob_data & 3;
  102|   867k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 538k, False: 329k]
  ------------------
  103|   538k|      const uint32_t offset = prob_data >> 2;
  104|   538k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 48, False: 538k]
  ------------------
  105|     48|        return false;
  106|     48|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  27.9M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 27.4M, False: 538k]
  ------------------
  109|  27.4M|        probability_table_[i + j] = 0;
  110|  27.4M|      }
  111|   538k|      i += offset;
  112|   538k|    } else {
  113|   329k|      const int extra_bytes = token;
  114|   329k|      uint32_t prob = prob_data >> 2;
  115|   582k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 253k, False: 329k]
  ------------------
  116|   253k|        uint8_t eb;
  117|   253k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 25, False: 253k]
  ------------------
  118|     25|          return false;
  119|     25|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   253k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   253k|      }
  124|   329k|      probability_table_[i] = prob;
  125|   329k|    }
  126|   867k|  }
  127|    314|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 123, False: 191]
  ------------------
  128|    123|    return false;
  129|    123|  }
  130|    191|  return true;
  131|    314|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|    216|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|    191|    DecoderBuffer *buffer) {
  136|    191|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    191|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    191|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    191|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 3, False: 188]
  ------------------
  140|      3|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 3]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      3|  } else
  145|    188|#endif
  146|    188|  {
  147|    188|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 12, False: 176]
  ------------------
  148|     12|      return false;
  149|     12|    }
  150|    188|  }
  151|    179|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 33, False: 146]
  ------------------
  152|     33|    return false;
  153|     33|  }
  154|    146|  const uint8_t *const data_head =
  155|    146|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    146|  buffer->Advance(bytes_encoded);
  158|    146|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 34, False: 112]
  ------------------
  159|     34|    return false;
  160|     34|  }
  161|    112|  return true;
  162|    146|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  20.1M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|    112|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    112|  ans_.read_end();
  167|    112|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    451|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    451|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    451|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 451]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    451|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    451|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    451|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 43, False: 408]
  ------------------
   67|     43|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 43]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     43|  } else
   72|    408|#endif
   73|    408|  {
   74|    408|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 9, False: 399]
  ------------------
   75|      9|      return false;
   76|      9|    }
   77|    408|  }
   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|    442|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 33, False: 409]
  ------------------
   83|     33|    return false;
   84|     33|  }
   85|    409|  probability_table_.resize(num_symbols_);
   86|    409|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 397]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|   387k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 387k, False: 302]
  ------------------
   91|   387k|    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|   387k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 33, False: 387k]
  ------------------
   95|     33|      return false;
   96|     33|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   387k|    const int token = prob_data & 3;
  102|   387k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 283k, False: 103k]
  ------------------
  103|   283k|      const uint32_t offset = prob_data >> 2;
  104|   283k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 43, False: 283k]
  ------------------
  105|     43|        return false;
  106|     43|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.93M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.64M, False: 283k]
  ------------------
  109|  3.64M|        probability_table_[i + j] = 0;
  110|  3.64M|      }
  111|   283k|      i += offset;
  112|   283k|    } else {
  113|   103k|      const int extra_bytes = token;
  114|   103k|      uint32_t prob = prob_data >> 2;
  115|   188k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 84.9k, False: 103k]
  ------------------
  116|  84.9k|        uint8_t eb;
  117|  84.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 19, False: 84.9k]
  ------------------
  118|     19|          return false;
  119|     19|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  84.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  84.9k|      }
  124|   103k|      probability_table_[i] = prob;
  125|   103k|    }
  126|   387k|  }
  127|    302|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 37, False: 265]
  ------------------
  128|     37|    return false;
  129|     37|  }
  130|    265|  return true;
  131|    302|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    277|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    265|    DecoderBuffer *buffer) {
  136|    265|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    265|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    265|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    265|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 18, False: 247]
  ------------------
  140|     18|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 18]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     18|  } else
  145|    247|#endif
  146|    247|  {
  147|    247|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 242]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|    247|  }
  151|    260|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 52, False: 208]
  ------------------
  152|     52|    return false;
  153|     52|  }
  154|    208|  const uint8_t *const data_head =
  155|    208|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    208|  buffer->Advance(bytes_encoded);
  158|    208|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 39, False: 169]
  ------------------
  159|     39|    return false;
  160|     39|  }
  161|    169|  return true;
  162|    208|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  2.07M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|    169|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    169|  ans_.read_end();
  167|    169|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    476|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    476|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    476|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 476]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    476|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    476|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    476|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 55, False: 421]
  ------------------
   67|     55|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 54]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     55|  } else
   72|    421|#endif
   73|    421|  {
   74|    421|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 417]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    421|  }
   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|    471|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 456]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    456|  probability_table_.resize(num_symbols_);
   86|    456|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 444]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|   224k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 224k, False: 360]
  ------------------
   91|   224k|    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|   224k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 42, False: 224k]
  ------------------
   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|   224k|    const int token = prob_data & 3;
  102|   224k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 60.4k, False: 163k]
  ------------------
  103|  60.4k|      const uint32_t offset = prob_data >> 2;
  104|  60.4k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 29, False: 60.4k]
  ------------------
  105|     29|        return false;
  106|     29|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.34M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.28M, False: 60.4k]
  ------------------
  109|  2.28M|        probability_table_[i + j] = 0;
  110|  2.28M|      }
  111|  60.4k|      i += offset;
  112|   163k|    } else {
  113|   163k|      const int extra_bytes = token;
  114|   163k|      uint32_t prob = prob_data >> 2;
  115|   287k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 123k, False: 163k]
  ------------------
  116|   123k|        uint8_t eb;
  117|   123k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 123k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   123k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   123k|      }
  124|   163k|      probability_table_[i] = prob;
  125|   163k|    }
  126|   224k|  }
  127|    360|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 40, False: 320]
  ------------------
  128|     40|    return false;
  129|     40|  }
  130|    320|  return true;
  131|    360|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|    332|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|    320|    DecoderBuffer *buffer) {
  136|    320|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    320|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    320|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    320|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 41, False: 279]
  ------------------
  140|     41|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 41]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     41|  } else
  145|    279|#endif
  146|    279|  {
  147|    279|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 15, False: 264]
  ------------------
  148|     15|      return false;
  149|     15|    }
  150|    279|  }
  151|    305|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 105, False: 200]
  ------------------
  152|    105|    return false;
  153|    105|  }
  154|    200|  const uint8_t *const data_head =
  155|    200|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    200|  buffer->Advance(bytes_encoded);
  158|    200|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 59, False: 141]
  ------------------
  159|     59|    return false;
  160|     59|  }
  161|    141|  return true;
  162|    200|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|  4.62M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|    141|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    141|  ans_.read_end();
  167|    141|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    322|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    322|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    322|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 322]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    322|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    322|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    322|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 9, False: 313]
  ------------------
   67|      9|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 9]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|      9|  } else
   72|    313|#endif
   73|    313|  {
   74|    313|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 307]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    313|  }
   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|    316|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 17, False: 299]
  ------------------
   83|     17|    return false;
   84|     17|  }
   85|    299|  probability_table_.resize(num_symbols_);
   86|    299|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 17, False: 282]
  ------------------
   87|     17|    return true;
   88|     17|  }
   89|       |  // Decode the table.
   90|   447k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 446k, False: 207]
  ------------------
   91|   446k|    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|   446k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 28, False: 446k]
  ------------------
   95|     28|      return false;
   96|     28|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   446k|    const int token = prob_data & 3;
  102|   446k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 435k, False: 11.6k]
  ------------------
  103|   435k|      const uint32_t offset = prob_data >> 2;
  104|   435k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 37, False: 435k]
  ------------------
  105|     37|        return false;
  106|     37|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  24.9M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 24.4M, False: 435k]
  ------------------
  109|  24.4M|        probability_table_[i + j] = 0;
  110|  24.4M|      }
  111|   435k|      i += offset;
  112|   435k|    } else {
  113|  11.6k|      const int extra_bytes = token;
  114|  11.6k|      uint32_t prob = prob_data >> 2;
  115|  19.7k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 8.06k, False: 11.6k]
  ------------------
  116|  8.06k|        uint8_t eb;
  117|  8.06k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 8.05k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  8.05k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  8.05k|      }
  124|  11.6k|      probability_table_[i] = prob;
  125|  11.6k|    }
  126|   446k|  }
  127|    207|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 26, False: 181]
  ------------------
  128|     26|    return false;
  129|     26|  }
  130|    181|  return true;
  131|    207|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    198|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|    181|    DecoderBuffer *buffer) {
  136|    181|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    181|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    181|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    181|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 180]
  ------------------
  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|    180|#endif
  146|    180|  {
  147|    180|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 171]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    180|  }
  151|    172|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 13, False: 159]
  ------------------
  152|     13|    return false;
  153|     13|  }
  154|    159|  const uint8_t *const data_head =
  155|    159|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    159|  buffer->Advance(bytes_encoded);
  158|    159|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 43, False: 116]
  ------------------
  159|     43|    return false;
  160|     43|  }
  161|    116|  return true;
  162|    159|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  6.66M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|    116|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    116|  ans_.read_end();
  167|    116|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    377|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    377|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    377|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 377]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    377|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    377|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    377|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 62, False: 315]
  ------------------
   67|     62|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 62]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     62|  } else
   72|    315|#endif
   73|    315|  {
   74|    315|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 309]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    315|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    371|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 34, False: 337]
  ------------------
   83|     34|    return false;
   84|     34|  }
   85|    337|  probability_table_.resize(num_symbols_);
   86|    337|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 8, False: 329]
  ------------------
   87|      8|    return true;
   88|      8|  }
   89|       |  // Decode the table.
   90|  12.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 11.9k, False: 258]
  ------------------
   91|  11.9k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  11.9k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 11.8k]
  ------------------
   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|  11.8k|    const int token = prob_data & 3;
  102|  11.8k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 4.66k, False: 7.20k]
  ------------------
  103|  4.66k|      const uint32_t offset = prob_data >> 2;
  104|  4.66k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 24, False: 4.64k]
  ------------------
  105|     24|        return false;
  106|     24|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   179k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 174k, False: 4.64k]
  ------------------
  109|   174k|        probability_table_[i + j] = 0;
  110|   174k|      }
  111|  4.64k|      i += offset;
  112|  7.20k|    } else {
  113|  7.20k|      const int extra_bytes = token;
  114|  7.20k|      uint32_t prob = prob_data >> 2;
  115|  11.5k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 4.39k, False: 7.19k]
  ------------------
  116|  4.39k|        uint8_t eb;
  117|  4.39k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 4.38k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  4.38k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  4.38k|      }
  124|  7.19k|      probability_table_[i] = prob;
  125|  7.19k|    }
  126|  11.8k|  }
  127|    258|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 20, False: 238]
  ------------------
  128|     20|    return false;
  129|     20|  }
  130|    238|  return true;
  131|    258|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|    246|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|    238|    DecoderBuffer *buffer) {
  136|    238|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    238|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    238|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    238|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 41, False: 197]
  ------------------
  140|     41|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 39]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     41|  } else
  145|    197|#endif
  146|    197|  {
  147|    197|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 5, False: 192]
  ------------------
  148|      5|      return false;
  149|      5|    }
  150|    197|  }
  151|    231|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 71, False: 160]
  ------------------
  152|     71|    return false;
  153|     71|  }
  154|    160|  const uint8_t *const data_head =
  155|    160|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    160|  buffer->Advance(bytes_encoded);
  158|    160|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 40, False: 120]
  ------------------
  159|     40|    return false;
  160|     40|  }
  161|    120|  return true;
  162|    160|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  5.54M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|    120|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    120|  ans_.read_end();
  167|    120|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    341|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    341|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    341|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 341]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    341|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    341|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    341|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 45, False: 296]
  ------------------
   67|     45|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 45]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     45|  } else
   72|    296|#endif
   73|    296|  {
   74|    296|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 289]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    296|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    334|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 8, False: 326]
  ------------------
   83|      8|    return false;
   84|      8|  }
   85|    326|  probability_table_.resize(num_symbols_);
   86|    326|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 10, False: 316]
  ------------------
   87|     10|    return true;
   88|     10|  }
   89|       |  // Decode the table.
   90|  1.10M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.10M, False: 201]
  ------------------
   91|  1.10M|    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.10M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 1.10M]
  ------------------
   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|  1.10M|    const int token = prob_data & 3;
  102|  1.10M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 318k, False: 791k]
  ------------------
  103|   318k|      const uint32_t offset = prob_data >> 2;
  104|   318k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 58, False: 318k]
  ------------------
  105|     58|        return false;
  106|     58|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  14.5M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 14.2M, False: 318k]
  ------------------
  109|  14.2M|        probability_table_[i + j] = 0;
  110|  14.2M|      }
  111|   318k|      i += offset;
  112|   791k|    } else {
  113|   791k|      const int extra_bytes = token;
  114|   791k|      uint32_t prob = prob_data >> 2;
  115|  1.27M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 485k, False: 791k]
  ------------------
  116|   485k|        uint8_t eb;
  117|   485k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 21, False: 485k]
  ------------------
  118|     21|          return false;
  119|     21|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   485k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   485k|      }
  124|   791k|      probability_table_[i] = prob;
  125|   791k|    }
  126|  1.10M|  }
  127|    201|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 21, False: 180]
  ------------------
  128|     21|    return false;
  129|     21|  }
  130|    180|  return true;
  131|    201|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|    190|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|    180|    DecoderBuffer *buffer) {
  136|    180|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    180|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    180|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    180|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 26, False: 154]
  ------------------
  140|     26|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 24]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     26|  } else
  145|    154|#endif
  146|    154|  {
  147|    154|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 10, False: 144]
  ------------------
  148|     10|      return false;
  149|     10|    }
  150|    154|  }
  151|    168|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 48, False: 120]
  ------------------
  152|     48|    return false;
  153|     48|  }
  154|    120|  const uint8_t *const data_head =
  155|    120|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    120|  buffer->Advance(bytes_encoded);
  158|    120|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 31, False: 89]
  ------------------
  159|     31|    return false;
  160|     31|  }
  161|     89|  return true;
  162|    120|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  12.9M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|     89|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     89|  ans_.read_end();
  167|     89|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    395|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    395|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    395|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 395]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    395|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    395|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    395|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 70, False: 325]
  ------------------
   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|    325|#endif
   73|    325|  {
   74|    325|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 315]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    325|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    383|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 28, False: 355]
  ------------------
   83|     28|    return false;
   84|     28|  }
   85|    355|  probability_table_.resize(num_symbols_);
   86|    355|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 344]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|   833k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 833k, False: 241]
  ------------------
   91|   833k|    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|   833k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 48, False: 833k]
  ------------------
   95|     48|      return false;
   96|     48|    }
   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|   833k|    const int token = prob_data & 3;
  102|   833k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 218k, False: 614k]
  ------------------
  103|   218k|      const uint32_t offset = prob_data >> 2;
  104|   218k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 37, False: 218k]
  ------------------
  105|     37|        return false;
  106|     37|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  11.0M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 10.8M, False: 218k]
  ------------------
  109|  10.8M|        probability_table_[i + j] = 0;
  110|  10.8M|      }
  111|   218k|      i += offset;
  112|   614k|    } else {
  113|   614k|      const int extra_bytes = token;
  114|   614k|      uint32_t prob = prob_data >> 2;
  115|   794k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 179k, False: 614k]
  ------------------
  116|   179k|        uint8_t eb;
  117|   179k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 18, False: 179k]
  ------------------
  118|     18|          return false;
  119|     18|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   179k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   179k|      }
  124|   614k|      probability_table_[i] = prob;
  125|   614k|    }
  126|   833k|  }
  127|    241|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 21, False: 220]
  ------------------
  128|     21|    return false;
  129|     21|  }
  130|    220|  return true;
  131|    241|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|    231|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|    220|    DecoderBuffer *buffer) {
  136|    220|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    220|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    220|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    220|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 32, False: 188]
  ------------------
  140|     32|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 32]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     32|  } else
  145|    188|#endif
  146|    188|  {
  147|    188|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 188]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    188|  }
  151|    220|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 64, False: 156]
  ------------------
  152|     64|    return false;
  153|     64|  }
  154|    156|  const uint8_t *const data_head =
  155|    156|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    156|  buffer->Advance(bytes_encoded);
  158|    156|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 42, False: 114]
  ------------------
  159|     42|    return false;
  160|     42|  }
  161|    114|  return true;
  162|    156|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  20.8M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|    114|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    114|  ans_.read_end();
  167|    114|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    426|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    426|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    426|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 426]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    426|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    426|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    426|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 25, False: 401]
  ------------------
   67|     25|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 25]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     25|  } else
   72|    401|#endif
   73|    401|  {
   74|    401|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 390]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    401|  }
   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|    415|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 21, False: 394]
  ------------------
   83|     21|    return false;
   84|     21|  }
   85|    394|  probability_table_.resize(num_symbols_);
   86|    394|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 385]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  44.8k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 44.5k, False: 319]
  ------------------
   91|  44.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|  44.5k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 31, False: 44.5k]
  ------------------
   95|     31|      return false;
   96|     31|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  44.5k|    const int token = prob_data & 3;
  102|  44.5k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 17.8k, False: 26.6k]
  ------------------
  103|  17.8k|      const uint32_t offset = prob_data >> 2;
  104|  17.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 17.8k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   606k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 588k, False: 17.8k]
  ------------------
  109|   588k|        probability_table_[i + j] = 0;
  110|   588k|      }
  111|  17.8k|      i += offset;
  112|  26.6k|    } else {
  113|  26.6k|      const int extra_bytes = token;
  114|  26.6k|      uint32_t prob = prob_data >> 2;
  115|  47.4k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 20.8k, False: 26.6k]
  ------------------
  116|  20.8k|        uint8_t eb;
  117|  20.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 20.8k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  20.8k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  20.8k|      }
  124|  26.6k|      probability_table_[i] = prob;
  125|  26.6k|    }
  126|  44.5k|  }
  127|    319|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 46, False: 273]
  ------------------
  128|     46|    return false;
  129|     46|  }
  130|    273|  return true;
  131|    319|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|    282|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|    273|    DecoderBuffer *buffer) {
  136|    273|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    273|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    273|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    273|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 8, False: 265]
  ------------------
  140|      8|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 7]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      8|  } else
  145|    265|#endif
  146|    265|  {
  147|    265|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 262]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|    265|  }
  151|    269|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 61, False: 208]
  ------------------
  152|     61|    return false;
  153|     61|  }
  154|    208|  const uint8_t *const data_head =
  155|    208|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    208|  buffer->Advance(bytes_encoded);
  158|    208|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 54, False: 154]
  ------------------
  159|     54|    return false;
  160|     54|  }
  161|    154|  return true;
  162|    208|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|  6.74M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|    154|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    154|  ans_.read_end();
  167|    154|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|    373|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|    373|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    373|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 373]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    373|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    373|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    373|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 29, False: 344]
  ------------------
   67|     29|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 27]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     29|  } else
   72|    344|#endif
   73|    344|  {
   74|    344|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 13, False: 331]
  ------------------
   75|     13|      return false;
   76|     13|    }
   77|    344|  }
   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|    358|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 14, False: 344]
  ------------------
   83|     14|    return false;
   84|     14|  }
   85|    344|  probability_table_.resize(num_symbols_);
   86|    344|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 341]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|   156k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 156k, False: 251]
  ------------------
   91|   156k|    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|   156k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 38, False: 156k]
  ------------------
   95|     38|      return false;
   96|     38|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   156k|    const int token = prob_data & 3;
  102|   156k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 10.9k, False: 145k]
  ------------------
  103|  10.9k|      const uint32_t offset = prob_data >> 2;
  104|  10.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 30, False: 10.8k]
  ------------------
  105|     30|        return false;
  106|     30|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   315k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 304k, False: 10.8k]
  ------------------
  109|   304k|        probability_table_[i + j] = 0;
  110|   304k|      }
  111|  10.8k|      i += offset;
  112|   145k|    } else {
  113|   145k|      const int extra_bytes = token;
  114|   145k|      uint32_t prob = prob_data >> 2;
  115|   289k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 144k, False: 145k]
  ------------------
  116|   144k|        uint8_t eb;
  117|   144k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 144k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   144k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   144k|      }
  124|   145k|      probability_table_[i] = prob;
  125|   145k|    }
  126|   156k|  }
  127|    251|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 63, False: 188]
  ------------------
  128|     63|    return false;
  129|     63|  }
  130|    188|  return true;
  131|    251|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|    191|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|    188|    DecoderBuffer *buffer) {
  136|    188|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    188|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    188|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    188|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 18, False: 170]
  ------------------
  140|     18|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 17]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     18|  } else
  145|    170|#endif
  146|    170|  {
  147|    170|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 168]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    170|  }
  151|    185|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 59, False: 126]
  ------------------
  152|     59|    return false;
  153|     59|  }
  154|    126|  const uint8_t *const data_head =
  155|    126|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    126|  buffer->Advance(bytes_encoded);
  158|    126|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 63, False: 63]
  ------------------
  159|     63|    return false;
  160|     63|  }
  161|     63|  return true;
  162|    126|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   535k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     63|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     63|  ans_.read_end();
  167|     63|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    313|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    313|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    313|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 313]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    313|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    313|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    313|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 22, False: 291]
  ------------------
   67|     22|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 22]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     22|  } else
   72|    291|#endif
   73|    291|  {
   74|    291|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 11, False: 280]
  ------------------
   75|     11|      return false;
   76|     11|    }
   77|    291|  }
   78|       |  // Check that decoded number of symbols is not unreasonably high. Remaining
   79|       |  // buffer size must be at least |num_symbols| / 64 bytes to contain the
   80|       |  // probability table. The |prob_data| below is one byte but it can be
   81|       |  // theoretically stored for each 64th symbol.
   82|    302|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 19, False: 283]
  ------------------
   83|     19|    return false;
   84|     19|  }
   85|    283|  probability_table_.resize(num_symbols_);
   86|    283|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 14, False: 269]
  ------------------
   87|     14|    return true;
   88|     14|  }
   89|       |  // Decode the table.
   90|  31.3k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 31.1k, False: 193]
  ------------------
   91|  31.1k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  31.1k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 31, False: 31.1k]
  ------------------
   95|     31|      return false;
   96|     31|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  31.1k|    const int token = prob_data & 3;
  102|  31.1k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 10.3k, False: 20.7k]
  ------------------
  103|  10.3k|      const uint32_t offset = prob_data >> 2;
  104|  10.3k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 33, False: 10.2k]
  ------------------
  105|     33|        return false;
  106|     33|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   417k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 407k, False: 10.2k]
  ------------------
  109|   407k|        probability_table_[i + j] = 0;
  110|   407k|      }
  111|  10.2k|      i += offset;
  112|  20.7k|    } else {
  113|  20.7k|      const int extra_bytes = token;
  114|  20.7k|      uint32_t prob = prob_data >> 2;
  115|  36.4k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 15.6k, False: 20.7k]
  ------------------
  116|  15.6k|        uint8_t eb;
  117|  15.6k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 15.6k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  15.6k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  15.6k|      }
  124|  20.7k|      probability_table_[i] = prob;
  125|  20.7k|    }
  126|  31.1k|  }
  127|    193|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 57, False: 136]
  ------------------
  128|     57|    return false;
  129|     57|  }
  130|    136|  return true;
  131|    193|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|    150|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|    136|    DecoderBuffer *buffer) {
  136|    136|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    136|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    136|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    136|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 136]
  ------------------
  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|    136|#endif
  146|    136|  {
  147|    136|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 9, False: 127]
  ------------------
  148|      9|      return false;
  149|      9|    }
  150|    136|  }
  151|    127|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 49, False: 78]
  ------------------
  152|     49|    return false;
  153|     49|  }
  154|     78|  const uint8_t *const data_head =
  155|     78|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     78|  buffer->Advance(bytes_encoded);
  158|     78|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 22, False: 56]
  ------------------
  159|     22|    return false;
  160|     22|  }
  161|     56|  return true;
  162|     78|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|   381k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     56|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     56|  ans_.read_end();
  167|     56|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    347|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    347|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    347|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 347]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    347|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    347|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    347|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 35, False: 312]
  ------------------
   67|     35|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 35]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     35|  } else
   72|    312|#endif
   73|    312|  {
   74|    312|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 14, False: 298]
  ------------------
   75|     14|      return false;
   76|     14|    }
   77|    312|  }
   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|    333|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 13, False: 320]
  ------------------
   83|     13|    return false;
   84|     13|  }
   85|    320|  probability_table_.resize(num_symbols_);
   86|    320|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 5, False: 315]
  ------------------
   87|      5|    return true;
   88|      5|  }
   89|       |  // Decode the table.
   90|   930k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 930k, False: 218]
  ------------------
   91|   930k|    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|   930k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 46, False: 930k]
  ------------------
   95|     46|      return false;
   96|     46|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|   930k|    const int token = prob_data & 3;
  102|   930k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 687k, False: 242k]
  ------------------
  103|   687k|      const uint32_t offset = prob_data >> 2;
  104|   687k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 35, False: 687k]
  ------------------
  105|     35|        return false;
  106|     35|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  29.4M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 28.7M, False: 687k]
  ------------------
  109|  28.7M|        probability_table_[i + j] = 0;
  110|  28.7M|      }
  111|   687k|      i += offset;
  112|   687k|    } else {
  113|   242k|      const int extra_bytes = token;
  114|   242k|      uint32_t prob = prob_data >> 2;
  115|   455k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 212k, False: 242k]
  ------------------
  116|   212k|        uint8_t eb;
  117|   212k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 16, False: 212k]
  ------------------
  118|     16|          return false;
  119|     16|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   212k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   212k|      }
  124|   242k|      probability_table_[i] = prob;
  125|   242k|    }
  126|   930k|  }
  127|    218|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 65, False: 153]
  ------------------
  128|     65|    return false;
  129|     65|  }
  130|    153|  return true;
  131|    218|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|    158|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|    153|    DecoderBuffer *buffer) {
  136|    153|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    153|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    153|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    153|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 137]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 2, False: 14]
  ------------------
  141|      2|      return false;
  142|      2|    }
  143|       |
  144|     16|  } else
  145|    137|#endif
  146|    137|  {
  147|    137|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 2, False: 135]
  ------------------
  148|      2|      return false;
  149|      2|    }
  150|    137|  }
  151|    149|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 63, False: 86]
  ------------------
  152|     63|    return false;
  153|     63|  }
  154|     86|  const uint8_t *const data_head =
  155|     86|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     86|  buffer->Advance(bytes_encoded);
  158|     86|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 29, False: 57]
  ------------------
  159|     29|    return false;
  160|     29|  }
  161|     57|  return true;
  162|     86|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|  62.5k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     57|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     57|  ans_.read_end();
  167|     57|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    357|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    357|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    357|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 357]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    357|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    357|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    357|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 20, False: 337]
  ------------------
   67|     20|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 20]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     20|  } else
   72|    337|#endif
   73|    337|  {
   74|    337|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 13, False: 324]
  ------------------
   75|     13|      return false;
   76|     13|    }
   77|    337|  }
   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|    344|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 329]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    329|  probability_table_.resize(num_symbols_);
   86|    329|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 12, False: 317]
  ------------------
   87|     12|    return true;
   88|     12|  }
   89|       |  // Decode the table.
   90|  1.23M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.23M, False: 232]
  ------------------
   91|  1.23M|    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.23M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 35, False: 1.23M]
  ------------------
   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|  1.23M|    const int token = prob_data & 3;
  102|  1.23M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 578k, False: 659k]
  ------------------
  103|   578k|      const uint32_t offset = prob_data >> 2;
  104|   578k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 28, False: 578k]
  ------------------
  105|     28|        return false;
  106|     28|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  31.5M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 30.9M, False: 578k]
  ------------------
  109|  30.9M|        probability_table_[i + j] = 0;
  110|  30.9M|      }
  111|   578k|      i += offset;
  112|   659k|    } else {
  113|   659k|      const int extra_bytes = token;
  114|   659k|      uint32_t prob = prob_data >> 2;
  115|  1.04M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 383k, False: 659k]
  ------------------
  116|   383k|        uint8_t eb;
  117|   383k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 383k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   383k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   383k|      }
  124|   659k|      probability_table_[i] = prob;
  125|   659k|    }
  126|  1.23M|  }
  127|    232|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 77, False: 155]
  ------------------
  128|     77|    return false;
  129|     77|  }
  130|    155|  return true;
  131|    232|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|    167|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|    155|    DecoderBuffer *buffer) {
  136|    155|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    155|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    155|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    155|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 155]
  ------------------
  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|    155|#endif
  146|    155|  {
  147|    155|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 154]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|    155|  }
  151|    154|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 58, False: 96]
  ------------------
  152|     58|    return false;
  153|     58|  }
  154|     96|  const uint8_t *const data_head =
  155|     96|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     96|  buffer->Advance(bytes_encoded);
  158|     96|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 26, False: 70]
  ------------------
  159|     26|    return false;
  160|     26|  }
  161|     70|  return true;
  162|     96|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|  78.5k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     70|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     70|  ans_.read_end();
  167|     70|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    302|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    302|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    302|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 302]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    302|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    302|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    302|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 47, False: 255]
  ------------------
   67|     47|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 46]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     47|  } else
   72|    255|#endif
   73|    255|  {
   74|    255|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 249]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    255|  }
   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|    295|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 16, False: 279]
  ------------------
   83|     16|    return false;
   84|     16|  }
   85|    279|  probability_table_.resize(num_symbols_);
   86|    279|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 268]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|   667k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 667k, False: 177]
  ------------------
   91|   667k|    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|   667k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 42, False: 667k]
  ------------------
   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|   667k|    const int token = prob_data & 3;
  102|   667k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 484k, False: 182k]
  ------------------
  103|   484k|      const uint32_t offset = prob_data >> 2;
  104|   484k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 27, False: 484k]
  ------------------
  105|     27|        return false;
  106|     27|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  19.5M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 19.0M, False: 484k]
  ------------------
  109|  19.0M|        probability_table_[i + j] = 0;
  110|  19.0M|      }
  111|   484k|      i += offset;
  112|   484k|    } else {
  113|   182k|      const int extra_bytes = token;
  114|   182k|      uint32_t prob = prob_data >> 2;
  115|   317k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 134k, False: 182k]
  ------------------
  116|   134k|        uint8_t eb;
  117|   134k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 134k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   134k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   134k|      }
  124|   182k|      probability_table_[i] = prob;
  125|   182k|    }
  126|   667k|  }
  127|    177|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 29, False: 148]
  ------------------
  128|     29|    return false;
  129|     29|  }
  130|    148|  return true;
  131|    177|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|    159|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|    148|    DecoderBuffer *buffer) {
  136|    148|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    148|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    148|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    148|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 19, False: 129]
  ------------------
  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|    129|#endif
  146|    129|  {
  147|    129|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 6, False: 123]
  ------------------
  148|      6|      return false;
  149|      6|    }
  150|    129|  }
  151|    141|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 46, False: 95]
  ------------------
  152|     46|    return false;
  153|     46|  }
  154|     95|  const uint8_t *const data_head =
  155|     95|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     95|  buffer->Advance(bytes_encoded);
  158|     95|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 35, False: 60]
  ------------------
  159|     35|    return false;
  160|     35|  }
  161|     60|  return true;
  162|     95|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  81.1k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     60|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     60|  ans_.read_end();
  167|     60|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    346|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    346|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    346|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 346]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    346|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    346|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    346|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 71, False: 275]
  ------------------
   67|     71|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 5, False: 66]
  ------------------
   68|      5|      return false;
   69|      5|    }
   70|       |
   71|     71|  } else
   72|    275|#endif
   73|    275|  {
   74|    275|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 4, False: 271]
  ------------------
   75|      4|      return false;
   76|      4|    }
   77|    275|  }
   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|    337|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 23, False: 314]
  ------------------
   83|     23|    return false;
   84|     23|  }
   85|    314|  probability_table_.resize(num_symbols_);
   86|    314|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 305]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|  1.56M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.56M, False: 224]
  ------------------
   91|  1.56M|    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.56M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 31, False: 1.56M]
  ------------------
   95|     31|      return false;
   96|     31|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.56M|    const int token = prob_data & 3;
  102|  1.56M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 1.39M, False: 164k]
  ------------------
  103|  1.39M|      const uint32_t offset = prob_data >> 2;
  104|  1.39M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 32, False: 1.39M]
  ------------------
  105|     32|        return false;
  106|     32|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  81.9M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 80.5M, False: 1.39M]
  ------------------
  109|  80.5M|        probability_table_[i + j] = 0;
  110|  80.5M|      }
  111|  1.39M|      i += offset;
  112|  1.39M|    } else {
  113|   164k|      const int extra_bytes = token;
  114|   164k|      uint32_t prob = prob_data >> 2;
  115|   289k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 124k, False: 164k]
  ------------------
  116|   124k|        uint8_t eb;
  117|   124k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 18, False: 124k]
  ------------------
  118|     18|          return false;
  119|     18|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   124k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   124k|      }
  124|   164k|      probability_table_[i] = prob;
  125|   164k|    }
  126|  1.56M|  }
  127|    224|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 38, False: 186]
  ------------------
  128|     38|    return false;
  129|     38|  }
  130|    186|  return true;
  131|    224|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|    195|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|    186|    DecoderBuffer *buffer) {
  136|    186|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    186|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    186|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    186|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 38, False: 148]
  ------------------
  140|     38|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 37]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     38|  } else
  145|    148|#endif
  146|    148|  {
  147|    148|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 6, False: 142]
  ------------------
  148|      6|      return false;
  149|      6|    }
  150|    148|  }
  151|    179|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 58, False: 121]
  ------------------
  152|     58|    return false;
  153|     58|  }
  154|    121|  const uint8_t *const data_head =
  155|    121|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    121|  buffer->Advance(bytes_encoded);
  158|    121|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 47, False: 74]
  ------------------
  159|     47|    return false;
  160|     47|  }
  161|     74|  return true;
  162|    121|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|   297k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     74|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     74|  ans_.read_end();
  167|     74|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    288|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    288|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    288|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 288]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    288|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    288|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    288|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 29, False: 259]
  ------------------
   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|    259|#endif
   73|    259|  {
   74|    259|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 10, False: 249]
  ------------------
   75|     10|      return false;
   76|     10|    }
   77|    259|  }
   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|    277|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 15, False: 262]
  ------------------
   83|     15|    return false;
   84|     15|  }
   85|    262|  probability_table_.resize(num_symbols_);
   86|    262|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 6, False: 256]
  ------------------
   87|      6|    return true;
   88|      6|  }
   89|       |  // Decode the table.
   90|   444k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 444k, False: 185]
  ------------------
   91|   444k|    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|   444k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 36, False: 444k]
  ------------------
   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|   444k|    const int token = prob_data & 3;
  102|   444k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 65.5k, False: 378k]
  ------------------
  103|  65.5k|      const uint32_t offset = prob_data >> 2;
  104|  65.5k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 18, False: 65.5k]
  ------------------
  105|     18|        return false;
  106|     18|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.19M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.12M, False: 65.5k]
  ------------------
  109|  2.12M|        probability_table_[i + j] = 0;
  110|  2.12M|      }
  111|  65.5k|      i += offset;
  112|   378k|    } else {
  113|   378k|      const int extra_bytes = token;
  114|   378k|      uint32_t prob = prob_data >> 2;
  115|   712k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 334k, False: 378k]
  ------------------
  116|   334k|        uint8_t eb;
  117|   334k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 17, False: 334k]
  ------------------
  118|     17|          return false;
  119|     17|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   334k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   334k|      }
  124|   378k|      probability_table_[i] = prob;
  125|   378k|    }
  126|   444k|  }
  127|    185|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 32, False: 153]
  ------------------
  128|     32|    return false;
  129|     32|  }
  130|    153|  return true;
  131|    185|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|    159|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|    153|    DecoderBuffer *buffer) {
  136|    153|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    153|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    153|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    153|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 7, False: 146]
  ------------------
  140|      7|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 6]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|      7|  } else
  145|    146|#endif
  146|    146|  {
  147|    146|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 146]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    146|  }
  151|    152|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 58, False: 94]
  ------------------
  152|     58|    return false;
  153|     58|  }
  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: 33, False: 61]
  ------------------
  159|     33|    return false;
  160|     33|  }
  161|     61|  return true;
  162|     94|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|   135k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     61|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     61|  ans_.read_end();
  167|     61|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    296|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    296|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    296|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 296]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    296|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    296|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    296|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 39, False: 257]
  ------------------
   67|     39|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 2, False: 37]
  ------------------
   68|      2|      return false;
   69|      2|    }
   70|       |
   71|     39|  } else
   72|    257|#endif
   73|    257|  {
   74|    257|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 6, False: 251]
  ------------------
   75|      6|      return false;
   76|      6|    }
   77|    257|  }
   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|    288|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 17, False: 271]
  ------------------
   83|     17|    return false;
   84|     17|  }
   85|    271|  probability_table_.resize(num_symbols_);
   86|    271|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 11, False: 260]
  ------------------
   87|     11|    return true;
   88|     11|  }
   89|       |  // Decode the table.
   90|  16.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 16.4k, False: 185]
  ------------------
   91|  16.4k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  16.4k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 35, False: 16.3k]
  ------------------
   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|  16.3k|    const int token = prob_data & 3;
  102|  16.3k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 5.19k, False: 11.1k]
  ------------------
  103|  5.19k|      const uint32_t offset = prob_data >> 2;
  104|  5.19k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 18, False: 5.18k]
  ------------------
  105|     18|        return false;
  106|     18|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   175k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 170k, False: 5.18k]
  ------------------
  109|   170k|        probability_table_[i + j] = 0;
  110|   170k|      }
  111|  5.18k|      i += offset;
  112|  11.1k|    } else {
  113|  11.1k|      const int extra_bytes = token;
  114|  11.1k|      uint32_t prob = prob_data >> 2;
  115|  19.8k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 8.67k, False: 11.1k]
  ------------------
  116|  8.67k|        uint8_t eb;
  117|  8.67k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 22, False: 8.65k]
  ------------------
  118|     22|          return false;
  119|     22|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  8.65k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  8.65k|      }
  124|  11.1k|      probability_table_[i] = prob;
  125|  11.1k|    }
  126|  16.3k|  }
  127|    185|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 28, False: 157]
  ------------------
  128|     28|    return false;
  129|     28|  }
  130|    157|  return true;
  131|    185|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|    168|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|    157|    DecoderBuffer *buffer) {
  136|    157|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    157|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    157|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    157|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 25, False: 132]
  ------------------
  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|    132|#endif
  146|    132|  {
  147|    132|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 132]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    132|  }
  151|    155|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 58, False: 97]
  ------------------
  152|     58|    return false;
  153|     58|  }
  154|     97|  const uint8_t *const data_head =
  155|     97|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     97|  buffer->Advance(bytes_encoded);
  158|     97|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 27, False: 70]
  ------------------
  159|     27|    return false;
  160|     27|  }
  161|     70|  return true;
  162|     97|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|   294k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     70|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     70|  ans_.read_end();
  167|     70|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    305|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    305|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    305|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 305]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    305|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    305|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    305|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 45, False: 260]
  ------------------
   67|     45|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 44]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     45|  } else
   72|    260|#endif
   73|    260|  {
   74|    260|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 257]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|    260|  }
   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|    301|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 16, False: 285]
  ------------------
   83|     16|    return false;
   84|     16|  }
   85|    285|  probability_table_.resize(num_symbols_);
   86|    285|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 9, False: 276]
  ------------------
   87|      9|    return true;
   88|      9|  }
   89|       |  // Decode the table.
   90|   326k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 326k, False: 181]
  ------------------
   91|   326k|    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|   326k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 35, False: 326k]
  ------------------
   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|   326k|    const int token = prob_data & 3;
  102|   326k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 77.2k, False: 249k]
  ------------------
  103|  77.2k|      const uint32_t offset = prob_data >> 2;
  104|  77.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 23, False: 77.1k]
  ------------------
  105|     23|        return false;
  106|     23|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  3.63M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 3.55M, False: 77.1k]
  ------------------
  109|  3.55M|        probability_table_[i + j] = 0;
  110|  3.55M|      }
  111|  77.1k|      i += offset;
  112|   249k|    } else {
  113|   249k|      const int extra_bytes = token;
  114|   249k|      uint32_t prob = prob_data >> 2;
  115|   480k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 231k, False: 249k]
  ------------------
  116|   231k|        uint8_t eb;
  117|   231k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 37, False: 231k]
  ------------------
  118|     37|          return false;
  119|     37|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   231k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   231k|      }
  124|   249k|      probability_table_[i] = prob;
  125|   249k|    }
  126|   326k|  }
  127|    181|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 30, False: 151]
  ------------------
  128|     30|    return false;
  129|     30|  }
  130|    151|  return true;
  131|    181|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|    160|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|    151|    DecoderBuffer *buffer) {
  136|    151|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    151|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    151|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    151|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 24, False: 127]
  ------------------
  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|    127|#endif
  146|    127|  {
  147|    127|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 127]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    127|  }
  151|    149|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 52, False: 97]
  ------------------
  152|     52|    return false;
  153|     52|  }
  154|     97|  const uint8_t *const data_head =
  155|     97|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     97|  buffer->Advance(bytes_encoded);
  158|     97|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 34, False: 63]
  ------------------
  159|     34|    return false;
  160|     34|  }
  161|     63|  return true;
  162|     97|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  71.6k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|     63|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     63|  ans_.read_end();
  167|     63|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  11.0k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  11.0k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 45, False: 11.0k]
  ------------------
   35|     45|    return true;
   36|     45|  }
   37|       |  // Decode which scheme to use.
   38|  11.0k|  uint8_t scheme;
   39|  11.0k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 154, False: 10.8k]
  ------------------
   40|    154|    return false;
   41|    154|  }
   42|  10.8k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 1.03k, False: 9.84k]
  ------------------
   43|  1.03k|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|  1.03k|                                                  src_buffer, out_values);
   45|  9.84k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 6.92k, False: 2.91k]
  ------------------
   46|  6.92k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  6.92k|                                               out_values);
   48|  6.92k|  }
   49|  2.91k|  return false;
   50|  10.8k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|  1.03k|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|  1.03k|  SymbolDecoderT<5> tag_decoder;
   57|  1.03k|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 543, False: 492]
  ------------------
   58|    543|    return false;
   59|    543|  }
   60|       |
   61|    492|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 220, False: 272]
  ------------------
   62|    220|    return false;
   63|    220|  }
   64|       |
   65|    272|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 272, False: 0]
  |  Branch (65:25): [True: 50, False: 222]
  ------------------
   66|     50|    return false;  // Wrong number of symbols.
   67|     50|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|    222|  src_buffer->StartBitDecoding(false, nullptr);
   72|    222|  int value_id = 0;
   73|  3.43M|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 3.43M, False: 208]
  ------------------
   74|       |    // Decode the tag.
   75|  3.43M|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  10.4M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 7.02M, False: 3.43M]
  ------------------
   78|  7.02M|      uint32_t val;
   79|  7.02M|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 14, False: 7.02M]
  ------------------
   80|     14|        return false;
   81|     14|      }
   82|  7.02M|      out_values[value_id++] = val;
   83|  7.02M|    }
   84|  3.43M|  }
   85|    208|  tag_decoder.EndDecoding();
   86|    208|  src_buffer->EndBitDecoding();
   87|    208|  return true;
   88|    222|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  6.92k|                      uint32_t *out_values) {
  117|  6.92k|  uint8_t max_bit_length;
  118|  6.92k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 57, False: 6.86k]
  ------------------
  119|     57|    return false;
  120|     57|  }
  121|  6.86k|  switch (max_bit_length) {
  122|    527|    case 1:
  ------------------
  |  Branch (122:5): [True: 527, False: 6.34k]
  ------------------
  123|    527|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    527|                                                         out_values);
  125|    451|    case 2:
  ------------------
  |  Branch (125:5): [True: 451, False: 6.41k]
  ------------------
  126|    451|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    451|                                                         out_values);
  128|    476|    case 3:
  ------------------
  |  Branch (128:5): [True: 476, False: 6.39k]
  ------------------
  129|    476|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    476|                                                         out_values);
  131|    322|    case 4:
  ------------------
  |  Branch (131:5): [True: 322, False: 6.54k]
  ------------------
  132|    322|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    322|                                                         out_values);
  134|    182|    case 5:
  ------------------
  |  Branch (134:5): [True: 182, False: 6.68k]
  ------------------
  135|    182|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|    182|                                                         out_values);
  137|    377|    case 6:
  ------------------
  |  Branch (137:5): [True: 377, False: 6.49k]
  ------------------
  138|    377|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    377|                                                         out_values);
  140|    341|    case 7:
  ------------------
  |  Branch (140:5): [True: 341, False: 6.52k]
  ------------------
  141|    341|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    341|                                                         out_values);
  143|    395|    case 8:
  ------------------
  |  Branch (143:5): [True: 395, False: 6.47k]
  ------------------
  144|    395|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    395|                                                         out_values);
  146|    426|    case 9:
  ------------------
  |  Branch (146:5): [True: 426, False: 6.44k]
  ------------------
  147|    426|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    426|                                                         out_values);
  149|    373|    case 10:
  ------------------
  |  Branch (149:5): [True: 373, False: 6.49k]
  ------------------
  150|    373|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|    373|          num_values, src_buffer, out_values);
  152|    313|    case 11:
  ------------------
  |  Branch (152:5): [True: 313, False: 6.55k]
  ------------------
  153|    313|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    313|          num_values, src_buffer, out_values);
  155|    347|    case 12:
  ------------------
  |  Branch (155:5): [True: 347, False: 6.52k]
  ------------------
  156|    347|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    347|          num_values, src_buffer, out_values);
  158|    357|    case 13:
  ------------------
  |  Branch (158:5): [True: 357, False: 6.51k]
  ------------------
  159|    357|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    357|          num_values, src_buffer, out_values);
  161|    302|    case 14:
  ------------------
  |  Branch (161:5): [True: 302, False: 6.56k]
  ------------------
  162|    302|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    302|          num_values, src_buffer, out_values);
  164|    346|    case 15:
  ------------------
  |  Branch (164:5): [True: 346, False: 6.52k]
  ------------------
  165|    346|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    346|          num_values, src_buffer, out_values);
  167|    288|    case 16:
  ------------------
  |  Branch (167:5): [True: 288, False: 6.58k]
  ------------------
  168|    288|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    288|          num_values, src_buffer, out_values);
  170|    296|    case 17:
  ------------------
  |  Branch (170:5): [True: 296, False: 6.57k]
  ------------------
  171|    296|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    296|          num_values, src_buffer, out_values);
  173|    305|    case 18:
  ------------------
  |  Branch (173:5): [True: 305, False: 6.56k]
  ------------------
  174|    305|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    305|          num_values, src_buffer, out_values);
  176|    445|    default:
  ------------------
  |  Branch (176:5): [True: 445, False: 6.42k]
  ------------------
  177|    445|      return false;
  178|  6.86k|  }
  179|  6.86k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    527|                              uint32_t *out_values) {
   93|    527|  SymbolDecoderT decoder;
   94|    527|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 311, False: 216]
  ------------------
   95|    311|    return false;
   96|    311|  }
   97|       |
   98|    216|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 216, False: 0]
  |  Branch (98:25): [True: 25, False: 191]
  ------------------
   99|     25|    return false;  // Wrong number of symbols.
  100|     25|  }
  101|       |
  102|    191|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 79, False: 112]
  ------------------
  103|     79|    return false;
  104|     79|  }
  105|  20.1M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 20.1M, False: 112]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  20.1M|    const uint32_t value = decoder.DecodeSymbol();
  108|  20.1M|    out_values[i] = value;
  109|  20.1M|  }
  110|    112|  decoder.EndDecoding();
  111|    112|  return true;
  112|    191|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    451|                              uint32_t *out_values) {
   93|    451|  SymbolDecoderT decoder;
   94|    451|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 174, False: 277]
  ------------------
   95|    174|    return false;
   96|    174|  }
   97|       |
   98|    277|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 277, False: 0]
  |  Branch (98:25): [True: 12, False: 265]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|    265|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 96, False: 169]
  ------------------
  103|     96|    return false;
  104|     96|  }
  105|  2.07M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.07M, False: 169]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.07M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.07M|    out_values[i] = value;
  109|  2.07M|  }
  110|    169|  decoder.EndDecoding();
  111|    169|  return true;
  112|    265|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    476|                              uint32_t *out_values) {
   93|    476|  SymbolDecoderT decoder;
   94|    476|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 144, False: 332]
  ------------------
   95|    144|    return false;
   96|    144|  }
   97|       |
   98|    332|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 332, False: 0]
  |  Branch (98:25): [True: 12, False: 320]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|    320|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 179, False: 141]
  ------------------
  103|    179|    return false;
  104|    179|  }
  105|  4.62M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.62M, False: 141]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.62M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.62M|    out_values[i] = value;
  109|  4.62M|  }
  110|    141|  decoder.EndDecoding();
  111|    141|  return true;
  112|    320|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    322|                              uint32_t *out_values) {
   93|    322|  SymbolDecoderT decoder;
   94|    322|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 124, False: 198]
  ------------------
   95|    124|    return false;
   96|    124|  }
   97|       |
   98|    198|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 198, False: 0]
  |  Branch (98:25): [True: 17, False: 181]
  ------------------
   99|     17|    return false;  // Wrong number of symbols.
  100|     17|  }
  101|       |
  102|    181|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 65, False: 116]
  ------------------
  103|     65|    return false;
  104|     65|  }
  105|  6.66M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.66M, False: 116]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.66M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.66M|    out_values[i] = value;
  109|  6.66M|  }
  110|    116|  decoder.EndDecoding();
  111|    116|  return true;
  112|    181|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|    182|                              uint32_t *out_values) {
   93|    182|  SymbolDecoderT decoder;
   94|    182|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 46, False: 136]
  ------------------
   95|     46|    return false;
   96|     46|  }
   97|       |
   98|    136|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 136, False: 0]
  |  Branch (98:25): [True: 43, False: 93]
  ------------------
   99|     43|    return false;  // Wrong number of symbols.
  100|     43|  }
  101|       |
  102|     93|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 13, False: 80]
  ------------------
  103|     13|    return false;
  104|     13|  }
  105|  8.97M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 8.97M, False: 80]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  8.97M|    const uint32_t value = decoder.DecodeSymbol();
  108|  8.97M|    out_values[i] = value;
  109|  8.97M|  }
  110|     80|  decoder.EndDecoding();
  111|     80|  return true;
  112|     93|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    377|                              uint32_t *out_values) {
   93|    377|  SymbolDecoderT decoder;
   94|    377|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 131, False: 246]
  ------------------
   95|    131|    return false;
   96|    131|  }
   97|       |
   98|    246|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 246, False: 0]
  |  Branch (98:25): [True: 8, False: 238]
  ------------------
   99|      8|    return false;  // Wrong number of symbols.
  100|      8|  }
  101|       |
  102|    238|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 118, False: 120]
  ------------------
  103|    118|    return false;
  104|    118|  }
  105|  5.54M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.54M, False: 120]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.54M|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.54M|    out_values[i] = value;
  109|  5.54M|  }
  110|    120|  decoder.EndDecoding();
  111|    120|  return true;
  112|    238|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    341|                              uint32_t *out_values) {
   93|    341|  SymbolDecoderT decoder;
   94|    341|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 151, False: 190]
  ------------------
   95|    151|    return false;
   96|    151|  }
   97|       |
   98|    190|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 190, False: 0]
  |  Branch (98:25): [True: 10, False: 180]
  ------------------
   99|     10|    return false;  // Wrong number of symbols.
  100|     10|  }
  101|       |
  102|    180|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 91, False: 89]
  ------------------
  103|     91|    return false;
  104|     91|  }
  105|  12.9M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 12.9M, False: 89]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  12.9M|    const uint32_t value = decoder.DecodeSymbol();
  108|  12.9M|    out_values[i] = value;
  109|  12.9M|  }
  110|     89|  decoder.EndDecoding();
  111|     89|  return true;
  112|    180|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    395|                              uint32_t *out_values) {
   93|    395|  SymbolDecoderT decoder;
   94|    395|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 164, False: 231]
  ------------------
   95|    164|    return false;
   96|    164|  }
   97|       |
   98|    231|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 231, False: 0]
  |  Branch (98:25): [True: 11, False: 220]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    220|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 106, False: 114]
  ------------------
  103|    106|    return false;
  104|    106|  }
  105|  20.8M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 20.8M, False: 114]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  20.8M|    const uint32_t value = decoder.DecodeSymbol();
  108|  20.8M|    out_values[i] = value;
  109|  20.8M|  }
  110|    114|  decoder.EndDecoding();
  111|    114|  return true;
  112|    220|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    426|                              uint32_t *out_values) {
   93|    426|  SymbolDecoderT decoder;
   94|    426|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 144, False: 282]
  ------------------
   95|    144|    return false;
   96|    144|  }
   97|       |
   98|    282|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 282, False: 0]
  |  Branch (98:25): [True: 9, False: 273]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    273|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 119, False: 154]
  ------------------
  103|    119|    return false;
  104|    119|  }
  105|  6.74M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.74M, False: 154]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.74M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.74M|    out_values[i] = value;
  109|  6.74M|  }
  110|    154|  decoder.EndDecoding();
  111|    154|  return true;
  112|    273|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|    373|                              uint32_t *out_values) {
   93|    373|  SymbolDecoderT decoder;
   94|    373|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 182, False: 191]
  ------------------
   95|    182|    return false;
   96|    182|  }
   97|       |
   98|    191|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 191, False: 0]
  |  Branch (98:25): [True: 3, False: 188]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|    188|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 125, False: 63]
  ------------------
  103|    125|    return false;
  104|    125|  }
  105|   535k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 535k, False: 63]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   535k|    const uint32_t value = decoder.DecodeSymbol();
  108|   535k|    out_values[i] = value;
  109|   535k|  }
  110|     63|  decoder.EndDecoding();
  111|     63|  return true;
  112|    188|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    313|                              uint32_t *out_values) {
   93|    313|  SymbolDecoderT decoder;
   94|    313|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 163, False: 150]
  ------------------
   95|    163|    return false;
   96|    163|  }
   97|       |
   98|    150|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 150, False: 0]
  |  Branch (98:25): [True: 14, False: 136]
  ------------------
   99|     14|    return false;  // Wrong number of symbols.
  100|     14|  }
  101|       |
  102|    136|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 80, False: 56]
  ------------------
  103|     80|    return false;
  104|     80|  }
  105|   381k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 381k, False: 56]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   381k|    const uint32_t value = decoder.DecodeSymbol();
  108|   381k|    out_values[i] = value;
  109|   381k|  }
  110|     56|  decoder.EndDecoding();
  111|     56|  return true;
  112|    136|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    347|                              uint32_t *out_values) {
   93|    347|  SymbolDecoderT decoder;
   94|    347|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 189, False: 158]
  ------------------
   95|    189|    return false;
   96|    189|  }
   97|       |
   98|    158|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 158, False: 0]
  |  Branch (98:25): [True: 5, False: 153]
  ------------------
   99|      5|    return false;  // Wrong number of symbols.
  100|      5|  }
  101|       |
  102|    153|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 96, False: 57]
  ------------------
  103|     96|    return false;
  104|     96|  }
  105|  62.5k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 62.5k, False: 57]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  62.5k|    const uint32_t value = decoder.DecodeSymbol();
  108|  62.5k|    out_values[i] = value;
  109|  62.5k|  }
  110|     57|  decoder.EndDecoding();
  111|     57|  return true;
  112|    153|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    357|                              uint32_t *out_values) {
   93|    357|  SymbolDecoderT decoder;
   94|    357|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 190, False: 167]
  ------------------
   95|    190|    return false;
   96|    190|  }
   97|       |
   98|    167|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 167, False: 0]
  |  Branch (98:25): [True: 12, False: 155]
  ------------------
   99|     12|    return false;  // Wrong number of symbols.
  100|     12|  }
  101|       |
  102|    155|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 85, False: 70]
  ------------------
  103|     85|    return false;
  104|     85|  }
  105|  78.6k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 78.5k, False: 70]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  78.5k|    const uint32_t value = decoder.DecodeSymbol();
  108|  78.5k|    out_values[i] = value;
  109|  78.5k|  }
  110|     70|  decoder.EndDecoding();
  111|     70|  return true;
  112|    155|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    302|                              uint32_t *out_values) {
   93|    302|  SymbolDecoderT decoder;
   94|    302|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 143, False: 159]
  ------------------
   95|    143|    return false;
   96|    143|  }
   97|       |
   98|    159|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 159, False: 0]
  |  Branch (98:25): [True: 11, False: 148]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    148|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 88, False: 60]
  ------------------
  103|     88|    return false;
  104|     88|  }
  105|  81.2k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 81.1k, False: 60]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  81.1k|    const uint32_t value = decoder.DecodeSymbol();
  108|  81.1k|    out_values[i] = value;
  109|  81.1k|  }
  110|     60|  decoder.EndDecoding();
  111|     60|  return true;
  112|    148|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    346|                              uint32_t *out_values) {
   93|    346|  SymbolDecoderT decoder;
   94|    346|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 151, False: 195]
  ------------------
   95|    151|    return false;
   96|    151|  }
   97|       |
   98|    195|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 195, False: 0]
  |  Branch (98:25): [True: 9, False: 186]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    186|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 112, False: 74]
  ------------------
  103|    112|    return false;
  104|    112|  }
  105|   297k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 297k, False: 74]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   297k|    const uint32_t value = decoder.DecodeSymbol();
  108|   297k|    out_values[i] = value;
  109|   297k|  }
  110|     74|  decoder.EndDecoding();
  111|     74|  return true;
  112|    186|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    288|                              uint32_t *out_values) {
   93|    288|  SymbolDecoderT decoder;
   94|    288|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 129, False: 159]
  ------------------
   95|    129|    return false;
   96|    129|  }
   97|       |
   98|    159|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 159, False: 0]
  |  Branch (98:25): [True: 6, False: 153]
  ------------------
   99|      6|    return false;  // Wrong number of symbols.
  100|      6|  }
  101|       |
  102|    153|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 92, False: 61]
  ------------------
  103|     92|    return false;
  104|     92|  }
  105|   135k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 135k, False: 61]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   135k|    const uint32_t value = decoder.DecodeSymbol();
  108|   135k|    out_values[i] = value;
  109|   135k|  }
  110|     61|  decoder.EndDecoding();
  111|     61|  return true;
  112|    153|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    296|                              uint32_t *out_values) {
   93|    296|  SymbolDecoderT decoder;
   94|    296|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 128, False: 168]
  ------------------
   95|    128|    return false;
   96|    128|  }
   97|       |
   98|    168|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 168, False: 0]
  |  Branch (98:25): [True: 11, False: 157]
  ------------------
   99|     11|    return false;  // Wrong number of symbols.
  100|     11|  }
  101|       |
  102|    157|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 87, False: 70]
  ------------------
  103|     87|    return false;
  104|     87|  }
  105|   294k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 294k, False: 70]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   294k|    const uint32_t value = decoder.DecodeSymbol();
  108|   294k|    out_values[i] = value;
  109|   294k|  }
  110|     70|  decoder.EndDecoding();
  111|     70|  return true;
  112|    157|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    305|                              uint32_t *out_values) {
   93|    305|  SymbolDecoderT decoder;
   94|    305|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 145, False: 160]
  ------------------
   95|    145|    return false;
   96|    145|  }
   97|       |
   98|    160|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 160, False: 0]
  |  Branch (98:25): [True: 9, False: 151]
  ------------------
   99|      9|    return false;  // Wrong number of symbols.
  100|      9|  }
  101|       |
  102|    151|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 88, False: 63]
  ------------------
  103|     88|    return false;
  104|     88|  }
  105|  71.7k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 71.6k, False: 63]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  71.6k|    const uint32_t value = decoder.DecodeSymbol();
  108|  71.6k|    out_values[i] = value;
  109|  71.6k|  }
  110|     63|  decoder.EndDecoding();
  111|     63|  return true;
  112|    151|}

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

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

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

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

_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEEC2Ev:
   48|  3.02k|    : decoder_(nullptr),
   49|  3.02k|      last_symbol_id_(-1),
   50|  3.02k|      last_vert_id_(-1),
   51|  3.02k|      last_face_id_(-1),
   52|  3.02k|      num_new_vertices_(0),
   53|  3.02k|      num_encoded_vertices_(0),
   54|  3.02k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  3.02k|    MeshEdgebreakerDecoder *decoder) {
   59|  3.02k|  decoder_ = decoder;
   60|  3.02k|  return true;
   61|  3.02k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23GetAttributeCornerTableEi:
   66|  3.16k|    int att_id) const {
   67|  4.34k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 3.64k, False: 704]
  ------------------
   68|  3.64k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  3.64k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 1.17k, False: 2.46k]
  |  Branch (69:27): [True: 0, False: 2.46k]
  ------------------
   70|  1.17k|      continue;
   71|  1.17k|    }
   72|  2.46k|    const AttributesDecoderInterface *const dec =
   73|  2.46k|        decoder_->attributes_decoder(decoder_id);
   74|  5.22k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 5.21k, False: 6]
  ------------------
   75|  5.21k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 2.46k, False: 2.75k]
  ------------------
   76|  2.46k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 1.69k, False: 771]
  ------------------
   77|  1.69k|          return &attribute_data_[i].connectivity_data;
   78|  1.69k|        }
   79|    771|        return nullptr;
   80|  2.46k|      }
   81|  5.21k|    }
   82|  2.46k|  }
   83|    704|  return nullptr;
   84|  3.16k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE24GetAttributeEncodingDataEi:
   89|  3.16k|    int att_id) const {
   90|  4.34k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 3.64k, False: 704]
  ------------------
   91|  3.64k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  3.64k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 1.17k, False: 2.46k]
  |  Branch (92:27): [True: 0, False: 2.46k]
  ------------------
   93|  1.17k|      continue;
   94|  1.17k|    }
   95|  2.46k|    const AttributesDecoderInterface *const dec =
   96|  2.46k|        decoder_->attributes_decoder(decoder_id);
   97|  5.22k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 5.21k, False: 6]
  ------------------
   98|  5.21k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 2.46k, False: 2.75k]
  ------------------
   99|  2.46k|        return &attribute_data_[i].encoding_data;
  100|  2.46k|      }
  101|  5.21k|    }
  102|  2.46k|  }
  103|    704|  return &pos_encoding_data_;
  104|  3.16k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE23CreateAttributesDecoderEi:
  130|  2.54k|    int32_t att_decoder_id) {
  131|  2.54k|  int8_t att_data_id;
  132|  2.54k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 10, False: 2.53k]
  ------------------
  133|     10|    return false;
  134|     10|  }
  135|  2.53k|  uint8_t decoder_type;
  136|  2.53k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 7, False: 2.52k]
  ------------------
  137|      7|    return false;
  138|      7|  }
  139|       |
  140|  2.52k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 1.96k, False: 555]
  ------------------
  141|  1.96k|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 74, False: 1.89k]
  ------------------
  142|     74|      return false;  // Unexpected attribute data.
  143|     74|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|  1.89k|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 4, False: 1.89k]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|       |
  151|  1.89k|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|  1.89k|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    555|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 3, False: 552]
  ------------------
  155|      3|      return false;  // Some other decoder is already using the data. Error.
  156|      3|    }
  157|    552|    pos_data_decoder_id_ = att_decoder_id;
  158|    552|  }
  159|       |
  160|  2.44k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  2.44k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  2.44k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 2.43k, False: 7]
  ------------------
  162|  2.43k|    uint8_t traversal_method_encoded;
  163|  2.43k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 6, False: 2.43k]
  ------------------
  164|      6|      return false;
  165|      6|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  2.43k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 12, False: 2.41k]
  ------------------
  168|     12|      return false;
  169|     12|    }
  170|  2.41k|    traversal_method =
  171|  2.41k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  2.41k|  }
  173|       |
  174|  2.42k|  const Mesh *mesh = decoder_->mesh();
  175|  2.42k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  2.42k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 1.18k, False: 1.24k]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|  1.18k|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|  1.18k|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 534, False: 648]
  ------------------
  182|    534|      encoding_data = &pos_encoding_data_;
  183|    648|    } else {
  184|    648|      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|    648|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    648|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|  1.18k|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 175, False: 1.00k]
  ------------------
  191|    175|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    175|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    175|          AttTraverser;
  194|    175|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|  1.00k|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 1.00k, False: 0]
  ------------------
  196|  1.00k|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|  1.00k|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|  1.00k|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|  1.00k|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|  1.24k|  } else {
  203|  1.24k|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 9, False: 1.23k]
  ------------------
  204|      9|      return false;  // Unsupported method.
  205|      9|    }
  206|  1.23k|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 5, False: 1.22k]
  ------------------
  207|      5|      return false;  // Attribute data must be specified.
  208|      5|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|  1.22k|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|  1.22k|        AttObserver;
  214|  1.22k|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|  1.22k|        AttTraverser;
  216|       |
  217|  1.22k|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|  1.22k|        &attribute_data_[att_data_id].encoding_data;
  219|  1.22k|    const MeshAttributeCornerTable *const corner_table =
  220|  1.22k|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|  1.22k|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|  1.22k|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|  1.22k|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|  1.22k|                             encoding_data);
  227|       |
  228|  1.22k|    AttTraverser att_traverser;
  229|  1.22k|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|  1.22k|    traversal_sequencer->SetTraverser(att_traverser);
  232|  1.22k|    sequencer = std::move(traversal_sequencer);
  233|  1.22k|  }
  234|       |
  235|  2.41k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 2.41k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  2.41k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  2.41k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  2.41k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  2.41k|                                        std::move(att_controller));
  244|  2.41k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEv:
  247|  3.02k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  3.02k|  num_new_vertices_ = 0;
  249|  3.02k|  new_to_parent_vertex_map_.clear();
  250|  3.02k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  3.02k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.02k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 479, False: 2.54k]
  ------------------
  252|    479|    uint32_t num_new_verts;
  253|    479|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    479|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 155, False: 324]
  ------------------
  254|    155|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 155]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|    324|    } else {
  258|    324|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 324]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|    324|    }
  262|    479|    num_new_vertices_ = num_new_verts;
  263|    479|  }
  264|  3.02k|#endif
  265|       |
  266|  3.02k|  uint32_t num_encoded_vertices;
  267|  3.02k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  3.02k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.02k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 155, False: 2.87k]
  ------------------
  269|    155|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 155]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|    155|  } else
  274|  2.87k|#endif
  275|  2.87k|  {
  276|  2.87k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 1, False: 2.87k]
  ------------------
  277|      1|      return false;
  278|      1|    }
  279|  2.87k|  }
  280|  3.02k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  3.02k|  uint32_t num_faces;
  283|  3.02k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  3.02k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.02k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 155, False: 2.87k]
  ------------------
  285|    155|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 155]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|    155|  } else
  290|  2.87k|#endif
  291|  2.87k|  {
  292|  2.87k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 1, False: 2.87k]
  ------------------
  293|      1|      return false;
  294|      1|    }
  295|  2.87k|  }
  296|  3.02k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 3, False: 3.02k]
  ------------------
  297|      3|    return false;  // Draco cannot handle this many faces.
  298|      3|  }
  299|       |
  300|  3.02k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 3, False: 3.02k]
  ------------------
  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|  3.02k|  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.02k|  const uint64_t num_encoded_vertices_64 =
  311|  3.02k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  3.02k|  const uint64_t max_num_vertex_edges =
  313|  3.02k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  3.02k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 2, False: 3.01k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      2|    return false;
  317|      2|  }
  318|       |
  319|  3.01k|  uint8_t num_attribute_data;
  320|  3.01k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 3.01k]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|  3.01k|  uint32_t num_encoded_symbols;
  325|  3.01k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  3.01k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  3.01k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 148, False: 2.87k]
  ------------------
  327|    148|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 148]
  ------------------
  328|      0|      return false;
  329|      0|    }
  330|       |
  331|    148|  } else
  332|  2.87k|#endif
  333|  2.87k|  {
  334|  2.87k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 2.87k]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|  2.87k|  }
  338|       |
  339|  3.01k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 8, False: 3.01k]
  ------------------
  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.01k|  const uint32_t max_encoded_faces =
  346|  3.01k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  3.01k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 14, False: 2.99k]
  ------------------
  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|     14|    return false;
  352|     14|  }
  353|       |
  354|  2.99k|  uint32_t num_encoded_split_symbols;
  355|  2.99k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.99k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.99k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 133, False: 2.86k]
  ------------------
  357|    133|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 133]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|    133|  } else
  362|  2.86k|#endif
  363|  2.86k|  {
  364|  2.86k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 2.86k]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|  2.86k|  }
  368|       |
  369|  2.99k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 15, False: 2.98k]
  ------------------
  370|     15|    return false;  // Split symbols are a sub-set of all symbols.
  371|     15|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.98k|  vertex_traversal_length_.clear();
  375|  2.98k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.98k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.98k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.98k|  processed_corner_ids_.clear();
  380|  2.98k|  processed_corner_ids_.reserve(num_faces);
  381|  2.98k|  processed_connectivity_corners_.clear();
  382|  2.98k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.98k|  topology_split_data_.clear();
  384|  2.98k|  hole_event_data_.clear();
  385|  2.98k|  init_face_configurations_.clear();
  386|  2.98k|  init_corners_.clear();
  387|       |
  388|  2.98k|  last_symbol_id_ = -1;
  389|  2.98k|  last_face_id_ = -1;
  390|  2.98k|  last_vert_id_ = -1;
  391|       |
  392|  2.98k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.98k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.98k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 1, False: 2.98k]
  ------------------
  397|  2.98k|          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.98k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.98k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.98k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.98k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.98k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 442, False: 2.53k]
  ------------------
  411|    442|    uint32_t encoded_connectivity_size;
  412|    442|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    442|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 124, False: 318]
  ------------------
  413|    124|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 3, False: 121]
  ------------------
  414|      3|        return false;
  415|      3|      }
  416|    318|    } else {
  417|    318|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 1, False: 317]
  ------------------
  418|      1|        return false;
  419|      1|      }
  420|    318|    }
  421|    438|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 1, False: 437]
  ------------------
  422|    437|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 17, False: 420]
  ------------------
  423|     18|      return false;
  424|     18|    }
  425|    420|    DecoderBuffer event_buffer;
  426|    420|    event_buffer.Init(
  427|    420|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    420|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    420|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    420|    topology_split_decoded_bytes =
  432|    420|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    420|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 106, False: 314]
  ------------------
  434|    106|      return false;
  435|    106|    }
  436|       |
  437|    420|  } else
  438|  2.53k|#endif
  439|  2.53k|  {
  440|  2.53k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 11, False: 2.52k]
  ------------------
  441|     11|      return false;
  442|     11|    }
  443|  2.53k|  }
  444|       |
  445|  2.84k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.84k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.84k|                                           num_encoded_split_symbols);
  449|  2.84k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.84k|  DecoderBuffer traversal_end_buffer;
  452|  2.84k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 108, False: 2.73k]
  ------------------
  453|    108|    return false;
  454|    108|  }
  455|       |
  456|  2.73k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  2.73k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 215, False: 2.51k]
  ------------------
  458|    215|    return false;
  459|    215|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  2.51k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  2.51k|                           traversal_end_buffer.remaining_size(),
  464|  2.51k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  2.51k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  2.51k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.51k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 213, False: 2.30k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|    213|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|    213|  }
  471|  2.51k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  2.51k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 2.46k, False: 49]
  ------------------
  475|  2.46k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  2.46k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.46k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 202, False: 2.26k]
  ------------------
  477|  1.45k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 1.25k, False: 202]
  ------------------
  478|  1.25k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 1.25k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|  1.25k|      }
  482|       |
  483|    202|    } else
  484|  2.26k|#endif
  485|  2.26k|    {
  486|   268k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 266k, False: 2.26k]
  ------------------
  487|   266k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 266k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   266k|      }
  491|  2.26k|    }
  492|  2.46k|  }
  493|  2.51k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  6.80k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 4.28k, False: 2.51k]
  ------------------
  498|  4.28k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|   629k|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 629k, False: 4.28k]
  ------------------
  501|   629k|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|   629k|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  4.28k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 4.28k]
  ------------------
  505|  4.28k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  4.28k|  }
  509|       |
  510|  2.51k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  6.80k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 4.28k, False: 2.51k]
  ------------------
  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.28k|    int32_t att_connectivity_verts =
  517|  4.28k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  4.28k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 512, False: 3.77k]
  ------------------
  519|    512|      att_connectivity_verts = corner_table_->num_vertices();
  520|    512|    }
  521|  4.28k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  4.28k|  }
  523|  2.51k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 2, False: 2.51k]
  ------------------
  524|      2|    return false;
  525|      2|  }
  526|  2.51k|  return true;
  527|  2.51k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE19OnAttributesDecodedEv:
  530|    547|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    547|  return true;
  532|    547|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18DecodeConnectivityEi:
  536|  2.73k|    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.73k|  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.73k|  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.73k|  std::vector<VertexIndex> invalid_vertices;
  558|  2.73k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  2.73k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  2.73k|  int num_faces = 0;
  562|  22.8M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 22.8M, False: 2.58k]
  ------------------
  563|  22.8M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  22.8M|    bool check_topology_split = false;
  566|  22.8M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  22.8M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 9.88M, False: 12.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|  9.88M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 0, False: 9.88M]
  ------------------
  588|      0|        return -1;
  589|      0|      }
  590|       |
  591|  9.88M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  9.88M|      const VertexIndex vertex_x =
  593|  9.88M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  9.88M|      const CornerIndex corner_b =
  595|  9.88M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  9.88M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 98, False: 9.88M]
  ------------------
  598|       |        // All matched corners must be different.
  599|     98|        return -1;
  600|     98|      }
  601|  9.88M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 9.88M]
  |  Branch (601:11): [True: 0, False: 9.88M]
  ------------------
  602|  9.88M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 9.88M]
  ------------------
  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|  9.88M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  9.88M|      SetOppositeCorners(corner_a, corner + 1);
  612|  9.88M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  9.88M|      const VertexIndex vert_a_prev =
  616|  9.88M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  9.88M|      const VertexIndex vert_b_next =
  618|  9.88M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  9.88M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 9.88M]
  |  Branch (619:38): [True: 0, False: 9.88M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  9.88M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  9.88M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  9.88M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  9.88M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  9.88M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  9.88M|      active_corner_stack.back() = corner;
  631|  12.9M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 4.21M, False: 8.73M]
  |  Branch (631:40): [True: 2.82M, False: 5.90M]
  ------------------
  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|  7.04M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 0, False: 7.04M]
  ------------------
  647|      0|        return -1;
  648|      0|      }
  649|  7.04M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  7.04M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 7.04M]
  ------------------
  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|  7.04M|      const CornerIndex corner(3 * face.value());
  658|  7.04M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  7.04M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 4.21M, False: 2.82M]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  4.21M|        opp_corner = corner + 2;
  662|  4.21M|        corner_l = corner + 1;
  663|  4.21M|        corner_r = corner;
  664|  4.21M|      } else {
  665|       |        // "l" is the new first corner.
  666|  2.82M|        opp_corner = corner + 1;
  667|  2.82M|        corner_l = corner;
  668|  2.82M|        corner_r = corner + 2;
  669|  2.82M|      }
  670|  7.04M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  7.04M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  7.04M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 0, False: 7.04M]
  ------------------
  675|      0|        return -1;  // Unexpected number of decoded vertices.
  676|      0|      }
  677|       |
  678|  7.04M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  7.04M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  7.04M|      const VertexIndex vertex_r =
  682|  7.04M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  7.04M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  7.04M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  7.04M|      corner_table_->MapCornerToVertex(
  688|  7.04M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  7.04M|      active_corner_stack.back() = corner;
  690|  7.04M|      check_topology_split = true;
  691|  7.04M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 2.92M, False: 2.97M]
  ------------------
  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|  2.92M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 0, False: 2.92M]
  ------------------
  703|      0|        return -1;
  704|      0|      }
  705|  2.92M|      const CornerIndex corner_b = active_corner_stack.back();
  706|  2.92M|      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|  2.92M|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  2.92M|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 158, False: 2.92M]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|    158|        active_corner_stack.push_back(it->second);
  714|    158|      }
  715|  2.92M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 14, False: 2.92M]
  ------------------
  716|     14|        return -1;
  717|     14|      }
  718|  2.92M|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  2.92M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 2.92M]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  2.92M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 4, False: 2.92M]
  |  Branch (724:11): [True: 4, False: 2.92M]
  ------------------
  725|  2.92M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 2.92M]
  ------------------
  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|  2.92M|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  2.92M|      SetOppositeCorners(corner_a, corner + 2);
  735|  2.92M|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  2.92M|      const VertexIndex vertex_p =
  739|  2.92M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  2.92M|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  2.92M|      corner_table_->MapCornerToVertex(
  742|  2.92M|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  2.92M|      const VertexIndex vert_b_prev =
  744|  2.92M|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  2.92M|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  2.92M|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  2.92M|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  2.92M|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  2.92M|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  2.92M|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  2.92M|                                       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|  2.92M|      const CornerIndex first_corner = corner_n;
  757|  10.9M|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 8.03M, False: 2.92M]
  ------------------
  758|  8.03M|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|  8.03M|        corner_n = corner_table_->SwingLeft(corner_n);
  760|  8.03M|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 3, False: 8.03M]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      3|          return -1;
  764|      3|        }
  765|  8.03M|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  2.92M|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  2.92M|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 957k, False: 1.97M]
  ------------------
  770|   957k|        invalid_vertices.push_back(vertex_n);
  771|   957k|      }
  772|  2.92M|      active_corner_stack.back() = corner;
  773|  2.97M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 2.97M, False: 0]
  ------------------
  774|  2.97M|      const CornerIndex corner(3 * face.value());
  775|  2.97M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  2.97M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  2.97M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  2.97M|                                       corner_table_->AddNewVertex());
  780|  2.97M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  2.97M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  2.97M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 4, False: 2.97M]
  ------------------
  784|      4|        return -1;  // Unexpected number of decoded vertices.
  785|      4|      }
  786|       |
  787|  2.97M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  2.97M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  2.97M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  2.97M|      active_corner_stack.push_back(corner);
  792|  2.97M|      check_topology_split = true;
  793|  2.97M|    } 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|  22.8M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  22.8M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 10.0M, False: 12.8M]
  ------------------
  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|  10.0M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  10.0M|      EdgeFaceName split_edge;
  812|  10.0M|      int encoder_split_symbol_id;
  813|  10.0M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.94k, False: 10.0M]
  ------------------
  814|  10.0M|                             &encoder_split_symbol_id)) {
  815|  1.94k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 28, False: 1.91k]
  ------------------
  816|     28|          return -1;  // Wrong split symbol id.
  817|     28|        }
  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.91k|        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.91k|        CornerIndex new_active_corner;
  831|  1.91k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 1.05k, False: 860]
  ------------------
  832|  1.05k|          new_active_corner = corner_table_->Next(act_top_corner);
  833|  1.05k|        } else {
  834|    860|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    860|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.91k|        const int decoder_split_symbol_id =
  839|  1.91k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.91k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.91k|            new_active_corner;
  842|  1.91k|      }
  843|  10.0M|    }
  844|  22.8M|  }
  845|  2.58k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 2.58k]
  ------------------
  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|  24.8k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 22.3k, False: 2.52k]
  ------------------
  850|  22.3k|    const CornerIndex corner = active_corner_stack.back();
  851|  22.3k|    active_corner_stack.pop_back();
  852|  22.3k|    const bool interior_face =
  853|  22.3k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  22.3k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 13.1k, False: 9.24k]
  ------------------
  855|       |      // The start face is interior, we need to find three corners that are
  856|       |      // opposite to it. The first opposite corner "a" is the corner from the
  857|       |      // top of the active corner stack and the remaining two corners "b" and
  858|       |      // "c" are then the next corners from the left-most corners of vertices
  859|       |      // "n" and "x" respectively.
  860|       |      //
  861|       |      //           *-------*
  862|       |      //          / \     / \
  863|       |      //         /   \   /   \
  864|       |      //        /     \ /     \
  865|       |      //       *-------p-------*
  866|       |      //      / \a    . .    c/ \
  867|       |      //     /   \   .   .   /   \
  868|       |      //    /     \ .  I  . /     \
  869|       |      //   *-------n.......x------*
  870|       |      //    \     / \     / \     /
  871|       |      //     \   /   \   /   \   /
  872|       |      //      \ /     \b/     \ /
  873|       |      //       *-------*-------*
  874|       |      //
  875|       |
  876|  13.1k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 14, False: 13.1k]
  ------------------
  877|     14|        return -1;  // More faces than expected added to the mesh.
  878|     14|      }
  879|       |
  880|  13.1k|      const CornerIndex corner_a = corner;
  881|  13.1k|      const VertexIndex vert_n =
  882|  13.1k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  13.1k|      const CornerIndex corner_b =
  884|  13.1k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  13.1k|      const VertexIndex vert_x =
  887|  13.1k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  13.1k|      const CornerIndex corner_c =
  889|  13.1k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  13.1k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 2, False: 13.1k]
  |  Branch (891:33): [True: 27, False: 13.0k]
  |  Branch (891:55): [True: 0, False: 13.0k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     29|        return -1;
  894|     29|      }
  895|  13.0k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 8, False: 13.0k]
  |  Branch (895:11): [True: 10, False: 13.0k]
  ------------------
  896|  13.0k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 1, False: 13.0k]
  ------------------
  897|  13.0k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 1, False: 13.0k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|     10|        return -1;
  901|     10|      }
  902|       |
  903|  13.0k|      const VertexIndex vert_p =
  904|  13.0k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  13.0k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  13.0k|      const CornerIndex new_corner(3 * face.value());
  909|  13.0k|      SetOppositeCorners(new_corner, corner);
  910|  13.0k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  13.0k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  13.0k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  13.0k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  13.0k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  52.2k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 39.2k, False: 13.0k]
  ------------------
  920|  39.2k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  39.2k|      }
  922|       |
  923|  13.0k|      init_face_configurations_.push_back(true);
  924|  13.0k|      init_corners_.push_back(new_corner);
  925|  13.0k|    } else {
  926|       |      // The initial face wasn't interior and the traversal had to start from
  927|       |      // an open boundary. In this case no new face is added, but we need to
  928|       |      // keep record about the first opposite corner to this boundary.
  929|  9.24k|      init_face_configurations_.push_back(false);
  930|  9.24k|      init_corners_.push_back(corner);
  931|  9.24k|    }
  932|  22.3k|  }
  933|  2.52k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 10, False: 2.51k]
  ------------------
  934|     10|    return -1;  // Unexpected number of decoded faces.
  935|     10|  }
  936|       |
  937|  2.51k|  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|  11.4k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 11.4k, False: 2.51k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  11.4k|    VertexIndex src_vert(num_vertices - 1);
  943|  12.8k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 1.39k, False: 11.4k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|  1.39k|      src_vert = VertexIndex(--num_vertices - 1);
  946|  1.39k|    }
  947|  11.4k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 1.39k, False: 10.0k]
  ------------------
  948|  1.39k|      continue;  // No need to swap anything.
  949|  1.39k|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  10.0k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  92.0k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 81.9k, False: 10.0k]
  ------------------
  954|  81.9k|      const CornerIndex cid = vcit.Corner();
  955|  81.9k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 1, False: 81.9k]
  ------------------
  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|  81.9k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  81.9k|    }
  962|  10.0k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  10.0k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  10.0k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  10.0k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  10.0k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  10.0k|    num_vertices--;
  972|  10.0k|  }
  973|  2.51k|  return num_vertices;
  974|  2.51k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.95k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.95k|  uint32_t num_topology_splits;
  982|  2.95k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.95k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.95k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 104, False: 2.85k]
  ------------------
  984|    104|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 2, False: 102]
  ------------------
  985|      2|      return -1;
  986|      2|    }
  987|       |
  988|    104|  } else
  989|  2.85k|#endif
  990|  2.85k|  {
  991|  2.85k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 2.85k]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|  2.85k|  }
  995|  2.95k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 1.46k, False: 1.49k]
  ------------------
  996|  1.46k|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 7, False: 1.45k]
  ------------------
  997|  1.46k|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|      7|      return -1;
  999|      7|    }
 1000|  1.45k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|  1.45k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.45k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 42, False: 1.41k]
  ------------------
 1002|  7.16k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 7.15k, False: 14]
  ------------------
 1003|  7.15k|        TopologySplitEventData event_data;
 1004|  7.15k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 18, False: 7.13k]
  ------------------
 1005|     18|          return -1;
 1006|     18|        }
 1007|  7.13k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 9, False: 7.12k]
  ------------------
 1008|      9|          return -1;
 1009|      9|        }
 1010|  7.12k|        uint8_t edge_data;
 1011|  7.12k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 1, False: 7.12k]
  ------------------
 1012|      1|          return -1;
 1013|      1|        }
 1014|  7.12k|        event_data.source_edge = edge_data & 1;
 1015|  7.12k|        topology_split_data_.push_back(event_data);
 1016|  7.12k|      }
 1017|       |
 1018|     42|    } else
 1019|  1.41k|#endif
 1020|  1.41k|    {
 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.41k|      int last_source_symbol_id = 0;
 1024|  6.40k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 4.99k, False: 1.40k]
  ------------------
 1025|  4.99k|        TopologySplitEventData event_data;
 1026|  4.99k|        uint32_t delta;
 1027|  4.99k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 4, False: 4.99k]
  ------------------
 1028|      4|          return -1;
 1029|      4|        }
 1030|  4.99k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  4.99k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 1, False: 4.99k]
  ------------------
 1032|      1|          return -1;
 1033|      1|        }
 1034|  4.99k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 4, False: 4.98k]
  ------------------
 1035|      4|          return -1;
 1036|      4|        }
 1037|  4.98k|        event_data.split_symbol_id =
 1038|  4.98k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  4.98k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  4.98k|        topology_split_data_.push_back(event_data);
 1041|  4.98k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|  1.40k|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  6.10k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 4.70k, False: 1.40k]
  ------------------
 1045|  4.70k|        uint32_t edge_data;
 1046|  4.70k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.70k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 1.43k, False: 3.26k]
  ------------------
 1047|  1.43k|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  3.26k|        } else {
 1049|  3.26k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  3.26k|        }
 1051|  4.70k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  4.70k|        event_data.source_edge = edge_data & 1;
 1053|  4.70k|      }
 1054|  1.40k|      decoder_buffer->EndBitDecoding();
 1055|  1.40k|    }
 1056|  1.45k|  }
 1057|  2.91k|  uint32_t num_hole_events = 0;
 1058|  2.91k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.91k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.91k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 69, False: 2.84k]
  ------------------
 1060|     69|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 3, False: 66]
  ------------------
 1061|      3|      return -1;
 1062|      3|    }
 1063|  2.84k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.84k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 272, False: 2.57k]
  ------------------
 1064|    272|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 8, False: 264]
  ------------------
 1065|      8|      return -1;
 1066|      8|    }
 1067|    272|  }
 1068|  2.90k|#endif
 1069|  2.90k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 93, False: 2.80k]
  ------------------
 1070|     93|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     93|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     93|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 49, False: 44]
  ------------------
 1072|   352k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 352k, False: 7]
  ------------------
 1073|   352k|        HoleEventData event_data;
 1074|   352k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 42, False: 352k]
  ------------------
 1075|     42|          return -1;
 1076|     42|        }
 1077|   352k|        hole_event_data_.push_back(event_data);
 1078|   352k|      }
 1079|       |
 1080|     49|    } else
 1081|     44|#endif
 1082|     44|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     44|      int last_symbol_id = 0;
 1085|   610k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 610k, False: 26]
  ------------------
 1086|   610k|        HoleEventData event_data;
 1087|   610k|        uint32_t delta;
 1088|   610k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 18, False: 610k]
  ------------------
 1089|     18|          return -1;
 1090|     18|        }
 1091|   610k|        event_data.symbol_id = delta + last_symbol_id;
 1092|   610k|        last_symbol_id = event_data.symbol_id;
 1093|   610k|        hole_event_data_.push_back(event_data);
 1094|   610k|      }
 1095|     44|    }
 1096|     93|  }
 1097|  2.84k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.90k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|  1.25k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|  1.25k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|  1.25k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  5.00k|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 3.75k, False: 1.25k]
  ------------------
 1109|  3.75k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  3.75k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 1.19k, False: 2.55k]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  2.64k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 1.45k, False: 1.19k]
  ------------------
 1114|  1.45k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|  1.45k|      }
 1116|  1.19k|      continue;
 1117|  1.19k|    }
 1118|       |
 1119|  6.55k|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 3.99k, False: 2.55k]
  ------------------
 1120|  3.99k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  3.99k|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 2.23k, False: 1.75k]
  ------------------
 1122|  2.23k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|  2.23k|      }
 1124|  3.99k|    }
 1125|  2.55k|  }
 1126|  1.25k|  return true;
 1127|  1.25k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   266k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   266k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   266k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   266k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  1.06M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 800k, False: 266k]
  ------------------
 1139|   800k|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|   800k|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 47.7k, False: 752k]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   137k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 89.7k, False: 47.7k]
  ------------------
 1144|  89.7k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|  89.7k|      }
 1146|  47.7k|      continue;
 1147|  47.7k|    }
 1148|   752k|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|   752k|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 376k, False: 376k]
  ------------------
 1151|   376k|      continue;
 1152|   376k|    }
 1153|       |
 1154|  1.07M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 702k, False: 376k]
  ------------------
 1155|   702k|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|   702k|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 536k, False: 165k]
  ------------------
 1157|   536k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|   536k|      }
 1159|   702k|    }
 1160|   376k|  }
 1161|   266k|  return true;
 1162|   266k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE21AssignPointsToCornersEi:
 1166|  2.51k|    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.51k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  2.51k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 49, False: 2.46k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|   170k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 170k, False: 49]
  ------------------
 1176|   170k|      Mesh::Face face;
 1177|   170k|      const CornerIndex start_corner(3 * f.value());
 1178|   680k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 510k, False: 170k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   510k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   510k|        face[c] = vert_id;
 1182|   510k|      }
 1183|   170k|      decoder_->mesh()->SetFace(f, face);
 1184|   170k|    }
 1185|     49|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|     49|    return true;
 1187|     49|  }
 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.46k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  2.46k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   184k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 182k, False: 2.46k]
  ------------------
 1197|   182k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   182k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 16.3k, False: 165k]
  ------------------
 1199|  16.3k|      continue;  // Isolated vertex.
 1200|  16.3k|    }
 1201|   165k|    CornerIndex deduplication_first_corner = c;
 1202|   165k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 48.9k, False: 116k]
  ------------------
 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|  48.9k|      deduplication_first_corner = c;
 1206|   116k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   164k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 131k, False: 32.1k]
  ------------------
 1210|   131k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 31.6k, False: 100k]
  ------------------
 1211|  31.6k|          continue;  // No seam for this attribute, ignore it.
 1212|  31.6k|        }
 1213|       |        // Else there needs to be at least one seam edge.
 1214|       |
 1215|       |        // At this point, we use identity mapping between corners and point ids.
 1216|   100k|        const VertexIndex vert_id =
 1217|   100k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|   100k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|   100k|        bool seam_found = false;
 1220|   171k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 155k, False: 15.6k]
  ------------------
 1221|   155k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 2, False: 155k]
  ------------------
 1222|      2|            return false;
 1223|      2|          }
 1224|   155k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 84.6k, False: 71.2k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  84.6k|            deduplication_first_corner = act_c;
 1227|  84.6k|            seam_found = true;
 1228|  84.6k|            break;
 1229|  84.6k|          }
 1230|  71.2k|          act_c = corner_table_->SwingRight(act_c);
 1231|  71.2k|        }
 1232|   100k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 84.6k, False: 15.6k]
  ------------------
 1233|  84.6k|          break;  // No reason to process other attributes if we found a seam.
 1234|  84.6k|        }
 1235|   100k|      }
 1236|   116k|    }
 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|   165k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   165k|    corner_to_point_map[c.value()] =
 1246|   165k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   165k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   165k|    CornerIndex prev_c = c;
 1250|   165k|    c = corner_table_->SwingRight(c);
 1251|   817k|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 767k, False: 49.4k]
  |  Branch (1251:40): [True: 651k, False: 116k]
  ------------------
 1252|   651k|      bool attribute_seam = false;
 1253|   920k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 751k, False: 169k]
  ------------------
 1254|   751k|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 482k, False: 269k]
  ------------------
 1255|   751k|            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|   482k|          attribute_seam = true;
 1259|   482k|          break;
 1260|   482k|        }
 1261|   751k|      }
 1262|   651k|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 482k, False: 169k]
  ------------------
 1263|   482k|        corner_to_point_map[c.value()] =
 1264|   482k|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|   482k|        point_to_corner_map.push_back(c.value());
 1266|   482k|      } else {
 1267|   169k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|   169k|      }
 1269|   651k|      prev_c = c;
 1270|   651k|      c = corner_table_->SwingRight(c);
 1271|   651k|    }
 1272|   165k|  }
 1273|       |  // Add faces.
 1274|   270k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 267k, False: 2.46k]
  ------------------
 1275|   267k|    Mesh::Face face;
 1276|  1.07M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 803k, False: 267k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|   803k|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|   803k|    }
 1280|   267k|    decoder_->mesh()->SetFace(f, face);
 1281|   267k|  }
 1282|  2.46k|  decoder_->point_cloud()->set_num_points(
 1283|  2.46k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  2.46k|  return true;
 1285|  2.46k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEEC2Ev:
   48|  1.79k|    : decoder_(nullptr),
   49|  1.79k|      last_symbol_id_(-1),
   50|  1.79k|      last_vert_id_(-1),
   51|  1.79k|      last_face_id_(-1),
   52|  1.79k|      num_new_vertices_(0),
   53|  1.79k|      num_encoded_vertices_(0),
   54|  1.79k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  1.79k|    MeshEdgebreakerDecoder *decoder) {
   59|  1.79k|  decoder_ = decoder;
   60|  1.79k|  return true;
   61|  1.79k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23GetAttributeCornerTableEi:
   66|  1.52k|    int att_id) const {
   67|  2.31k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 1.83k, False: 481]
  ------------------
   68|  1.83k|    const int decoder_id = attribute_data_[i].decoder_id;
   69|  1.83k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 790, False: 1.04k]
  |  Branch (69:27): [True: 0, False: 1.04k]
  ------------------
   70|    790|      continue;
   71|    790|    }
   72|  1.04k|    const AttributesDecoderInterface *const dec =
   73|  1.04k|        decoder_->attributes_decoder(decoder_id);
   74|  3.00k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 3.00k, False: 2]
  ------------------
   75|  3.00k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 1.04k, False: 1.96k]
  ------------------
   76|  1.04k|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 760, False: 282]
  ------------------
   77|    760|          return &attribute_data_[i].connectivity_data;
   78|    760|        }
   79|    282|        return nullptr;
   80|  1.04k|      }
   81|  3.00k|    }
   82|  1.04k|  }
   83|    481|  return nullptr;
   84|  1.52k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE24GetAttributeEncodingDataEi:
   89|  1.52k|    int att_id) const {
   90|  2.31k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 1.83k, False: 481]
  ------------------
   91|  1.83k|    const int decoder_id = attribute_data_[i].decoder_id;
   92|  1.83k|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 790, False: 1.04k]
  |  Branch (92:27): [True: 0, False: 1.04k]
  ------------------
   93|    790|      continue;
   94|    790|    }
   95|  1.04k|    const AttributesDecoderInterface *const dec =
   96|  1.04k|        decoder_->attributes_decoder(decoder_id);
   97|  3.00k|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 3.00k, False: 2]
  ------------------
   98|  3.00k|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 1.04k, False: 1.96k]
  ------------------
   99|  1.04k|        return &attribute_data_[i].encoding_data;
  100|  1.04k|      }
  101|  3.00k|    }
  102|  1.04k|  }
  103|    481|  return &pos_encoding_data_;
  104|  1.52k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE23CreateAttributesDecoderEi:
  130|  1.21k|    int32_t att_decoder_id) {
  131|  1.21k|  int8_t att_data_id;
  132|  1.21k|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 24, False: 1.19k]
  ------------------
  133|     24|    return false;
  134|     24|  }
  135|  1.19k|  uint8_t decoder_type;
  136|  1.19k|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 24, False: 1.17k]
  ------------------
  137|     24|    return false;
  138|     24|  }
  139|       |
  140|  1.17k|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 815, False: 356]
  ------------------
  141|    815|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 52, False: 763]
  ------------------
  142|     52|      return false;  // Unexpected attribute data.
  143|     52|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|    763|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 4, False: 759]
  ------------------
  148|      4|      return false;
  149|      4|    }
  150|       |
  151|    759|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|    759|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    356|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 2, False: 354]
  ------------------
  155|      2|      return false;  // Some other decoder is already using the data. Error.
  156|      2|    }
  157|    354|    pos_data_decoder_id_ = att_decoder_id;
  158|    354|  }
  159|       |
  160|  1.11k|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|  1.11k|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|  1.11k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 1.11k, False: 0]
  ------------------
  162|  1.11k|    uint8_t traversal_method_encoded;
  163|  1.11k|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 11, False: 1.10k]
  ------------------
  164|     11|      return false;
  165|     11|    }
  166|       |    // Check that decoded traversal method is valid.
  167|  1.10k|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 20, False: 1.08k]
  ------------------
  168|     20|      return false;
  169|     20|    }
  170|  1.08k|    traversal_method =
  171|  1.08k|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|  1.08k|  }
  173|       |
  174|  1.08k|  const Mesh *mesh = decoder_->mesh();
  175|  1.08k|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|  1.08k|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 548, False: 534]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    548|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    548|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 335, False: 213]
  ------------------
  182|    335|      encoding_data = &pos_encoding_data_;
  183|    335|    } else {
  184|    213|      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|    213|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|    213|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    548|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 229, False: 319]
  ------------------
  191|    229|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|    229|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|    229|          AttTraverser;
  194|    229|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    319|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 319, False: 0]
  ------------------
  196|    319|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    319|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    319|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    319|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    548|  } else {
  203|    534|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 1, False: 533]
  ------------------
  204|      1|      return false;  // Unsupported method.
  205|      1|    }
  206|    533|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 2, False: 531]
  ------------------
  207|      2|      return false;  // Attribute data must be specified.
  208|      2|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|    531|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|    531|        AttObserver;
  214|    531|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|    531|        AttTraverser;
  216|       |
  217|    531|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|    531|        &attribute_data_[att_data_id].encoding_data;
  219|    531|    const MeshAttributeCornerTable *const corner_table =
  220|    531|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|    531|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|    531|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|    531|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|    531|                             encoding_data);
  227|       |
  228|    531|    AttTraverser att_traverser;
  229|    531|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|    531|    traversal_sequencer->SetTraverser(att_traverser);
  232|    531|    sequencer = std::move(traversal_sequencer);
  233|    531|  }
  234|       |
  235|  1.07k|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 1.07k]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|  1.07k|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|  1.07k|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|  1.07k|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|  1.07k|                                        std::move(att_controller));
  244|  1.07k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEv:
  247|  1.79k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  1.79k|  num_new_vertices_ = 0;
  249|  1.79k|  new_to_parent_vertex_map_.clear();
  250|  1.79k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  1.79k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.79k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 494, False: 1.30k]
  ------------------
  252|    494|    uint32_t num_new_verts;
  253|    494|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    494|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 195, False: 299]
  ------------------
  254|    195|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 195]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|    299|    } else {
  258|    299|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 299]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|    299|    }
  262|    494|    num_new_vertices_ = num_new_verts;
  263|    494|  }
  264|  1.79k|#endif
  265|       |
  266|  1.79k|  uint32_t num_encoded_vertices;
  267|  1.79k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  1.79k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.79k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 195, False: 1.59k]
  ------------------
  269|    195|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 195]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|    195|  } else
  274|  1.59k|#endif
  275|  1.59k|  {
  276|  1.59k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 0, False: 1.59k]
  ------------------
  277|      0|      return false;
  278|      0|    }
  279|  1.59k|  }
  280|  1.79k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  1.79k|  uint32_t num_faces;
  283|  1.79k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  1.79k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.79k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 195, False: 1.59k]
  ------------------
  285|    195|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 195]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|    195|  } else
  290|  1.59k|#endif
  291|  1.59k|  {
  292|  1.59k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 1.59k]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|  1.59k|  }
  296|  1.79k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 1, False: 1.79k]
  ------------------
  297|      1|    return false;  // Draco cannot handle this many faces.
  298|      1|  }
  299|       |
  300|  1.79k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 5, False: 1.78k]
  ------------------
  301|      5|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|      5|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  1.78k|  const uint32_t min_num_face_edges = 3 * num_faces / 2;
  307|       |
  308|       |  // Maximum number of edges that can exist between |num_encoded_vertices_|.
  309|       |  // This is based on graph theory assuming simple connected graph.
  310|  1.78k|  const uint64_t num_encoded_vertices_64 =
  311|  1.78k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  1.78k|  const uint64_t max_num_vertex_edges =
  313|  1.78k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  1.78k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 1, False: 1.78k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      1|    return false;
  317|      1|  }
  318|       |
  319|  1.78k|  uint8_t num_attribute_data;
  320|  1.78k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 1.78k]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|  1.78k|  uint32_t num_encoded_symbols;
  325|  1.78k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  1.78k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.78k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 189, False: 1.59k]
  ------------------
  327|    189|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 189]
  ------------------
  328|      0|      return false;
  329|      0|    }
  330|       |
  331|    189|  } else
  332|  1.59k|#endif
  333|  1.59k|  {
  334|  1.59k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 0, False: 1.59k]
  ------------------
  335|      0|      return false;
  336|      0|    }
  337|  1.59k|  }
  338|       |
  339|  1.78k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 7, False: 1.78k]
  ------------------
  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|      7|    return false;
  344|      7|  }
  345|  1.78k|  const uint32_t max_encoded_faces =
  346|  1.78k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  1.78k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 17, False: 1.76k]
  ------------------
  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|     17|    return false;
  352|     17|  }
  353|       |
  354|  1.76k|  uint32_t num_encoded_split_symbols;
  355|  1.76k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  1.76k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.76k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 172, False: 1.59k]
  ------------------
  357|    172|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 172]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|    172|  } else
  362|  1.59k|#endif
  363|  1.59k|  {
  364|  1.59k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 1.59k]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|  1.59k|  }
  368|       |
  369|  1.76k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 14, False: 1.74k]
  ------------------
  370|     14|    return false;  // Split symbols are a sub-set of all symbols.
  371|     14|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  1.74k|  vertex_traversal_length_.clear();
  375|  1.74k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  1.74k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 1.74k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  1.74k|  processed_corner_ids_.clear();
  380|  1.74k|  processed_corner_ids_.reserve(num_faces);
  381|  1.74k|  processed_connectivity_corners_.clear();
  382|  1.74k|  processed_connectivity_corners_.reserve(num_faces);
  383|  1.74k|  topology_split_data_.clear();
  384|  1.74k|  hole_event_data_.clear();
  385|  1.74k|  init_face_configurations_.clear();
  386|  1.74k|  init_corners_.clear();
  387|       |
  388|  1.74k|  last_symbol_id_ = -1;
  389|  1.74k|  last_face_id_ = -1;
  390|  1.74k|  last_vert_id_ = -1;
  391|       |
  392|  1.74k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  1.74k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  1.74k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 1, False: 1.74k]
  ------------------
  397|  1.74k|          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|  1.74k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  1.74k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  1.74k|  int32_t topology_split_decoded_bytes = -1;
  410|  1.74k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.74k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 459, False: 1.28k]
  ------------------
  411|    459|    uint32_t encoded_connectivity_size;
  412|    459|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    459|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 161, False: 298]
  ------------------
  413|    161|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 1, False: 160]
  ------------------
  414|      1|        return false;
  415|      1|      }
  416|    298|    } else {
  417|    298|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 298]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|    298|    }
  421|    458|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 0, False: 458]
  ------------------
  422|    458|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 20, False: 438]
  ------------------
  423|     20|      return false;
  424|     20|    }
  425|    438|    DecoderBuffer event_buffer;
  426|    438|    event_buffer.Init(
  427|    438|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    438|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    438|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    438|    topology_split_decoded_bytes =
  432|    438|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    438|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 150, False: 288]
  ------------------
  434|    150|      return false;
  435|    150|    }
  436|       |
  437|    438|  } else
  438|  1.28k|#endif
  439|  1.28k|  {
  440|  1.28k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 17, False: 1.27k]
  ------------------
  441|     17|      return false;
  442|     17|    }
  443|  1.28k|  }
  444|       |
  445|  1.56k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  1.56k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  1.56k|                                           num_encoded_split_symbols);
  449|  1.56k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  1.56k|  DecoderBuffer traversal_end_buffer;
  452|  1.56k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 115, False: 1.44k]
  ------------------
  453|    115|    return false;
  454|    115|  }
  455|       |
  456|  1.44k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.44k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 187, False: 1.25k]
  ------------------
  458|    187|    return false;
  459|    187|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|  1.25k|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|  1.25k|                           traversal_end_buffer.remaining_size(),
  464|  1.25k|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|  1.25k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|  1.25k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  1.25k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 223, False: 1.03k]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|    223|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|    223|  }
  471|  1.25k|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|  1.25k|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 1.11k, False: 142]
  ------------------
  475|  1.11k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|  1.11k|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.11k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 170, False: 946]
  ------------------
  477|   438k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 438k, False: 170]
  ------------------
  478|   438k|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 438k]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|   438k|      }
  482|       |
  483|    170|    } else
  484|    946|#endif
  485|    946|    {
  486|  7.40M|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 7.40M, False: 946]
  ------------------
  487|  7.40M|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 7.40M]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|  7.40M|      }
  491|    946|    }
  492|  1.11k|  }
  493|  1.25k|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|  2.80k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 1.54k, False: 1.25k]
  ------------------
  498|  1.54k|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  11.7M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 11.7M, False: 1.54k]
  ------------------
  501|  11.7M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  11.7M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|  1.54k|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 1.54k]
  ------------------
  505|  1.54k|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|  1.54k|  }
  509|       |
  510|  1.25k|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|  2.80k|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 1.54k, False: 1.25k]
  ------------------
  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.54k|    int32_t att_connectivity_verts =
  517|  1.54k|        attribute_data_[i].connectivity_data.num_vertices();
  518|  1.54k|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 336, False: 1.21k]
  ------------------
  519|    336|      att_connectivity_verts = corner_table_->num_vertices();
  520|    336|    }
  521|  1.54k|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|  1.54k|  }
  523|  1.25k|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 9, False: 1.24k]
  ------------------
  524|      9|    return false;
  525|      9|  }
  526|  1.24k|  return true;
  527|  1.25k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE19OnAttributesDecodedEv:
  530|    250|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|    250|  return true;
  532|    250|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18DecodeConnectivityEi:
  536|  1.44k|    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.44k|  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.44k|  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.44k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.44k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.44k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.44k|  int num_faces = 0;
  562|  72.6M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 72.6M, False: 1.34k]
  ------------------
  563|  72.6M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  72.6M|    bool check_topology_split = false;
  566|  72.6M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  72.6M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 35.4M, False: 37.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|  35.4M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 0, False: 35.4M]
  ------------------
  588|      0|        return -1;
  589|      0|      }
  590|       |
  591|  35.4M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  35.4M|      const VertexIndex vertex_x =
  593|  35.4M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  35.4M|      const CornerIndex corner_b =
  595|  35.4M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  35.4M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 22, False: 35.4M]
  ------------------
  598|       |        // All matched corners must be different.
  599|     22|        return -1;
  600|     22|      }
  601|  35.4M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 35.4M]
  |  Branch (601:11): [True: 0, False: 35.4M]
  ------------------
  602|  35.4M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 35.4M]
  ------------------
  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|  35.4M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  35.4M|      SetOppositeCorners(corner_a, corner + 1);
  612|  35.4M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  35.4M|      const VertexIndex vert_a_prev =
  616|  35.4M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  35.4M|      const VertexIndex vert_b_next =
  618|  35.4M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  35.4M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 35.4M]
  |  Branch (619:38): [True: 0, False: 35.4M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  35.4M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  35.4M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  35.4M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  35.4M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  35.4M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  35.4M|      active_corner_stack.back() = corner;
  631|  37.1M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 37.1M, False: 77.5k]
  |  Branch (631:40): [True: 15.6k, False: 61.9k]
  ------------------
  632|       |      // Create a new face extending from the open boundary edge opposite to the
  633|       |      // corner "a" from the image below. Two new boundary edges are created
  634|       |      // opposite to corners "r" and "l". New active corner is set to either "r"
  635|       |      // or "l" depending on the decoded symbol. One new vertex is created
  636|       |      // at the opposite corner to corner "a".
  637|       |      //     *-------*
  638|       |      //    /a\     / \
  639|       |      //   /   \   /   \
  640|       |      //  /     \ /     \
  641|       |      // *-------v-------*
  642|       |      //  .l   r.
  643|       |      //   .   .
  644|       |      //    . .
  645|       |      //     *
  646|  37.1M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 0, False: 37.1M]
  ------------------
  647|      0|        return -1;
  648|      0|      }
  649|  37.1M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  37.1M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 37.1M]
  ------------------
  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|  37.1M|      const CornerIndex corner(3 * face.value());
  658|  37.1M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  37.1M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 37.1M, False: 15.6k]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  37.1M|        opp_corner = corner + 2;
  662|  37.1M|        corner_l = corner + 1;
  663|  37.1M|        corner_r = corner;
  664|  37.1M|      } else {
  665|       |        // "l" is the new first corner.
  666|  15.6k|        opp_corner = corner + 1;
  667|  15.6k|        corner_l = corner;
  668|  15.6k|        corner_r = corner + 2;
  669|  15.6k|      }
  670|  37.1M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  37.1M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  37.1M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 9, False: 37.1M]
  ------------------
  675|      9|        return -1;  // Unexpected number of decoded vertices.
  676|      9|      }
  677|       |
  678|  37.1M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  37.1M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  37.1M|      const VertexIndex vertex_r =
  682|  37.1M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  37.1M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  37.1M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  37.1M|      corner_table_->MapCornerToVertex(
  688|  37.1M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  37.1M|      active_corner_stack.back() = corner;
  690|  37.1M|      check_topology_split = true;
  691|  37.1M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 13.8k, False: 48.1k]
  ------------------
  692|       |      // Create a new face that merges two last active edges from the active
  693|       |      // stack. No new vertex is created, but two vertices at corners "p" and
  694|       |      // "n" need to be merged into a single vertex.
  695|       |      //
  696|       |      // *-------v-------*
  697|       |      //  \a   p/x\n   b/
  698|       |      //   \   /   \   /
  699|       |      //    \ /  S  \ /
  700|       |      //     *.......*
  701|       |      //
  702|  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: 33, False: 13.7k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     33|        active_corner_stack.push_back(it->second);
  714|     33|      }
  715|  13.8k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 16, False: 13.8k]
  ------------------
  716|     16|        return -1;
  717|     16|      }
  718|  13.8k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  13.8k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 13.8k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  13.8k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 5, False: 13.8k]
  |  Branch (724:11): [True: 5, False: 13.8k]
  ------------------
  725|  13.8k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 13.8k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      5|        return -1;
  729|      5|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  13.8k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  13.8k|      SetOppositeCorners(corner_a, corner + 2);
  735|  13.8k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  13.8k|      const VertexIndex vertex_p =
  739|  13.8k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  13.8k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  13.8k|      corner_table_->MapCornerToVertex(
  742|  13.8k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  13.8k|      const VertexIndex vert_b_prev =
  744|  13.8k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  13.8k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  13.8k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  13.8k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  13.8k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  13.8k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  13.8k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  13.8k|                                       corner_table_->LeftMostCorner(vertex_n));
  753|       |
  754|       |      // Also update the vertex id at corner "n" and all corners that are
  755|       |      // connected to it in the CCW direction.
  756|  13.8k|      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: 5, False: 51.7k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      5|          return -1;
  764|      5|        }
  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: 3.44k, False: 10.3k]
  ------------------
  770|  3.44k|        invalid_vertices.push_back(vertex_n);
  771|  3.44k|      }
  772|  13.7k|      active_corner_stack.back() = corner;
  773|  48.1k|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 48.1k, False: 0]
  ------------------
  774|  48.1k|      const CornerIndex corner(3 * face.value());
  775|  48.1k|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  48.1k|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  48.1k|      corner_table_->MapCornerToVertex(corner + 1,
  779|  48.1k|                                       corner_table_->AddNewVertex());
  780|  48.1k|      corner_table_->MapCornerToVertex(corner + 2,
  781|  48.1k|                                       corner_table_->AddNewVertex());
  782|       |
  783|  48.1k|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 4, False: 48.1k]
  ------------------
  784|      4|        return -1;  // Unexpected number of decoded vertices.
  785|      4|      }
  786|       |
  787|  48.1k|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  48.1k|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  48.1k|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  48.1k|      active_corner_stack.push_back(corner);
  792|  48.1k|      check_topology_split = true;
  793|  48.1k|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|      0|      return -1;
  796|      0|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  72.6M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  72.6M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 37.1M, False: 35.4M]
  ------------------
  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|  37.1M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  37.1M|      EdgeFaceName split_edge;
  812|  37.1M|      int encoder_split_symbol_id;
  813|  37.1M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.64k, False: 37.1M]
  ------------------
  814|  37.1M|                             &encoder_split_symbol_id)) {
  815|  1.64k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 39, False: 1.60k]
  ------------------
  816|     39|          return -1;  // Wrong split symbol id.
  817|     39|        }
  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.60k|        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.60k|        CornerIndex new_active_corner;
  831|  1.60k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 516, False: 1.08k]
  ------------------
  832|    516|          new_active_corner = corner_table_->Next(act_top_corner);
  833|  1.08k|        } else {
  834|  1.08k|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|  1.08k|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.60k|        const int decoder_split_symbol_id =
  839|  1.60k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.60k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.60k|            new_active_corner;
  842|  1.60k|      }
  843|  37.1M|    }
  844|  72.6M|  }
  845|  1.34k|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 1.34k]
  ------------------
  846|      0|    return -1;  // Unexpected number of decoded vertices.
  847|      0|  }
  848|       |  // Decode start faces and connect them to the faces from the active stack.
  849|  33.9k|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 32.6k, False: 1.31k]
  ------------------
  850|  32.6k|    const CornerIndex corner = active_corner_stack.back();
  851|  32.6k|    active_corner_stack.pop_back();
  852|  32.6k|    const bool interior_face =
  853|  32.6k|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  32.6k|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 24.2k, False: 8.34k]
  ------------------
  855|       |      // The start face is interior, we need to find three corners that are
  856|       |      // opposite to it. The first opposite corner "a" is the corner from the
  857|       |      // top of the active corner stack and the remaining two corners "b" and
  858|       |      // "c" are then the next corners from the left-most corners of vertices
  859|       |      // "n" and "x" respectively.
  860|       |      //
  861|       |      //           *-------*
  862|       |      //          / \     / \
  863|       |      //         /   \   /   \
  864|       |      //        /     \ /     \
  865|       |      //       *-------p-------*
  866|       |      //      / \a    . .    c/ \
  867|       |      //     /   \   .   .   /   \
  868|       |      //    /     \ .  I  . /     \
  869|       |      //   *-------n.......x------*
  870|       |      //    \     / \     / \     /
  871|       |      //     \   /   \   /   \   /
  872|       |      //      \ /     \b/     \ /
  873|       |      //       *-------*-------*
  874|       |      //
  875|       |
  876|  24.2k|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 13, False: 24.2k]
  ------------------
  877|     13|        return -1;  // More faces than expected added to the mesh.
  878|     13|      }
  879|       |
  880|  24.2k|      const CornerIndex corner_a = corner;
  881|  24.2k|      const VertexIndex vert_n =
  882|  24.2k|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  24.2k|      const CornerIndex corner_b =
  884|  24.2k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  24.2k|      const VertexIndex vert_x =
  887|  24.2k|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  24.2k|      const CornerIndex corner_c =
  889|  24.2k|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  24.2k|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 2, False: 24.2k]
  |  Branch (891:33): [True: 9, False: 24.2k]
  |  Branch (891:55): [True: 0, False: 24.2k]
  ------------------
  892|       |        // All matched corners must be different.
  893|     11|        return -1;
  894|     11|      }
  895|  24.2k|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 4, False: 24.2k]
  |  Branch (895:11): [True: 4, False: 24.2k]
  ------------------
  896|  24.2k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 24.2k]
  ------------------
  897|  24.2k|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 24.2k]
  ------------------
  898|       |        // One of the corners is already opposite to an existing face, which
  899|       |        // should not happen unless the input was tampered with.
  900|      4|        return -1;
  901|      4|      }
  902|       |
  903|  24.2k|      const VertexIndex vert_p =
  904|  24.2k|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  24.2k|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  24.2k|      const CornerIndex new_corner(3 * face.value());
  909|  24.2k|      SetOppositeCorners(new_corner, corner);
  910|  24.2k|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  24.2k|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  24.2k|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  24.2k|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  24.2k|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  96.8k|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 72.6k, False: 24.2k]
  ------------------
  920|  72.6k|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  72.6k|      }
  922|       |
  923|  24.2k|      init_face_configurations_.push_back(true);
  924|  24.2k|      init_corners_.push_back(new_corner);
  925|  24.2k|    } else {
  926|       |      // The initial face wasn't interior and the traversal had to start from
  927|       |      // an open boundary. In this case no new face is added, but we need to
  928|       |      // keep record about the first opposite corner to this boundary.
  929|  8.34k|      init_face_configurations_.push_back(false);
  930|  8.34k|      init_corners_.push_back(corner);
  931|  8.34k|    }
  932|  32.6k|  }
  933|  1.31k|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 56, False: 1.26k]
  ------------------
  934|     56|    return -1;  // Unexpected number of decoded faces.
  935|     56|  }
  936|       |
  937|  1.26k|  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.91k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 1.91k, False: 1.25k]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  1.91k|    VertexIndex src_vert(num_vertices - 1);
  943|  2.12k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 213, False: 1.91k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    213|      src_vert = VertexIndex(--num_vertices - 1);
  946|    213|    }
  947|  1.91k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 213, False: 1.70k]
  ------------------
  948|    213|      continue;  // No need to swap anything.
  949|    213|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  1.70k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  8.57k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 6.87k, False: 1.69k]
  ------------------
  954|  6.87k|      const CornerIndex cid = vcit.Corner();
  955|  6.87k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 3, False: 6.87k]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      3|        return -1;
  959|      3|      }
  960|  6.87k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  6.87k|    }
  962|  1.69k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  1.69k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  1.69k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  1.69k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  1.69k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  1.69k|    num_vertices--;
  972|  1.69k|  }
  973|  1.25k|  return num_vertices;
  974|  1.26k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  1.72k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  1.72k|  uint32_t num_topology_splits;
  982|  1.72k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  1.72k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.72k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 140, False: 1.58k]
  ------------------
  984|    140|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 1, False: 139]
  ------------------
  985|      1|      return -1;
  986|      1|    }
  987|       |
  988|    140|  } else
  989|  1.58k|#endif
  990|  1.58k|  {
  991|  1.58k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 1.58k]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|  1.58k|  }
  995|  1.72k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 686, False: 1.04k]
  ------------------
  996|    686|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 28, False: 658]
  ------------------
  997|    686|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     28|      return -1;
  999|     28|    }
 1000|    658|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    658|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    658|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 74, False: 584]
  ------------------
 1002|   340k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 340k, False: 39]
  ------------------
 1003|   340k|        TopologySplitEventData event_data;
 1004|   340k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 20, False: 339k]
  ------------------
 1005|     20|          return -1;
 1006|     20|        }
 1007|   339k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 11, False: 339k]
  ------------------
 1008|     11|          return -1;
 1009|     11|        }
 1010|   339k|        uint8_t edge_data;
 1011|   339k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 4, False: 339k]
  ------------------
 1012|      4|          return -1;
 1013|      4|        }
 1014|   339k|        event_data.source_edge = edge_data & 1;
 1015|   339k|        topology_split_data_.push_back(event_data);
 1016|   339k|      }
 1017|       |
 1018|     74|    } else
 1019|    584|#endif
 1020|    584|    {
 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|    584|      int last_source_symbol_id = 0;
 1024|  35.9k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 35.3k, False: 569]
  ------------------
 1025|  35.3k|        TopologySplitEventData event_data;
 1026|  35.3k|        uint32_t delta;
 1027|  35.3k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 4, False: 35.3k]
  ------------------
 1028|      4|          return -1;
 1029|      4|        }
 1030|  35.3k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  35.3k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 1, False: 35.3k]
  ------------------
 1032|      1|          return -1;
 1033|      1|        }
 1034|  35.3k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 10, False: 35.3k]
  ------------------
 1035|     10|          return -1;
 1036|     10|        }
 1037|  35.3k|        event_data.split_symbol_id =
 1038|  35.3k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  35.3k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  35.3k|        topology_split_data_.push_back(event_data);
 1041|  35.3k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    569|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  35.6k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 35.0k, False: 569]
  ------------------
 1045|  35.0k|        uint32_t edge_data;
 1046|  35.0k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  35.0k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 2.52k, False: 32.5k]
  ------------------
 1047|  2.52k|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  32.5k|        } else {
 1049|  32.5k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  32.5k|        }
 1051|  35.0k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  35.0k|        event_data.source_edge = edge_data & 1;
 1053|  35.0k|      }
 1054|    569|      decoder_buffer->EndBitDecoding();
 1055|    569|    }
 1056|    658|  }
 1057|  1.64k|  uint32_t num_hole_events = 0;
 1058|  1.64k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  1.64k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  1.64k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 86, False: 1.56k]
  ------------------
 1060|     86|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 4, False: 82]
  ------------------
 1061|      4|      return -1;
 1062|      4|    }
 1063|  1.56k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  1.56k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 212, False: 1.35k]
  ------------------
 1064|    212|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 5, False: 207]
  ------------------
 1065|      5|      return -1;
 1066|      5|    }
 1067|    212|  }
 1068|  1.63k|#endif
 1069|  1.63k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 90, False: 1.54k]
  ------------------
 1070|     90|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     90|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     90|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 68, False: 22]
  ------------------
 1072|   990k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 990k, False: 5]
  ------------------
 1073|   990k|        HoleEventData event_data;
 1074|   990k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 63, False: 990k]
  ------------------
 1075|     63|          return -1;
 1076|     63|        }
 1077|   990k|        hole_event_data_.push_back(event_data);
 1078|   990k|      }
 1079|       |
 1080|     68|    } else
 1081|     22|#endif
 1082|     22|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     22|      int last_symbol_id = 0;
 1085|   151k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 151k, False: 6]
  ------------------
 1086|   151k|        HoleEventData event_data;
 1087|   151k|        uint32_t delta;
 1088|   151k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 16, False: 151k]
  ------------------
 1089|     16|          return -1;
 1090|     16|        }
 1091|   151k|        event_data.symbol_id = delta + last_symbol_id;
 1092|   151k|        last_symbol_id = event_data.symbol_id;
 1093|   151k|        hole_event_data_.push_back(event_data);
 1094|   151k|      }
 1095|     22|    }
 1096|     90|  }
 1097|  1.56k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  1.63k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|   438k|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|   438k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|   438k|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|  1.75M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 1.31M, False: 438k]
  ------------------
 1109|  1.31M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|  1.31M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 5.10k, False: 1.30M]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|  10.4k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 5.33k, False: 5.10k]
  ------------------
 1114|  5.33k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|  5.33k|      }
 1116|  5.10k|      continue;
 1117|  5.10k|    }
 1118|       |
 1119|  2.62M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 1.31M, False: 1.30M]
  ------------------
 1120|  1.31M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|  1.31M|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 492k, False: 819k]
  ------------------
 1122|   492k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|   492k|      }
 1124|  1.31M|    }
 1125|  1.30M|  }
 1126|   438k|  return true;
 1127|   438k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|  7.40M|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|  7.40M|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|  7.40M|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|  7.40M|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  29.6M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 22.2M, False: 7.40M]
  ------------------
 1139|  22.2M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  22.2M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 92.1k, False: 22.1M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   218k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 126k, False: 92.1k]
  ------------------
 1144|   126k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   126k|      }
 1146|  92.1k|      continue;
 1147|  92.1k|    }
 1148|  22.1M|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|  22.1M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 11.0M, False: 11.0M]
  ------------------
 1151|  11.0M|      continue;
 1152|  11.0M|    }
 1153|       |
 1154|  24.4M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 13.3M, False: 11.0M]
  ------------------
 1155|  13.3M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  13.3M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 11.1M, False: 2.24M]
  ------------------
 1157|  11.1M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  11.1M|      }
 1159|  13.3M|    }
 1160|  11.0M|  }
 1161|  7.40M|  return true;
 1162|  7.40M|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE21AssignPointsToCornersEi:
 1166|  1.25k|    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.25k|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|  1.25k|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 142, False: 1.11k]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|  1.44M|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 1.44M, False: 142]
  ------------------
 1176|  1.44M|      Mesh::Face face;
 1177|  1.44M|      const CornerIndex start_corner(3 * f.value());
 1178|  5.76M|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 4.32M, False: 1.44M]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|  4.32M|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|  4.32M|        face[c] = vert_id;
 1182|  4.32M|      }
 1183|  1.44M|      decoder_->mesh()->SetFace(f, face);
 1184|  1.44M|    }
 1185|    142|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|    142|    return true;
 1187|    142|  }
 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.11k|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|  1.11k|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|  3.95M|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 3.95M, False: 1.10k]
  ------------------
 1197|  3.95M|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|  3.95M|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 2.33k, False: 3.94M]
  ------------------
 1199|  2.33k|      continue;  // Isolated vertex.
 1200|  2.33k|    }
 1201|  3.94M|    CornerIndex deduplication_first_corner = c;
 1202|  3.94M|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 96.6k, False: 3.85M]
  ------------------
 1203|       |      // If the vertex is on a boundary, start deduplication from the left most
 1204|       |      // corner that is guaranteed to lie on the boundary.
 1205|  96.6k|      deduplication_first_corner = c;
 1206|  3.85M|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|  4.39M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 3.93M, False: 456k]
  ------------------
 1210|  3.93M|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 530k, False: 3.40M]
  ------------------
 1211|   530k|          continue;  // No seam for this attribute, ignore it.
 1212|   530k|        }
 1213|       |        // Else there needs to be at least one seam edge.
 1214|       |
 1215|       |        // At this point, we use identity mapping between corners and point ids.
 1216|  3.40M|        const VertexIndex vert_id =
 1217|  3.40M|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|  3.40M|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|  3.40M|        bool seam_found = false;
 1220|  3.48M|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 3.47M, False: 9.05k]
  ------------------
 1221|  3.47M|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 9, False: 3.47M]
  ------------------
 1222|      9|            return false;
 1223|      9|          }
 1224|  3.47M|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 3.39M, False: 75.7k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|  3.39M|            deduplication_first_corner = act_c;
 1227|  3.39M|            seam_found = true;
 1228|  3.39M|            break;
 1229|  3.39M|          }
 1230|  75.7k|          act_c = corner_table_->SwingRight(act_c);
 1231|  75.7k|        }
 1232|  3.40M|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 3.39M, False: 9.05k]
  ------------------
 1233|  3.39M|          break;  // No reason to process other attributes if we found a seam.
 1234|  3.39M|        }
 1235|  3.40M|      }
 1236|  3.85M|    }
 1237|       |
 1238|       |    // Do a deduplication pass over the corners on the processed vertex.
 1239|       |    // At this point each corner corresponds to one point id and our goal is to
 1240|       |    // merge similar points into a single point id.
 1241|       |    // We do a single pass in a clockwise direction over the corners and we add
 1242|       |    // a new point id whenever one of the attributes change.
 1243|  3.94M|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|  3.94M|    corner_to_point_map[c.value()] =
 1246|  3.94M|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|  3.94M|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|  3.94M|    CornerIndex prev_c = c;
 1250|  3.94M|    c = corner_table_->SwingRight(c);
 1251|  23.3M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 23.2M, False: 97.5k]
  |  Branch (1251:40): [True: 19.4M, False: 3.85M]
  ------------------
 1252|  19.4M|      bool attribute_seam = false;
 1253|  22.2M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 19.8M, False: 2.34M]
  ------------------
 1254|  19.8M|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 17.0M, False: 2.77M]
  ------------------
 1255|  19.8M|            attribute_data_[i].connectivity_data.Vertex(prev_c)) {
 1256|       |          // Attribute index changed from the previous corner. We need to add a
 1257|       |          // new point here.
 1258|  17.0M|          attribute_seam = true;
 1259|  17.0M|          break;
 1260|  17.0M|        }
 1261|  19.8M|      }
 1262|  19.4M|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 17.0M, False: 2.34M]
  ------------------
 1263|  17.0M|        corner_to_point_map[c.value()] =
 1264|  17.0M|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  17.0M|        point_to_corner_map.push_back(c.value());
 1266|  17.0M|      } else {
 1267|  2.34M|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|  2.34M|      }
 1269|  19.4M|      prev_c = c;
 1270|  19.4M|      c = corner_table_->SwingRight(c);
 1271|  19.4M|    }
 1272|  3.94M|  }
 1273|       |  // Add faces.
 1274|  7.79M|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 7.79M, False: 1.10k]
  ------------------
 1275|  7.79M|    Mesh::Face face;
 1276|  31.1M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 23.3M, False: 7.79M]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  23.3M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  23.3M|    }
 1280|  7.79M|    decoder_->mesh()->SetFace(f, face);
 1281|  7.79M|  }
 1282|  1.10k|  decoder_->point_cloud()->set_num_points(
 1283|  1.10k|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|  1.10k|  return true;
 1285|  1.11k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEEC2Ev:
   48|  2.64k|    : decoder_(nullptr),
   49|  2.64k|      last_symbol_id_(-1),
   50|  2.64k|      last_vert_id_(-1),
   51|  2.64k|      last_face_id_(-1),
   52|  2.64k|      num_new_vertices_(0),
   53|  2.64k|      num_encoded_vertices_(0),
   54|  2.64k|      pos_data_decoder_id_(-1) {}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE4InitEPNS_22MeshEdgebreakerDecoderE:
   58|  2.64k|    MeshEdgebreakerDecoder *decoder) {
   59|  2.64k|  decoder_ = decoder;
   60|  2.64k|  return true;
   61|  2.64k|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23GetAttributeCornerTableEi:
   66|    237|    int att_id) const {
   67|    333|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (67:24): [True: 135, False: 198]
  ------------------
   68|    135|    const int decoder_id = attribute_data_[i].decoder_id;
   69|    135|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (69:9): [True: 83, False: 52]
  |  Branch (69:27): [True: 0, False: 52]
  ------------------
   70|     83|      continue;
   71|     83|    }
   72|     52|    const AttributesDecoderInterface *const dec =
   73|     52|        decoder_->attributes_decoder(decoder_id);
   74|    122|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (74:21): [True: 109, False: 13]
  ------------------
   75|    109|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (75:11): [True: 39, False: 70]
  ------------------
   76|     39|        if (attribute_data_[i].is_connectivity_used) {
  ------------------
  |  Branch (76:13): [True: 22, False: 17]
  ------------------
   77|     22|          return &attribute_data_[i].connectivity_data;
   78|     22|        }
   79|     17|        return nullptr;
   80|     39|      }
   81|    109|    }
   82|     52|  }
   83|    198|  return nullptr;
   84|    237|}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE24GetAttributeEncodingDataEi:
   89|    237|    int att_id) const {
   90|    333|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (90:24): [True: 135, False: 198]
  ------------------
   91|    135|    const int decoder_id = attribute_data_[i].decoder_id;
   92|    135|    if (decoder_id < 0 || decoder_id >= decoder_->num_attributes_decoders()) {
  ------------------
  |  Branch (92:9): [True: 83, False: 52]
  |  Branch (92:27): [True: 0, False: 52]
  ------------------
   93|     83|      continue;
   94|     83|    }
   95|     52|    const AttributesDecoderInterface *const dec =
   96|     52|        decoder_->attributes_decoder(decoder_id);
   97|    122|    for (int j = 0; j < dec->GetNumAttributes(); ++j) {
  ------------------
  |  Branch (97:21): [True: 109, False: 13]
  ------------------
   98|    109|      if (dec->GetAttributeId(j) == att_id) {
  ------------------
  |  Branch (98:11): [True: 39, False: 70]
  ------------------
   99|     39|        return &attribute_data_[i].encoding_data;
  100|     39|      }
  101|    109|    }
  102|     52|  }
  103|    198|  return &pos_encoding_data_;
  104|    237|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE23CreateAttributesDecoderEi:
  130|    306|    int32_t att_decoder_id) {
  131|    306|  int8_t att_data_id;
  132|    306|  if (!decoder_->buffer()->Decode(&att_data_id)) {
  ------------------
  |  Branch (132:7): [True: 16, False: 290]
  ------------------
  133|     16|    return false;
  134|     16|  }
  135|    290|  uint8_t decoder_type;
  136|    290|  if (!decoder_->buffer()->Decode(&decoder_type)) {
  ------------------
  |  Branch (136:7): [True: 8, False: 282]
  ------------------
  137|      8|    return false;
  138|      8|  }
  139|       |
  140|    282|  if (att_data_id >= 0) {
  ------------------
  |  Branch (140:7): [True: 132, False: 150]
  ------------------
  141|    132|    if (att_data_id >= attribute_data_.size()) {
  ------------------
  |  Branch (141:9): [True: 22, False: 110]
  ------------------
  142|     22|      return false;  // Unexpected attribute data.
  143|     22|    }
  144|       |
  145|       |    // Ensure that the attribute data is not mapped to a different attributes
  146|       |    // decoder already.
  147|    110|    if (attribute_data_[att_data_id].decoder_id >= 0) {
  ------------------
  |  Branch (147:9): [True: 6, False: 104]
  ------------------
  148|      6|      return false;
  149|      6|    }
  150|       |
  151|    104|    attribute_data_[att_data_id].decoder_id = att_decoder_id;
  152|    150|  } else {
  153|       |    // Assign the attributes decoder to |pos_encoding_data_|.
  154|    150|    if (pos_data_decoder_id_ >= 0) {
  ------------------
  |  Branch (154:9): [True: 1, False: 149]
  ------------------
  155|      1|      return false;  // Some other decoder is already using the data. Error.
  156|      1|    }
  157|    149|    pos_data_decoder_id_ = att_decoder_id;
  158|    149|  }
  159|       |
  160|    253|  MeshTraversalMethod traversal_method = MESH_TRAVERSAL_DEPTH_FIRST;
  161|    253|  if (decoder_->bitstream_version() >= DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    253|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (161:7): [True: 253, False: 0]
  ------------------
  162|    253|    uint8_t traversal_method_encoded;
  163|    253|    if (!decoder_->buffer()->Decode(&traversal_method_encoded)) {
  ------------------
  |  Branch (163:9): [True: 6, False: 247]
  ------------------
  164|      6|      return false;
  165|      6|    }
  166|       |    // Check that decoded traversal method is valid.
  167|    247|    if (traversal_method_encoded >= NUM_TRAVERSAL_METHODS) {
  ------------------
  |  Branch (167:9): [True: 20, False: 227]
  ------------------
  168|     20|      return false;
  169|     20|    }
  170|    227|    traversal_method =
  171|    227|        static_cast<MeshTraversalMethod>(traversal_method_encoded);
  172|    227|  }
  173|       |
  174|    227|  const Mesh *mesh = decoder_->mesh();
  175|    227|  std::unique_ptr<PointsSequencer> sequencer;
  176|       |
  177|    227|  if (decoder_type == MESH_VERTEX_ATTRIBUTE) {
  ------------------
  |  Branch (177:7): [True: 179, False: 48]
  ------------------
  178|       |    // Per-vertex attribute decoder.
  179|       |
  180|    179|    MeshAttributeIndicesEncodingData *encoding_data = nullptr;
  181|    179|    if (att_data_id < 0) {
  ------------------
  |  Branch (181:9): [True: 127, False: 52]
  ------------------
  182|    127|      encoding_data = &pos_encoding_data_;
  183|    127|    } else {
  184|     52|      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|     52|      attribute_data_[att_data_id].is_connectivity_used = false;
  188|     52|    }
  189|       |    // Defining sequencer via a traversal scheme.
  190|    179|    if (traversal_method == MESH_TRAVERSAL_PREDICTION_DEGREE) {
  ------------------
  |  Branch (190:9): [True: 55, False: 124]
  ------------------
  191|     55|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  192|     55|      typedef MaxPredictionDegreeTraverser<CornerTable, AttObserver>
  193|     55|          AttTraverser;
  194|     55|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  195|    124|    } else if (traversal_method == MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (195:16): [True: 124, False: 0]
  ------------------
  196|    124|      typedef MeshAttributeIndicesEncodingObserver<CornerTable> AttObserver;
  197|    124|      typedef DepthFirstTraverser<CornerTable, AttObserver> AttTraverser;
  198|    124|      sequencer = CreateVertexTraversalSequencer<AttTraverser>(encoding_data);
  199|    124|    } else {
  200|      0|      return false;  // Unsupported method
  201|      0|    }
  202|    179|  } else {
  203|     48|    if (traversal_method != MESH_TRAVERSAL_DEPTH_FIRST) {
  ------------------
  |  Branch (203:9): [True: 3, False: 45]
  ------------------
  204|      3|      return false;  // Unsupported method.
  205|      3|    }
  206|     45|    if (att_data_id < 0) {
  ------------------
  |  Branch (206:9): [True: 2, False: 43]
  ------------------
  207|      2|      return false;  // Attribute data must be specified.
  208|      2|    }
  209|       |
  210|       |    // Per-corner attribute decoder.
  211|       |
  212|     43|    typedef MeshAttributeIndicesEncodingObserver<MeshAttributeCornerTable>
  213|     43|        AttObserver;
  214|     43|    typedef DepthFirstTraverser<MeshAttributeCornerTable, AttObserver>
  215|     43|        AttTraverser;
  216|       |
  217|     43|    MeshAttributeIndicesEncodingData *const encoding_data =
  218|     43|        &attribute_data_[att_data_id].encoding_data;
  219|     43|    const MeshAttributeCornerTable *const corner_table =
  220|     43|        &attribute_data_[att_data_id].connectivity_data;
  221|       |
  222|     43|    std::unique_ptr<MeshTraversalSequencer<AttTraverser>> traversal_sequencer(
  223|     43|        new MeshTraversalSequencer<AttTraverser>(mesh, encoding_data));
  224|       |
  225|     43|    AttObserver att_observer(corner_table, mesh, traversal_sequencer.get(),
  226|     43|                             encoding_data);
  227|       |
  228|     43|    AttTraverser att_traverser;
  229|     43|    att_traverser.Init(corner_table, att_observer);
  230|       |
  231|     43|    traversal_sequencer->SetTraverser(att_traverser);
  232|     43|    sequencer = std::move(traversal_sequencer);
  233|     43|  }
  234|       |
  235|    222|  if (!sequencer) {
  ------------------
  |  Branch (235:7): [True: 0, False: 222]
  ------------------
  236|      0|    return false;
  237|      0|  }
  238|       |
  239|    222|  std::unique_ptr<SequentialAttributeDecodersController> att_controller(
  240|    222|      new SequentialAttributeDecodersController(std::move(sequencer)));
  241|       |
  242|    222|  return decoder_->SetAttributesDecoder(att_decoder_id,
  243|    222|                                        std::move(att_controller));
  244|    222|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEv:
  247|  2.64k|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::DecodeConnectivity() {
  248|  2.64k|  num_new_vertices_ = 0;
  249|  2.64k|  new_to_parent_vertex_map_.clear();
  250|  2.64k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  251|  2.64k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.64k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (251:7): [True: 427, False: 2.21k]
  ------------------
  252|    427|    uint32_t num_new_verts;
  253|    427|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    427|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (253:9): [True: 275, False: 152]
  ------------------
  254|    275|      if (!decoder_->buffer()->Decode(&num_new_verts)) {
  ------------------
  |  Branch (254:11): [True: 0, False: 275]
  ------------------
  255|      0|        return false;
  256|      0|      }
  257|    275|    } else {
  258|    152|      if (!DecodeVarint(&num_new_verts, decoder_->buffer())) {
  ------------------
  |  Branch (258:11): [True: 0, False: 152]
  ------------------
  259|      0|        return false;
  260|      0|      }
  261|    152|    }
  262|    427|    num_new_vertices_ = num_new_verts;
  263|    427|  }
  264|  2.64k|#endif
  265|       |
  266|  2.64k|  uint32_t num_encoded_vertices;
  267|  2.64k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  268|  2.64k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.64k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (268:7): [True: 275, False: 2.36k]
  ------------------
  269|    275|    if (!decoder_->buffer()->Decode(&num_encoded_vertices)) {
  ------------------
  |  Branch (269:9): [True: 0, False: 275]
  ------------------
  270|      0|      return false;
  271|      0|    }
  272|       |
  273|    275|  } else
  274|  2.36k|#endif
  275|  2.36k|  {
  276|  2.36k|    if (!DecodeVarint(&num_encoded_vertices, decoder_->buffer())) {
  ------------------
  |  Branch (276:9): [True: 0, False: 2.36k]
  ------------------
  277|      0|      return false;
  278|      0|    }
  279|  2.36k|  }
  280|  2.64k|  num_encoded_vertices_ = num_encoded_vertices;
  281|       |
  282|  2.64k|  uint32_t num_faces;
  283|  2.64k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  284|  2.64k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.64k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (284:7): [True: 275, False: 2.36k]
  ------------------
  285|    275|    if (!decoder_->buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (285:9): [True: 0, False: 275]
  ------------------
  286|      0|      return false;
  287|      0|    }
  288|       |
  289|    275|  } else
  290|  2.36k|#endif
  291|  2.36k|  {
  292|  2.36k|    if (!DecodeVarint(&num_faces, decoder_->buffer())) {
  ------------------
  |  Branch (292:9): [True: 0, False: 2.36k]
  ------------------
  293|      0|      return false;
  294|      0|    }
  295|  2.36k|  }
  296|  2.64k|  if (num_faces > std::numeric_limits<CornerIndex::ValueType>::max() / 3) {
  ------------------
  |  Branch (296:7): [True: 1, False: 2.64k]
  ------------------
  297|      1|    return false;  // Draco cannot handle this many faces.
  298|      1|  }
  299|       |
  300|  2.64k|  if (static_cast<uint32_t>(num_encoded_vertices_) > num_faces * 3) {
  ------------------
  |  Branch (300:7): [True: 8, False: 2.63k]
  ------------------
  301|      8|    return false;  // There cannot be more vertices than 3 * num_faces.
  302|      8|  }
  303|       |
  304|       |  // Minimum number of edges of the mesh assuming each edge is shared between
  305|       |  // two faces.
  306|  2.63k|  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.63k|  const uint64_t num_encoded_vertices_64 =
  311|  2.63k|      static_cast<uint64_t>(num_encoded_vertices_);
  312|  2.63k|  const uint64_t max_num_vertex_edges =
  313|  2.63k|      num_encoded_vertices_64 * (num_encoded_vertices_64 - 1) / 2;
  314|  2.63k|  if (max_num_vertex_edges < min_num_face_edges) {
  ------------------
  |  Branch (314:7): [True: 2, False: 2.63k]
  ------------------
  315|       |    // It is impossible to construct a manifold mesh with these properties.
  316|      2|    return false;
  317|      2|  }
  318|       |
  319|  2.63k|  uint8_t num_attribute_data;
  320|  2.63k|  if (!decoder_->buffer()->Decode(&num_attribute_data)) {
  ------------------
  |  Branch (320:7): [True: 0, False: 2.63k]
  ------------------
  321|      0|    return false;
  322|      0|  }
  323|       |
  324|  2.63k|  uint32_t num_encoded_symbols;
  325|  2.63k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  326|  2.63k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.63k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (326:7): [True: 272, False: 2.36k]
  ------------------
  327|    272|    if (!decoder_->buffer()->Decode(&num_encoded_symbols)) {
  ------------------
  |  Branch (327:9): [True: 0, False: 272]
  ------------------
  328|      0|      return false;
  329|      0|    }
  330|       |
  331|    272|  } else
  332|  2.36k|#endif
  333|  2.36k|  {
  334|  2.36k|    if (!DecodeVarint(&num_encoded_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (334:9): [True: 1, False: 2.35k]
  ------------------
  335|      1|      return false;
  336|      1|    }
  337|  2.36k|  }
  338|       |
  339|  2.63k|  if (num_faces < num_encoded_symbols) {
  ------------------
  |  Branch (339:7): [True: 5, False: 2.62k]
  ------------------
  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.62k|  const uint32_t max_encoded_faces =
  346|  2.62k|      num_encoded_symbols + (num_encoded_symbols / 3);
  347|  2.62k|  if (num_faces > max_encoded_faces) {
  ------------------
  |  Branch (347:7): [True: 11, False: 2.61k]
  ------------------
  348|       |    // Faces can only be 1 1/3 times bigger than number of encoded symbols. This
  349|       |    // could only happen if all new encoded components started with interior
  350|       |    // triangles. E.g. A mesh with multiple tetrahedrons.
  351|     11|    return false;
  352|     11|  }
  353|       |
  354|  2.61k|  uint32_t num_encoded_split_symbols;
  355|  2.61k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  356|  2.61k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.61k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (356:7): [True: 265, False: 2.35k]
  ------------------
  357|    265|    if (!decoder_->buffer()->Decode(&num_encoded_split_symbols)) {
  ------------------
  |  Branch (357:9): [True: 0, False: 265]
  ------------------
  358|      0|      return false;
  359|      0|    }
  360|       |
  361|    265|  } else
  362|  2.35k|#endif
  363|  2.35k|  {
  364|  2.35k|    if (!DecodeVarint(&num_encoded_split_symbols, decoder_->buffer())) {
  ------------------
  |  Branch (364:9): [True: 0, False: 2.35k]
  ------------------
  365|      0|      return false;
  366|      0|    }
  367|  2.35k|  }
  368|       |
  369|  2.61k|  if (num_encoded_split_symbols > num_encoded_symbols) {
  ------------------
  |  Branch (369:7): [True: 11, False: 2.60k]
  ------------------
  370|     11|    return false;  // Split symbols are a sub-set of all symbols.
  371|     11|  }
  372|       |
  373|       |  // Decode topology (connectivity).
  374|  2.60k|  vertex_traversal_length_.clear();
  375|  2.60k|  corner_table_ = std::unique_ptr<CornerTable>(new CornerTable());
  376|  2.60k|  if (corner_table_ == nullptr) {
  ------------------
  |  Branch (376:7): [True: 0, False: 2.60k]
  ------------------
  377|      0|    return false;
  378|      0|  }
  379|  2.60k|  processed_corner_ids_.clear();
  380|  2.60k|  processed_corner_ids_.reserve(num_faces);
  381|  2.60k|  processed_connectivity_corners_.clear();
  382|  2.60k|  processed_connectivity_corners_.reserve(num_faces);
  383|  2.60k|  topology_split_data_.clear();
  384|  2.60k|  hole_event_data_.clear();
  385|  2.60k|  init_face_configurations_.clear();
  386|  2.60k|  init_corners_.clear();
  387|       |
  388|  2.60k|  last_symbol_id_ = -1;
  389|  2.60k|  last_face_id_ = -1;
  390|  2.60k|  last_vert_id_ = -1;
  391|       |
  392|  2.60k|  attribute_data_.clear();
  393|       |  // Add one attribute data for each attribute decoder.
  394|  2.60k|  attribute_data_.resize(num_attribute_data);
  395|       |
  396|  2.60k|  if (!corner_table_->Reset(
  ------------------
  |  Branch (396:7): [True: 0, False: 2.60k]
  ------------------
  397|  2.60k|          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.60k|  is_vert_hole_.assign(num_encoded_vertices_ + num_encoded_split_symbols, true);
  407|       |
  408|  2.60k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  409|  2.60k|  int32_t topology_split_decoded_bytes = -1;
  410|  2.60k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.60k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (410:7): [True: 412, False: 2.19k]
  ------------------
  411|    412|    uint32_t encoded_connectivity_size;
  412|    412|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    412|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (412:9): [True: 261, False: 151]
  ------------------
  413|    261|      if (!decoder_->buffer()->Decode(&encoded_connectivity_size)) {
  ------------------
  |  Branch (413:11): [True: 4, False: 257]
  ------------------
  414|      4|        return false;
  415|      4|      }
  416|    261|    } else {
  417|    151|      if (!DecodeVarint(&encoded_connectivity_size, decoder_->buffer())) {
  ------------------
  |  Branch (417:11): [True: 0, False: 151]
  ------------------
  418|      0|        return false;
  419|      0|      }
  420|    151|    }
  421|    408|    if (encoded_connectivity_size == 0 ||
  ------------------
  |  Branch (421:9): [True: 2, False: 406]
  ------------------
  422|    406|        encoded_connectivity_size > decoder_->buffer()->remaining_size()) {
  ------------------
  |  Branch (422:9): [True: 27, False: 379]
  ------------------
  423|     29|      return false;
  424|     29|    }
  425|    379|    DecoderBuffer event_buffer;
  426|    379|    event_buffer.Init(
  427|    379|        decoder_->buffer()->data_head() + encoded_connectivity_size,
  428|    379|        decoder_->buffer()->remaining_size() - encoded_connectivity_size,
  429|    379|        decoder_->buffer()->bitstream_version());
  430|       |    // Decode hole and topology split events.
  431|    379|    topology_split_decoded_bytes =
  432|    379|        DecodeHoleAndTopologySplitEvents(&event_buffer);
  433|    379|    if (topology_split_decoded_bytes == -1) {
  ------------------
  |  Branch (433:9): [True: 71, False: 308]
  ------------------
  434|     71|      return false;
  435|     71|    }
  436|       |
  437|    379|  } else
  438|  2.19k|#endif
  439|  2.19k|  {
  440|  2.19k|    if (DecodeHoleAndTopologySplitEvents(decoder_->buffer()) == -1) {
  ------------------
  |  Branch (440:9): [True: 31, False: 2.16k]
  ------------------
  441|     31|      return false;
  442|     31|    }
  443|  2.19k|  }
  444|       |
  445|  2.46k|  traversal_decoder_.Init(this);
  446|       |  // Add one extra vertex for each split symbol.
  447|  2.46k|  traversal_decoder_.SetNumEncodedVertices(num_encoded_vertices_ +
  448|  2.46k|                                           num_encoded_split_symbols);
  449|  2.46k|  traversal_decoder_.SetNumAttributeData(num_attribute_data);
  450|       |
  451|  2.46k|  DecoderBuffer traversal_end_buffer;
  452|  2.46k|  if (!traversal_decoder_.Start(&traversal_end_buffer)) {
  ------------------
  |  Branch (452:7): [True: 1.25k, False: 1.21k]
  ------------------
  453|  1.25k|    return false;
  454|  1.25k|  }
  455|       |
  456|  1.21k|  const int num_connectivity_verts = DecodeConnectivity(num_encoded_symbols);
  457|  1.21k|  if (num_connectivity_verts == -1) {
  ------------------
  |  Branch (457:7): [True: 920, False: 292]
  ------------------
  458|    920|    return false;
  459|    920|  }
  460|       |
  461|       |  // Set the main buffer to the end of the traversal.
  462|    292|  decoder_->buffer()->Init(traversal_end_buffer.data_head(),
  463|    292|                           traversal_end_buffer.remaining_size(),
  464|    292|                           decoder_->buffer()->bitstream_version());
  465|       |
  466|    292|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  467|    292|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    292|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (467:7): [True: 6, False: 286]
  ------------------
  468|       |    // Skip topology split data that was already decoded earlier.
  469|      6|    decoder_->buffer()->Advance(topology_split_decoded_bytes);
  470|      6|  }
  471|    292|#endif
  472|       |
  473|       |  // Decode connectivity of non-position attributes.
  474|    292|  if (!attribute_data_.empty()) {
  ------------------
  |  Branch (474:7): [True: 176, False: 116]
  ------------------
  475|    176|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  476|    176|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|    176|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (476:9): [True: 5, False: 171]
  ------------------
  477|     15|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (477:31): [True: 10, False: 5]
  ------------------
  478|     10|        if (!DecodeAttributeConnectivitiesOnFaceLegacy(ci)) {
  ------------------
  |  Branch (478:13): [True: 0, False: 10]
  ------------------
  479|      0|          return false;
  480|      0|        }
  481|     10|      }
  482|       |
  483|      5|    } else
  484|    171|#endif
  485|    171|    {
  486|   646k|      for (CornerIndex ci(0); ci < corner_table_->num_corners(); ci += 3) {
  ------------------
  |  Branch (486:31): [True: 646k, False: 171]
  ------------------
  487|   646k|        if (!DecodeAttributeConnectivitiesOnFace(ci)) {
  ------------------
  |  Branch (487:13): [True: 0, False: 646k]
  ------------------
  488|      0|          return false;
  489|      0|        }
  490|   646k|      }
  491|    171|    }
  492|    176|  }
  493|    292|  traversal_decoder_.Done();
  494|       |
  495|       |  // Decode attribute connectivity.
  496|       |  // Prepare data structure for decoding non-position attribute connectivity.
  497|    868|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (497:24): [True: 576, False: 292]
  ------------------
  498|    576|    attribute_data_[i].connectivity_data.InitEmpty(corner_table_.get());
  499|       |    // Add all seams.
  500|  1.77M|    for (int32_t c : attribute_data_[i].attribute_seam_corners) {
  ------------------
  |  Branch (500:20): [True: 1.77M, False: 576]
  ------------------
  501|  1.77M|      attribute_data_[i].connectivity_data.AddSeamEdge(CornerIndex(c));
  502|  1.77M|    }
  503|       |    // Recompute vertices from the newly added seam edges.
  504|    576|    if (!attribute_data_[i].connectivity_data.RecomputeVertices(nullptr,
  ------------------
  |  Branch (504:9): [True: 0, False: 576]
  ------------------
  505|    576|                                                                nullptr)) {
  506|      0|      return false;
  507|      0|    }
  508|    576|  }
  509|       |
  510|    292|  pos_encoding_data_.Init(corner_table_->num_vertices());
  511|    868|  for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (511:24): [True: 576, False: 292]
  ------------------
  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|    576|    int32_t att_connectivity_verts =
  517|    576|        attribute_data_[i].connectivity_data.num_vertices();
  518|    576|    if (att_connectivity_verts < corner_table_->num_vertices()) {
  ------------------
  |  Branch (518:9): [True: 2, False: 574]
  ------------------
  519|      2|      att_connectivity_verts = corner_table_->num_vertices();
  520|      2|    }
  521|    576|    attribute_data_[i].encoding_data.Init(att_connectivity_verts);
  522|    576|  }
  523|    292|  if (!AssignPointsToCorners(num_connectivity_verts)) {
  ------------------
  |  Branch (523:7): [True: 8, False: 284]
  ------------------
  524|      8|    return false;
  525|      8|  }
  526|    284|  return true;
  527|    292|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE19OnAttributesDecodedEv:
  530|     30|bool MeshEdgebreakerDecoderImpl<TraversalDecoder>::OnAttributesDecoded() {
  531|     30|  return true;
  532|     30|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18DecodeConnectivityEi:
  536|  1.21k|    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.21k|  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.21k|  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.21k|  std::vector<VertexIndex> invalid_vertices;
  558|  1.21k|  const bool remove_invalid_vertices = attribute_data_.empty();
  559|       |
  560|  1.21k|  int max_num_vertices = static_cast<int>(is_vert_hole_.size());
  561|  1.21k|  int num_faces = 0;
  562|  50.4M|  for (int symbol_id = 0; symbol_id < num_symbols; ++symbol_id) {
  ------------------
  |  Branch (562:27): [True: 50.4M, False: 445]
  ------------------
  563|  50.4M|    const FaceIndex face(num_faces++);
  564|       |    // Used to flag cases where we need to look for topology split events.
  565|  50.4M|    bool check_topology_split = false;
  566|  50.4M|    const uint32_t symbol = traversal_decoder_.DecodeSymbol();
  567|  50.4M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (567:9): [True: 4.27M, False: 46.2M]
  ------------------
  568|       |      // Create a new face between two edges on the open boundary.
  569|       |      // The first edge is opposite to the corner "a" from the image below.
  570|       |      // The other edge is opposite to the corner "b" that can be reached
  571|       |      // through a CCW traversal around the vertex "v".
  572|       |      // One new active boundary edge is created, opposite to the new corner
  573|       |      // "x".
  574|       |      //
  575|       |      //     *-------*
  576|       |      //    / \     / \
  577|       |      //   /   \   /   \
  578|       |      //  /     \ /     \
  579|       |      // *-------v-------*
  580|       |      //  \b    /x\    a/
  581|       |      //   \   /   \   /
  582|       |      //    \ /  C  \ /
  583|       |      //     *.......*
  584|       |
  585|       |      // Find the corner "b" from the corner "a" which is the corner on the
  586|       |      // top of the active stack.
  587|  4.27M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (587:11): [True: 109, False: 4.27M]
  ------------------
  588|    109|        return -1;
  589|    109|      }
  590|       |
  591|  4.27M|      const CornerIndex corner_a = active_corner_stack.back();
  592|  4.27M|      const VertexIndex vertex_x =
  593|  4.27M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  594|  4.27M|      const CornerIndex corner_b =
  595|  4.27M|          corner_table_->Next(corner_table_->LeftMostCorner(vertex_x));
  596|       |
  597|  4.27M|      if (corner_a == corner_b) {
  ------------------
  |  Branch (597:11): [True: 290, False: 4.27M]
  ------------------
  598|       |        // All matched corners must be different.
  599|    290|        return -1;
  600|    290|      }
  601|  4.27M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (601:11): [True: 0, False: 4.27M]
  |  Branch (601:11): [True: 0, False: 4.27M]
  ------------------
  602|  4.27M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (602:11): [True: 0, False: 4.27M]
  ------------------
  603|       |        // One of the corners is already opposite to an existing face, which
  604|       |        // should not happen unless the input was tampered with.
  605|      0|        return -1;
  606|      0|      }
  607|       |
  608|       |      // New tip corner.
  609|  4.27M|      const CornerIndex corner(3 * face.value());
  610|       |      // Update opposite corner mappings.
  611|  4.27M|      SetOppositeCorners(corner_a, corner + 1);
  612|  4.27M|      SetOppositeCorners(corner_b, corner + 2);
  613|       |
  614|       |      // Update vertex mapping.
  615|  4.27M|      const VertexIndex vert_a_prev =
  616|  4.27M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  617|  4.27M|      const VertexIndex vert_b_next =
  618|  4.27M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  619|  4.27M|      if (vertex_x == vert_a_prev || vertex_x == vert_b_next) {
  ------------------
  |  Branch (619:11): [True: 0, False: 4.27M]
  |  Branch (619:38): [True: 0, False: 4.27M]
  ------------------
  620|       |        // Encoding is invalid, because face vertices are degenerate.
  621|      0|        return -1;
  622|      0|      }
  623|  4.27M|      corner_table_->MapCornerToVertex(corner, vertex_x);
  624|  4.27M|      corner_table_->MapCornerToVertex(corner + 1, vert_b_next);
  625|  4.27M|      corner_table_->MapCornerToVertex(corner + 2, vert_a_prev);
  626|  4.27M|      corner_table_->SetLeftMostCorner(vert_a_prev, corner + 2);
  627|       |      // Mark the vertex |x| as interior.
  628|  4.27M|      is_vert_hole_[vertex_x.value()] = false;
  629|       |      // Update the corner on the active stack.
  630|  4.27M|      active_corner_stack.back() = corner;
  631|  46.2M|    } else if (symbol == TOPOLOGY_R || symbol == TOPOLOGY_L) {
  ------------------
  |  Branch (631:16): [True: 1.65k, False: 46.2M]
  |  Branch (631:40): [True: 39.3M, False: 6.85M]
  ------------------
  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|  39.3M|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (646:11): [True: 1, False: 39.3M]
  ------------------
  647|      1|        return -1;
  648|      1|      }
  649|  39.3M|      const CornerIndex corner_a = active_corner_stack.back();
  650|  39.3M|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex) {
  ------------------
  |  Branch (650:11): [True: 0, False: 39.3M]
  ------------------
  651|       |        // Active corner is already opposite to an existing face, which should
  652|       |        // not happen unless the input was tampered with.
  653|      0|        return -1;
  654|      0|      }
  655|       |
  656|       |      // First corner on the new face is either corner "l" or "r".
  657|  39.3M|      const CornerIndex corner(3 * face.value());
  658|  39.3M|      CornerIndex opp_corner, corner_l, corner_r;
  659|  39.3M|      if (symbol == TOPOLOGY_R) {
  ------------------
  |  Branch (659:11): [True: 1.65k, False: 39.3M]
  ------------------
  660|       |        // "r" is the new first corner.
  661|  1.65k|        opp_corner = corner + 2;
  662|  1.65k|        corner_l = corner + 1;
  663|  1.65k|        corner_r = corner;
  664|  39.3M|      } else {
  665|       |        // "l" is the new first corner.
  666|  39.3M|        opp_corner = corner + 1;
  667|  39.3M|        corner_l = corner;
  668|  39.3M|        corner_r = corner + 2;
  669|  39.3M|      }
  670|  39.3M|      SetOppositeCorners(opp_corner, corner_a);
  671|       |      // Update vertex mapping.
  672|  39.3M|      const VertexIndex new_vert_index = corner_table_->AddNewVertex();
  673|       |
  674|  39.3M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (674:11): [True: 9, False: 39.3M]
  ------------------
  675|      9|        return -1;  // Unexpected number of decoded vertices.
  676|      9|      }
  677|       |
  678|  39.3M|      corner_table_->MapCornerToVertex(opp_corner, new_vert_index);
  679|  39.3M|      corner_table_->SetLeftMostCorner(new_vert_index, opp_corner);
  680|       |
  681|  39.3M|      const VertexIndex vertex_r =
  682|  39.3M|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  683|  39.3M|      corner_table_->MapCornerToVertex(corner_r, vertex_r);
  684|       |      // Update left-most corner on the vertex on the |corner_r|.
  685|  39.3M|      corner_table_->SetLeftMostCorner(vertex_r, corner_r);
  686|       |
  687|  39.3M|      corner_table_->MapCornerToVertex(
  688|  39.3M|          corner_l, corner_table_->Vertex(corner_table_->Next(corner_a)));
  689|  39.3M|      active_corner_stack.back() = corner;
  690|  39.3M|      check_topology_split = true;
  691|  39.3M|    } else if (symbol == TOPOLOGY_S) {
  ------------------
  |  Branch (691:16): [True: 33.2k, False: 6.82M]
  ------------------
  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|  33.2k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (702:11): [True: 1, False: 33.2k]
  ------------------
  703|      1|        return -1;
  704|      1|      }
  705|  33.2k|      const CornerIndex corner_b = active_corner_stack.back();
  706|  33.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|  33.2k|      const auto it = topology_split_active_corners.find(symbol_id);
  711|  33.2k|      if (it != topology_split_active_corners.end()) {
  ------------------
  |  Branch (711:11): [True: 38, False: 33.1k]
  ------------------
  712|       |        // Topology split event. Move the retrieved edge to the stack.
  713|     38|        active_corner_stack.push_back(it->second);
  714|     38|      }
  715|  33.2k|      if (active_corner_stack.empty()) {
  ------------------
  |  Branch (715:11): [True: 42, False: 33.1k]
  ------------------
  716|     42|        return -1;
  717|     42|      }
  718|  33.1k|      const CornerIndex corner_a = active_corner_stack.back();
  719|       |
  720|  33.1k|      if (corner_a == corner_b) {
  ------------------
  |  Branch (720:11): [True: 0, False: 33.1k]
  ------------------
  721|       |        // All matched corners must be different.
  722|      0|        return -1;
  723|      0|      }
  724|  33.1k|      if (corner_table_->Opposite(corner_a) != kInvalidCornerIndex ||
  ------------------
  |  Branch (724:11): [True: 3, False: 33.1k]
  |  Branch (724:11): [True: 3, False: 33.1k]
  ------------------
  725|  33.1k|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex) {
  ------------------
  |  Branch (725:11): [True: 0, False: 33.1k]
  ------------------
  726|       |        // One of the corners is already opposite to an existing face, which
  727|       |        // should not happen unless the input was tampered with.
  728|      3|        return -1;
  729|      3|      }
  730|       |
  731|       |      // First corner on the new face is corner "x" from the image above.
  732|  33.1k|      const CornerIndex corner(3 * face.value());
  733|       |      // Update the opposite corner mapping.
  734|  33.1k|      SetOppositeCorners(corner_a, corner + 2);
  735|  33.1k|      SetOppositeCorners(corner_b, corner + 1);
  736|       |      // Update vertices. For the vertex at corner "x", use the vertex id from
  737|       |      // the corner "p".
  738|  33.1k|      const VertexIndex vertex_p =
  739|  33.1k|          corner_table_->Vertex(corner_table_->Previous(corner_a));
  740|  33.1k|      corner_table_->MapCornerToVertex(corner, vertex_p);
  741|  33.1k|      corner_table_->MapCornerToVertex(
  742|  33.1k|          corner + 1, corner_table_->Vertex(corner_table_->Next(corner_a)));
  743|  33.1k|      const VertexIndex vert_b_prev =
  744|  33.1k|          corner_table_->Vertex(corner_table_->Previous(corner_b));
  745|  33.1k|      corner_table_->MapCornerToVertex(corner + 2, vert_b_prev);
  746|  33.1k|      corner_table_->SetLeftMostCorner(vert_b_prev, corner + 2);
  747|  33.1k|      CornerIndex corner_n = corner_table_->Next(corner_b);
  748|  33.1k|      const VertexIndex vertex_n = corner_table_->Vertex(corner_n);
  749|  33.1k|      traversal_decoder_.MergeVertices(vertex_p, vertex_n);
  750|       |      // Update the left most corner on the newly merged vertex.
  751|  33.1k|      corner_table_->SetLeftMostCorner(vertex_p,
  752|  33.1k|                                       corner_table_->LeftMostCorner(vertex_n));
  753|       |
  754|       |      // Also update the vertex id at corner "n" and all corners that are
  755|       |      // connected to it in the CCW direction.
  756|  33.1k|      const CornerIndex first_corner = corner_n;
  757|   644k|      while (corner_n != kInvalidCornerIndex) {
  ------------------
  |  Branch (757:14): [True: 611k, False: 33.1k]
  ------------------
  758|   611k|        corner_table_->MapCornerToVertex(corner_n, vertex_p);
  759|   611k|        corner_n = corner_table_->SwingLeft(corner_n);
  760|   611k|        if (corner_n == first_corner) {
  ------------------
  |  Branch (760:13): [True: 3, False: 611k]
  ------------------
  761|       |          // We reached the start again which should not happen for split
  762|       |          // symbols.
  763|      3|          return -1;
  764|      3|        }
  765|   611k|      }
  766|       |      // Make sure the old vertex n is now mapped to an invalid corner (make it
  767|       |      // isolated).
  768|  33.1k|      corner_table_->MakeVertexIsolated(vertex_n);
  769|  33.1k|      if (remove_invalid_vertices) {
  ------------------
  |  Branch (769:11): [True: 32.4k, False: 759]
  ------------------
  770|  32.4k|        invalid_vertices.push_back(vertex_n);
  771|  32.4k|      }
  772|  33.1k|      active_corner_stack.back() = corner;
  773|  6.82M|    } else if (symbol == TOPOLOGY_E) {
  ------------------
  |  Branch (773:16): [True: 6.82M, False: 229]
  ------------------
  774|  6.82M|      const CornerIndex corner(3 * face.value());
  775|  6.82M|      const VertexIndex first_vert_index = corner_table_->AddNewVertex();
  776|       |      // Create three new vertices at the corners of the new face.
  777|  6.82M|      corner_table_->MapCornerToVertex(corner, first_vert_index);
  778|  6.82M|      corner_table_->MapCornerToVertex(corner + 1,
  779|  6.82M|                                       corner_table_->AddNewVertex());
  780|  6.82M|      corner_table_->MapCornerToVertex(corner + 2,
  781|  6.82M|                                       corner_table_->AddNewVertex());
  782|       |
  783|  6.82M|      if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (783:11): [True: 10, False: 6.82M]
  ------------------
  784|     10|        return -1;  // Unexpected number of decoded vertices.
  785|     10|      }
  786|       |
  787|  6.82M|      corner_table_->SetLeftMostCorner(first_vert_index, corner);
  788|  6.82M|      corner_table_->SetLeftMostCorner(first_vert_index + 1, corner + 1);
  789|  6.82M|      corner_table_->SetLeftMostCorner(first_vert_index + 2, corner + 2);
  790|       |      // Add the tip corner to the active stack.
  791|  6.82M|      active_corner_stack.push_back(corner);
  792|  6.82M|      check_topology_split = true;
  793|  6.82M|    } else {
  794|       |      // Error. Unknown symbol decoded.
  795|    229|      return -1;
  796|    229|    }
  797|       |    // Inform the traversal decoder that a new corner has been reached.
  798|  50.4M|    traversal_decoder_.NewActiveCornerReached(active_corner_stack.back());
  799|       |
  800|  50.4M|    if (check_topology_split) {
  ------------------
  |  Branch (800:9): [True: 46.1M, False: 4.30M]
  ------------------
  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|  46.1M|      const int encoder_symbol_id = num_symbols - symbol_id - 1;
  811|  46.1M|      EdgeFaceName split_edge;
  812|  46.1M|      int encoder_split_symbol_id;
  813|  46.1M|      while (IsTopologySplit(encoder_symbol_id, &split_edge,
  ------------------
  |  Branch (813:14): [True: 1.74k, False: 46.1M]
  ------------------
  814|  46.1M|                             &encoder_split_symbol_id)) {
  815|  1.74k|        if (encoder_split_symbol_id < 0) {
  ------------------
  |  Branch (815:13): [True: 70, False: 1.67k]
  ------------------
  816|     70|          return -1;  // Wrong split symbol id.
  817|     70|        }
  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.67k|        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.67k|        CornerIndex new_active_corner;
  831|  1.67k|        if (split_edge == RIGHT_FACE_EDGE) {
  ------------------
  |  Branch (831:13): [True: 778, False: 899]
  ------------------
  832|    778|          new_active_corner = corner_table_->Next(act_top_corner);
  833|    899|        } else {
  834|    899|          new_active_corner = corner_table_->Previous(act_top_corner);
  835|    899|        }
  836|       |        // Add the new active edge.
  837|       |        // Convert the encoder split symbol id to decoder symbol id.
  838|  1.67k|        const int decoder_split_symbol_id =
  839|  1.67k|            num_symbols - encoder_split_symbol_id - 1;
  840|  1.67k|        topology_split_active_corners[decoder_split_symbol_id] =
  841|  1.67k|            new_active_corner;
  842|  1.67k|      }
  843|  46.1M|    }
  844|  50.4M|  }
  845|    445|  if (corner_table_->num_vertices() > max_num_vertices) {
  ------------------
  |  Branch (845:7): [True: 0, False: 445]
  ------------------
  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|  5.65M|  while (!active_corner_stack.empty()) {
  ------------------
  |  Branch (849:10): [True: 5.65M, False: 367]
  ------------------
  850|  5.65M|    const CornerIndex corner = active_corner_stack.back();
  851|  5.65M|    active_corner_stack.pop_back();
  852|  5.65M|    const bool interior_face =
  853|  5.65M|        traversal_decoder_.DecodeStartFaceConfiguration();
  854|  5.65M|    if (interior_face) {
  ------------------
  |  Branch (854:9): [True: 2.21M, False: 3.44M]
  ------------------
  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.21M|      if (num_faces >= corner_table_->num_faces()) {
  ------------------
  |  Branch (876:11): [True: 73, False: 2.21M]
  ------------------
  877|     73|        return -1;  // More faces than expected added to the mesh.
  878|     73|      }
  879|       |
  880|  2.21M|      const CornerIndex corner_a = corner;
  881|  2.21M|      const VertexIndex vert_n =
  882|  2.21M|          corner_table_->Vertex(corner_table_->Next(corner_a));
  883|  2.21M|      const CornerIndex corner_b =
  884|  2.21M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_n));
  885|       |
  886|  2.21M|      const VertexIndex vert_x =
  887|  2.21M|          corner_table_->Vertex(corner_table_->Next(corner_b));
  888|  2.21M|      const CornerIndex corner_c =
  889|  2.21M|          corner_table_->Next(corner_table_->LeftMostCorner(vert_x));
  890|       |
  891|  2.21M|      if (corner == corner_b || corner == corner_c || corner_b == corner_c) {
  ------------------
  |  Branch (891:11): [True: 1, False: 2.21M]
  |  Branch (891:33): [True: 4, False: 2.21M]
  |  Branch (891:55): [True: 0, False: 2.21M]
  ------------------
  892|       |        // All matched corners must be different.
  893|      5|        return -1;
  894|      5|      }
  895|  2.21M|      if (corner_table_->Opposite(corner) != kInvalidCornerIndex ||
  ------------------
  |  Branch (895:11): [True: 0, False: 2.21M]
  |  Branch (895:11): [True: 0, False: 2.21M]
  ------------------
  896|  2.21M|          corner_table_->Opposite(corner_b) != kInvalidCornerIndex ||
  ------------------
  |  Branch (896:11): [True: 0, False: 2.21M]
  ------------------
  897|  2.21M|          corner_table_->Opposite(corner_c) != kInvalidCornerIndex) {
  ------------------
  |  Branch (897:11): [True: 0, False: 2.21M]
  ------------------
  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.21M|      const VertexIndex vert_p =
  904|  2.21M|          corner_table_->Vertex(corner_table_->Next(corner_c));
  905|       |
  906|  2.21M|      const FaceIndex face(num_faces++);
  907|       |      // The first corner of the initial face is the corner opposite to "a".
  908|  2.21M|      const CornerIndex new_corner(3 * face.value());
  909|  2.21M|      SetOppositeCorners(new_corner, corner);
  910|  2.21M|      SetOppositeCorners(new_corner + 1, corner_b);
  911|  2.21M|      SetOppositeCorners(new_corner + 2, corner_c);
  912|       |
  913|       |      // Map new corners to existing vertices.
  914|  2.21M|      corner_table_->MapCornerToVertex(new_corner, vert_x);
  915|  2.21M|      corner_table_->MapCornerToVertex(new_corner + 1, vert_p);
  916|  2.21M|      corner_table_->MapCornerToVertex(new_corner + 2, vert_n);
  917|       |
  918|       |      // Mark all three vertices as interior.
  919|  8.85M|      for (int ci = 0; ci < 3; ++ci) {
  ------------------
  |  Branch (919:24): [True: 6.64M, False: 2.21M]
  ------------------
  920|  6.64M|        is_vert_hole_[corner_table_->Vertex(new_corner + ci).value()] = false;
  921|  6.64M|      }
  922|       |
  923|  2.21M|      init_face_configurations_.push_back(true);
  924|  2.21M|      init_corners_.push_back(new_corner);
  925|  3.44M|    } else {
  926|       |      // The initial face wasn't interior and the traversal had to start from
  927|       |      // an open boundary. In this case no new face is added, but we need to
  928|       |      // keep record about the first opposite corner to this boundary.
  929|  3.44M|      init_face_configurations_.push_back(false);
  930|  3.44M|      init_corners_.push_back(corner);
  931|  3.44M|    }
  932|  5.65M|  }
  933|    367|  if (num_faces != corner_table_->num_faces()) {
  ------------------
  |  Branch (933:7): [True: 72, False: 295]
  ------------------
  934|     72|    return -1;  // Unexpected number of decoded faces.
  935|     72|  }
  936|       |
  937|    295|  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.26k|  for (const VertexIndex invalid_vert : invalid_vertices) {
  ------------------
  |  Branch (940:39): [True: 3.26k, False: 292]
  ------------------
  941|       |    // Find the last valid vertex and swap it with the isolated vertex.
  942|  3.26k|    VertexIndex src_vert(num_vertices - 1);
  943|  3.89k|    while (corner_table_->LeftMostCorner(src_vert) == kInvalidCornerIndex) {
  ------------------
  |  Branch (943:12): [True: 637, False: 3.26k]
  ------------------
  944|       |      // The last vertex is invalid, proceed to the previous one.
  945|    637|      src_vert = VertexIndex(--num_vertices - 1);
  946|    637|    }
  947|  3.26k|    if (src_vert < invalid_vert) {
  ------------------
  |  Branch (947:9): [True: 446, False: 2.81k]
  ------------------
  948|    446|      continue;  // No need to swap anything.
  949|    446|    }
  950|       |
  951|       |    // Remap all corners mapped to |src_vert| to |invalid_vert|.
  952|  2.81k|    VertexCornersIterator<CornerTable> vcit(corner_table_.get(), src_vert);
  953|  11.3k|    for (; !vcit.End(); ++vcit) {
  ------------------
  |  Branch (953:12): [True: 8.52k, False: 2.81k]
  ------------------
  954|  8.52k|      const CornerIndex cid = vcit.Corner();
  955|  8.52k|      if (corner_table_->Vertex(cid) != src_vert) {
  ------------------
  |  Branch (955:11): [True: 3, False: 8.51k]
  ------------------
  956|       |        // Vertex mapped to |cid| was not |src_vert|. This indicates corrupted
  957|       |        // data and we should terminate the decoding.
  958|      3|        return -1;
  959|      3|      }
  960|  8.51k|      corner_table_->MapCornerToVertex(cid, invalid_vert);
  961|  8.51k|    }
  962|  2.81k|    corner_table_->SetLeftMostCorner(invalid_vert,
  963|  2.81k|                                     corner_table_->LeftMostCorner(src_vert));
  964|       |
  965|       |    // Make the |src_vert| invalid.
  966|  2.81k|    corner_table_->MakeVertexIsolated(src_vert);
  967|  2.81k|    is_vert_hole_[invalid_vert.value()] = is_vert_hole_[src_vert.value()];
  968|  2.81k|    is_vert_hole_[src_vert.value()] = false;
  969|       |
  970|       |    // The last vertex is now invalid.
  971|  2.81k|    num_vertices--;
  972|  2.81k|  }
  973|    292|  return num_vertices;
  974|    295|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE32DecodeHoleAndTopologySplitEventsEPNS_13DecoderBufferE:
  979|  2.57k|    DecoderBuffer *decoder_buffer) {
  980|       |  // Prepare a new decoder from the provided buffer offset.
  981|  2.57k|  uint32_t num_topology_splits;
  982|  2.57k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  983|  2.57k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.57k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (983:7): [True: 235, False: 2.33k]
  ------------------
  984|    235|    if (!decoder_buffer->Decode(&num_topology_splits)) {
  ------------------
  |  Branch (984:9): [True: 1, False: 234]
  ------------------
  985|      1|      return -1;
  986|      1|    }
  987|       |
  988|    235|  } else
  989|  2.33k|#endif
  990|  2.33k|  {
  991|  2.33k|    if (!DecodeVarint(&num_topology_splits, decoder_buffer)) {
  ------------------
  |  Branch (991:9): [True: 0, False: 2.33k]
  ------------------
  992|      0|      return -1;
  993|      0|    }
  994|  2.33k|  }
  995|  2.57k|  if (num_topology_splits > 0) {
  ------------------
  |  Branch (995:7): [True: 624, False: 1.94k]
  ------------------
  996|    624|    if (num_topology_splits >
  ------------------
  |  Branch (996:9): [True: 23, False: 601]
  ------------------
  997|    624|        static_cast<uint32_t>(corner_table_->num_faces())) {
  998|     23|      return -1;
  999|     23|    }
 1000|    601|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1001|    601|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|    601|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1001:9): [True: 28, False: 573]
  ------------------
 1002|  21.0k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1002:28): [True: 21.0k, False: 5]
  ------------------
 1003|  21.0k|        TopologySplitEventData event_data;
 1004|  21.0k|        if (!decoder_buffer->Decode(&event_data.split_symbol_id)) {
  ------------------
  |  Branch (1004:13): [True: 14, False: 21.0k]
  ------------------
 1005|     14|          return -1;
 1006|     14|        }
 1007|  21.0k|        if (!decoder_buffer->Decode(&event_data.source_symbol_id)) {
  ------------------
  |  Branch (1007:13): [True: 7, False: 21.0k]
  ------------------
 1008|      7|          return -1;
 1009|      7|        }
 1010|  21.0k|        uint8_t edge_data;
 1011|  21.0k|        if (!decoder_buffer->Decode(&edge_data)) {
  ------------------
  |  Branch (1011:13): [True: 2, False: 21.0k]
  ------------------
 1012|      2|          return -1;
 1013|      2|        }
 1014|  21.0k|        event_data.source_edge = edge_data & 1;
 1015|  21.0k|        topology_split_data_.push_back(event_data);
 1016|  21.0k|      }
 1017|       |
 1018|     28|    } else
 1019|    573|#endif
 1020|    573|    {
 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|    573|      int last_source_symbol_id = 0;
 1024|  5.52k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1024:28): [True: 4.97k, False: 551]
  ------------------
 1025|  4.97k|        TopologySplitEventData event_data;
 1026|  4.97k|        uint32_t delta;
 1027|  4.97k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1027:13): [True: 7, False: 4.97k]
  ------------------
 1028|      7|          return -1;
 1029|      7|        }
 1030|  4.97k|        event_data.source_symbol_id = delta + last_source_symbol_id;
 1031|  4.97k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1031:13): [True: 5, False: 4.96k]
  ------------------
 1032|      5|          return -1;
 1033|      5|        }
 1034|  4.96k|        if (delta > event_data.source_symbol_id) {
  ------------------
  |  Branch (1034:13): [True: 10, False: 4.95k]
  ------------------
 1035|     10|          return -1;
 1036|     10|        }
 1037|  4.95k|        event_data.split_symbol_id =
 1038|  4.95k|            event_data.source_symbol_id - static_cast<int32_t>(delta);
 1039|  4.95k|        last_source_symbol_id = event_data.source_symbol_id;
 1040|  4.95k|        topology_split_data_.push_back(event_data);
 1041|  4.95k|      }
 1042|       |      // Split edges are decoded from a direct bit decoder.
 1043|    551|      decoder_buffer->StartBitDecoding(false, nullptr);
 1044|  5.11k|      for (uint32_t i = 0; i < num_topology_splits; ++i) {
  ------------------
  |  Branch (1044:28): [True: 4.55k, False: 551]
  ------------------
 1045|  4.55k|        uint32_t edge_data;
 1046|  4.55k|        if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.55k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1046:13): [True: 553, False: 4.00k]
  ------------------
 1047|    553|          decoder_buffer->DecodeLeastSignificantBits32(2, &edge_data);
 1048|  4.00k|        } else {
 1049|  4.00k|          decoder_buffer->DecodeLeastSignificantBits32(1, &edge_data);
 1050|  4.00k|        }
 1051|  4.55k|        TopologySplitEventData &event_data = topology_split_data_[i];
 1052|  4.55k|        event_data.source_edge = edge_data & 1;
 1053|  4.55k|      }
 1054|    551|      decoder_buffer->EndBitDecoding();
 1055|    551|    }
 1056|    601|  }
 1057|  2.50k|  uint32_t num_hole_events = 0;
 1058|  2.50k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1059|  2.50k|  if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.50k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1059:7): [True: 205, False: 2.29k]
  ------------------
 1060|    205|    if (!decoder_buffer->Decode(&num_hole_events)) {
  ------------------
  |  Branch (1060:9): [True: 2, False: 203]
  ------------------
 1061|      2|      return -1;
 1062|      2|    }
 1063|  2.29k|  } else if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 1)) {
  ------------------
  |  |  115|  2.29k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1063:14): [True: 125, False: 2.17k]
  ------------------
 1064|    125|    if (!DecodeVarint(&num_hole_events, decoder_buffer)) {
  ------------------
  |  Branch (1064:9): [True: 5, False: 120]
  ------------------
 1065|      5|      return -1;
 1066|      5|    }
 1067|    125|  }
 1068|  2.49k|#endif
 1069|  2.49k|  if (num_hole_events > 0) {
  ------------------
  |  Branch (1069:7): [True: 42, False: 2.45k]
  ------------------
 1070|     42|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
 1071|     42|    if (decoder_->bitstream_version() < DRACO_BITSTREAM_VERSION(1, 2)) {
  ------------------
  |  |  115|     42|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (1071:9): [True: 17, False: 25]
  ------------------
 1072|  43.9k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1072:28): [True: 43.9k, False: 1]
  ------------------
 1073|  43.9k|        HoleEventData event_data;
 1074|  43.9k|        if (!decoder_buffer->Decode(&event_data)) {
  ------------------
  |  Branch (1074:13): [True: 16, False: 43.9k]
  ------------------
 1075|     16|          return -1;
 1076|     16|        }
 1077|  43.9k|        hole_event_data_.push_back(event_data);
 1078|  43.9k|      }
 1079|       |
 1080|     17|    } else
 1081|     25|#endif
 1082|     25|    {
 1083|       |      // Decode hole symbol ids using delta and varint coding.
 1084|     25|      int last_symbol_id = 0;
 1085|  19.6k|      for (uint32_t i = 0; i < num_hole_events; ++i) {
  ------------------
  |  Branch (1085:28): [True: 19.6k, False: 15]
  ------------------
 1086|  19.6k|        HoleEventData event_data;
 1087|  19.6k|        uint32_t delta;
 1088|  19.6k|        if (!DecodeVarint<uint32_t>(&delta, decoder_buffer)) {
  ------------------
  |  Branch (1088:13): [True: 10, False: 19.6k]
  ------------------
 1089|     10|          return -1;
 1090|     10|        }
 1091|  19.6k|        event_data.symbol_id = delta + last_symbol_id;
 1092|  19.6k|        last_symbol_id = event_data.symbol_id;
 1093|  19.6k|        hole_event_data_.push_back(event_data);
 1094|  19.6k|      }
 1095|     25|    }
 1096|     42|  }
 1097|  2.46k|  return static_cast<int32_t>(decoder_buffer->decoded_size());
 1098|  2.49k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE41DecodeAttributeConnectivitiesOnFaceLegacyENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1103|     10|    DecodeAttributeConnectivitiesOnFaceLegacy(CornerIndex corner) {
 1104|       |  // Three corners of the face.
 1105|     10|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1106|     10|                                  corner_table_->Previous(corner)};
 1107|       |
 1108|     40|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1108:19): [True: 30, False: 10]
  ------------------
 1109|     30|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1110|     30|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1110:9): [True: 10, False: 20]
  ------------------
 1111|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1112|       |      // is automatically an attribute seam).
 1113|     20|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1113:28): [True: 10, False: 10]
  ------------------
 1114|     10|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1115|     10|      }
 1116|     10|      continue;
 1117|     10|    }
 1118|       |
 1119|     40|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1119:26): [True: 20, False: 20]
  ------------------
 1120|     20|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1121|     20|      if (is_seam) {
  ------------------
  |  Branch (1121:11): [True: 10, False: 10]
  ------------------
 1122|     10|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1123|     10|      }
 1124|     20|    }
 1125|     20|  }
 1126|     10|  return true;
 1127|     10|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE35DecodeAttributeConnectivitiesOnFaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
 1132|   646k|    TraversalDecoder>::DecodeAttributeConnectivitiesOnFace(CornerIndex corner) {
 1133|       |  // Three corners of the face.
 1134|   646k|  const CornerIndex corners[3] = {corner, corner_table_->Next(corner),
 1135|   646k|                                  corner_table_->Previous(corner)};
 1136|       |
 1137|   646k|  const FaceIndex src_face_id = corner_table_->Face(corner);
 1138|  2.58M|  for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1138:19): [True: 1.93M, False: 646k]
  ------------------
 1139|  1.93M|    const CornerIndex opp_corner = corner_table_->Opposite(corners[c]);
 1140|  1.93M|    if (opp_corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (1140:9): [True: 327k, False: 1.61M]
  ------------------
 1141|       |      // Don't decode attribute seams on boundary edges (every boundary edge
 1142|       |      // is automatically an attribute seam).
 1143|   982k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1143:28): [True: 655k, False: 327k]
  ------------------
 1144|   655k|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1145|   655k|      }
 1146|   327k|      continue;
 1147|   327k|    }
 1148|  1.61M|    const FaceIndex opp_face_id = corner_table_->Face(opp_corner);
 1149|       |    // Don't decode edges when the opposite face has been already processed.
 1150|  1.61M|    if (opp_face_id < src_face_id) {
  ------------------
  |  Branch (1150:9): [True: 805k, False: 805k]
  ------------------
 1151|   805k|      continue;
 1152|   805k|    }
 1153|       |
 1154|  2.41M|    for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1154:26): [True: 1.60M, False: 805k]
  ------------------
 1155|  1.60M|      const bool is_seam = traversal_decoder_.DecodeAttributeSeam(i);
 1156|  1.60M|      if (is_seam) {
  ------------------
  |  Branch (1156:11): [True: 1.11M, False: 492k]
  ------------------
 1157|  1.11M|        attribute_data_[i].attribute_seam_corners.push_back(corners[c].value());
 1158|  1.11M|      }
 1159|  1.60M|    }
 1160|   805k|  }
 1161|   646k|  return true;
 1162|   646k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE21AssignPointsToCornersEi:
 1166|    292|    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|    292|  decoder_->mesh()->SetNumFaces(corner_table_->num_faces());
 1171|       |
 1172|    292|  if (attribute_data_.empty()) {
  ------------------
  |  Branch (1172:7): [True: 116, False: 176]
  ------------------
 1173|       |    // We have connectivity for position only. In this case all vertex indices
 1174|       |    // are equal to point indices.
 1175|   102k|    for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1175:26): [True: 101k, False: 116]
  ------------------
 1176|   101k|      Mesh::Face face;
 1177|   101k|      const CornerIndex start_corner(3 * f.value());
 1178|   407k|      for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1178:23): [True: 305k, False: 101k]
  ------------------
 1179|       |        // Get the vertex index on the corner and use it as a point index.
 1180|   305k|        const int32_t vert_id = corner_table_->Vertex(start_corner + c).value();
 1181|   305k|        face[c] = vert_id;
 1182|   305k|      }
 1183|   101k|      decoder_->mesh()->SetFace(f, face);
 1184|   101k|    }
 1185|    116|    decoder_->point_cloud()->set_num_points(num_connectivity_verts);
 1186|    116|    return true;
 1187|    116|  }
 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|    176|  std::vector<int32_t> point_to_corner_map;
 1194|       |  // Map between every corner and their new point ids.
 1195|    176|  std::vector<int32_t> corner_to_point_map(corner_table_->num_corners());
 1196|   477k|  for (int v = 0; v < corner_table_->num_vertices(); ++v) {
  ------------------
  |  Branch (1196:19): [True: 477k, False: 168]
  ------------------
 1197|   477k|    CornerIndex c = corner_table_->LeftMostCorner(VertexIndex(v));
 1198|   477k|    if (c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1198:9): [True: 103, False: 477k]
  ------------------
 1199|    103|      continue;  // Isolated vertex.
 1200|    103|    }
 1201|   477k|    CornerIndex deduplication_first_corner = c;
 1202|   477k|    if (is_vert_hole_[v]) {
  ------------------
  |  Branch (1202:9): [True: 327k, False: 150k]
  ------------------
 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|   327k|      deduplication_first_corner = c;
 1206|   327k|    } else {
 1207|       |      // If we are not on the boundary we need to find the first seam (of any
 1208|       |      // attribute).
 1209|   228k|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1209:28): [True: 199k, False: 29.3k]
  ------------------
 1210|   199k|        if (!attribute_data_[i].connectivity_data.IsCornerOnSeam(c)) {
  ------------------
  |  Branch (1210:13): [True: 74.1k, False: 125k]
  ------------------
 1211|  74.1k|          continue;  // No seam for this attribute, ignore it.
 1212|  74.1k|        }
 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|   125k|        const VertexIndex vert_id =
 1217|   125k|            attribute_data_[i].connectivity_data.Vertex(c);
 1218|   125k|        CornerIndex act_c = corner_table_->SwingRight(c);
 1219|   125k|        bool seam_found = false;
 1220|   148k|        while (act_c != c) {
  ------------------
  |  Branch (1220:16): [True: 144k, False: 4.25k]
  ------------------
 1221|   144k|          if (act_c == kInvalidCornerIndex) {
  ------------------
  |  Branch (1221:15): [True: 8, False: 144k]
  ------------------
 1222|      8|            return false;
 1223|      8|          }
 1224|   144k|          if (attribute_data_[i].connectivity_data.Vertex(act_c) != vert_id) {
  ------------------
  |  Branch (1224:15): [True: 120k, False: 23.4k]
  ------------------
 1225|       |            // Attribute seam found. Stop.
 1226|   120k|            deduplication_first_corner = act_c;
 1227|   120k|            seam_found = true;
 1228|   120k|            break;
 1229|   120k|          }
 1230|  23.4k|          act_c = corner_table_->SwingRight(act_c);
 1231|  23.4k|        }
 1232|   125k|        if (seam_found) {
  ------------------
  |  Branch (1232:13): [True: 120k, False: 4.25k]
  ------------------
 1233|   120k|          break;  // No reason to process other attributes if we found a seam.
 1234|   120k|        }
 1235|   125k|      }
 1236|   150k|    }
 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|   477k|    c = deduplication_first_corner;
 1244|       |    // Create a new point.
 1245|   477k|    corner_to_point_map[c.value()] =
 1246|   477k|        static_cast<uint32_t>(point_to_corner_map.size());
 1247|   477k|    point_to_corner_map.push_back(c.value());
 1248|       |    // Traverse in CW direction.
 1249|   477k|    CornerIndex prev_c = c;
 1250|   477k|    c = corner_table_->SwingRight(c);
 1251|  1.92M|    while (c != kInvalidCornerIndex && c != deduplication_first_corner) {
  ------------------
  |  Branch (1251:12): [True: 1.60M, False: 327k]
  |  Branch (1251:40): [True: 1.45M, False: 150k]
  ------------------
 1252|  1.45M|      bool attribute_seam = false;
 1253|  2.20M|      for (uint32_t i = 0; i < attribute_data_.size(); ++i) {
  ------------------
  |  Branch (1253:28): [True: 1.96M, False: 238k]
  ------------------
 1254|  1.96M|        if (attribute_data_[i].connectivity_data.Vertex(c) !=
  ------------------
  |  Branch (1254:13): [True: 1.21M, False: 755k]
  ------------------
 1255|  1.96M|            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.21M|          attribute_seam = true;
 1259|  1.21M|          break;
 1260|  1.21M|        }
 1261|  1.96M|      }
 1262|  1.45M|      if (attribute_seam) {
  ------------------
  |  Branch (1262:11): [True: 1.21M, False: 238k]
  ------------------
 1263|  1.21M|        corner_to_point_map[c.value()] =
 1264|  1.21M|            static_cast<uint32_t>(point_to_corner_map.size());
 1265|  1.21M|        point_to_corner_map.push_back(c.value());
 1266|  1.21M|      } else {
 1267|   238k|        corner_to_point_map[c.value()] = corner_to_point_map[prev_c.value()];
 1268|   238k|      }
 1269|  1.45M|      prev_c = c;
 1270|  1.45M|      c = corner_table_->SwingRight(c);
 1271|  1.45M|    }
 1272|   477k|  }
 1273|       |  // Add faces.
 1274|   594k|  for (FaceIndex f(0); f < decoder_->mesh()->num_faces(); ++f) {
  ------------------
  |  Branch (1274:24): [True: 594k, False: 168]
  ------------------
 1275|   594k|    Mesh::Face face;
 1276|  2.37M|    for (int c = 0; c < 3; ++c) {
  ------------------
  |  Branch (1276:21): [True: 1.78M, False: 594k]
  ------------------
 1277|       |      // Remap old points to the new ones.
 1278|  1.78M|      face[c] = corner_to_point_map[3 * f.value() + c];
 1279|  1.78M|    }
 1280|   594k|    decoder_->mesh()->SetFace(f, face);
 1281|   594k|  }
 1282|    168|  decoder_->point_cloud()->set_num_points(
 1283|    168|      static_cast<uint32_t>(point_to_corner_map.size()));
 1284|    168|  return true;
 1285|    176|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    175|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    175|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    175|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    175|  const Mesh *mesh = decoder_->mesh();
  115|    175|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    175|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    175|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    175|                           encoding_data);
  120|       |
  121|    175|  TraverserT att_traverser;
  122|    175|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    175|  traversal_sequencer->SetTraverser(att_traverser);
  125|    175|  return std::move(traversal_sequencer);
  126|    175|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|  1.00k|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|  1.00k|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|  1.00k|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|  1.00k|  const Mesh *mesh = decoder_->mesh();
  115|  1.00k|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|  1.00k|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|  1.00k|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|  1.00k|                           encoding_data);
  120|       |
  121|  1.00k|  TraverserT att_traverser;
  122|  1.00k|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|  1.00k|  traversal_sequencer->SetTraverser(att_traverser);
  125|  1.00k|  return std::move(traversal_sequencer);
  126|  1.00k|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    229|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    229|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    229|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    229|  const Mesh *mesh = decoder_->mesh();
  115|    229|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    229|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    229|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    229|                           encoding_data);
  120|       |
  121|    229|  TraverserT att_traverser;
  122|    229|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    229|  traversal_sequencer->SetTraverser(att_traverser);
  125|    229|  return std::move(traversal_sequencer);
  126|    229|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    319|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    319|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    319|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    319|  const Mesh *mesh = decoder_->mesh();
  115|    319|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    319|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    319|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    319|                           encoding_data);
  120|       |
  121|    319|  TraverserT att_traverser;
  122|    319|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    319|  traversal_sequencer->SetTraverser(att_traverser);
  125|    319|  return std::move(traversal_sequencer);
  126|    319|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|     55|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|     55|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|     55|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|     55|  const Mesh *mesh = decoder_->mesh();
  115|     55|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|     55|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|     55|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|     55|                           encoding_data);
  120|       |
  121|     55|  TraverserT att_traverser;
  122|     55|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|     55|  traversal_sequencer->SetTraverser(att_traverser);
  125|     55|  return std::move(traversal_sequencer);
  126|     55|}
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE30CreateVertexTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS5_EEEEEENSt3__110unique_ptrINS_15PointsSequencerENS9_14default_deleteISB_EEEEPNS_32MeshAttributeIndicesEncodingDataE:
  110|    124|    MeshAttributeIndicesEncodingData *encoding_data) {
  111|    124|  typedef typename TraverserT::TraversalObserver AttObserver;
  112|    124|  typedef typename TraverserT::CornerTable CornerTable;
  113|       |
  114|    124|  const Mesh *mesh = decoder_->mesh();
  115|    124|  std::unique_ptr<MeshTraversalSequencer<TraverserT>> traversal_sequencer(
  116|    124|      new MeshTraversalSequencer<TraverserT>(mesh, encoding_data));
  117|       |
  118|    124|  AttObserver att_observer(corner_table_.get(), mesh, traversal_sequencer.get(),
  119|    124|                           encoding_data);
  120|       |
  121|    124|  TraverserT att_traverser;
  122|    124|  att_traverser.Init(corner_table_.get(), att_observer);
  123|       |
  124|    124|  traversal_sequencer->SetTraverser(att_traverser);
  125|    124|  return std::move(traversal_sequencer);
  126|    124|}

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  8.52k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  3.16k|  const CornerTable *GetCornerTable() const override {
   67|  3.16k|    return corner_table_.get();
   68|  3.16k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  10.0M|                       int *out_encoder_split_symbol_id) {
   87|  10.0M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 1.23M, False: 8.79M]
  ------------------
   88|  1.23M|      return false;
   89|  1.23M|    }
   90|  8.79M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 28, False: 8.79M]
  ------------------
   91|  8.79M|        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|     28|      *out_encoder_split_symbol_id = -1;
   98|     28|      return true;
   99|     28|    }
  100|  8.79M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 8.79M, False: 1.91k]
  ------------------
  101|  8.79M|      return false;
  102|  8.79M|    }
  103|  1.91k|    *out_face_edge =
  104|  1.91k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.91k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.91k|    topology_split_data_.pop_back();
  108|  1.91k|    return true;
  109|  8.79M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  32.7M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  32.7M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  32.7M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  32.7M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  8.37k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  4.68k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  3.08k|  const CornerTable *GetCornerTable() const override {
   67|  3.08k|    return corner_table_.get();
   68|  3.08k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  37.1M|                       int *out_encoder_split_symbol_id) {
   87|  37.1M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 36.6M, False: 498k]
  ------------------
   88|  36.6M|      return false;
   89|  36.6M|    }
   90|   498k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 39, False: 498k]
  ------------------
   91|   498k|        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|     39|      *out_encoder_split_symbol_id = -1;
   98|     39|      return true;
   99|     39|    }
  100|   498k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 496k, False: 1.60k]
  ------------------
  101|   496k|      return false;
  102|   496k|    }
  103|  1.60k|    *out_face_edge =
  104|  1.60k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.60k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.60k|    topology_split_data_.pop_back();
  108|  1.60k|    return true;
  109|   498k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|   108M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|   108M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|   108M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|   108M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  11.9k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  13.6k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  2.70k|  const CornerTable *GetCornerTable() const override {
   67|  2.70k|    return corner_table_.get();
   68|  2.70k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  46.1M|                       int *out_encoder_split_symbol_id) {
   87|  46.1M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 45.8M, False: 330k]
  ------------------
   88|  45.8M|      return false;
   89|  45.8M|    }
   90|   330k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 70, False: 330k]
  ------------------
   91|   330k|        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|     70|      *out_encoder_split_symbol_id = -1;
   98|     70|      return true;
   99|     70|    }
  100|   330k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 328k, False: 1.67k]
  ------------------
  101|   328k|      return false;
  102|   328k|    }
  103|  1.67k|    *out_face_edge =
  104|  1.67k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.67k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.67k|    topology_split_data_.pop_back();
  108|  1.67k|    return true;
  109|   330k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  54.6M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  54.6M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  54.6M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  54.6M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  6.81k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  7.46k|      : attribute_connectivity_decoders_(nullptr),
   34|  7.46k|        num_attribute_data_(0),
   35|  7.46k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  6.87k|  void Init(MeshEdgebreakerDecoderImplInterface *decoder) {
   37|  6.87k|    decoder_impl_ = decoder;
   38|  6.87k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  6.87k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  6.87k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  6.87k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  6.19k|  uint16_t BitstreamVersion() const {
   45|  6.19k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  6.19k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  2.84k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  6.87k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  4.40k|  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.40k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 61, False: 4.34k]
  ------------------
   63|     61|      return false;
   64|     61|    }
   65|       |
   66|  4.34k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 97, False: 4.24k]
  ------------------
   67|     97|      return false;
   68|     97|    }
   69|       |
   70|  4.24k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 15, False: 4.22k]
  ------------------
   71|     15|      return false;
   72|     15|    }
   73|  4.22k|    *out_buffer = buffer_;
   74|  4.22k|    return true;
   75|  4.24k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  5.71M|  inline bool DecodeStartFaceConfiguration() {
   79|  5.71M|    uint32_t face_configuration;
   80|  5.71M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  5.71M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  5.71M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 1.26k, False: 5.71M]
  ------------------
   82|  1.26k|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|  1.26k|    } else
   85|  5.71M|#endif
   86|  5.71M|    {
   87|  5.71M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  5.71M|    }
   89|  5.71M|    return face_configuration;
   90|  5.71M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  23.0M|  inline uint32_t DecodeSymbol() {
   94|  23.0M|    uint32_t symbol;
   95|  23.0M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  23.0M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 9.96M, False: 13.0M]
  ------------------
   97|  9.96M|      return symbol;
   98|  9.96M|    }
   99|       |    // Else decode two additional bits.
  100|  13.0M|    uint32_t symbol_suffix;
  101|  13.0M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  13.0M|    symbol |= (symbol_suffix << 1);
  103|  13.0M|    return symbol;
  104|  23.0M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  22.8M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|  2.92M|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  17.0M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  17.0M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  17.0M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  4.06k|  void Done() {
  123|  4.06k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 3.78k, False: 286]
  ------------------
  124|  3.78k|      symbol_buffer_.EndBitDecoding();
  125|  3.78k|    }
  126|  4.06k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  4.06k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  4.06k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 442, False: 3.62k]
  ------------------
  128|    442|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    442|    } else
  131|  3.62k|#endif
  132|  3.62k|    {
  133|  3.62k|      start_face_decoder_.EndDecoding();
  134|  3.62k|    }
  135|  4.06k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|  2.33k|  DecoderBuffer *buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  4.70k|  bool DecodeTraversalSymbols() {
  141|  4.70k|    uint64_t traversal_size;
  142|  4.70k|    symbol_buffer_ = buffer_;
  143|  4.70k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 20, False: 4.68k]
  ------------------
  144|     20|      return false;
  145|     20|    }
  146|  4.68k|    buffer_ = symbol_buffer_;
  147|  4.68k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 87, False: 4.60k]
  ------------------
  148|     87|      return false;
  149|     87|    }
  150|  4.60k|    buffer_.Advance(traversal_size);
  151|  4.60k|    return true;
  152|  4.68k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  6.76k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  6.76k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  6.76k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  6.76k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 842, False: 5.92k]
  ------------------
  158|    842|      start_face_buffer_ = buffer_;
  159|    842|      uint64_t traversal_size;
  160|    842|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 3, False: 839]
  ------------------
  161|      3|        return false;
  162|      3|      }
  163|    839|      buffer_ = start_face_buffer_;
  164|    839|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 158, False: 681]
  ------------------
  165|    158|        return false;
  166|    158|      }
  167|    681|      buffer_.Advance(traversal_size);
  168|    681|      return true;
  169|    839|    }
  170|  5.92k|#endif
  171|  5.92k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  6.76k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  6.58k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  6.58k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 4.17k, False: 2.41k]
  ------------------
  177|  4.17k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  4.17k|          new BinaryDecoder[num_attribute_data_]);
  179|  11.5k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 7.36k, False: 4.14k]
  ------------------
  180|  7.36k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 28, False: 7.34k]
  ------------------
  181|     28|          return false;
  182|     28|        }
  183|  7.36k|      }
  184|  4.17k|    }
  185|  6.56k|    return true;
  186|  6.58k|  }

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

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

_ZN5draco21MeshSequentialDecoderC2Ev:
   27|  2.70k|MeshSequentialDecoder::MeshSequentialDecoder() {}
_ZN5draco21MeshSequentialDecoder18DecodeConnectivityEv:
   29|  2.46k|bool MeshSequentialDecoder::DecodeConnectivity() {
   30|  2.46k|  uint32_t num_faces;
   31|  2.46k|  uint32_t num_points;
   32|  2.46k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   33|  2.46k|  if (bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.46k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (33:7): [True: 458, False: 2.00k]
  ------------------
   34|    458|    if (!buffer()->Decode(&num_faces)) {
  ------------------
  |  Branch (34:9): [True: 0, False: 458]
  ------------------
   35|      0|      return false;
   36|      0|    }
   37|    458|    if (!buffer()->Decode(&num_points)) {
  ------------------
  |  Branch (37:9): [True: 0, False: 458]
  ------------------
   38|      0|      return false;
   39|      0|    }
   40|       |
   41|    458|  } else
   42|  2.00k|#endif
   43|  2.00k|  {
   44|  2.00k|    if (!DecodeVarint(&num_faces, buffer())) {
  ------------------
  |  Branch (44:9): [True: 0, False: 2.00k]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|  2.00k|    if (!DecodeVarint(&num_points, buffer())) {
  ------------------
  |  Branch (47:9): [True: 0, False: 2.00k]
  ------------------
   48|      0|      return false;
   49|      0|    }
   50|  2.00k|  }
   51|       |
   52|       |  // Check that num_faces and num_points are valid values.
   53|  2.46k|  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.46k|  if (faces_64 > 0xffffffff / 3) {
  ------------------
  |  Branch (55:7): [True: 0, False: 2.46k]
  ------------------
   56|      0|    return false;
   57|      0|  }
   58|  2.46k|  if (faces_64 > buffer()->remaining_size() / 3) {
  ------------------
  |  Branch (58:7): [True: 5, False: 2.45k]
  ------------------
   59|       |    // The number of faces is unreasonably high, because face indices do not
   60|       |    // fit in the remaining size of the buffer.
   61|      5|    return false;
   62|      5|  }
   63|  2.45k|  uint8_t connectivity_method;
   64|  2.45k|  if (!buffer()->Decode(&connectivity_method)) {
  ------------------
  |  Branch (64:7): [True: 0, False: 2.45k]
  ------------------
   65|      0|    return false;
   66|      0|  }
   67|  2.45k|  if (connectivity_method == 0) {
  ------------------
  |  Branch (67:7): [True: 1.68k, False: 775]
  ------------------
   68|  1.68k|    if (!DecodeAndDecompressIndices(num_faces)) {
  ------------------
  |  Branch (68:9): [True: 1.55k, False: 124]
  ------------------
   69|  1.55k|      return false;
   70|  1.55k|    }
   71|  1.68k|  } else {
   72|    775|    if (num_points < 256) {
  ------------------
  |  Branch (72:9): [True: 517, False: 258]
  ------------------
   73|       |      // Decode indices as uint8_t.
   74|  8.11k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (74:28): [True: 7.59k, False: 516]
  ------------------
   75|  7.59k|        Mesh::Face face;
   76|  30.3k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (76:25): [True: 22.7k, False: 7.59k]
  ------------------
   77|  22.7k|          uint8_t val;
   78|  22.7k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (78:15): [True: 1, False: 22.7k]
  ------------------
   79|      1|            return false;
   80|      1|          }
   81|  22.7k|          face[j] = val;
   82|  22.7k|        }
   83|  7.59k|        mesh()->AddFace(face);
   84|  7.59k|      }
   85|    517|    } else if (num_points < (1 << 16)) {
  ------------------
  |  Branch (85:16): [True: 179, False: 79]
  ------------------
   86|       |      // Decode indices as uint16_t.
   87|   185k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (87:28): [True: 185k, False: 169]
  ------------------
   88|   185k|        Mesh::Face face;
   89|   741k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (89:25): [True: 556k, False: 185k]
  ------------------
   90|   556k|          uint16_t val;
   91|   556k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (91:15): [True: 10, False: 556k]
  ------------------
   92|     10|            return false;
   93|     10|          }
   94|   556k|          face[j] = val;
   95|   556k|        }
   96|   185k|        mesh()->AddFace(face);
   97|   185k|      }
   98|    179|    } else if (num_points < (1 << 21) &&
  ------------------
  |  Branch (98:16): [True: 21, False: 58]
  ------------------
   99|     21|               bitstream_version() >= DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     21|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (99:16): [True: 17, False: 4]
  ------------------
  100|       |      // Decode indices as uint32_t.
  101|    543|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (101:28): [True: 534, False: 9]
  ------------------
  102|    534|        Mesh::Face face;
  103|  2.12k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (103:25): [True: 1.59k, False: 526]
  ------------------
  104|  1.59k|          uint32_t val;
  105|  1.59k|          if (!DecodeVarint(&val, buffer())) {
  ------------------
  |  Branch (105:15): [True: 8, False: 1.58k]
  ------------------
  106|      8|            return false;
  107|      8|          }
  108|  1.58k|          face[j] = val;
  109|  1.58k|        }
  110|    526|        mesh()->AddFace(face);
  111|    526|      }
  112|     62|    } else {
  113|       |      // Decode faces as uint32_t (default).
  114|  2.11k|      for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (114:28): [True: 2.07k, False: 41]
  ------------------
  115|  2.07k|        Mesh::Face face;
  116|  8.24k|        for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (116:25): [True: 6.19k, False: 2.05k]
  ------------------
  117|  6.19k|          uint32_t val;
  118|  6.19k|          if (!buffer()->Decode(&val)) {
  ------------------
  |  Branch (118:15): [True: 21, False: 6.17k]
  ------------------
  119|     21|            return false;
  120|     21|          }
  121|  6.17k|          face[j] = val;
  122|  6.17k|        }
  123|  2.05k|        mesh()->AddFace(face);
  124|  2.05k|      }
  125|     62|    }
  126|    775|  }
  127|    859|  point_cloud()->set_num_points(num_points);
  128|    859|  return true;
  129|  2.45k|}
_ZN5draco21MeshSequentialDecoder23CreateAttributesDecoderEi:
  131|  23.9k|bool MeshSequentialDecoder::CreateAttributesDecoder(int32_t att_decoder_id) {
  132|       |  // Always create the basic attribute decoder.
  133|  23.9k|  return SetAttributesDecoder(
  134|  23.9k|      att_decoder_id,
  135|  23.9k|      std::unique_ptr<AttributesDecoder>(
  136|  23.9k|          new SequentialAttributeDecodersController(
  137|  23.9k|              std::unique_ptr<PointsSequencer>(
  138|  23.9k|                  new LinearSequencer(point_cloud()->num_points())))));
  139|  23.9k|}
_ZN5draco21MeshSequentialDecoder26DecodeAndDecompressIndicesEj:
  141|  1.68k|bool MeshSequentialDecoder::DecodeAndDecompressIndices(uint32_t num_faces) {
  142|       |  // Get decoded indices differences that were encoded with an entropy code.
  143|  1.68k|  std::vector<uint32_t> indices_buffer(num_faces * 3);
  144|  1.68k|  if (!DecodeSymbols(num_faces * 3, 1, buffer(), indices_buffer.data())) {
  ------------------
  |  Branch (144:7): [True: 1.48k, False: 199]
  ------------------
  145|  1.48k|    return false;
  146|  1.48k|  }
  147|       |  // Reconstruct the indices from the differences.
  148|       |  // See MeshSequentialEncoder::CompressAndEncodeIndices() for more details.
  149|    199|  int32_t last_index_value = 0;  // This will always be >= 0.
  150|    199|  int vertex_index = 0;
  151|  3.66k|  for (uint32_t i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (151:24): [True: 3.54k, False: 124]
  ------------------
  152|  3.54k|    Mesh::Face face;
  153|  13.9k|    for (int j = 0; j < 3; ++j) {
  ------------------
  |  Branch (153:21): [True: 10.5k, False: 3.46k]
  ------------------
  154|  10.5k|      const uint32_t encoded_val = indices_buffer[vertex_index++];
  155|  10.5k|      int32_t index_diff = (encoded_val >> 1);
  156|  10.5k|      if (encoded_val & 1) {
  ------------------
  |  Branch (156:11): [True: 1.02k, False: 9.49k]
  ------------------
  157|  1.02k|        if (index_diff > last_index_value) {
  ------------------
  |  Branch (157:13): [True: 39, False: 981]
  ------------------
  158|       |          // Subtracting index_diff would result in a negative index.
  159|     39|          return false;
  160|     39|        }
  161|    981|        index_diff = -index_diff;
  162|  9.49k|      } else {
  163|  9.49k|        if (index_diff >
  ------------------
  |  Branch (163:13): [True: 36, False: 9.45k]
  ------------------
  164|  9.49k|            (std::numeric_limits<int32_t>::max() - last_index_value)) {
  165|       |          // Adding index_diff to last_index_value would overflow.
  166|     36|          return false;
  167|     36|        }
  168|  9.49k|      }
  169|  10.4k|      const int32_t index_value = index_diff + last_index_value;
  170|  10.4k|      face[j] = index_value;
  171|  10.4k|      last_index_value = index_value;
  172|  10.4k|    }
  173|  3.46k|    mesh()->AddFace(face);
  174|  3.46k|  }
  175|    124|  return true;
  176|    199|}

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.34k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  1.29M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  1.29M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.26M, False: 25.3k]
  ------------------
   61|  1.26M|      return true;  // Already traversed.
   62|  1.26M|    }
   63|       |
   64|  25.3k|    corner_traversal_stack_.clear();
   65|  25.3k|    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|  25.3k|    const VertexIndex next_vert =
   69|  25.3k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  25.3k|    const VertexIndex prev_vert =
   71|  25.3k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  25.3k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 25.3k]
  |  Branch (72:45): [True: 0, False: 25.3k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  25.3k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 24.7k, False: 669]
  ------------------
   76|  24.7k|      this->MarkVertexVisited(next_vert);
   77|  24.7k|      this->traversal_observer().OnNewVertexVisited(
   78|  24.7k|          next_vert, this->corner_table()->Next(corner_id));
   79|  24.7k|    }
   80|  25.3k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 3.75k, False: 21.6k]
  ------------------
   81|  3.75k|      this->MarkVertexVisited(prev_vert);
   82|  3.75k|      this->traversal_observer().OnNewVertexVisited(
   83|  3.75k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  3.75k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  59.9k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 34.5k, False: 25.3k]
  ------------------
   88|       |      // Currently processed corner.
   89|  34.5k|      corner_id = corner_traversal_stack_.back();
   90|  34.5k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  34.5k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 34.5k]
  |  Branch (92:47): [True: 531, False: 34.0k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    531|        corner_traversal_stack_.pop_back();
   95|    531|        continue;
   96|    531|      }
   97|  1.29M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 1.29M, Folded]
  ------------------
   98|  1.29M|        this->MarkFaceVisited(face_id);
   99|  1.29M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  1.29M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  1.29M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 1.29M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  1.29M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 644k, False: 650k]
  ------------------
  105|   644k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|   644k|          this->MarkVertexVisited(vert_id);
  107|   644k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|   644k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 626k, False: 17.4k]
  ------------------
  109|   626k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   626k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   626k|            continue;
  112|   626k|          }
  113|   644k|        }
  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|   667k|        const CornerIndex right_corner_id =
  118|   667k|            this->corner_table()->GetRightCorner(corner_id);
  119|   667k|        const CornerIndex left_corner_id =
  120|   667k|            this->corner_table()->GetLeftCorner(corner_id);
  121|   667k|        const FaceIndex right_face_id(
  122|   667k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 13.6k, False: 654k]
  ------------------
  123|   667k|                 ? kInvalidFaceIndex
  124|   667k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|   667k|        const FaceIndex left_face_id(
  126|   667k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 28.2k, False: 639k]
  ------------------
  127|   667k|                 ? kInvalidFaceIndex
  128|   667k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|   667k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 646k, False: 21.2k]
  ------------------
  130|       |          // Right face has been already visited.
  131|   646k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 29.4k, False: 617k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  29.4k|            corner_traversal_stack_.pop_back();
  134|  29.4k|            break;  // Break from the while (true) loop.
  135|   617k|          } else {
  136|       |            // Go to the left face.
  137|   617k|            corner_id = left_corner_id;
  138|   617k|            face_id = left_face_id;
  139|   617k|          }
  140|   646k|        } else {
  141|       |          // Right face was not visited.
  142|  21.2k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 16.6k, False: 4.59k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  16.6k|            corner_id = right_corner_id;
  145|  16.6k|            face_id = right_face_id;
  146|  16.6k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  4.59k|            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.59k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  4.59k|            break;
  159|  4.59k|          }
  160|  21.2k|        }
  161|   667k|      }
  162|  34.0k|    }
  163|  25.3k|    return true;
  164|  25.3k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.34k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.90k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.73k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  3.38M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  3.38M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.18M, False: 2.19M]
  ------------------
   61|  1.18M|      return true;  // Already traversed.
   62|  1.18M|    }
   63|       |
   64|  2.19M|    corner_traversal_stack_.clear();
   65|  2.19M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  2.19M|    const VertexIndex next_vert =
   69|  2.19M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  2.19M|    const VertexIndex prev_vert =
   71|  2.19M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  2.19M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 2.19M]
  |  Branch (72:45): [True: 0, False: 2.19M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  2.19M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 2.19M, False: 1.11k]
  ------------------
   76|  2.19M|      this->MarkVertexVisited(next_vert);
   77|  2.19M|      this->traversal_observer().OnNewVertexVisited(
   78|  2.19M|          next_vert, this->corner_table()->Next(corner_id));
   79|  2.19M|    }
   80|  2.19M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.16M, False: 28.7k]
  ------------------
   81|  2.16M|      this->MarkVertexVisited(prev_vert);
   82|  2.16M|      this->traversal_observer().OnNewVertexVisited(
   83|  2.16M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.16M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  4.42M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 2.23M, False: 2.19M]
  ------------------
   88|       |      // Currently processed corner.
   89|  2.23M|      corner_id = corner_traversal_stack_.back();
   90|  2.23M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  2.23M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 2.23M]
  |  Branch (92:47): [True: 3.17k, False: 2.22M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  3.17k|        corner_traversal_stack_.pop_back();
   95|  3.17k|        continue;
   96|  3.17k|      }
   97|  3.38M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 3.38M, Folded]
  ------------------
   98|  3.38M|        this->MarkFaceVisited(face_id);
   99|  3.38M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  3.38M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  3.38M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 3.38M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  3.38M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 2.77M, False: 606k]
  ------------------
  105|  2.77M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  2.77M|          this->MarkVertexVisited(vert_id);
  107|  2.77M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  2.77M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 569k, False: 2.20M]
  ------------------
  109|   569k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   569k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   569k|            continue;
  112|   569k|          }
  113|  2.77M|        }
  114|       |        // The current vertex has been already visited or it was on a boundary.
  115|       |        // We need to determine whether we can visit any of it's neighboring
  116|       |        // faces.
  117|  2.81M|        const CornerIndex right_corner_id =
  118|  2.81M|            this->corner_table()->GetRightCorner(corner_id);
  119|  2.81M|        const CornerIndex left_corner_id =
  120|  2.81M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  2.81M|        const FaceIndex right_face_id(
  122|  2.81M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 2.19M, False: 622k]
  ------------------
  123|  2.81M|                 ? kInvalidFaceIndex
  124|  2.81M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  2.81M|        const FaceIndex left_face_id(
  126|  2.81M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 2.21M, False: 601k]
  ------------------
  127|  2.81M|                 ? kInvalidFaceIndex
  128|  2.81M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  2.81M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 2.75M, False: 55.6k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  2.75M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 2.21M, False: 547k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  2.21M|            corner_traversal_stack_.pop_back();
  134|  2.21M|            break;  // Break from the while (true) loop.
  135|  2.21M|          } else {
  136|       |            // Go to the left face.
  137|   547k|            corner_id = left_corner_id;
  138|   547k|            face_id = left_face_id;
  139|   547k|          }
  140|  2.75M|        } else {
  141|       |          // Right face was not visited.
  142|  55.6k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 38.4k, False: 17.2k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  38.4k|            corner_id = right_corner_id;
  145|  38.4k|            face_id = right_face_id;
  146|  38.4k|          } 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|  17.2k|            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|  17.2k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  17.2k|            break;
  159|  17.2k|          }
  160|  55.6k|        }
  161|  2.81M|      }
  162|  2.22M|    }
  163|  2.19M|    return true;
  164|  2.19M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.73k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  3.60k|  DepthFirstTraverser() {}

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

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

_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|    459|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  1.90k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  1.90k|    const auto *corner_table = traverser_.corner_table();
   50|  1.90k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  1.90k|    const size_t num_faces = mesh_->num_faces();
   52|  1.90k|    const size_t num_points = mesh_->num_points();
   53|  4.52M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 4.52M, False: 1.90k]
  ------------------
   54|  4.52M|      const auto &face = mesh_->face(f);
   55|  18.0M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 13.5M, False: 4.52M]
  ------------------
   56|  13.5M|        const PointIndex point_id = face[p];
   57|  13.5M|        const VertexIndex vert_id =
   58|  13.5M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  13.5M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 13.5M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  13.5M|        const AttributeValueIndex att_entry_id(
   63|  13.5M|            encoding_data_
   64|  13.5M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  13.5M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 13.5M]
  |  Branch (65:13): [True: 0, False: 13.5M]
  |  Branch (65:39): [True: 0, False: 13.5M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  13.5M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  13.5M|      }
   71|  4.52M|    }
   72|  1.90k|    return true;
   73|  1.90k|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|    419|  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|    419|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|    419|    traverser_.OnTraversalStart();
   82|    419|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 419]
  ------------------
   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|    419|    } else {
   89|    419|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  2.62M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 2.62M, False: 419]
  ------------------
   91|  2.62M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 2.62M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  2.62M|      }
   95|    419|    }
   96|    419|    traverser_.OnTraversalEnd();
   97|    419|    return true;
   98|    419|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  2.62M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  2.62M|    return traverser_.TraverseFromCorner(corner_id);
  103|  2.62M|  }
_ZN5draco22MeshTraversalSequencerINS_28MaxPredictionDegreeTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|    459|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.45k|      : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE34UpdatePointToAttributeIndexMappingEPNS_14PointAttributeE:
   48|  4.96k|  bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override {
   49|  4.96k|    const auto *corner_table = traverser_.corner_table();
   50|  4.96k|    attribute->SetExplicitMapping(mesh_->num_points());
   51|  4.96k|    const size_t num_faces = mesh_->num_faces();
   52|  4.96k|    const size_t num_points = mesh_->num_points();
   53|  2.50M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 2.50M, False: 4.96k]
  ------------------
   54|  2.50M|      const auto &face = mesh_->face(f);
   55|  10.0M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 7.50M, False: 2.50M]
  ------------------
   56|  7.50M|        const PointIndex point_id = face[p];
   57|  7.50M|        const VertexIndex vert_id =
   58|  7.50M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  7.50M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 7.50M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  7.50M|        const AttributeValueIndex att_entry_id(
   63|  7.50M|            encoding_data_
   64|  7.50M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  7.50M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 7.50M]
  |  Branch (65:13): [True: 0, False: 7.50M]
  |  Branch (65:39): [True: 0, False: 7.50M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      0|          return false;
   68|      0|        }
   69|  7.50M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  7.50M|      }
   71|  2.50M|    }
   72|  4.96k|    return true;
   73|  4.96k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.34k|  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.34k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.34k|    traverser_.OnTraversalStart();
   82|  1.34k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.34k]
  ------------------
   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.34k|    } else {
   89|  1.34k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  1.29M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 1.29M, False: 1.34k]
  ------------------
   91|  1.29M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 1.29M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  1.29M|      }
   95|  1.34k|    }
   96|  1.34k|    traverser_.OnTraversalEnd();
   97|  1.34k|    return true;
   98|  1.34k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  1.29M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  1.29M|    return traverser_.TraverseFromCorner(corner_id);
  103|  1.29M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.45k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEEC2EPKNS_4MeshEPKNS_32MeshAttributeIndicesEncodingDataE:
   34|  1.80k|      : 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|  5.51M|    for (FaceIndex f(0); f < static_cast<uint32_t>(num_faces); ++f) {
  ------------------
  |  Branch (53:26): [True: 5.51M, False: 5.89k]
  ------------------
   54|  5.51M|      const auto &face = mesh_->face(f);
   55|  22.0M|      for (int p = 0; p < 3; ++p) {
  ------------------
  |  Branch (55:23): [True: 16.5M, False: 5.51M]
  ------------------
   56|  16.5M|        const PointIndex point_id = face[p];
   57|  16.5M|        const VertexIndex vert_id =
   58|  16.5M|            corner_table->Vertex(CornerIndex(3 * f.value() + p));
   59|  16.5M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (59:13): [True: 0, False: 16.5M]
  ------------------
   60|      0|          return false;
   61|      0|        }
   62|  16.5M|        const AttributeValueIndex att_entry_id(
   63|  16.5M|            encoding_data_
   64|  16.5M|                ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
   65|  16.5M|        if (point_id >= num_points || att_entry_id.value() >= num_points) {
  ------------------
  |  Branch (65:13): [True: 0, False: 16.5M]
  |  Branch (65:13): [True: 2, False: 16.5M]
  |  Branch (65:39): [True: 2, False: 16.5M]
  ------------------
   66|       |          // There cannot be more attribute values than the number of points.
   67|      2|          return false;
   68|      2|        }
   69|  16.5M|        attribute->SetPointMapEntry(point_id, att_entry_id);
   70|  16.5M|      }
   71|  5.51M|    }
   72|  5.89k|    return true;
   73|  5.89k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE24GenerateSequenceInternalEv:
   76|  1.73k|  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.73k|    out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
   80|       |
   81|  1.73k|    traverser_.OnTraversalStart();
   82|  1.73k|    if (corner_order_) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.73k]
  ------------------
   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.73k|    } else {
   89|  1.73k|      const int32_t num_faces = traverser_.corner_table()->num_faces();
   90|  3.38M|      for (int i = 0; i < num_faces; ++i) {
  ------------------
  |  Branch (90:23): [True: 3.38M, False: 1.73k]
  ------------------
   91|  3.38M|        if (!ProcessCorner(CornerIndex(3 * i))) {
  ------------------
  |  Branch (91:13): [True: 0, False: 3.38M]
  ------------------
   92|      0|          return false;
   93|      0|        }
   94|  3.38M|      }
   95|  1.73k|    }
   96|  1.73k|    traverser_.OnTraversalEnd();
   97|  1.73k|    return true;
   98|  1.73k|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE13ProcessCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|  3.38M|  bool ProcessCorner(CornerIndex corner_id) {
  102|  3.38M|    return traverser_.TraverseFromCorner(corner_id);
  103|  3.38M|  }
_ZN5draco22MeshTraversalSequencerINS_19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS2_EEEEE12SetTraverserERKS5_:
   35|  1.80k|  void SetTraverser(const TraverserT &t) { traverser_ = t; }

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.60k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  28.9M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  15.7M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  15.7M|    return is_vertex_visited_[vert_id.value()];
   65|  15.7M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  2.01M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  2.01M|    is_vertex_visited_[vert_id.value()] = true;
   68|  2.01M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  5.93M|  inline TraversalObserverT &traversal_observer() {
   75|  5.93M|    return traversal_observer_;
   76|  5.93M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  11.8M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  11.8M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 84.7k, False: 11.7M]
  ------------------
   47|  84.7k|      return true;  // Invalid faces are always considered as visited.
   48|  84.7k|    }
   49|  11.7M|    return is_face_visited_[face_id.value()];
   50|  11.8M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  3.92M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  3.92M|    is_face_visited_[face_id.value()] = true;
   62|  3.92M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.81k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  3.81k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.90k|                    TraversalObserver traversal_observer) {
   37|  1.90k|    corner_table_ = corner_table;
   38|  1.90k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.90k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.90k|    traversal_observer_ = traversal_observer;
   41|  1.90k|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  1.29M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  1.29M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 1.29M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  1.29M|    return is_face_visited_[corner_id.value() / 3];
   58|  1.29M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  25.5M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  3.38M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  3.38M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 3.38M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  3.38M|    return is_face_visited_[corner_id.value() / 3];
   58|  3.38M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  7.77M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  7.77M|    return is_vertex_visited_[vert_id.value()];
   65|  7.77M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  7.13M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  7.13M|    is_vertex_visited_[vert_id.value()] = true;
   68|  7.13M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  10.5M|  inline TraversalObserverT &traversal_observer() {
   75|  10.5M|    return traversal_observer_;
   76|  10.5M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  7.85M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  7.85M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 4.40M, False: 3.45M]
  ------------------
   47|  4.40M|      return true;  // Invalid faces are always considered as visited.
   48|  4.40M|    }
   49|  3.45M|    return is_face_visited_[face_id.value()];
   50|  7.85M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  3.38M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  3.38M|    is_face_visited_[face_id.value()] = true;
   62|  3.38M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  3.60k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.80k|                    TraversalObserver traversal_observer) {
   37|  1.80k|    corner_table_ = corner_table;
   38|  1.80k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.80k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.80k|    traversal_observer_ = traversal_observer;
   41|  1.80k|  }

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  43.1M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  43.1M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 43.1M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  43.1M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  43.1M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|   889M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|   889M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 416, False: 889M]
  ------------------
   78|    416|      return false;  // Buffer overflow.
   79|    416|    }
   80|   889M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|   889M|    pos_ += size_to_decode;
   82|   889M|    return true;
   83|   889M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  26.0k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  10.4k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  40.7k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   328k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  6.87k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  43.1M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  5.77M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  8.27k|    inline void reset(const void *b, size_t s) {
  131|  8.27k|      bit_offset_ = 0;
  132|  8.27k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  8.27k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  8.27k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  6.95k|    inline uint64_t BitsDecoded() const {
  138|  6.95k|      return static_cast<uint64_t>(bit_offset_);
  139|  6.95k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  43.1M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  43.1M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 14, False: 43.1M]
  ------------------
  162|     14|        return false;
  163|     14|      }
  164|  43.1M|      uint32_t value = 0;
  165|  96.1M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 52.9M, False: 43.1M]
  ------------------
  166|  52.9M|        value |= GetBit() << bit;
  167|  52.9M|      }
  168|  43.1M|      *x = value;
  169|  43.1M|      return true;
  170|  43.1M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  52.9M|    inline int GetBit() {
  176|  52.9M|      const size_t off = bit_offset_;
  177|  52.9M|      const size_t byte_offset = off >> 3;
  178|  52.9M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  52.9M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 46.8M, False: 6.10M]
  ------------------
  180|  46.8M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  46.8M|        bit_offset_ = off + 1;
  182|  46.8M|        return bit;
  183|  46.8M|      }
  184|  6.10M|      return 0;
  185|  52.9M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  14.5M|  bool Decode(T *out_val) {
   69|  14.5M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 3.25k, False: 14.5M]
  ------------------
   70|  3.25k|      return false;
   71|  3.25k|    }
   72|  14.5M|    pos_ += sizeof(T);
   73|  14.5M|    return true;
   74|  14.5M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  14.5M|  bool Peek(T *out_val) {
   88|  14.5M|    const size_t size_to_decode = sizeof(T);
   89|  14.5M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 3.25k, False: 14.5M]
  ------------------
   90|  3.25k|      return false;  // Buffer overflow.
   91|  3.25k|    }
   92|  14.5M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  14.5M|    return true;
   94|  14.5M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  11.7k|  bool Decode(T *out_val) {
   69|  11.7k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 122, False: 11.6k]
  ------------------
   70|    122|      return false;
   71|    122|    }
   72|  11.6k|    pos_ += sizeof(T);
   73|  11.6k|    return true;
   74|  11.7k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  11.7k|  bool Peek(T *out_val) {
   88|  11.7k|    const size_t size_to_decode = sizeof(T);
   89|  11.7k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 122, False: 11.6k]
  ------------------
   90|    122|      return false;  // Buffer overflow.
   91|    122|    }
   92|  11.6k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  11.6k|    return true;
   94|  11.7k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   750k|  bool Decode(T *out_val) {
   69|   750k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 168, False: 750k]
  ------------------
   70|    168|      return false;
   71|    168|    }
   72|   750k|    pos_ += sizeof(T);
   73|   750k|    return true;
   74|   750k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   750k|  bool Peek(T *out_val) {
   88|   750k|    const size_t size_to_decode = sizeof(T);
   89|   750k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 168, False: 750k]
  ------------------
   90|    168|      return false;  // Buffer overflow.
   91|    168|    }
   92|   750k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   750k|    return true;
   94|   750k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  23.6k|  bool Decode(T *out_val) {
   69|  23.6k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 285, False: 23.4k]
  ------------------
   70|    285|      return false;
   71|    285|    }
   72|  23.4k|    pos_ += sizeof(T);
   73|  23.4k|    return true;
   74|  23.6k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  23.6k|  bool Peek(T *out_val) {
   88|  23.6k|    const size_t size_to_decode = sizeof(T);
   89|  23.6k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 285, False: 23.4k]
  ------------------
   90|    285|      return false;  // Buffer overflow.
   91|    285|    }
   92|  23.4k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  23.4k|    return true;
   94|  23.6k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|  1.38M|  bool Decode(T *out_val) {
   69|  1.38M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 121, False: 1.38M]
  ------------------
   70|    121|      return false;
   71|    121|    }
   72|  1.38M|    pos_ += sizeof(T);
   73|  1.38M|    return true;
   74|  1.38M|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|  1.38M|  bool Peek(T *out_val) {
   88|  1.38M|    const size_t size_to_decode = sizeof(T);
   89|  1.38M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 121, False: 1.38M]
  ------------------
   90|    121|      return false;  // Buffer overflow.
   91|    121|    }
   92|  1.38M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.38M|    return true;
   94|  1.38M|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|   577k|  bool Decode(T *out_val) {
   69|   577k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 14, False: 577k]
  ------------------
   70|     14|      return false;
   71|     14|    }
   72|   577k|    pos_ += sizeof(T);
   73|   577k|    return true;
   74|   577k|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|   577k|  bool Peek(T *out_val) {
   88|   577k|    const size_t size_to_decode = sizeof(T);
   89|   577k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 14, False: 577k]
  ------------------
   90|     14|      return false;  // Buffer overflow.
   91|     14|    }
   92|   577k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   577k|    return true;
   94|   577k|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  2.11k|  bool Decode(T *out_val) {
   69|  2.11k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 22, False: 2.09k]
  ------------------
   70|     22|      return false;
   71|     22|    }
   72|  2.09k|    pos_ += sizeof(T);
   73|  2.09k|    return true;
   74|  2.11k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  2.11k|  bool Peek(T *out_val) {
   88|  2.11k|    const size_t size_to_decode = sizeof(T);
   89|  2.11k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 22, False: 2.09k]
  ------------------
   90|     22|      return false;  // Buffer overflow.
   91|     22|    }
   92|  2.09k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  2.09k|    return true;
   94|  2.11k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    187|  bool Decode(T *out_val) {
   69|    187|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 24, False: 163]
  ------------------
   70|     24|      return false;
   71|     24|    }
   72|    163|    pos_ += sizeof(T);
   73|    163|    return true;
   74|    187|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    187|  bool Peek(T *out_val) {
   88|    187|    const size_t size_to_decode = sizeof(T);
   89|    187|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 24, False: 163]
  ------------------
   90|     24|      return false;  // Buffer overflow.
   91|     24|    }
   92|    163|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    163|    return true;
   94|    187|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|  85.3M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|  92.5M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  10.3M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  10.3M|    return value_ >= val;
  100|  10.3M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   268M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  3.47G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  22.9M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|  84.5M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  84.5M|    value_ = i.value_;
  153|  84.5M|    return *this;
  154|  84.5M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   291M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   291M|    value_ = i.value_;
  153|   291M|    return *this;
  154|   291M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  22.9M|  inline ThisIndexType &operator++() {
  103|  22.9M|    ++value_;
  104|  22.9M|    return *this;
  105|  22.9M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  2.53G|  constexpr bool operator==(const IndexType &i) const {
   76|  2.53G|    return value_ == i.value_;
   77|  2.53G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|  1.02G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  16.6k|  constexpr bool operator<(const IndexType &i) const {
   88|  16.6k|    return value_ < i.value_;
   89|  16.6k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   145M|  constexpr bool operator==(const IndexType &i) const {
   76|   145M|    return value_ == i.value_;
   77|   145M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   165M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   165M|    return ThisIndexType(value_ - val);
  133|   165M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   836M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   836M|    return ThisIndexType(value_ + val);
  127|   836M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  19.6M|  constexpr bool operator==(const IndexType &i) const {
   76|  19.6M|    return value_ == i.value_;
   77|  19.6M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   278M|  constexpr bool operator!=(const IndexType &i) const {
   82|   278M|    return value_ != i.value_;
   83|   278M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   365M|  constexpr bool operator!=(const IndexType &i) const {
   82|   365M|    return value_ != i.value_;
   83|   365M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   572M|  inline ThisIndexType &operator++() {
  103|   572M|    ++value_;
  104|   572M|    return *this;
  105|   572M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   487M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   487M|    value_ = i.value_;
  153|   487M|    return *this;
  154|   487M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|  1.17G|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  1.17G|    value_ = i.value_;
  153|  1.17G|    return *this;
  154|  1.17G|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  37.6M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  37.6M|    return value_ >= val;
  100|  37.6M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  8.76M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|  1.21G|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  25.2G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   209M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  19.9G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   261M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  19.6M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  19.6M|    return ThisIndexType(value_ + val);
  127|  19.6M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   171M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  24.4M|  constexpr bool operator<(const IndexType &i) const {
   88|  24.4M|    return value_ < i.value_;
   89|  24.4M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   204M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   292M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  61.6M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|  65.7M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   252M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  5.04M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  5.04M|    value_ = i.value_;
  153|  5.04M|    return *this;
  154|  5.04M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  8.76M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  8.76M|    value_ += val;
  141|  8.76M|    return *this;
  142|  8.76M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  31.7M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  31.7M|    value_ = val;
  157|  31.7M|    return *this;
  158|  31.7M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|   260M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  6.10M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  6.09M|  inline ThisIndexType &operator++() {
  103|  6.09M|    ++value_;
  104|  6.09M|    return *this;
  105|  6.09M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  20.4M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|  20.4M|  inline ThisIndexType &operator++() {
  103|  20.4M|    ++value_;
  104|  20.4M|    return *this;
  105|  20.4M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  34.4M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  34.4M|    return vector_[index.value()];
   75|  34.4M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  20.4M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  11.8k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  16.6k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   70|  58.0M|  inline reference operator[](const IndexTypeT &index) {
   71|  58.0M|    return vector_[index.value()];
   72|  58.0M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|   199k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  20.7M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  4.06k|  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|  10.3M|  inline reference operator[](const IndexTypeT &index) {
   71|  10.3M|    return vector_[index.value()];
   72|  10.3M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  21.6M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  21.6M|    return vector_[index.value()];
   75|  21.6M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   217M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  11.0M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   334M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   334M|    return vector_[index.value()];
   75|   334M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   917M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   917M|    return vector_[index.value()];
   75|   917M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   453M|  inline reference operator[](const IndexTypeT &index) {
   71|   453M|    return vector_[index.value()];
   72|   453M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  68.4M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  68.4M|    return vector_[index.value()];
   75|  68.4M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   390M|  inline reference operator[](const IndexTypeT &index) {
   71|   390M|    return vector_[index.value()];
   72|   390M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|   113M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   255M|  inline reference operator[](const IndexTypeT &index) {
   71|   255M|    return vector_[index.value()];
   72|   255M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  2.73k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|   200M|  inline reference operator[](const IndexTypeT &index) {
   71|   200M|    return vector_[index.value()];
   72|   200M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  51.7k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|  2.62M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  48.1k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  7.33k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  7.33k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  7.33k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  7.33k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  13.7k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  13.7k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  13.7k|    vector_.swap(arg.vector_);
   57|  13.7k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  13.7k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  13.7k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  13.7k|    vector_.swap(arg.vector_);
   57|  13.7k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  7.33k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  7.33k|  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.33k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  10.4k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  42.9k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  71.8k|int32_t DataTypeLength(DataType dt) {
   20|  71.8k|  switch (dt) {
   21|  33.2k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 33.2k, False: 38.6k]
  ------------------
   22|  35.2k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 2.01k, False: 69.8k]
  ------------------
   23|  35.2k|      return 1;
   24|  1.92k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 1.92k, False: 69.9k]
  ------------------
   25|  2.19k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 272, False: 71.5k]
  ------------------
   26|  2.19k|      return 2;
   27|  28.5k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 28.5k, False: 43.2k]
  ------------------
   28|  29.3k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 742, False: 71.1k]
  ------------------
   29|  29.3k|      return 4;
   30|    433|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 433, False: 71.4k]
  ------------------
   31|    816|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 383, False: 71.4k]
  ------------------
   32|    816|      return 8;
   33|  3.73k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 3.73k, False: 68.1k]
  ------------------
   34|  3.73k|      return 4;
   35|    195|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 195, False: 71.6k]
  ------------------
   36|    195|      return 8;
   37|    374|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 374, False: 71.4k]
  ------------------
   38|    374|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 71.8k]
  ------------------
   40|      0|      return -1;
   41|  71.8k|  }
   42|  71.8k|}

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

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

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

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

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

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

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

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|  1.30M|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  1.30M|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 1.30M, Folded]
  ------------------
   65|  1.30M|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 1.32k, False: 1.29M]
  ------------------
   66|  1.32k|      return false;
   67|  1.32k|    }
   68|  1.30M|  } else {
   69|       |    // IntTypeT is a signed value. Decode the symbol and convert to signed.
   70|      0|    typename std::make_unsigned<IntTypeT>::type symbol;
   71|      0|    if (!DecodeVarintUnsigned(1, &symbol, buffer)) {
  ------------------
  |  Branch (71:9): [True: 0, False: 0]
  ------------------
   72|      0|      return false;
   73|      0|    }
   74|      0|    *out_val = ConvertSymbolToSignedInt(symbol);
   75|      0|  }
   76|  1.29M|  return true;
   77|  1.30M|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   941k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   941k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   941k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 113, False: 941k]
  ------------------
   33|    113|    return false;
   34|    113|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   941k|  uint8_t in;
   39|   941k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 859, False: 940k]
  ------------------
   40|    859|    return false;
   41|    859|  }
   42|   940k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 21.6k, False: 919k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  21.6k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 656, False: 20.9k]
  ------------------
   45|    656|      return false;
   46|    656|    }
   47|       |    // Append decoded info from this byte.
   48|  20.9k|    *out_val <<= 7;
   49|  20.9k|    *out_val |= in & ((1 << 7) - 1);
   50|   919k|  } else {
   51|       |    // Last byte reached
   52|   919k|    *out_val = in;
   53|   919k|  }
   54|   940k|  return true;
   55|   940k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  6.05k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  6.05k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  6.05k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 6.05k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  6.05k|  uint8_t in;
   39|  6.05k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 7, False: 6.04k]
  ------------------
   40|      7|    return false;
   41|      7|  }
   42|  6.04k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 449, False: 5.59k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    449|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 8, False: 441]
  ------------------
   45|      8|      return false;
   46|      8|    }
   47|       |    // Append decoded info from this byte.
   48|    441|    *out_val <<= 7;
   49|    441|    *out_val |= in & ((1 << 7) - 1);
   50|  5.59k|  } else {
   51|       |    // Last byte reached
   52|  5.59k|    *out_val = in;
   53|  5.59k|  }
   54|  6.03k|  return true;
   55|  6.04k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  7.31k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  7.31k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 7.31k, Folded]
  ------------------
   65|  7.31k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 121, False: 7.19k]
  ------------------
   66|    121|      return false;
   67|    121|    }
   68|  7.31k|  } 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.19k|  return true;
   77|  7.31k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  3.87k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.87k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.87k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 3.87k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.87k|  uint8_t in;
   39|  3.87k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 20, False: 3.85k]
  ------------------
   40|     20|    return false;
   41|     20|  }
   42|  3.85k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 74, False: 3.77k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|     74|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 3, False: 71]
  ------------------
   45|      3|      return false;
   46|      3|    }
   47|       |    // Append decoded info from this byte.
   48|     71|    *out_val <<= 7;
   49|     71|    *out_val |= in & ((1 << 7) - 1);
   50|  3.77k|  } else {
   51|       |    // Last byte reached
   52|  3.77k|    *out_val = in;
   53|  3.77k|  }
   54|  3.85k|  return true;
   55|  3.85k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   309k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   309k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   309k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 22, False: 309k]
  ------------------
   33|     22|    return false;
   34|     22|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   309k|  uint8_t in;
   39|   309k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 50, False: 309k]
  ------------------
   40|     50|    return false;
   41|     50|  }
   42|   309k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.46k, False: 308k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.46k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 121, False: 1.33k]
  ------------------
   45|    121|      return false;
   46|    121|    }
   47|       |    // Append decoded info from this byte.
   48|  1.33k|    *out_val <<= 7;
   49|  1.33k|    *out_val |= in & ((1 << 7) - 1);
   50|   308k|  } else {
   51|       |    // Last byte reached
   52|   308k|    *out_val = in;
   53|   308k|  }
   54|   309k|  return true;
   55|   309k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.64k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.64k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.64k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 3.64k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.64k|  uint8_t in;
   39|  3.64k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 28, False: 3.61k]
  ------------------
   40|     28|    return false;
   41|     28|  }
   42|  3.61k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 665, False: 2.95k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    665|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 37, False: 628]
  ------------------
   45|     37|      return false;
   46|     37|    }
   47|       |    // Append decoded info from this byte.
   48|    628|    *out_val <<= 7;
   49|    628|    *out_val |= in & ((1 << 7) - 1);
   50|  2.95k|  } else {
   51|       |    // Last byte reached
   52|  2.95k|    *out_val = in;
   53|  2.95k|  }
   54|  3.58k|  return true;
   55|  3.61k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  16.7k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  16.7k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  16.7k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 5, False: 16.7k]
  ------------------
   33|      5|    return false;
   34|      5|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  16.7k|  uint8_t in;
   39|  16.7k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 19, False: 16.6k]
  ------------------
   40|     19|    return false;
   41|     19|  }
   42|  16.6k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 211, False: 16.4k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    211|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 25, False: 186]
  ------------------
   45|     25|      return false;
   46|     25|    }
   47|       |    // Append decoded info from this byte.
   48|    186|    *out_val <<= 7;
   49|    186|    *out_val |= in & ((1 << 7) - 1);
   50|  16.4k|  } else {
   51|       |    // Last byte reached
   52|  16.4k|    *out_val = in;
   53|  16.4k|  }
   54|  16.6k|  return true;
   55|  16.6k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  8.87k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  8.87k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  8.87k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 114, False: 8.75k]
  ------------------
   33|    114|    return false;
   34|    114|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  8.75k|  uint8_t in;
   39|  8.75k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 68, False: 8.69k]
  ------------------
   40|     68|    return false;
   41|     68|  }
   42|  8.69k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 2.23k, False: 6.45k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  2.23k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 602, False: 1.63k]
  ------------------
   45|    602|      return false;
   46|    602|    }
   47|       |    // Append decoded info from this byte.
   48|  1.63k|    *out_val <<= 7;
   49|  1.63k|    *out_val |= in & ((1 << 7) - 1);
   50|  6.45k|  } else {
   51|       |    // Last byte reached
   52|  6.45k|    *out_val = in;
   53|  6.45k|  }
   54|  8.08k|  return true;
   55|  8.69k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  7.12k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  7.12k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  7.12k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 58, False: 7.06k]
  ------------------
   33|     58|    return false;
   34|     58|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  7.06k|  uint8_t in;
   39|  7.06k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 43, False: 7.02k]
  ------------------
   40|     43|    return false;
   41|     43|  }
   42|  7.02k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 3.60k, False: 3.41k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  3.60k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 668, False: 2.93k]
  ------------------
   45|    668|      return false;
   46|    668|    }
   47|       |    // Append decoded info from this byte.
   48|  2.93k|    *out_val <<= 7;
   49|  2.93k|    *out_val |= in & ((1 << 7) - 1);
   50|  3.41k|  } else {
   51|       |    // Last byte reached
   52|  3.41k|    *out_val = in;
   53|  3.41k|  }
   54|  6.35k|  return true;
   55|  7.02k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  42.4k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  42.4k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  42.4k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 4, False: 42.4k]
  ------------------
   33|      4|    return false;
   34|      4|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  42.4k|  uint8_t in;
   39|  42.4k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 29, False: 42.4k]
  ------------------
   40|     29|    return false;
   41|     29|  }
   42|  42.4k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.21k, False: 41.2k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.21k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 26, False: 1.19k]
  ------------------
   45|     26|      return false;
   46|     26|    }
   47|       |    // Append decoded info from this byte.
   48|  1.19k|    *out_val <<= 7;
   49|  1.19k|    *out_val |= in & ((1 << 7) - 1);
   50|  41.2k|  } else {
   51|       |    // Last byte reached
   52|  41.2k|    *out_val = in;
   53|  41.2k|  }
   54|  42.4k|  return true;
   55|  42.4k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|   308k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|   406k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  33.8k|  Self operator-(const Self &o) const {
  138|  33.8k|    Self ret;
  139|   135k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 101k, False: 33.8k]
  ------------------
  140|   101k|      ret[i] = (*this)[i] - o[i];
  141|   101k|    }
  142|  33.8k|    return ret;
  143|  33.8k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  84.4k|  VectorD() {
   41|   337k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 253k, False: 84.4k]
  ------------------
   42|   253k|      (*this)[i] = Scalar(0);
   43|   253k|    }
   44|  84.4k|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|   140M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  11.6M|  Self operator-(const Self &o) const {
  138|  11.6M|    Self ret;
  139|  46.5M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 34.9M, False: 11.6M]
  ------------------
  140|  34.9M|      ret[i] = (*this)[i] - o[i];
  141|  34.9M|    }
  142|  11.6M|    return ret;
  143|  11.6M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  5.80M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  5.80M|  static_assert(std::is_signed<ScalarT>::value,
  321|  5.80M|                "ScalarT must be a signed type. ");
  322|  5.80M|  VectorD<ScalarT, 3> r;
  323|  5.80M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  5.80M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  5.80M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  5.80M|  return r;
  327|  5.80M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  5.80M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  5.80M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  2.30M|  Scalar AbsSum() const {
  238|  2.30M|    Scalar result(0);
  239|  9.18M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 6.89M, False: 2.29M]
  ------------------
  240|  6.89M|      Scalar next_value = std::abs(v_[i]);
  241|  6.89M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 9.10k, False: 6.88M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  9.10k|        return std::numeric_limits<Scalar>::max();
  244|  9.10k|      }
  245|  6.88M|      result += next_value;
  246|  6.88M|    }
  247|  2.29M|    return result;
  248|  2.30M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   149k|  Self operator/(const Scalar &o) const {
  183|   149k|    Self ret;
  184|   598k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 448k, False: 149k]
  ------------------
  185|   448k|      ret[i] = (*this)[i] / o;
  186|   448k|    }
  187|   149k|    return ret;
  188|   149k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   175M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  9.61M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  6.90M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  1.60M|  Self operator-() const {
  121|  1.60M|    Self ret;
  122|  6.40M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 4.80M, False: 1.60M]
  ------------------
  123|  4.80M|      ret[i] = -(*this)[i];
  124|  4.80M|    }
  125|  1.60M|    return ret;
  126|  1.60M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  4.80M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|  1.13M|  Self operator-(const Self &o) const {
  138|  1.13M|    Self ret;
  139|  3.40M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.27M, False: 1.13M]
  ------------------
  140|  2.27M|      ret[i] = (*this)[i] - o[i];
  141|  2.27M|    }
  142|  1.13M|    return ret;
  143|  1.13M|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  13.6M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  20.4M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  41.6M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  2.27M|  Self operator+(const Self &o) const {
  130|  2.27M|    Self ret;
  131|  6.81M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 4.54M, False: 2.27M]
  ------------------
  132|  4.54M|      ret[i] = (*this)[i] + o[i];
  133|  4.54M|    }
  134|  2.27M|    return ret;
  135|  2.27M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  39.7M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|  1.13M|  Self operator-(const Self &o) const {
  138|  1.13M|    Self ret;
  139|  3.41M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.27M, False: 1.13M]
  ------------------
  140|  2.27M|      ret[i] = (*this)[i] - o[i];
  141|  2.27M|    }
  142|  1.13M|    return ret;
  143|  1.13M|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|  1.13M|  Self operator+(const Self &o) const {
  130|  1.13M|    Self ret;
  131|  3.41M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 2.27M, False: 1.13M]
  ------------------
  132|  2.27M|      ret[i] = (*this)[i] + o[i];
  133|  2.27M|    }
  134|  1.13M|    return ret;
  135|  1.13M|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   344k|  bool operator==(const Self &o) const {
  207|  1.00M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 673k, False: 327k]
  ------------------
  208|   673k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 16.7k, False: 656k]
  ------------------
  209|  16.7k|        return false;
  210|  16.7k|      }
  211|   673k|    }
  212|   327k|    return true;
  213|   344k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  3.99M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  17.0k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  17.3k|  Scalar Dot(const Self &o) const {
  251|  17.3k|    Scalar ret(0);
  252|  69.5k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 52.1k, False: 17.3k]
  ------------------
  253|  52.1k|      ret += (*this)[i] * o[i];
  254|  52.1k|    }
  255|  17.3k|    return ret;
  256|  17.3k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    310|  Self operator*(const Scalar &o) const {
  175|    310|    Self ret;
  176|  1.24k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 930, False: 310]
  ------------------
  177|    930|      ret[i] = (*this)[i] * o;
  178|    930|    }
  179|    310|    return ret;
  180|    310|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  16.7k|  Self operator-(const Self &o) const {
  138|  16.7k|    Self ret;
  139|  50.2k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 33.5k, False: 16.7k]
  ------------------
  140|  33.5k|      ret[i] = (*this)[i] - o[i];
  141|  33.5k|    }
  142|  16.7k|    return ret;
  143|  16.7k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  33.5k|  VectorD() {
   41|   100k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 67.0k, False: 33.5k]
  ------------------
   42|  67.0k|      (*this)[i] = Scalar(0);
   43|  67.0k|    }
   44|  33.5k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   704k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   704k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   704k|    v_[0] = c0;
   55|   704k|    v_[1] = c1;
   56|   704k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|   134k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   279k|  bool operator==(const Self &o) const {
  207|   798k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 539k, False: 258k]
  ------------------
  208|   539k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 21.1k, False: 518k]
  ------------------
  209|  21.1k|        return false;
  210|  21.1k|      }
  211|   539k|    }
  212|   258k|    return true;
  213|   279k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  1.64M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  33.8M|  VectorD() {
   41|   135M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 101M, False: 33.8M]
  ------------------
   42|   101M|      (*this)[i] = Scalar(0);
   43|   101M|    }
   44|  33.8M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  22.9k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  24.9k|  Scalar Dot(const Self &o) const {
  251|  24.9k|    Scalar ret(0);
  252|  99.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 74.8k, False: 24.9k]
  ------------------
  253|  74.8k|      ret += (*this)[i] * o[i];
  254|  74.8k|    }
  255|  24.9k|    return ret;
  256|  24.9k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  1.96k|  Self operator-(const Self &o) const {
  138|  1.96k|    Self ret;
  139|  5.89k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 3.92k, False: 1.96k]
  ------------------
  140|  3.92k|      ret[i] = (*this)[i] - o[i];
  141|  3.92k|    }
  142|  1.96k|    return ret;
  143|  1.96k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  5.54k|  Self operator*(const Scalar &o) const {
  175|  5.54k|    Self ret;
  176|  16.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 11.0k, False: 5.54k]
  ------------------
  177|  11.0k|      ret[i] = (*this)[i] * o;
  178|  11.0k|    }
  179|  5.54k|    return ret;
  180|  5.54k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  1.85k|  Self operator+(const Self &o) const {
  130|  1.85k|    Self ret;
  131|  5.56k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 3.71k, False: 1.85k]
  ------------------
  132|  3.71k|      ret[i] = (*this)[i] + o[i];
  133|  3.71k|    }
  134|  1.85k|    return ret;
  135|  1.85k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  1.85k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  1.85k|  return v * o;
  294|  1.85k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  1.83k|  Self operator+(const Self &o) const {
  130|  1.83k|    Self ret;
  131|  7.34k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 5.50k, False: 1.83k]
  ------------------
  132|  5.50k|      ret[i] = (*this)[i] + o[i];
  133|  5.50k|    }
  134|  1.83k|    return ret;
  135|  1.83k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  1.83k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  1.83k|  return v * o;
  294|  1.83k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  1.83k|  Self operator*(const Scalar &o) const {
  175|  1.83k|    Self ret;
  176|  7.34k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 5.50k, False: 1.83k]
  ------------------
  177|  5.50k|      ret[i] = (*this)[i] * o;
  178|  5.50k|    }
  179|  1.83k|    return ret;
  180|  1.83k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   561k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   561k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   561k|    v_[0] = c0;
   55|   561k|    v_[1] = c1;
   56|   561k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  13.0k|  VectorD() {
   41|  39.0k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 26.0k, False: 13.0k]
  ------------------
   42|  26.0k|      (*this)[i] = Scalar(0);
   43|  26.0k|    }
   44|  13.0k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  3.65k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  10.9k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 7.31k, False: 3.65k]
  ------------------
  104|  7.31k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 7.31k, False: 0]
  ------------------
  105|  7.31k|        v_[i] = Scalar(src_vector[i]);
  106|  7.31k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  7.31k|    }
  110|  3.65k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|    851|  Self operator+(const Self &o) const {
  130|    851|    Self ret;
  131|  2.55k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.70k, False: 851]
  ------------------
  132|  1.70k|      ret[i] = (*this)[i] + o[i];
  133|  1.70k|    }
  134|    851|    return ret;
  135|    851|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  1.82k|  VectorD() {
   41|  5.48k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.65k, False: 1.82k]
  ------------------
   42|  3.65k|      (*this)[i] = Scalar(0);
   43|  3.65k|    }
   44|  1.82k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  10.9k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  7.31k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  1.82k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  5.48k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 3.65k, False: 1.82k]
  ------------------
  104|  3.65k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 3.65k, False: 0]
  ------------------
  105|  3.65k|        v_[i] = Scalar(src_vector[i]);
  106|  3.65k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  3.65k|    }
  110|  1.82k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  1.82k|  Self operator/(const Scalar &o) const {
  183|  1.82k|    Self ret;
  184|  5.48k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 3.65k, False: 1.82k]
  ------------------
  185|  3.65k|      ret[i] = (*this)[i] / o;
  186|  3.65k|    }
  187|  1.82k|    return ret;
  188|  1.82k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|    977|  Self operator-(const Self &o) const {
  138|    977|    Self ret;
  139|  2.93k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.95k, False: 977]
  ------------------
  140|  1.95k|      ret[i] = (*this)[i] - o[i];
  141|  1.95k|    }
  142|    977|    return ret;
  143|    977|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  52.0k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  1.60M|  VectorD() {
   41|  6.41M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 4.80M, False: 1.60M]
  ------------------
   42|  4.80M|      (*this)[i] = Scalar(0);
   43|  4.80M|    }
   44|  1.60M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  8.39M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  8.39M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  8.39M|    v_[0] = c0;
   55|  8.39M|    v_[1] = c1;
   56|  8.39M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  6.81M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  20.4M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 13.6M, False: 6.81M]
  ------------------
  104|  13.6M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 13.6M, False: 0]
  ------------------
  105|  13.6M|        v_[i] = Scalar(src_vector[i]);
  106|  13.6M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  13.6M|    }
  110|  6.81M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  3.40M|  VectorD() {
   41|  10.2M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 6.81M, False: 3.40M]
  ------------------
   42|  6.81M|      (*this)[i] = Scalar(0);
   43|  6.81M|    }
   44|  3.40M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  3.40M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  10.2M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 6.81M, False: 3.40M]
  ------------------
  104|  6.81M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 6.81M, False: 0]
  ------------------
  105|  6.81M|        v_[i] = Scalar(src_vector[i]);
  106|  6.81M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  6.81M|    }
  110|  3.40M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  4.98M|  VectorD(const Self &o) {
   89|  14.9M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 9.97M, False: 4.98M]
  ------------------
   90|  9.97M|      (*this)[i] = o[i];
   91|  9.97M|    }
   92|  4.98M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  2.27M|  VectorD() {
   41|  6.83M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 4.55M, False: 2.27M]
  ------------------
   42|  4.55M|      (*this)[i] = Scalar(0);
   43|  4.55M|    }
   44|  2.27M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|   104M|  inline int num_vertices() const {
   74|   104M|    return static_cast<int>(vertex_corners_.size());
   75|   104M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  8.78M|  inline int num_corners() const {
   77|  8.78M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  8.78M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  2.27M|  inline int num_faces() const {
   80|  2.27M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  2.27M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   334M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   334M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 334M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   334M|    return opposite_corners_[corner];
   88|   334M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   585M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   585M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 12.6M, False: 572M]
  ------------------
   91|  12.6M|      return corner;
   92|  12.6M|    }
   93|   572M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 523M, False: 48.9M]
  ------------------
   94|   585M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   467M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   467M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 4.40M, False: 462M]
  ------------------
   97|  4.40M|      return corner;
   98|  4.40M|    }
   99|   462M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 116M, False: 346M]
  ------------------
  100|   467M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   917M|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|   917M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 917M]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|   917M|    return ConfidentVertex(corner);
  106|   917M|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|   917M|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|   917M|    DRACO_DCHECK_GE(corner.value(), 0);
  109|   917M|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|   917M|    return corner_to_vertex_map_[corner];
  111|   917M|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  32.8M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  32.8M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 32.8M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  32.8M|    return FaceIndex(corner.value() / 3);
  117|  32.8M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|  1.03G|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  68.4M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  68.4M|    return vertex_corners_[v];
  152|  68.4M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|   644k|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|   644k|    const CornerIndex corner = LeftMostCorner(vert);
  187|   644k|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 17.4k, False: 626k]
  ------------------
  188|  17.4k|      return true;
  189|  17.4k|    }
  190|   626k|    return false;
  191|   644k|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  67.6M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  67.6M|    return Previous(Opposite(Previous(corner)));
  202|  67.6M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  13.5M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  13.5M|    return Next(Opposite(Next(corner)));
  207|  13.5M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  3.29M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  3.29M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 3.29M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  3.29M|    return Opposite(Previous(corner_id));
  222|  3.29M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  3.92M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  3.92M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 3.92M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  3.92M|    return Opposite(Next(corner_id));
  228|  3.92M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   390M|                                CornerIndex opp_corner_id) {
  249|   390M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   390M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   390M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   453M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   453M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   453M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   453M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|   113M|  VertexIndex AddNewVertex() {
  271|   113M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|   113M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|   113M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|   113M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   252M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   252M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   252M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 252M, False: 0]
  ------------------
  295|   252M|      vertex_corners_[vert] = corner;
  296|   252M|    }
  297|   252M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|  2.99M|  void MakeVertexIsolated(VertexIndex vert) {
  329|  2.99M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|  2.99M|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|  2.99M|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  14.5k|      : corner_table_(table),
  229|  14.5k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  14.5k|        corner_(start_corner_),
  231|  14.5k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  4.30M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  97.3k|  VertexCornersIterator &operator++() {
  268|  97.3k|    Next();
  269|  97.3k|    return *this;
  270|  97.3k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  3.68M|  void Next() {
  248|  3.68M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 3.60M, False: 73.2k]
  ------------------
  249|  3.60M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  3.60M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 22.5k, False: 3.58M]
  ------------------
  251|       |        // Open boundary reached.
  252|  22.5k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  22.5k|        left_traversal_ = false;
  254|  3.58M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 597k, False: 2.98M]
  ------------------
  255|       |        // End reached.
  256|   597k|        corner_ = kInvalidCornerIndex;
  257|   597k|      }
  258|  3.60M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  73.2k|      corner_ = corner_table_->SwingRight(corner_);
  262|  73.2k|    }
  263|  3.68M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  6.59M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  3.92M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  3.85M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  2.22M|  void Next() {
  248|  2.22M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 2.20M, False: 22.5k]
  ------------------
  249|  2.20M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  2.20M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 1.59M, False: 608k]
  ------------------
  251|       |        // Open boundary reached.
  252|  1.59M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  1.59M|        left_traversal_ = false;
  254|  1.59M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 99.1k, False: 509k]
  ------------------
  255|       |        // End reached.
  256|  99.1k|        corner_ = kInvalidCornerIndex;
  257|  99.1k|      }
  258|  2.20M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  22.5k|      corner_ = corner_table_->SwingRight(corner_);
  262|  22.5k|    }
  263|  2.22M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  1.69M|      : corner_table_(table),
  236|  1.69M|        start_corner_(corner_id),
  237|  1.69M|        corner_(start_corner_),
  238|  1.69M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   605k|      : corner_table_(table),
  236|   605k|        start_corner_(corner_id),
  237|   605k|        corner_(start_corner_),
  238|   605k|        left_traversal_(true) {}

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

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

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

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

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

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

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

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

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

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

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

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

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

