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

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

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

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

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

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

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

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

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

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

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

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

_ZNK5draco17AttributesDecoder14GetAttributeIdEi:
   44|  56.4k|  int32_t GetAttributeId(int i) const override {
   45|  56.4k|    return point_attribute_ids_[i];
   46|  56.4k|  }
_ZNK5draco17AttributesDecoder16GetNumAttributesEv:
   47|  34.6k|  int32_t GetNumAttributes() const override {
   48|  34.6k|    return static_cast<int32_t>(point_attribute_ids_.size());
   49|  34.6k|  }
_ZNK5draco17AttributesDecoder10GetDecoderEv:
   50|  35.4k|  PointCloudDecoder *GetDecoder() const override {
   51|  35.4k|    return point_cloud_decoder_;
   52|  35.4k|  }
_ZN5draco17AttributesDecoder16DecodeAttributesEPNS_13DecoderBufferE:
   55|  3.12k|  bool DecodeAttributes(DecoderBuffer *in_buffer) override {
   56|  3.12k|    if (!DecodePortableAttributes(in_buffer)) {
  ------------------
  |  Branch (56:9): [True: 1.19k, False: 1.93k]
  ------------------
   57|  1.19k|      return false;
   58|  1.19k|    }
   59|  1.93k|    if (!DecodeDataNeededByPortableTransforms(in_buffer)) {
  ------------------
  |  Branch (59:9): [True: 429, False: 1.50k]
  ------------------
   60|    429|      return false;
   61|    429|    }
   62|  1.50k|    if (!TransformAttributesToOriginalFormat()) {
  ------------------
  |  Branch (62:9): [True: 148, False: 1.35k]
  ------------------
   63|    148|      return false;
   64|    148|    }
   65|  1.35k|    return true;
   66|  1.50k|  }
_ZNK5draco17AttributesDecoder27GetLocalIdForPointAttributeEi:
   69|  1.67k|  int32_t GetLocalIdForPointAttribute(int32_t point_attribute_id) const {
   70|  1.67k|    const int id_map_size =
   71|  1.67k|        static_cast<int>(point_attribute_to_local_id_map_.size());
   72|  1.67k|    if (point_attribute_id >= id_map_size) {
  ------------------
  |  Branch (72:9): [True: 0, False: 1.67k]
  ------------------
   73|      0|      return -1;
   74|      0|    }
   75|  1.67k|    return point_attribute_to_local_id_map_[point_attribute_id];
   76|  1.67k|  }
_ZN5draco17AttributesDecoderD2Ev:
   35|  19.5k|  virtual ~AttributesDecoder() = default;

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

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

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

_ZN5draco17OctahedronToolBoxC2Ev:
   53|  1.83k|      : quantization_bits_(-1),
   54|  1.83k|        max_quantized_value_(-1),
   55|  1.83k|        max_value_(-1),
   56|  1.83k|        dequantization_scale_(1.f),
   57|  1.83k|        center_value_(-1) {}
_ZN5draco17OctahedronToolBox19SetQuantizationBitsEi:
   59|  1.65k|  bool SetQuantizationBits(int32_t q) {
   60|  1.65k|    if (q < 2 || q > 30) {
  ------------------
  |  Branch (60:9): [True: 658, False: 1.00k]
  |  Branch (60:18): [True: 49, False: 951]
  ------------------
   61|    707|      return false;
   62|    707|    }
   63|    951|    quantization_bits_ = q;
   64|    951|    max_quantized_value_ = (1u << quantization_bits_) - 1;
   65|    951|    max_value_ = max_quantized_value_ - 1;
   66|    951|    dequantization_scale_ = 2.f / max_value_;
   67|    951|    center_value_ = max_value_ / 2;
   68|    951|    return true;
   69|  1.65k|  }
_ZNK5draco17OctahedronToolBox28CanonicalizeOctahedralCoordsEiiPiS1_:
   76|  2.32M|                                           int32_t *out_t) const {
   77|  2.32M|    if ((s == 0 && t == 0) || (s == 0 && t == max_value_) ||
  ------------------
  |  Branch (77:10): [True: 2.80k, False: 2.32M]
  |  Branch (77:20): [True: 0, False: 2.80k]
  |  Branch (77:32): [True: 2.80k, False: 2.32M]
  |  Branch (77:42): [True: 0, False: 2.80k]
  ------------------
   78|  2.32M|        (s == max_value_ && t == 0)) {
  ------------------
  |  Branch (78:10): [True: 1.39M, False: 926k]
  |  Branch (78:29): [True: 3.98k, False: 1.39M]
  ------------------
   79|  3.98k|      s = max_value_;
   80|  3.98k|      t = max_value_;
   81|  2.31M|    } else if (s == 0 && t > center_value_) {
  ------------------
  |  Branch (81:16): [True: 2.80k, False: 2.31M]
  |  Branch (81:26): [True: 694, False: 2.11k]
  ------------------
   82|    694|      t = center_value_ - (t - center_value_);
   83|  2.31M|    } else if (s == max_value_ && t < center_value_) {
  ------------------
  |  Branch (83:16): [True: 1.39M, False: 925k]
  |  Branch (83:35): [True: 4.20k, False: 1.38M]
  ------------------
   84|  4.20k|      t = center_value_ + (center_value_ - t);
   85|  2.31M|    } else if (t == max_value_ && s < center_value_) {
  ------------------
  |  Branch (85:16): [True: 1.39M, False: 923k]
  |  Branch (85:35): [True: 203, False: 1.39M]
  ------------------
   86|    203|      s = center_value_ + (center_value_ - s);
   87|  2.31M|    } else if (t == 0 && s > center_value_) {
  ------------------
  |  Branch (87:16): [True: 3.64k, False: 2.31M]
  |  Branch (87:26): [True: 1.58k, False: 2.06k]
  ------------------
   88|  1.58k|      s = center_value_ - (s - center_value_);
   89|  1.58k|    }
   90|       |
   91|  2.32M|    *out_s = s;
   92|  2.32M|    *out_t = t;
   93|  2.32M|  }
_ZNK5draco17OctahedronToolBox40IntegerVectorToQuantizedOctahedralCoordsEPKiPiS3_:
   99|  2.32M|                                                       int32_t *out_t) const {
  100|  2.32M|    DRACO_DCHECK_EQ(
  101|  2.32M|        std::abs(int_vec[0]) + std::abs(int_vec[1]) + std::abs(int_vec[2]),
  102|  2.32M|        center_value_);
  103|  2.32M|    int32_t s, t;
  104|  2.32M|    if (int_vec[0] >= 0) {
  ------------------
  |  Branch (104:9): [True: 1.18M, False: 1.13M]
  ------------------
  105|       |      // Right hemisphere.
  106|  1.18M|      s = (int_vec[1] + center_value_);
  107|  1.18M|      t = (int_vec[2] + center_value_);
  108|  1.18M|    } else {
  109|       |      // Left hemisphere.
  110|  1.13M|      if (int_vec[1] < 0) {
  ------------------
  |  Branch (110:11): [True: 47.9k, False: 1.09M]
  ------------------
  111|  47.9k|        s = std::abs(int_vec[2]);
  112|  1.09M|      } else {
  113|  1.09M|        s = (max_value_ - std::abs(int_vec[2]));
  114|  1.09M|      }
  115|  1.13M|      if (int_vec[2] < 0) {
  ------------------
  |  Branch (115:11): [True: 51.1k, False: 1.08M]
  ------------------
  116|  51.1k|        t = std::abs(int_vec[1]);
  117|  1.08M|      } else {
  118|  1.08M|        t = (max_value_ - std::abs(int_vec[1]));
  119|  1.08M|      }
  120|  1.13M|    }
  121|  2.32M|    CanonicalizeOctahedralCoords(s, t, out_s, out_t);
  122|  2.32M|  }
_ZNK5draco17OctahedronToolBox37QuantizedOctahedralCoordsToUnitVectorEiiPf:
  198|   233k|                                                    float *out_vector) const {
  199|   233k|    OctahedralCoordsToUnitVector(in_s * dequantization_scale_ - 1.f,
  200|   233k|                                 in_t * dequantization_scale_ - 1.f,
  201|   233k|                                 out_vector);
  202|   233k|  }
_ZNK5draco17OctahedronToolBox11IsInDiamondERKiS2_:
  205|  1.87M|  inline bool IsInDiamond(const int32_t &s, const int32_t &t) const {
  206|       |    // Expect center already at origin.
  207|  1.87M|    DRACO_DCHECK_LE(s, center_value_);
  208|  1.87M|    DRACO_DCHECK_LE(t, center_value_);
  209|  1.87M|    DRACO_DCHECK_GE(s, -center_value_);
  210|  1.87M|    DRACO_DCHECK_GE(t, -center_value_);
  211|  1.87M|    const uint32_t st =
  212|  1.87M|        static_cast<uint32_t>(std::abs(s)) + static_cast<uint32_t>(std::abs(t));
  213|  1.87M|    return st <= center_value_;
  214|  1.87M|  }
_ZNK5draco17OctahedronToolBox13InvertDiamondEPiS1_:
  216|  2.01M|  void InvertDiamond(int32_t *s, int32_t *t) const {
  217|       |    // Expect center already at origin.
  218|  2.01M|    DRACO_DCHECK_LE(*s, center_value_);
  219|  2.01M|    DRACO_DCHECK_LE(*t, center_value_);
  220|  2.01M|    DRACO_DCHECK_GE(*s, -center_value_);
  221|  2.01M|    DRACO_DCHECK_GE(*t, -center_value_);
  222|  2.01M|    int32_t sign_s = 0;
  223|  2.01M|    int32_t sign_t = 0;
  224|  2.01M|    if (*s >= 0 && *t >= 0) {
  ------------------
  |  Branch (224:9): [True: 1.91M, False: 99.7k]
  |  Branch (224:20): [True: 1.85M, False: 60.1k]
  ------------------
  225|  1.85M|      sign_s = 1;
  226|  1.85M|      sign_t = 1;
  227|  1.85M|    } else if (*s <= 0 && *t <= 0) {
  ------------------
  |  Branch (227:16): [True: 101k, False: 57.9k]
  |  Branch (227:27): [True: 47.7k, False: 54.1k]
  ------------------
  228|  47.7k|      sign_s = -1;
  229|  47.7k|      sign_t = -1;
  230|   112k|    } else {
  231|   112k|      sign_s = (*s > 0) ? 1 : -1;
  ------------------
  |  Branch (231:16): [True: 57.9k, False: 54.1k]
  ------------------
  232|   112k|      sign_t = (*t > 0) ? 1 : -1;
  ------------------
  |  Branch (232:16): [True: 54.1k, False: 57.9k]
  ------------------
  233|   112k|    }
  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.01M|    const uint32_t corner_point_s = sign_s * center_value_;
  239|  2.01M|    const uint32_t corner_point_t = sign_t * center_value_;
  240|  2.01M|    uint32_t us = *s;
  241|  2.01M|    uint32_t ut = *t;
  242|  2.01M|    us = us + us - corner_point_s;
  243|  2.01M|    ut = ut + ut - corner_point_t;
  244|  2.01M|    if (sign_s * sign_t >= 0) {
  ------------------
  |  Branch (244:9): [True: 1.90M, False: 112k]
  ------------------
  245|  1.90M|      uint32_t temp = us;
  246|  1.90M|      us = -ut;
  247|  1.90M|      ut = -temp;
  248|  1.90M|    } else {
  249|   112k|      std::swap(us, ut);
  250|   112k|    }
  251|  2.01M|    us = us + corner_point_s;
  252|  2.01M|    ut = ut + corner_point_t;
  253|       |
  254|  2.01M|    *s = us;
  255|  2.01M|    *t = ut;
  256|  2.01M|    *s /= 2;
  257|  2.01M|    *t /= 2;
  258|  2.01M|  }
_ZNK5draco17OctahedronToolBox6ModMaxEi:
  272|  3.74M|  int32_t ModMax(int32_t x) const {
  273|  3.74M|    if (x > this->center_value()) {
  ------------------
  |  Branch (273:9): [True: 816, False: 3.74M]
  ------------------
  274|    816|      return x - this->max_quantized_value();
  275|    816|    }
  276|  3.74M|    if (x < -this->center_value()) {
  ------------------
  |  Branch (276:9): [True: 999, False: 3.74M]
  ------------------
  277|    999|      return x + this->max_quantized_value();
  278|    999|    }
  279|  3.74M|    return x;
  280|  3.74M|  }
_ZNK5draco17OctahedronToolBox17quantization_bitsEv:
  291|    910|  int32_t quantization_bits() const { return quantization_bits_; }
_ZNK5draco17OctahedronToolBox19max_quantized_valueEv:
  292|  1.81k|  int32_t max_quantized_value() const { return max_quantized_value_; }
_ZNK5draco17OctahedronToolBox12center_valueEv:
  294|  11.2M|  int32_t center_value() const { return center_value_; }
_ZNK5draco17OctahedronToolBox28OctahedralCoordsToUnitVectorEffPf:
  298|   233k|                                           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|   233k|    float y = in_s_scaled;
  329|   233k|    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|   233k|    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|   233k|    float x_offset = -x;
  342|   233k|    x_offset = x_offset < 0 ? 0 : x_offset;
  ------------------
  |  Branch (342:16): [True: 68.9k, False: 164k]
  ------------------
  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|   233k|    y += y < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (347:10): [True: 809, False: 233k]
  ------------------
  348|   233k|    z += z < 0 ? x_offset : -x_offset;
  ------------------
  |  Branch (348:10): [True: 1.01k, False: 232k]
  ------------------
  349|       |
  350|       |    // Normalize the computed vector.
  351|   233k|    const float norm_squared = x * x + y * y + z * z;
  352|   233k|    if (norm_squared < 1e-6) {
  ------------------
  |  Branch (352:9): [True: 0, False: 233k]
  ------------------
  353|      0|      out_vector[0] = 0;
  354|      0|      out_vector[1] = 0;
  355|      0|      out_vector[2] = 0;
  356|   233k|    } else {
  357|   233k|      const float d = 1.0f / std::sqrt(norm_squared);
  358|   233k|      out_vector[0] = x * d;
  359|   233k|      out_vector[1] = y * d;
  360|   233k|      out_vector[2] = z * d;
  361|   233k|    }
  362|   233k|  }
_ZNK5draco17OctahedronToolBox25CanonicalizeIntegerVectorIiEEvPT_:
  173|  2.32M|  void CanonicalizeIntegerVector(T *vec) const {
  174|  2.32M|    static_assert(std::is_integral<T>::value, "T must be an integral type.");
  175|  2.32M|    static_assert(std::is_signed<T>::value, "T must be a signed type.");
  176|  2.32M|    const int64_t abs_sum = static_cast<int64_t>(std::abs(vec[0])) +
  177|  2.32M|                            static_cast<int64_t>(std::abs(vec[1])) +
  178|  2.32M|                            static_cast<int64_t>(std::abs(vec[2]));
  179|       |
  180|  2.32M|    if (abs_sum == 0) {
  ------------------
  |  Branch (180:9): [True: 2.07M, False: 244k]
  ------------------
  181|  2.07M|      vec[0] = center_value_;  // vec[1] == v[2] == 0
  182|  2.07M|    } else {
  183|   244k|      vec[0] =
  184|   244k|          (static_cast<int64_t>(vec[0]) * static_cast<int64_t>(center_value_)) /
  185|   244k|          abs_sum;
  186|   244k|      vec[1] =
  187|   244k|          (static_cast<int64_t>(vec[1]) * static_cast<int64_t>(center_value_)) /
  188|   244k|          abs_sum;
  189|   244k|      if (vec[2] >= 0) {
  ------------------
  |  Branch (189:11): [True: 128k, False: 115k]
  ------------------
  190|   128k|        vec[2] = center_value_ - std::abs(vec[0]) - std::abs(vec[1]);
  191|   128k|      } else {
  192|   115k|        vec[2] = -(center_value_ - std::abs(vec[0]) - std::abs(vec[1]));
  193|   115k|      }
  194|   244k|    }
  195|  2.32M|  }

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

_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    170|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    170|            attribute, transform, mesh_data),
   52|    170|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    164|                                                                *buffer) {
  194|    164|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    164|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    164|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 21, False: 143]
  ------------------
  196|       |    // Decode prediction mode.
  197|     21|    uint8_t mode;
  198|     21|    if (!buffer->Decode(&mode)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 21]
  ------------------
  199|      0|      return false;
  200|      0|    }
  201|       |
  202|     21|    if (mode != Mode::OPTIMAL_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (202:9): [True: 17, False: 4]
  ------------------
  203|       |      // Unsupported mode.
  204|     17|      return false;
  205|     17|    }
  206|     21|  }
  207|    147|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|    671|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 558, False: 113]
  ------------------
  211|    558|    uint32_t num_flags;
  212|    558|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 1, False: 557]
  ------------------
  213|      1|      return false;
  214|      1|    }
  215|    557|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 20, False: 537]
  ------------------
  216|     20|      return false;
  217|     20|    }
  218|    537|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 296, False: 241]
  ------------------
  219|    296|      is_crease_edge_[i].resize(num_flags);
  220|    296|      RAnsBitDecoder decoder;
  221|    296|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 13, False: 283]
  ------------------
  222|     13|        return false;
  223|     13|      }
  224|   906k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 906k, False: 283]
  ------------------
  225|   906k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|   906k|      }
  227|    283|      decoder.EndDecoding();
  228|    283|    }
  229|    537|  }
  230|    113|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    113|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    147|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    105|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    105|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    105|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    525|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 420, False: 105]
  ------------------
   93|    420|    pred_vals[i].resize(num_components, 0);
   94|    420|  }
   95|    105|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    105|                                         out_data);
   97|       |
   98|    105|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    105|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    105|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    105|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    105|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    105|  const int corner_map_size =
  109|    105|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|   437k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 437k, False: 73]
  ------------------
  111|   437k|    const CornerIndex start_corner_id =
  112|   437k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|   437k|    CornerIndex corner_id(start_corner_id);
  115|   437k|    int num_parallelograms = 0;
  116|   437k|    bool first_pass = true;
  117|  1.05M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 642k, False: 410k]
  ------------------
  118|   642k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 75.5k, False: 567k]
  ------------------
  119|   642k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   642k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  75.5k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  75.5k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 510, False: 75.0k]
  ------------------
  127|    510|          break;
  128|    510|        }
  129|  75.5k|      }
  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|   642k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 602k, False: 39.8k]
  ------------------
  134|   602k|        corner_id = table->SwingLeft(corner_id);
  135|   602k|      } else {
  136|  39.8k|        corner_id = table->SwingRight(corner_id);
  137|  39.8k|      }
  138|   642k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 26.4k, False: 615k]
  ------------------
  139|  26.4k|        break;
  140|  26.4k|      }
  141|   615k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 431k, False: 184k]
  |  Branch (141:47): [True: 410k, False: 21.2k]
  ------------------
  142|   410k|        first_pass = false;
  143|   410k|        corner_id = table->SwingRight(start_corner_id);
  144|   410k|      }
  145|   615k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|   437k|    int num_used_parallelograms = 0;
  150|   437k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 49.1k, False: 388k]
  ------------------
  151|  7.50M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 7.45M, False: 49.1k]
  ------------------
  152|  7.45M|        multi_pred_vals[i] = 0;
  153|  7.45M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   124k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 75.5k, False: 49.1k]
  ------------------
  156|  75.5k|        const int context = num_parallelograms - 1;
  157|  75.5k|        const int pos = is_crease_edge_pos[context]++;
  158|  75.5k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 32, False: 75.5k]
  ------------------
  159|     32|          return false;
  160|     32|        }
  161|  75.5k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  75.5k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 8.66k, False: 66.8k]
  ------------------
  163|  8.66k|          ++num_used_parallelograms;
  164|  1.25M|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 1.24M, False: 8.66k]
  ------------------
  165|  1.24M|            multi_pred_vals[j] =
  166|  1.24M|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|  1.24M|          }
  168|  8.66k|        }
  169|  75.5k|      }
  170|  49.1k|    }
  171|   437k|    const int dst_offset = p * num_components;
  172|   437k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 434k, False: 3.40k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|   434k|      const int src_offset = (p - 1) * num_components;
  176|   434k|      this->transform().ComputeOriginalValue(
  177|   434k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|   434k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   509k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 506k, False: 3.40k]
  ------------------
  181|   506k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   506k|      }
  183|  3.40k|      this->transform().ComputeOriginalValue(
  184|  3.40k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  3.40k|    }
  186|   437k|  }
  187|     73|  return true;
  188|    105|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   50|    151|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   51|    151|            attribute, transform, mesh_data),
   52|    151|        selected_mode_(Mode::OPTIMAL_MULTI_PARALLELOGRAM) {}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  193|    149|                                                                *buffer) {
  194|    149|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  195|    149|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    149|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (195:7): [True: 3, False: 146]
  ------------------
  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|    147|#endif
  208|       |
  209|       |  // Encode selected edges using separate rans bit coder for each context.
  210|    635|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (210:19): [True: 523, False: 112]
  ------------------
  211|    523|    uint32_t num_flags;
  212|    523|    if (!DecodeVarint<uint32_t>(&num_flags, buffer)) {
  ------------------
  |  Branch (212:9): [True: 6, False: 517]
  ------------------
  213|      6|      return false;
  214|      6|    }
  215|    517|    if (num_flags > this->mesh_data().corner_table()->num_corners()) {
  ------------------
  |  Branch (215:9): [True: 25, False: 492]
  ------------------
  216|     25|      return false;
  217|     25|    }
  218|    492|    if (num_flags > 0) {
  ------------------
  |  Branch (218:9): [True: 206, False: 286]
  ------------------
  219|    206|      is_crease_edge_[i].resize(num_flags);
  220|    206|      RAnsBitDecoder decoder;
  221|    206|      if (!decoder.StartDecoding(buffer)) {
  ------------------
  |  Branch (221:11): [True: 4, False: 202]
  ------------------
  222|      4|        return false;
  223|      4|      }
  224|   423k|      for (uint32_t j = 0; j < num_flags; ++j) {
  ------------------
  |  Branch (224:28): [True: 423k, False: 202]
  ------------------
  225|   423k|        is_crease_edge_[i][j] = decoder.DecodeNextBit();
  226|   423k|      }
  227|    202|      decoder.EndDecoding();
  228|    202|    }
  229|    492|  }
  230|    112|  return MeshPredictionSchemeDecoder<DataTypeT, TransformT,
  231|    112|                                     MeshDataT>::DecodePredictionData(buffer);
  232|    147|}
_ZN5draco56MeshPredictionSchemeConstrainedMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   86|    100|                          const PointIndex * /* entry_to_point_id_map */) {
   87|    100|  this->transform().Init(num_components);
   88|       |
   89|       |  // Predicted values for all simple parallelograms encountered at any given
   90|       |  // vertex.
   91|    100|  std::vector<DataTypeT> pred_vals[kMaxNumParallelograms];
   92|    500|  for (int i = 0; i < kMaxNumParallelograms; ++i) {
  ------------------
  |  Branch (92:19): [True: 400, False: 100]
  ------------------
   93|    400|    pred_vals[i].resize(num_components, 0);
   94|    400|  }
   95|    100|  this->transform().ComputeOriginalValue(pred_vals[0].data(), in_corr,
   96|    100|                                         out_data);
   97|       |
   98|    100|  const CornerTable *const table = this->mesh_data().corner_table();
   99|    100|  const std::vector<int32_t> *const vertex_to_data_map =
  100|    100|      this->mesh_data().vertex_to_data_map();
  101|       |
  102|       |  // Current position in the |is_crease_edge_| array for each context.
  103|    100|  std::vector<int> is_crease_edge_pos(kMaxNumParallelograms, 0);
  104|       |
  105|       |  // Used to store predicted value for multi-parallelogram prediction.
  106|    100|  std::vector<DataTypeT> multi_pred_vals(num_components);
  107|       |
  108|    100|  const int corner_map_size =
  109|    100|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  110|  58.6k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (110:19): [True: 58.5k, False: 66]
  ------------------
  111|  58.5k|    const CornerIndex start_corner_id =
  112|  58.5k|        this->mesh_data().data_to_corner_map()->at(p);
  113|       |
  114|  58.5k|    CornerIndex corner_id(start_corner_id);
  115|  58.5k|    int num_parallelograms = 0;
  116|  58.5k|    bool first_pass = true;
  117|   378k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (117:12): [True: 355k, False: 23.7k]
  ------------------
  118|   355k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (118:11): [True: 92.6k, False: 262k]
  ------------------
  119|   355k|              p, corner_id, table, *vertex_to_data_map, out_data,
  120|   355k|              num_components, &(pred_vals[num_parallelograms][0]))) {
  121|       |        // Parallelogram prediction applied and stored in
  122|       |        // |pred_vals[num_parallelograms]|
  123|  92.6k|        ++num_parallelograms;
  124|       |        // Stop processing when we reach the maximum number of allowed
  125|       |        // parallelograms.
  126|  92.6k|        if (num_parallelograms == kMaxNumParallelograms) {
  ------------------
  |  Branch (126:13): [True: 513, False: 92.1k]
  ------------------
  127|    513|          break;
  128|    513|        }
  129|  92.6k|      }
  130|       |
  131|       |      // Proceed to the next corner attached to the vertex. First swing left
  132|       |      // and if we reach a boundary, swing right from the start corner.
  133|   354k|      if (first_pass) {
  ------------------
  |  Branch (133:11): [True: 292k, False: 62.1k]
  ------------------
  134|   292k|        corner_id = table->SwingLeft(corner_id);
  135|   292k|      } else {
  136|  62.1k|        corner_id = table->SwingRight(corner_id);
  137|  62.1k|      }
  138|   354k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (138:11): [True: 34.3k, False: 320k]
  ------------------
  139|  34.3k|        break;
  140|  34.3k|      }
  141|   320k|      if (corner_id == kInvalidCornerIndex && first_pass) {
  ------------------
  |  Branch (141:11): [True: 46.9k, False: 273k]
  |  Branch (141:47): [True: 23.7k, False: 23.2k]
  ------------------
  142|  23.7k|        first_pass = false;
  143|  23.7k|        corner_id = table->SwingRight(start_corner_id);
  144|  23.7k|      }
  145|   320k|    }
  146|       |
  147|       |    // Check which of the available parallelograms are actually used and compute
  148|       |    // the final predicted value.
  149|  58.5k|    int num_used_parallelograms = 0;
  150|  58.5k|    if (num_parallelograms > 0) {
  ------------------
  |  Branch (150:9): [True: 58.1k, False: 441]
  ------------------
  151|  6.62M|      for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (151:23): [True: 6.56M, False: 58.1k]
  ------------------
  152|  6.56M|        multi_pred_vals[i] = 0;
  153|  6.56M|      }
  154|       |      // Check which parallelograms are actually used.
  155|   150k|      for (int i = 0; i < num_parallelograms; ++i) {
  ------------------
  |  Branch (155:23): [True: 92.5k, False: 58.1k]
  ------------------
  156|  92.5k|        const int context = num_parallelograms - 1;
  157|  92.5k|        const int pos = is_crease_edge_pos[context]++;
  158|  92.5k|        if (is_crease_edge_[context].size() <= pos) {
  ------------------
  |  Branch (158:13): [True: 34, False: 92.5k]
  ------------------
  159|     34|          return false;
  160|     34|        }
  161|  92.5k|        const bool is_crease = is_crease_edge_[context][pos];
  162|  92.5k|        if (!is_crease) {
  ------------------
  |  Branch (162:13): [True: 5.59k, False: 86.9k]
  ------------------
  163|  5.59k|          ++num_used_parallelograms;
  164|   693k|          for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (164:27): [True: 687k, False: 5.59k]
  ------------------
  165|   687k|            multi_pred_vals[j] =
  166|   687k|                AddAsUnsigned(multi_pred_vals[j], pred_vals[i][j]);
  167|   687k|          }
  168|  5.59k|        }
  169|  92.5k|      }
  170|  58.1k|    }
  171|  58.5k|    const int dst_offset = p * num_components;
  172|  58.5k|    if (num_used_parallelograms == 0) {
  ------------------
  |  Branch (172:9): [True: 56.5k, False: 2.03k]
  ------------------
  173|       |      // No parallelogram was valid.
  174|       |      // We use the last decoded point as a reference.
  175|  56.5k|      const int src_offset = (p - 1) * num_components;
  176|  56.5k|      this->transform().ComputeOriginalValue(
  177|  56.5k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  178|  56.5k|    } else {
  179|       |      // Compute the correction from the predicted value.
  180|   235k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (180:23): [True: 233k, False: 2.03k]
  ------------------
  181|   233k|        multi_pred_vals[c] /= num_used_parallelograms;
  182|   233k|      }
  183|  2.03k|      this->transform().ComputeOriginalValue(
  184|  2.03k|          multi_pred_vals.data(), in_corr + dst_offset, out_data + dst_offset);
  185|  2.03k|    }
  186|  58.5k|  }
  187|     66|  return true;
  188|    100|}

_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  1.70k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  1.70k|    mesh_ = mesh;
   39|  1.70k|    corner_table_ = table;
   40|  1.70k|    data_to_corner_map_ = data_to_corner_map;
   41|  1.70k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  1.70k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE12corner_tableEv:
   45|  12.3M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18vertex_to_data_mapEv:
   46|  8.68M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  8.68M|    return vertex_to_data_map_;
   48|  8.68M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEE18data_to_corner_mapEv:
   49|  4.40M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  4.40M|    return data_to_corner_map_;
   51|  4.40M|  }
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEE3SetEPKNS_4MeshEPKS1_PKNSt3__16vectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS8_9allocatorISC_EEEEPKNS9_IiNSD_IiEEEE:
   37|  1.51k|           const std::vector<int32_t> *vertex_to_data_map) {
   38|  1.51k|    mesh_ = mesh;
   39|  1.51k|    corner_table_ = table;
   40|  1.51k|    data_to_corner_map_ = data_to_corner_map;
   41|  1.51k|    vertex_to_data_map_ = vertex_to_data_map;
   42|  1.51k|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE12corner_tableEv:
   45|  7.10M|  const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18vertex_to_data_mapEv:
   46|  6.13M|  const std::vector<int32_t> *vertex_to_data_map() const {
   47|  6.13M|    return vertex_to_data_map_;
   48|  6.13M|  }
_ZNK5draco24MeshPredictionSchemeDataINS_11CornerTableEE18data_to_corner_mapEv:
   49|  1.15M|  const std::vector<CornerIndex> *data_to_corner_map() const {
   50|  1.15M|    return data_to_corner_map_;
   51|  1.15M|  }
_ZN5draco24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEC2Ev:
   30|  1.70k|      : mesh_(nullptr),
   31|  1.70k|        corner_table_(nullptr),
   32|  1.70k|        vertex_to_data_map_(nullptr),
   33|  1.70k|        data_to_corner_map_(nullptr) {}
_ZN5draco24MeshPredictionSchemeDataINS_11CornerTableEEC2Ev:
   30|  1.51k|      : mesh_(nullptr),
   31|  1.51k|        corner_table_(nullptr),
   32|  1.51k|        vertex_to_data_map_(nullptr),
   33|  1.51k|        data_to_corner_map_(nullptr) {}

_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   924k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   132k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|   606k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|   146k|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.40k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.40k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE9mesh_dataEv:
   38|  5.49M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|  1.32k|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|  1.32k|        mesh_data_(mesh_data) {}
_ZNK5draco27MeshPredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE9mesh_dataEv:
   38|  1.48M|  const MeshData &mesh_data() const { return mesh_data_; }
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    147|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    147|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|     97|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|     97|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|    135|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|    135|        mesh_data_(mesh_data) {}
_ZN5draco27MeshPredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   34|     88|      : PredictionSchemeDecoder<DataTypeT, TransformT>(attribute, transform),
   35|     88|        mesh_data_(mesh_data) {}

_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    293|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    147|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    147|    DRACO_DCHECK_EQ(i, 0);
   70|    147|    (void)i;
   71|    147|    return GeometryAttribute::POSITION;
   72|    147|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    147|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    147|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 147]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    147|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 146]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    146|    predictor_.SetPositionAttribute(*att);
   82|    146|    return true;
   83|    147|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    146|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    146|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 3, False: 143]
  ------------------
  145|      3|    return false;
  146|      3|  }
  147|       |
  148|    143|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    143|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    143|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 64, False: 79]
  ------------------
  150|     64|    uint8_t prediction_mode;
  151|     64|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 63]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     63|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 2, False: 61]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      2|      return false;
  157|      2|    }
  158|       |
  159|     61|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 61]
  ------------------
  160|     61|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     61|  }
  164|    140|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    140|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 14, False: 126]
  ------------------
  168|     14|    return false;
  169|     14|  }
  170|       |
  171|    126|  return true;
  172|    140|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    126|                                      const PointIndex *entry_to_point_id_map) {
  103|    126|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    126|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    126|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    126|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    126|  const int corner_map_size =
  111|    126|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    126|  VectorD<int32_t, 3> pred_normal_3d;
  114|    126|  int32_t pred_normal_oct[2];
  115|       |
  116|   924k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 924k, False: 126]
  ------------------
  117|   924k|    const CornerIndex corner_id =
  118|   924k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   924k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   924k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   924k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   924k|                    octahedron_tool_box_.center_value());
  125|   924k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 483k, False: 441k]
  ------------------
  126|   483k|      pred_normal_3d = -pred_normal_3d;
  127|   483k|    }
  128|   924k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   924k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   924k|    const int data_offset = data_id * 2;
  132|   924k|    this->transform().ComputeOriginalValue(
  133|   924k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   924k|  }
  135|    126|  flip_normal_bit_decoder_.EndDecoding();
  136|    126|  return true;
  137|    126|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    126|  void SetQuantizationBits(int q) {
   85|    126|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    126|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    194|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|     97|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|     97|    DRACO_DCHECK_EQ(i, 0);
   70|     97|    (void)i;
   71|     97|    return GeometryAttribute::POSITION;
   72|     97|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|     97|  bool SetParentAttribute(const PointAttribute *att) override {
   75|     97|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 97]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|     97|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 97]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|     97|    predictor_.SetPositionAttribute(*att);
   82|     97|    return true;
   83|     97|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|     97|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|     97|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 3, False: 94]
  ------------------
  145|      3|    return false;
  146|      3|  }
  147|       |
  148|     94|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|     94|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     94|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 22, False: 72]
  ------------------
  150|     22|    uint8_t prediction_mode;
  151|     22|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 21]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     21|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 20]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     20|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 20]
  ------------------
  160|     20|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     20|  }
  164|     92|#endif
  165|       |
  166|       |  // Init normal flips.
  167|     92|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 1, False: 91]
  ------------------
  168|      1|    return false;
  169|      1|  }
  170|       |
  171|     91|  return true;
  172|     92|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|     91|                                      const PointIndex *entry_to_point_id_map) {
  103|     91|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|     91|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|     91|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|     91|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|     91|  const int corner_map_size =
  111|     91|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|     91|  VectorD<int32_t, 3> pred_normal_3d;
  114|     91|  int32_t pred_normal_oct[2];
  115|       |
  116|   132k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 132k, False: 91]
  ------------------
  117|   132k|    const CornerIndex corner_id =
  118|   132k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   132k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   132k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   132k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   132k|                    octahedron_tool_box_.center_value());
  125|   132k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 132k, False: 267]
  ------------------
  126|   132k|      pred_normal_3d = -pred_normal_3d;
  127|   132k|    }
  128|   132k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   132k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   132k|    const int data_offset = data_id * 2;
  132|   132k|    this->transform().ComputeOriginalValue(
  133|   132k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   132k|  }
  135|     91|  flip_normal_bit_decoder_.EndDecoding();
  136|     91|  return true;
  137|     91|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|     91|  void SetQuantizationBits(int q) {
   85|     91|    octahedron_tool_box_.SetQuantizationBits(q);
   86|     91|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    269|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    135|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    135|    DRACO_DCHECK_EQ(i, 0);
   70|    135|    (void)i;
   71|    135|    return GeometryAttribute::POSITION;
   72|    135|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    135|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    135|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 135]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    135|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 1, False: 134]
  ------------------
   79|      1|      return false;  // Currently works only for 3 component positions.
   80|      1|    }
   81|    134|    predictor_.SetPositionAttribute(*att);
   82|    134|    return true;
   83|    135|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    134|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    134|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 2, False: 132]
  ------------------
  145|      2|    return false;
  146|      2|  }
  147|       |
  148|    132|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    132|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    132|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 55, False: 77]
  ------------------
  150|     55|    uint8_t prediction_mode;
  151|     55|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 54]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     54|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 4, False: 50]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      4|      return false;
  157|      4|    }
  158|       |
  159|     50|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 50]
  ------------------
  160|     50|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     50|  }
  164|    127|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    127|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 2, False: 125]
  ------------------
  168|      2|    return false;
  169|      2|  }
  170|       |
  171|    125|  return true;
  172|    127|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    125|                                      const PointIndex *entry_to_point_id_map) {
  103|    125|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    125|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    125|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    125|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    125|  const int corner_map_size =
  111|    125|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    125|  VectorD<int32_t, 3> pred_normal_3d;
  114|    125|  int32_t pred_normal_oct[2];
  115|       |
  116|   606k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 606k, False: 125]
  ------------------
  117|   606k|    const CornerIndex corner_id =
  118|   606k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   606k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   606k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   606k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   606k|                    octahedron_tool_box_.center_value());
  125|   606k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 366k, False: 240k]
  ------------------
  126|   366k|      pred_normal_3d = -pred_normal_3d;
  127|   366k|    }
  128|   606k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   606k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   606k|    const int data_offset = data_id * 2;
  132|   606k|    this->transform().ComputeOriginalValue(
  133|   606k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   606k|  }
  135|    125|  flip_normal_bit_decoder_.EndDecoding();
  136|    125|  return true;
  137|    125|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    125|  void SetQuantizationBits(int q) {
   85|    125|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    125|  }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    176|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|     88|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|     88|    DRACO_DCHECK_EQ(i, 0);
   70|     88|    (void)i;
   71|     88|    return GeometryAttribute::POSITION;
   72|     88|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|     88|  bool SetParentAttribute(const PointAttribute *att) override {
   75|     88|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 88]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|     88|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 88]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|     88|    predictor_.SetPositionAttribute(*att);
   82|     88|    return true;
   83|     88|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|     88|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|     88|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 0, False: 88]
  ------------------
  145|      0|    return false;
  146|      0|  }
  147|       |
  148|     88|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|     88|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|     88|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 23, False: 65]
  ------------------
  150|     23|    uint8_t prediction_mode;
  151|     23|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 22]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|     22|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 21]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|     21|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 21]
  ------------------
  160|     21|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|     21|  }
  164|     86|#endif
  165|       |
  166|       |  // Init normal flips.
  167|     86|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 2, False: 84]
  ------------------
  168|      2|    return false;
  169|      2|  }
  170|       |
  171|     84|  return true;
  172|     86|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|     84|                                      const PointIndex *entry_to_point_id_map) {
  103|     84|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|     84|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|     84|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|     84|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|     84|  const int corner_map_size =
  111|     84|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|     84|  VectorD<int32_t, 3> pred_normal_3d;
  114|     84|  int32_t pred_normal_oct[2];
  115|       |
  116|   146k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 146k, False: 84]
  ------------------
  117|   146k|    const CornerIndex corner_id =
  118|   146k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   146k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   146k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   146k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   146k|                    octahedron_tool_box_.center_value());
  125|   146k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 131k, False: 14.2k]
  ------------------
  126|   131k|      pred_normal_3d = -pred_normal_3d;
  127|   131k|    }
  128|   146k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   146k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   146k|    const int data_offset = data_id * 2;
  132|   146k|    this->transform().ComputeOriginalValue(
  133|   146k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   146k|  }
  135|     84|  flip_normal_bit_decoder_.EndDecoding();
  136|     84|  return true;
  137|     84|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|     84|  void SetQuantizationBits(int q) {
   85|     84|    octahedron_tool_box_.SetQuantizationBits(q);
   86|     84|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    346|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    346|            attribute, transform, mesh_data),
   37|    346|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetNumParentAttributesEv:
   66|    692|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE22GetParentAttributeTypeEi:
   68|    346|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    346|    DRACO_DCHECK_EQ(i, 0);
   70|    346|    (void)i;
   71|    346|    return GeometryAttribute::POSITION;
   72|    346|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    346|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    346|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 346]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    346|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 346]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|    346|    predictor_.SetPositionAttribute(*att);
   82|    346|    return true;
   83|    346|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    345|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    345|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 21, False: 324]
  ------------------
  145|     21|    return false;
  146|     21|  }
  147|       |
  148|    324|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    324|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    324|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 165, False: 159]
  ------------------
  150|    165|    uint8_t prediction_mode;
  151|    165|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 164]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|    164|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 3, False: 161]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      3|      return false;
  157|      3|    }
  158|       |
  159|    161|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 161]
  ------------------
  160|    161|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|    161|  }
  164|    320|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    320|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 24, False: 296]
  ------------------
  168|     24|    return false;
  169|     24|  }
  170|       |
  171|    296|  return true;
  172|    320|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    296|                                      const PointIndex *entry_to_point_id_map) {
  103|    296|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    296|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    296|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    296|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    296|  const int corner_map_size =
  111|    296|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    296|  VectorD<int32_t, 3> pred_normal_3d;
  114|    296|  int32_t pred_normal_oct[2];
  115|       |
  116|   357k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 356k, False: 296]
  ------------------
  117|   356k|    const CornerIndex corner_id =
  118|   356k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   356k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   356k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   356k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   356k|                    octahedron_tool_box_.center_value());
  125|   356k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 257k, False: 99.4k]
  ------------------
  126|   257k|      pred_normal_3d = -pred_normal_3d;
  127|   257k|    }
  128|   356k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   356k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   356k|    const int data_offset = data_id * 2;
  132|   356k|    this->transform().ComputeOriginalValue(
  133|   356k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   356k|  }
  135|    296|  flip_normal_bit_decoder_.EndDecoding();
  136|    296|  return true;
  137|    296|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE19SetQuantizationBitsEi:
   84|    296|  void SetQuantizationBits(int q) {
   85|    296|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    296|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    362|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    362|            attribute, transform, mesh_data),
   37|    362|        predictor_(mesh_data) {}
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetNumParentAttributesEv:
   66|    723|  int GetNumParentAttributes() const override { return 1; }
_ZNK5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE22GetParentAttributeTypeEi:
   68|    362|  GeometryAttribute::Type GetParentAttributeType(int i) const override {
   69|    362|    DRACO_DCHECK_EQ(i, 0);
   70|    362|    (void)i;
   71|    362|    return GeometryAttribute::POSITION;
   72|    362|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18SetParentAttributeEPKNS_14PointAttributeE:
   74|    361|  bool SetParentAttribute(const PointAttribute *att) override {
   75|    361|    if (att->attribute_type() != GeometryAttribute::POSITION) {
  ------------------
  |  Branch (75:9): [True: 0, False: 361]
  ------------------
   76|      0|      return false;  // Invalid attribute type.
   77|      0|    }
   78|    361|    if (att->num_components() != 3) {
  ------------------
  |  Branch (78:9): [True: 0, False: 361]
  ------------------
   79|      0|      return false;  // Currently works only for 3 component positions.
   80|      0|    }
   81|    361|    predictor_.SetPositionAttribute(*att);
   82|    361|    return true;
   83|    361|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20DecodePredictionDataEPNS_13DecoderBufferE:
  142|    361|                                                                *buffer) {
  143|       |  // Get data needed for transform
  144|    361|  if (!this->transform().DecodeTransformData(buffer)) {
  ------------------
  |  Branch (144:7): [True: 38, False: 323]
  ------------------
  145|     38|    return false;
  146|     38|  }
  147|       |
  148|    323|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  149|    323|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|    323|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (149:7): [True: 131, False: 192]
  ------------------
  150|    131|    uint8_t prediction_mode;
  151|    131|    if (!buffer->Decode(&prediction_mode)) {
  ------------------
  |  Branch (151:9): [True: 1, False: 130]
  ------------------
  152|      1|      return false;
  153|      1|    }
  154|    130|    if (prediction_mode > TRIANGLE_AREA) {
  ------------------
  |  Branch (154:9): [True: 1, False: 129]
  ------------------
  155|       |      // Invalid prediction mode.
  156|      1|      return false;
  157|      1|    }
  158|       |
  159|    129|    if (!predictor_.SetNormalPredictionMode(
  ------------------
  |  Branch (159:9): [True: 0, False: 129]
  ------------------
  160|    129|            NormalPredictionMode(prediction_mode))) {
  161|      0|      return false;
  162|      0|    }
  163|    129|  }
  164|    321|#endif
  165|       |
  166|       |  // Init normal flips.
  167|    321|  if (!flip_normal_bit_decoder_.StartDecoding(buffer)) {
  ------------------
  |  Branch (167:7): [True: 22, False: 299]
  ------------------
  168|     22|    return false;
  169|     22|  }
  170|       |
  171|    299|  return true;
  172|    321|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
  102|    299|                                      const PointIndex *entry_to_point_id_map) {
  103|    299|  this->SetQuantizationBits(this->transform().quantization_bits());
  104|    299|  predictor_.SetEntryToPointIdMap(entry_to_point_id_map);
  105|    299|  DRACO_DCHECK(this->IsInitialized());
  106|       |
  107|       |  // Expecting in_data in octahedral coordinates, i.e., portable attribute.
  108|    299|  DRACO_DCHECK_EQ(num_components, 2);
  109|       |
  110|    299|  const int corner_map_size =
  111|    299|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
  112|       |
  113|    299|  VectorD<int32_t, 3> pred_normal_3d;
  114|    299|  int32_t pred_normal_oct[2];
  115|       |
  116|   156k|  for (int data_id = 0; data_id < corner_map_size; ++data_id) {
  ------------------
  |  Branch (116:25): [True: 156k, False: 299]
  ------------------
  117|   156k|    const CornerIndex corner_id =
  118|   156k|        this->mesh_data().data_to_corner_map()->at(data_id);
  119|   156k|    predictor_.ComputePredictedValue(corner_id, pred_normal_3d.data());
  120|       |
  121|       |    // Compute predicted octahedral coordinates.
  122|   156k|    octahedron_tool_box_.CanonicalizeIntegerVector(pred_normal_3d.data());
  123|   156k|    DRACO_DCHECK_EQ(pred_normal_3d.AbsSum(),
  124|   156k|                    octahedron_tool_box_.center_value());
  125|   156k|    if (flip_normal_bit_decoder_.DecodeNextBit()) {
  ------------------
  |  Branch (125:9): [True: 104k, False: 52.0k]
  ------------------
  126|   104k|      pred_normal_3d = -pred_normal_3d;
  127|   104k|    }
  128|   156k|    octahedron_tool_box_.IntegerVectorToQuantizedOctahedralCoords(
  129|   156k|        pred_normal_3d.data(), pred_normal_oct, pred_normal_oct + 1);
  130|       |
  131|   156k|    const int data_offset = data_id * 2;
  132|   156k|    this->transform().ComputeOriginalValue(
  133|   156k|        pred_normal_oct, in_corr + data_offset, out_data + data_offset);
  134|   156k|  }
  135|    299|  flip_normal_bit_decoder_.EndDecoding();
  136|    299|  return true;
  137|    299|}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE19SetQuantizationBitsEi:
   84|    299|  void SetQuantizationBits(int q) {
   85|    299|    octahedron_tool_box_.SetQuantizationBits(q);
   86|    299|  }
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    147|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    147|            attribute, transform, mesh_data),
   37|    147|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|     97|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|     97|            attribute, transform, mesh_data),
   37|     97|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|    135|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|    135|            attribute, transform, mesh_data),
   37|    135|        predictor_(mesh_data) {}
_ZN5draco42MeshPredictionSchemeGeometricNormalDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   35|     88|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   36|     88|            attribute, transform, mesh_data),
   37|     88|        predictor_(mesh_data) {}

_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    208|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    208|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 44, False: 164]
  ------------------
  105|     44|      this->normal_prediction_mode_ = mode;
  106|     44|      return true;
  107|    164|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 164, False: 0]
  ------------------
  108|    164|      this->normal_prediction_mode_ = mode;
  109|    164|      return true;
  110|    164|    }
  111|      0|    return false;
  112|    208|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   924k|                             DataTypeT *prediction) override {
   42|   924k|    DRACO_DCHECK(this->IsInitialized());
   43|   924k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   924k|    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|   924k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   924k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   924k|    VectorD<int64_t, 3> normal;
   53|   924k|    CornerIndex c_next, c_prev;
   54|  1.88M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 961k, False: 924k]
  ------------------
   55|       |      // Getting corners.
   56|   961k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 240, False: 960k]
  ------------------
   57|    240|        c_next = corner_table->Next(corner_id);
   58|    240|        c_prev = corner_table->Previous(corner_id);
   59|   960k|      } else {
   60|   960k|        c_next = corner_table->Next(cit.Corner());
   61|   960k|        c_prev = corner_table->Previous(cit.Corner());
   62|   960k|      }
   63|   961k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   961k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   961k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   961k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   961k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   961k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   961k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   961k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   961k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   961k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   961k|      cit.Next();
   81|   961k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   924k|    constexpr int64_t upper_bound = 1 << 29;
   85|   924k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 160, False: 924k]
  ------------------
   86|    160|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    160|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 46, False: 114]
  ------------------
   88|     46|        const int64_t quotient = abs_sum / upper_bound;
   89|     46|        normal = normal / quotient;
   90|     46|      }
   91|   924k|    } else {
   92|   924k|      const int64_t abs_sum = normal.AbsSum();
   93|   924k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.51k, False: 922k]
  ------------------
   94|  2.51k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.51k|        normal = normal / quotient;
   96|  2.51k|      }
   97|   924k|    }
   98|   924k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   924k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   924k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   924k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   924k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    117|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    117|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 18, False: 99]
  ------------------
  105|     18|      this->normal_prediction_mode_ = mode;
  106|     18|      return true;
  107|     99|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 99, False: 0]
  ------------------
  108|     99|      this->normal_prediction_mode_ = mode;
  109|     99|      return true;
  110|     99|    }
  111|      0|    return false;
  112|    117|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   132k|                             DataTypeT *prediction) override {
   42|   132k|    DRACO_DCHECK(this->IsInitialized());
   43|   132k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   132k|    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|   132k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   132k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   132k|    VectorD<int64_t, 3> normal;
   53|   132k|    CornerIndex c_next, c_prev;
   54|   928k|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 795k, False: 132k]
  ------------------
   55|       |      // Getting corners.
   56|   795k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 108, False: 795k]
  ------------------
   57|    108|        c_next = corner_table->Next(corner_id);
   58|    108|        c_prev = corner_table->Previous(corner_id);
   59|   795k|      } else {
   60|   795k|        c_next = corner_table->Next(cit.Corner());
   61|   795k|        c_prev = corner_table->Previous(cit.Corner());
   62|   795k|      }
   63|   795k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   795k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   795k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   795k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   795k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   795k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   795k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   795k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   795k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   795k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   795k|      cit.Next();
   81|   795k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   132k|    constexpr int64_t upper_bound = 1 << 29;
   85|   132k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 72, False: 132k]
  ------------------
   86|     72|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     72|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 18, False: 54]
  ------------------
   88|     18|        const int64_t quotient = abs_sum / upper_bound;
   89|     18|        normal = normal / quotient;
   90|     18|      }
   91|   132k|    } else {
   92|   132k|      const int64_t abs_sum = normal.AbsSum();
   93|   132k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 98.9k, False: 33.7k]
  ------------------
   94|  98.9k|        const int64_t quotient = abs_sum / upper_bound;
   95|  98.9k|        normal = normal / quotient;
   96|  98.9k|      }
   97|   132k|    }
   98|   132k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   132k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   132k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   132k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   132k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    185|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    185|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 49, False: 136]
  ------------------
  105|     49|      this->normal_prediction_mode_ = mode;
  106|     49|      return true;
  107|    136|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 136, False: 0]
  ------------------
  108|    136|      this->normal_prediction_mode_ = mode;
  109|    136|      return true;
  110|    136|    }
  111|      0|    return false;
  112|    185|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   606k|                             DataTypeT *prediction) override {
   42|   606k|    DRACO_DCHECK(this->IsInitialized());
   43|   606k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   606k|    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|   606k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   606k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   606k|    VectorD<int64_t, 3> normal;
   53|   606k|    CornerIndex c_next, c_prev;
   54|  1.23M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 633k, False: 606k]
  ------------------
   55|       |      // Getting corners.
   56|   633k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 294, False: 633k]
  ------------------
   57|    294|        c_next = corner_table->Next(corner_id);
   58|    294|        c_prev = corner_table->Previous(corner_id);
   59|   633k|      } else {
   60|   633k|        c_next = corner_table->Next(cit.Corner());
   61|   633k|        c_prev = corner_table->Previous(cit.Corner());
   62|   633k|      }
   63|   633k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   633k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   633k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   633k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   633k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   633k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   633k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   633k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   633k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   633k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   633k|      cit.Next();
   81|   633k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   606k|    constexpr int64_t upper_bound = 1 << 29;
   85|   606k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 196, False: 606k]
  ------------------
   86|    196|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|    196|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 34, False: 162]
  ------------------
   88|     34|        const int64_t quotient = abs_sum / upper_bound;
   89|     34|        normal = normal / quotient;
   90|     34|      }
   91|   606k|    } else {
   92|   606k|      const int64_t abs_sum = normal.AbsSum();
   93|   606k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.55k, False: 603k]
  ------------------
   94|  2.55k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.55k|        normal = normal / quotient;
   96|  2.55k|      }
   97|   606k|    }
   98|   606k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   606k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   606k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   606k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   606k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    109|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    109|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 19, False: 90]
  ------------------
  105|     19|      this->normal_prediction_mode_ = mode;
  106|     19|      return true;
  107|     90|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 90, False: 0]
  ------------------
  108|     90|      this->normal_prediction_mode_ = mode;
  109|     90|      return true;
  110|     90|    }
  111|      0|    return false;
  112|    109|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   146k|                             DataTypeT *prediction) override {
   42|   146k|    DRACO_DCHECK(this->IsInitialized());
   43|   146k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   146k|    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|   146k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   146k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   146k|    VectorD<int64_t, 3> normal;
   53|   146k|    CornerIndex c_next, c_prev;
   54|  1.01M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 872k, False: 146k]
  ------------------
   55|       |      // Getting corners.
   56|   872k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 108, False: 872k]
  ------------------
   57|    108|        c_next = corner_table->Next(corner_id);
   58|    108|        c_prev = corner_table->Previous(corner_id);
   59|   872k|      } else {
   60|   872k|        c_next = corner_table->Next(cit.Corner());
   61|   872k|        c_prev = corner_table->Previous(cit.Corner());
   62|   872k|      }
   63|   872k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   872k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   872k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   872k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   872k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   872k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   872k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   872k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   872k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   872k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   872k|      cit.Next();
   81|   872k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   146k|    constexpr int64_t upper_bound = 1 << 29;
   85|   146k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 72, False: 145k]
  ------------------
   86|     72|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|     72|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 17, False: 55]
  ------------------
   88|     17|        const int64_t quotient = abs_sum / upper_bound;
   89|     17|        normal = normal / quotient;
   90|     17|      }
   91|   145k|    } else {
   92|   145k|      const int64_t abs_sum = normal.AbsSum();
   93|   145k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 120k, False: 25.5k]
  ------------------
   94|   120k|        const int64_t quotient = abs_sum / upper_bound;
   95|   120k|        normal = normal / quotient;
   96|   120k|      }
   97|   145k|    }
   98|   146k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   146k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   146k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   146k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   146k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    346|      : Base(md) {
   35|    346|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    346|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    507|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    507|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 130, False: 377]
  ------------------
  105|    130|      this->normal_prediction_mode_ = mode;
  106|    130|      return true;
  107|    377|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 377, False: 0]
  ------------------
  108|    377|      this->normal_prediction_mode_ = mode;
  109|    377|      return true;
  110|    377|    }
  111|      0|    return false;
  112|    507|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   356k|                             DataTypeT *prediction) override {
   42|   356k|    DRACO_DCHECK(this->IsInitialized());
   43|   356k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   356k|    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|   356k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   356k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   356k|    VectorD<int64_t, 3> normal;
   53|   356k|    CornerIndex c_next, c_prev;
   54|  1.26M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 905k, False: 356k]
  ------------------
   55|       |      // Getting corners.
   56|   905k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 354k, False: 550k]
  ------------------
   57|   354k|        c_next = corner_table->Next(corner_id);
   58|   354k|        c_prev = corner_table->Previous(corner_id);
   59|   550k|      } else {
   60|   550k|        c_next = corner_table->Next(cit.Corner());
   61|   550k|        c_prev = corner_table->Previous(cit.Corner());
   62|   550k|      }
   63|   905k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   905k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   905k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   905k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   905k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   905k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   905k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   905k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   905k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   905k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   905k|      cit.Next();
   81|   905k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   356k|    constexpr int64_t upper_bound = 1 << 29;
   85|   356k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 59.9k, False: 297k]
  ------------------
   86|  59.9k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  59.9k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 339, False: 59.6k]
  ------------------
   88|    339|        const int64_t quotient = abs_sum / upper_bound;
   89|    339|        normal = normal / quotient;
   90|    339|      }
   91|   297k|    } else {
   92|   297k|      const int64_t abs_sum = normal.AbsSum();
   93|   297k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 1.26k, False: 295k]
  ------------------
   94|  1.26k|        const int64_t quotient = abs_sum / upper_bound;
   95|  1.26k|        normal = normal / quotient;
   96|  1.26k|      }
   97|   297k|    }
   98|   356k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   356k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   356k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   356k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   356k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|    362|      : Base(md) {
   35|    362|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    362|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE23SetNormalPredictionModeENS_20NormalPredictionModeE:
  103|    491|  bool SetNormalPredictionMode(NormalPredictionMode mode) override {
  104|    491|    if (mode == ONE_TRIANGLE) {
  ------------------
  |  Branch (104:9): [True: 115, False: 376]
  ------------------
  105|    115|      this->normal_prediction_mode_ = mode;
  106|    115|      return true;
  107|    376|    } else if (mode == TRIANGLE_AREA) {
  ------------------
  |  Branch (107:16): [True: 376, False: 0]
  ------------------
  108|    376|      this->normal_prediction_mode_ = mode;
  109|    376|      return true;
  110|    376|    }
  111|      0|    return false;
  112|    491|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPi:
   41|   156k|                             DataTypeT *prediction) override {
   42|   156k|    DRACO_DCHECK(this->IsInitialized());
   43|   156k|    typedef typename MeshDataT::CornerTable CornerTable;
   44|   156k|    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|   156k|    VertexCornersIterator<CornerTable> cit(corner_table, corner_id);
   48|       |    // Position of central vertex does not change in loop.
   49|   156k|    const VectorD<int64_t, 3> pos_cent = this->GetPositionForCorner(corner_id);
   50|       |    // Computing normals for triangles and adding them up.
   51|       |
   52|   156k|    VectorD<int64_t, 3> normal;
   53|   156k|    CornerIndex c_next, c_prev;
   54|  1.06M|    while (!cit.End()) {
  ------------------
  |  Branch (54:12): [True: 910k, False: 156k]
  ------------------
   55|       |      // Getting corners.
   56|   910k|      if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (56:11): [True: 319k, False: 591k]
  ------------------
   57|   319k|        c_next = corner_table->Next(corner_id);
   58|   319k|        c_prev = corner_table->Previous(corner_id);
   59|   591k|      } else {
   60|   591k|        c_next = corner_table->Next(cit.Corner());
   61|   591k|        c_prev = corner_table->Previous(cit.Corner());
   62|   591k|      }
   63|   910k|      const VectorD<int64_t, 3> pos_next = this->GetPositionForCorner(c_next);
   64|   910k|      const VectorD<int64_t, 3> pos_prev = this->GetPositionForCorner(c_prev);
   65|       |
   66|       |      // Computing delta vectors to next and prev.
   67|   910k|      const VectorD<int64_t, 3> delta_next = pos_next - pos_cent;
   68|   910k|      const VectorD<int64_t, 3> delta_prev = pos_prev - pos_cent;
   69|       |
   70|       |      // Computing cross product.
   71|   910k|      const VectorD<int64_t, 3> cross = CrossProduct(delta_next, delta_prev);
   72|       |
   73|       |      // Prevent signed integer overflows by doing math as unsigned.
   74|   910k|      auto normal_data = reinterpret_cast<uint64_t *>(normal.data());
   75|   910k|      auto cross_data = reinterpret_cast<const uint64_t *>(cross.data());
   76|   910k|      normal_data[0] = normal_data[0] + cross_data[0];
   77|   910k|      normal_data[1] = normal_data[1] + cross_data[1];
   78|   910k|      normal_data[2] = normal_data[2] + cross_data[2];
   79|       |
   80|   910k|      cit.Next();
   81|   910k|    }
   82|       |
   83|       |    // Convert to int32_t, make sure entries are not too large.
   84|   156k|    constexpr int64_t upper_bound = 1 << 29;
   85|   156k|    if (this->normal_prediction_mode_ == ONE_TRIANGLE) {
  ------------------
  |  Branch (85:9): [True: 53.7k, False: 102k]
  ------------------
   86|  53.7k|      const int32_t abs_sum = static_cast<int32_t>(normal.AbsSum());
   87|  53.7k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (87:11): [True: 323, False: 53.4k]
  ------------------
   88|    323|        const int64_t quotient = abs_sum / upper_bound;
   89|    323|        normal = normal / quotient;
   90|    323|      }
   91|   102k|    } else {
   92|   102k|      const int64_t abs_sum = normal.AbsSum();
   93|   102k|      if (abs_sum > upper_bound) {
  ------------------
  |  Branch (93:11): [True: 2.46k, False: 100k]
  ------------------
   94|  2.46k|        const int64_t quotient = abs_sum / upper_bound;
   95|  2.46k|        normal = normal / quotient;
   96|  2.46k|      }
   97|   102k|    }
   98|   156k|    DRACO_DCHECK_LE(normal.AbsSum(), upper_bound);
   99|   156k|    prediction[0] = static_cast<int32_t>(normal[0]);
  100|   156k|    prediction[1] = static_cast<int32_t>(normal[1]);
  101|   156k|    prediction[2] = static_cast<int32_t>(normal[2]);
  102|   156k|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    147|      : Base(md) {
   35|    147|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    147|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|     97|      : Base(md) {
   35|     97|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     97|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   34|    135|      : Base(md) {
   35|    135|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|    135|  };
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorAreaIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   34|     88|      : Base(md) {
   35|     88|    this->SetNormalPredictionMode(TRIANGLE_AREA);
   36|     88|  };

_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.84M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.84M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.84M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.84M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.84M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.84M|    return GetPositionForDataId(data_id);
   77|  2.84M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.84M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.84M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.84M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.84M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.84M|    VectorD<int64_t, 3> pos;
   68|  2.84M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.84M|    return pos;
   70|  2.84M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    146|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    146|    pos_attribute_ = &position_attribute;
   43|    146|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    126|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    126|    entry_to_point_id_map_ = map;
   46|    126|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.72M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.72M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.72M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.72M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.72M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.72M|    return GetPositionForDataId(data_id);
   77|  1.72M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.72M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.72M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.72M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.72M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.72M|    VectorD<int64_t, 3> pos;
   68|  1.72M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.72M|    return pos;
   70|  1.72M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     97|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     97|    pos_attribute_ = &position_attribute;
   43|     97|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     91|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     91|    entry_to_point_id_map_ = map;
   46|     91|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.87M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.87M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.87M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.87M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.87M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.87M|    return GetPositionForDataId(data_id);
   77|  1.87M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  1.87M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.87M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.87M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.87M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.87M|    VectorD<int64_t, 3> pos;
   68|  1.87M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.87M|    return pos;
   70|  1.87M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    134|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    134|    pos_attribute_ = &position_attribute;
   43|    134|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    125|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    125|    entry_to_point_id_map_ = map;
   46|    125|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.89M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.89M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.89M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.89M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.89M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.89M|    return GetPositionForDataId(data_id);
   77|  1.89M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.89M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.89M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.89M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.89M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.89M|    VectorD<int64_t, 3> pos;
   68|  1.89M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.89M|    return pos;
   70|  1.89M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|     88|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|     88|    pos_attribute_ = &position_attribute;
   43|     88|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|     84|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|     84|    entry_to_point_id_map_ = map;
   46|     84|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    346|      : pos_attribute_(nullptr),
   36|    346|        entry_to_point_id_map_(nullptr),
   37|    346|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    346|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  2.16M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  2.16M|    DRACO_DCHECK(this->IsInitialized());
   73|  2.16M|    const auto corner_table = mesh_data_.corner_table();
   74|  2.16M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  2.16M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  2.16M|    return GetPositionForDataId(data_id);
   77|  2.16M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20GetPositionForDataIdEi:
   63|  2.16M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  2.16M|    DRACO_DCHECK(this->IsInitialized());
   65|  2.16M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  2.16M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  2.16M|    VectorD<int64_t, 3> pos;
   68|  2.16M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  2.16M|    return pos;
   70|  2.16M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    346|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    346|    pos_attribute_ = &position_attribute;
   43|    346|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    296|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    296|    entry_to_point_id_map_ = map;
   46|    296|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|    362|      : pos_attribute_(nullptr),
   36|    362|        entry_to_point_id_map_(nullptr),
   37|    362|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|    362|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   71|  1.97M|  VectorD<int64_t, 3> GetPositionForCorner(CornerIndex ci) const {
   72|  1.97M|    DRACO_DCHECK(this->IsInitialized());
   73|  1.97M|    const auto corner_table = mesh_data_.corner_table();
   74|  1.97M|    const auto vert_id = corner_table->Vertex(ci).value();
   75|  1.97M|    const auto data_id = mesh_data_.vertex_to_data_map()->at(vert_id);
   76|  1.97M|    return GetPositionForDataId(data_id);
   77|  1.97M|  }
_ZNK5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20GetPositionForDataIdEi:
   63|  1.97M|  VectorD<int64_t, 3> GetPositionForDataId(int data_id) const {
   64|  1.97M|    DRACO_DCHECK(this->IsInitialized());
   65|  1.97M|    const auto point_id = entry_to_point_id_map_[data_id];
   66|  1.97M|    const auto pos_val_id = pos_attribute_->mapped_index(point_id);
   67|  1.97M|    VectorD<int64_t, 3> pos;
   68|  1.97M|    pos_attribute_->ConvertValue(pos_val_id, &pos[0]);
   69|  1.97M|    return pos;
   70|  1.97M|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    361|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    361|    pos_attribute_ = &position_attribute;
   43|    361|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    299|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    299|    entry_to_point_id_map_ = map;
   46|    299|  }
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    147|      : pos_attribute_(nullptr),
   36|    147|        entry_to_point_id_map_(nullptr),
   37|    147|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    147|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|     97|      : pos_attribute_(nullptr),
   36|     97|        entry_to_point_id_map_(nullptr),
   37|     97|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|     97|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS5_:
   35|    135|      : pos_attribute_(nullptr),
   36|    135|        entry_to_point_id_map_(nullptr),
   37|    135|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEED2Ev:
   38|    135|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS5_:
   35|     88|      : pos_attribute_(nullptr),
   36|     88|        entry_to_point_id_map_(nullptr),
   37|     88|        mesh_data_(md) {}
_ZN5draco48MeshPredictionSchemeGeometricNormalPredictorBaseIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEED2Ev:
   38|     88|  virtual ~MeshPredictionSchemeGeometricNormalPredictorBase() {}

_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    102|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    102|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|     98|                          const PointIndex * /* entry_to_point_id_map */) {
   64|     98|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|     98|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|     98|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|     98|      new DataTypeT[num_components]());
   70|       |
   71|     98|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|     98|  const CornerTable *const table = this->mesh_data().corner_table();
   74|     98|  const std::vector<int32_t> *const vertex_to_data_map =
   75|     98|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|     98|  const int corner_map_size =
   78|     98|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   214k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 214k, False: 98]
  ------------------
   80|   214k|    const CornerIndex start_corner_id =
   81|   214k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   214k|    CornerIndex corner_id(start_corner_id);
   84|   214k|    int num_parallelograms = 0;
   85|  2.57M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 2.36M, False: 214k]
  ------------------
   86|  2.36M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  2.36M|    }
   88|   487k|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 272k, False: 214k]
  ------------------
   89|   272k|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 24.2k, False: 248k]
  ------------------
   90|   272k|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|   272k|              num_components, parallelogram_pred_vals.get())) {
   92|   382k|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 357k, False: 24.2k]
  ------------------
   93|   357k|          pred_vals[c] =
   94|   357k|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|   357k|        }
   96|  24.2k|        ++num_parallelograms;
   97|  24.2k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|   272k|      corner_id = table->SwingRight(corner_id);
  101|   272k|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 11.3k, False: 261k]
  ------------------
  102|  11.3k|        corner_id = kInvalidCornerIndex;
  103|  11.3k|      }
  104|   272k|    }
  105|       |
  106|   214k|    const int dst_offset = p * num_components;
  107|   214k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 200k, False: 13.1k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|   200k|      const int src_offset = (p - 1) * num_components;
  111|   200k|      this->transform().ComputeOriginalValue(
  112|   200k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   200k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|   203k|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 190k, False: 13.1k]
  ------------------
  116|   190k|        pred_vals[c] /= num_parallelograms;
  117|   190k|      }
  118|  13.1k|      this->transform().ComputeOriginalValue(
  119|  13.1k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|  13.1k|    }
  121|   214k|  }
  122|     98|  return true;
  123|     98|}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2EPKNS_14PointAttributeERKS2_RKS5_:
   43|    322|      : MeshPredictionSchemeDecoder<DataTypeT, TransformT, MeshDataT>(
   44|    322|            attribute, transform, mesh_data) {}
_ZN5draco45MeshPredictionSchemeMultiParallelogramDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputeOriginalValuesEPKiPiiiPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   63|    294|                          const PointIndex * /* entry_to_point_id_map */) {
   64|    294|  this->transform().Init(num_components);
   65|       |
   66|       |  // For storage of prediction values (already initialized to zero).
   67|    294|  std::unique_ptr<DataTypeT[]> pred_vals(new DataTypeT[num_components]());
   68|    294|  std::unique_ptr<DataTypeT[]> parallelogram_pred_vals(
   69|    294|      new DataTypeT[num_components]());
   70|       |
   71|    294|  this->transform().ComputeOriginalValue(pred_vals.get(), in_corr, out_data);
   72|       |
   73|    294|  const CornerTable *const table = this->mesh_data().corner_table();
   74|    294|  const std::vector<int32_t> *const vertex_to_data_map =
   75|    294|      this->mesh_data().vertex_to_data_map();
   76|       |
   77|    294|  const int corner_map_size =
   78|    294|      static_cast<int>(this->mesh_data().data_to_corner_map()->size());
   79|   328k|  for (int p = 1; p < corner_map_size; ++p) {
  ------------------
  |  Branch (79:19): [True: 328k, False: 294]
  ------------------
   80|   328k|    const CornerIndex start_corner_id =
   81|   328k|        this->mesh_data().data_to_corner_map()->at(p);
   82|       |
   83|   328k|    CornerIndex corner_id(start_corner_id);
   84|   328k|    int num_parallelograms = 0;
   85|  1.58M|    for (int i = 0; i < num_components; ++i) {
  ------------------
  |  Branch (85:21): [True: 1.25M, False: 328k]
  ------------------
   86|  1.25M|      pred_vals[i] = static_cast<DataTypeT>(0);
   87|  1.25M|    }
   88|  2.27M|    while (corner_id != kInvalidCornerIndex) {
  ------------------
  |  Branch (88:12): [True: 1.94M, False: 328k]
  ------------------
   89|  1.94M|      if (ComputeParallelogramPrediction(
  ------------------
  |  Branch (89:11): [True: 631k, False: 1.31M]
  ------------------
   90|  1.94M|              p, corner_id, table, *vertex_to_data_map, out_data,
   91|  1.94M|              num_components, parallelogram_pred_vals.get())) {
   92|  2.98M|        for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (92:25): [True: 2.35M, False: 631k]
  ------------------
   93|  2.35M|          pred_vals[c] =
   94|  2.35M|              AddAsUnsigned(pred_vals[c], parallelogram_pred_vals[c]);
   95|  2.35M|        }
   96|   631k|        ++num_parallelograms;
   97|   631k|      }
   98|       |
   99|       |      // Proceed to the next corner attached to the vertex.
  100|  1.94M|      corner_id = table->SwingRight(corner_id);
  101|  1.94M|      if (corner_id == start_corner_id) {
  ------------------
  |  Branch (101:11): [True: 323k, False: 1.62M]
  ------------------
  102|   323k|        corner_id = kInvalidCornerIndex;
  103|   323k|      }
  104|  1.94M|    }
  105|       |
  106|   328k|    const int dst_offset = p * num_components;
  107|   328k|    if (num_parallelograms == 0) {
  ------------------
  |  Branch (107:9): [True: 1.27k, False: 327k]
  ------------------
  108|       |      // No parallelogram was valid.
  109|       |      // We use the last decoded point as a reference.
  110|  1.27k|      const int src_offset = (p - 1) * num_components;
  111|  1.27k|      this->transform().ComputeOriginalValue(
  112|  1.27k|          out_data + src_offset, in_corr + dst_offset, out_data + dst_offset);
  113|   327k|    } else {
  114|       |      // Compute the correction from the predicted value.
  115|  1.56M|      for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (115:23): [True: 1.23M, False: 327k]
  ------------------
  116|  1.23M|        pred_vals[c] /= num_parallelograms;
  117|  1.23M|      }
  118|   327k|      this->transform().ComputeOriginalValue(
  119|   327k|          pred_vals.get(), in_corr + dst_offset, out_data + dst_offset);
  120|   327k|    }
  121|   328k|  }
  122|    294|  return true;
  123|    294|}

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

_ZN5draco30ComputeParallelogramPredictionINS_24MeshAttributeCornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  1.88M|    int num_components, DataTypeT *out_prediction) {
   49|  1.88M|  const CornerIndex oci = table->Opposite(ci);
   50|  1.88M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 1.39M, False: 493k]
  ------------------
   51|  1.39M|    return false;
   52|  1.39M|  }
   53|   493k|  int vert_opp, vert_next, vert_prev;
   54|   493k|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|   493k|                                        &vert_opp, &vert_next, &vert_prev);
   56|   493k|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 339k, False: 154k]
  |  Branch (56:35): [True: 297k, False: 42.0k]
  ------------------
   57|   297k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 293k, False: 3.98k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   293k|    const int v_opp_off = vert_opp * num_components;
   60|   293k|    const int v_next_off = vert_next * num_components;
   61|   293k|    const int v_prev_off = vert_prev * num_components;
   62|  13.9M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 13.7M, False: 293k]
  ------------------
   63|  13.7M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  13.7M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  13.7M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  13.7M|      const int64_t result =
   67|  13.7M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  13.7M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  13.7M|    }
   71|   293k|    return true;
   72|   293k|  }
   73|   200k|  return false;  // Not all data is available for prediction
   74|   493k|}
_ZN5draco23GetParallelogramEntriesINS_24MeshAttributeCornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|   493k|    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|   493k|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|   493k|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|   493k|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|   493k|}
_ZN5draco30ComputeParallelogramPredictionINS_11CornerTableEiEEbiNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPKT0_iPSF_:
   48|  2.36M|    int num_components, DataTypeT *out_prediction) {
   49|  2.36M|  const CornerIndex oci = table->Opposite(ci);
   50|  2.36M|  if (oci == kInvalidCornerIndex) {
  ------------------
  |  Branch (50:7): [True: 25.7k, False: 2.33M]
  ------------------
   51|  25.7k|    return false;
   52|  25.7k|  }
   53|  2.33M|  int vert_opp, vert_next, vert_prev;
   54|  2.33M|  GetParallelogramEntries<CornerTableT>(oci, table, vertex_to_data_map,
   55|  2.33M|                                        &vert_opp, &vert_next, &vert_prev);
   56|  2.33M|  if (vert_opp < data_entry_id && vert_next < data_entry_id &&
  ------------------
  |  Branch (56:7): [True: 1.17M, False: 1.16M]
  |  Branch (56:35): [True: 846k, False: 328k]
  ------------------
   57|   846k|      vert_prev < data_entry_id) {
  ------------------
  |  Branch (57:7): [True: 783k, False: 62.2k]
  ------------------
   58|       |    // Apply the parallelogram prediction.
   59|   783k|    const int v_opp_off = vert_opp * num_components;
   60|   783k|    const int v_next_off = vert_next * num_components;
   61|   783k|    const int v_prev_off = vert_prev * num_components;
   62|  16.1M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (62:21): [True: 15.3M, False: 783k]
  ------------------
   63|  15.3M|      const int64_t in_data_next_off = in_data[v_next_off + c];
   64|  15.3M|      const int64_t in_data_prev_off = in_data[v_prev_off + c];
   65|  15.3M|      const int64_t in_data_opp_off = in_data[v_opp_off + c];
   66|  15.3M|      const int64_t result =
   67|  15.3M|          (in_data_next_off + in_data_prev_off) - in_data_opp_off;
   68|       |
   69|  15.3M|      out_prediction[c] = static_cast<DataTypeT>(result);
   70|  15.3M|    }
   71|   783k|    return true;
   72|   783k|  }
   73|  1.55M|  return false;  // Not all data is available for prediction
   74|  2.33M|}
_ZN5draco23GetParallelogramEntriesINS_11CornerTableEEEvNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKT_RKNSt3__16vectorIiNS8_9allocatorIiEEEEPiSF_SF_:
   31|  2.33M|    int *next_entry, int *prev_entry) {
   32|       |  // One vertex of the input |table| correspond to exactly one attribute value
   33|       |  // entry. The |table| can be either CornerTable for per-vertex attributes,
   34|       |  // or MeshAttributeCornerTable for attributes with interior seams.
   35|  2.33M|  *opp_entry = vertex_to_data_map[table->Vertex(ci).value()];
   36|  2.33M|  *next_entry = vertex_to_data_map[table->Vertex(table->Next(ci)).value()];
   37|  2.33M|  *prev_entry = vertex_to_data_map[table->Vertex(table->Previous(ci)).value()];
   38|  2.33M|}

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

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

_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEC2ERKS3_:
   38|    134|      : pos_attribute_(nullptr),
   39|    134|        entry_to_point_id_map_(nullptr),
   40|    134|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    133|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    133|    pos_attribute_ = &position_attribute;
   43|    133|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE18ResizeOrientationsEi:
   73|    123|  void ResizeOrientations(int num_orientations) {
   74|    123|    orientations_.resize(num_orientations);
   75|    123|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15set_orientationEib:
   71|  1.25G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    113|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    113|    entry_to_point_id_map_ = map;
   46|    113|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   460k|                                                 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|   460k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   460k|  const CornerIndex prev_corner_id =
   99|   460k|      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|   460k|  int next_data_id, prev_data_id;
  103|       |
  104|   460k|  int next_vert_id, prev_vert_id;
  105|   460k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   460k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   460k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   460k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   460k|  typedef VectorD<int64_t, 2> Vec2;
  112|   460k|  typedef VectorD<int64_t, 3> Vec3;
  113|   460k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   460k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 315k, False: 144k]
  |  Branch (115:33): [True: 171k, False: 144k]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   171k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   171k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   171k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 153k, False: 18.3k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   153k|      predicted_value_[0] = p_uv[0];
  122|   153k|      predicted_value_[1] = p_uv[1];
  123|   153k|      return true;
  124|   153k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  18.3k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  18.3k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  18.3k|    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|  18.3k|    const Vec3 pn = prev_pos - next_pos;
  146|  18.3k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  18.3k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 843, False: 17.5k]
  ------------------
  148|       |      // Compute the projection of C onto PN by computing dot product of CN with
  149|       |      // PN and normalizing it by length of PN. This gives us a factor |s| where
  150|       |      // |s = PN.Dot(CN) / PN.SquaredNorm2()|. This factor can be used to
  151|       |      // compute X in UV space |X_UV| as |X_UV = N_UV + s * PN_UV|.
  152|    843|      const Vec3 cn = tip_pos - next_pos;
  153|    843|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|    843|      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|    843|      const int64_t n_uv_absmax_element =
  164|    843|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|    843|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 16, False: 827]
  ------------------
  166|    843|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     16|        return false;
  169|     16|      }
  170|    827|      const int64_t pn_uv_absmax_element =
  171|    827|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|    827|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 8, False: 819]
  ------------------
  173|    827|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|      8|        return false;
  176|      8|      }
  177|    819|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|    819|      const int64_t pn_absmax_element =
  179|    819|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|    819|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 10, False: 809]
  ------------------
  181|    819|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|     10|        return false;
  184|     10|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|    809|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|    809|      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|    809|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|    809|      const uint64_t norm_squared =
  207|    809|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|    809|      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|    809|      Vec2 predicted_uv;
  214|    809|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 809]
  ------------------
  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|    809|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|    809|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 0, False: 809]
  ------------------
  233|      0|          return false;
  234|      0|        }
  235|    809|        const bool orientation = orientations_.back();
  236|    809|        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|    809|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 311, False: 498]
  ------------------
  240|    311|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    498|        } else {
  242|    498|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    498|        }
  244|    809|      }
  245|    809|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|    809|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|    809|      return true;
  248|    809|    }
  249|  18.3k|  }
  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|   306k|  int data_offset = 0;
  254|   306k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 161k, False: 144k]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|   161k|    data_offset = prev_data_id * kNumComponents;
  257|   161k|  }
  258|   306k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 17.5k, False: 288k]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  17.5k|    data_offset = next_data_id * kNumComponents;
  261|   288k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|   288k|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 288k, False: 113]
  ------------------
  265|   288k|      data_offset = (data_id - 1) * kNumComponents;
  266|   288k|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    339|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 226, False: 113]
  ------------------
  269|    226|        predicted_value_[i] = 0;
  270|    226|      }
  271|    113|      return true;
  272|    113|    }
  273|   288k|  }
  274|   917k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 611k, False: 305k]
  ------------------
  275|   611k|    predicted_value_[i] = data[data_offset + i];
  276|   611k|  }
  277|   305k|  return true;
  278|   306k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   343k|                                            const DataTypeT *data) const {
   59|   343k|    const int data_offset = entry_id * kNumComponents;
   60|   343k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   343k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE21GetPositionForEntryIdEi:
   49|  55.1k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  55.1k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  55.1k|    VectorD<int64_t, 3> pos;
   52|  55.1k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  55.1k|                                 &pos[0]);
   54|  55.1k|    return pos;
   55|  55.1k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEE15predicted_valueEv:
   69|   460k|  const DataTypeT *predicted_value() const { return predicted_value_; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEEC2ERKS3_:
   38|    134|      : pos_attribute_(nullptr),
   39|    134|        entry_to_point_id_map_(nullptr),
   40|    134|        mesh_data_(md) {}
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetPositionAttributeERKNS_14PointAttributeE:
   41|    134|  void SetPositionAttribute(const PointAttribute &position_attribute) {
   42|    134|    pos_attribute_ = &position_attribute;
   43|    134|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE18ResizeOrientationsEi:
   73|    132|  void ResizeOrientations(int num_orientations) {
   74|    132|    orientations_.resize(num_orientations);
   75|    132|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15set_orientationEib:
   71|  6.65G|  void set_orientation(int i, bool v) { orientations_[i] = v; }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE20SetEntryToPointIdMapEPKNS_9IndexTypeIjNS_20PointIndex_tag_type_EEE:
   44|    109|  void SetEntryToPointIdMap(const PointIndex *map) {
   45|    109|    entry_to_point_id_map_ = map;
   46|    109|  }
_ZN5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21ComputePredictedValueILb0EEEbNS_9IndexTypeIjNS_21CornerIndex_tag_type_EEEPKii:
   93|   167k|                                                 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|   167k|  const CornerIndex next_corner_id = mesh_data_.corner_table()->Next(corner_id);
   98|   167k|  const CornerIndex prev_corner_id =
   99|   167k|      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|   167k|  int next_data_id, prev_data_id;
  103|       |
  104|   167k|  int next_vert_id, prev_vert_id;
  105|   167k|  next_vert_id = mesh_data_.corner_table()->Vertex(next_corner_id).value();
  106|   167k|  prev_vert_id = mesh_data_.corner_table()->Vertex(prev_corner_id).value();
  107|       |
  108|   167k|  next_data_id = mesh_data_.vertex_to_data_map()->at(next_vert_id);
  109|   167k|  prev_data_id = mesh_data_.vertex_to_data_map()->at(prev_vert_id);
  110|       |
  111|   167k|  typedef VectorD<int64_t, 2> Vec2;
  112|   167k|  typedef VectorD<int64_t, 3> Vec3;
  113|   167k|  typedef VectorD<uint64_t, 2> Vec2u;
  114|       |
  115|   167k|  if (prev_data_id < data_id && next_data_id < data_id) {
  ------------------
  |  Branch (115:7): [True: 167k, False: 186]
  |  Branch (115:33): [True: 167k, False: 188]
  ------------------
  116|       |    // Both other corners have available UV coordinates for prediction.
  117|   167k|    const Vec2 n_uv = GetTexCoordForEntryId(next_data_id, data);
  118|   167k|    const Vec2 p_uv = GetTexCoordForEntryId(prev_data_id, data);
  119|   167k|    if (p_uv == n_uv) {
  ------------------
  |  Branch (119:9): [True: 160k, False: 6.89k]
  ------------------
  120|       |      // We cannot do a reliable prediction on degenerated UV triangles.
  121|   160k|      predicted_value_[0] = p_uv[0];
  122|   160k|      predicted_value_[1] = p_uv[1];
  123|   160k|      return true;
  124|   160k|    }
  125|       |
  126|       |    // Get positions at all corners.
  127|  6.89k|    const Vec3 tip_pos = GetPositionForEntryId(data_id);
  128|  6.89k|    const Vec3 next_pos = GetPositionForEntryId(next_data_id);
  129|  6.89k|    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|  6.89k|    const Vec3 pn = prev_pos - next_pos;
  146|  6.89k|    const uint64_t pn_norm2_squared = pn.SquaredNorm();
  147|  6.89k|    if (pn_norm2_squared != 0) {
  ------------------
  |  Branch (147:9): [True: 1.19k, False: 5.69k]
  ------------------
  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.19k|      const Vec3 cn = tip_pos - next_pos;
  153|  1.19k|      const int64_t cn_dot_pn = pn.Dot(cn);
  154|       |
  155|  1.19k|      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.19k|      const int64_t n_uv_absmax_element =
  164|  1.19k|          std::max(std::abs(n_uv[0]), std::abs(n_uv[1]));
  165|  1.19k|      if (n_uv_absmax_element >
  ------------------
  |  Branch (165:11): [True: 17, False: 1.18k]
  ------------------
  166|  1.19k|          std::numeric_limits<int64_t>::max() / pn_norm2_squared) {
  167|       |        // Return false if the below multiplication would overflow.
  168|     17|        return false;
  169|     17|      }
  170|  1.18k|      const int64_t pn_uv_absmax_element =
  171|  1.18k|          std::max(std::abs(pn_uv[0]), std::abs(pn_uv[1]));
  172|  1.18k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (172:11): [True: 13, False: 1.16k]
  ------------------
  173|  1.18k|          std::numeric_limits<int64_t>::max() / pn_uv_absmax_element) {
  174|       |        // Return false if squared length calculation would overflow.
  175|     13|        return false;
  176|     13|      }
  177|  1.16k|      const Vec2 x_uv = n_uv * pn_norm2_squared + (cn_dot_pn * pn_uv);
  178|  1.16k|      const int64_t pn_absmax_element =
  179|  1.16k|          std::max(std::max(std::abs(pn[0]), std::abs(pn[1])), std::abs(pn[2]));
  180|  1.16k|      if (std::abs(cn_dot_pn) >
  ------------------
  |  Branch (180:11): [True: 4, False: 1.16k]
  ------------------
  181|  1.16k|          std::numeric_limits<int64_t>::max() / pn_absmax_element) {
  182|       |        // Return false if squared length calculation would overflow.
  183|      4|        return false;
  184|      4|      }
  185|       |
  186|       |      // Compute squared length of vector CX in position coordinate system:
  187|  1.16k|      const Vec3 x_pos = next_pos + (cn_dot_pn * pn) / pn_norm2_squared;
  188|  1.16k|      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.16k|      Vec2 cx_uv(pn_uv[1], -pn_uv[0]);  // Rotated PN_UV.
  205|       |      // Compute CX.Norm2() * PN.Norm2()
  206|  1.16k|      const uint64_t norm_squared =
  207|  1.16k|          IntSqrt(cx_norm2_squared * pn_norm2_squared);
  208|       |      // Final cx_uv in the scaled coordinate space.
  209|  1.16k|      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.16k|      Vec2 predicted_uv;
  214|  1.16k|      if (is_encoder_t) {
  ------------------
  |  Branch (214:11): [Folded, False: 1.16k]
  ------------------
  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.16k|      } else {
  231|       |        // When decoding the data, we already know which orientation to use.
  232|  1.16k|        if (orientations_.empty()) {
  ------------------
  |  Branch (232:13): [True: 1, False: 1.16k]
  ------------------
  233|      1|          return false;
  234|      1|        }
  235|  1.16k|        const bool orientation = orientations_.back();
  236|  1.16k|        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.16k|        if (orientation) {
  ------------------
  |  Branch (239:13): [True: 359, False: 805]
  ------------------
  240|    359|          predicted_uv = Vec2(Vec2u(x_uv) + Vec2u(cx_uv)) / pn_norm2_squared;
  241|    805|        } else {
  242|    805|          predicted_uv = Vec2(Vec2u(x_uv) - Vec2u(cx_uv)) / pn_norm2_squared;
  243|    805|        }
  244|  1.16k|      }
  245|  1.16k|      predicted_value_[0] = static_cast<int>(predicted_uv[0]);
  246|  1.16k|      predicted_value_[1] = static_cast<int>(predicted_uv[1]);
  247|  1.16k|      return true;
  248|  1.16k|    }
  249|  6.89k|  }
  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|  6.07k|  int data_offset = 0;
  254|  6.07k|  if (prev_data_id < data_id) {
  ------------------
  |  Branch (254:7): [True: 5.88k, False: 186]
  ------------------
  255|       |    // Use the value on the previous corner as the prediction.
  256|  5.88k|    data_offset = prev_data_id * kNumComponents;
  257|  5.88k|  }
  258|  6.07k|  if (next_data_id < data_id) {
  ------------------
  |  Branch (258:7): [True: 5.70k, False: 368]
  ------------------
  259|       |    // Use the value on the next corner as the prediction.
  260|  5.70k|    data_offset = next_data_id * kNumComponents;
  261|  5.70k|  } else {
  262|       |    // None of the other corners have a valid value. Use the last encoded value
  263|       |    // as the prediction if possible.
  264|    368|    if (data_id > 0) {
  ------------------
  |  Branch (264:9): [True: 259, False: 109]
  ------------------
  265|    259|      data_offset = (data_id - 1) * kNumComponents;
  266|    259|    } else {
  267|       |      // We are encoding the first value. Predict 0.
  268|    327|      for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (268:23): [True: 218, False: 109]
  ------------------
  269|    218|        predicted_value_[i] = 0;
  270|    218|      }
  271|    109|      return true;
  272|    109|    }
  273|    368|  }
  274|  17.8k|  for (int i = 0; i < kNumComponents; ++i) {
  ------------------
  |  Branch (274:19): [True: 11.9k, False: 5.96k]
  ------------------
  275|  11.9k|    predicted_value_[i] = data[data_offset + i];
  276|  11.9k|  }
  277|  5.96k|  return true;
  278|  6.07k|}
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetTexCoordForEntryIdEiPKi:
   58|   334k|                                            const DataTypeT *data) const {
   59|   334k|    const int data_offset = entry_id * kNumComponents;
   60|   334k|    return VectorD<int64_t, 2>(data[data_offset], data[data_offset + 1]);
   61|   334k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE21GetPositionForEntryIdEi:
   49|  20.6k|  VectorD<int64_t, 3> GetPositionForEntryId(int entry_id) const {
   50|  20.6k|    const PointIndex point_id = entry_to_point_id_map_[entry_id];
   51|  20.6k|    VectorD<int64_t, 3> pos;
   52|  20.6k|    pos_attribute_->ConvertValue(pos_attribute_->mapped_index(point_id),
   53|  20.6k|                                 &pos[0]);
   54|  20.6k|    return pos;
   55|  20.6k|  }
_ZNK5draco46MeshPredictionSchemeTexCoordsPortablePredictorIiNS_24MeshPredictionSchemeDataINS_11CornerTableEEEE15predicted_valueEv:
   69|   167k|  const DataTypeT *predicted_value() const { return predicted_value_; }

_ZNK5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     32|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    272|  bool AreCorrectionsPositive() override {
   71|    272|    return transform_.AreCorrectionsPositive();
   72|    272|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     29|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     29|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 19, False: 10]
  ------------------
   50|     19|      return false;
   51|     19|    }
   52|     10|    return true;
   53|     29|  }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEE9transformEv:
   81|  1.08M|  inline Transform &transform() { return transform_; }
_ZNK5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22GetNumParentAttributesEv:
   58|     33|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE22AreCorrectionsPositiveEv:
   70|    253|  bool AreCorrectionsPositive() override {
   71|    253|    return transform_.AreCorrectionsPositive();
   72|    253|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|     31|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|     31|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 9, False: 22]
  ------------------
   50|      9|      return false;
   51|      9|    }
   52|     22|    return true;
   53|     31|  }
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEE9transformEv:
   81|   783k|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEC2EPKNS_14PointAttributeERKS2_:
   46|  2.96k|      : attribute_(attribute), transform_(transform) {}
_ZNK5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22GetNumParentAttributesEv:
   58|  1.75k|  int GetNumParentAttributes() const override { return 0; }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE22AreCorrectionsPositiveEv:
   70|  2.82k|  bool AreCorrectionsPositive() override {
   71|  2.82k|    return transform_.AreCorrectionsPositive();
   72|  2.82k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE20DecodePredictionDataEPNS_13DecoderBufferE:
   48|  1.98k|  bool DecodePredictionData(DecoderBuffer *buffer) override {
   49|  1.98k|    if (!transform_.DecodeTransformData(buffer)) {
  ------------------
  |  Branch (49:9): [True: 90, False: 1.89k]
  ------------------
   50|     90|      return false;
   51|     90|    }
   52|  1.89k|    return true;
   53|  1.98k|  }
_ZN5draco23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEE9transformEv:
   81|  4.69M|  inline Transform &transform() { return transform_; }
_ZN5draco23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    276|      : attribute_(attribute), transform_(transform) {}
_ZN5draco23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEC2EPKNS_14PointAttributeERKS2_:
   46|    256|      : attribute_(attribute), transform_(transform) {}

_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    276|                                 const PointCloudDecoder *decoder) {
  188|    276|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    276|      method, att_id, decoder, TransformT());
  190|    276|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    276|                                 const TransformT &transform) {
  156|    276|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 276]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    276|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    276|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 276, 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|    276|    const MeshDecoder *const mesh_decoder =
  167|    276|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    276|    auto ret = CreateMeshPredictionScheme<
  170|    276|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    276|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    276|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    276|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 244, False: 32]
  ------------------
  174|    244|      return ret;
  175|    244|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    276|  }
  178|       |  // Create delta decoder.
  179|     32|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     32|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    276|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    164|      uint16_t bitstream_version) {
  143|    164|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    164|        method, attribute, transform, mesh_data, bitstream_version);
  145|    164|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|    164|        uint16_t bitstream_version) {
  127|    164|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 147, False: 17]
  ------------------
  128|    147|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|    147|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|    147|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|    147|                                                  mesh_data));
  132|    147|      }
  133|     17|      return nullptr;
  134|    164|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|     99|      uint16_t bitstream_version) {
  143|     99|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|     99|        method, attribute, transform, mesh_data, bitstream_version);
  145|     99|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_49PredictionSchemeNormalOctahedronDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE2EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  126|     99|        uint16_t bitstream_version) {
  127|     99|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (127:11): [True: 97, False: 2]
  ------------------
  128|     97|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  129|     97|            new MeshPredictionSchemeGeometricNormalDecoder<
  130|     97|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  131|     97|                                                  mesh_data));
  132|     97|      }
  133|      2|      return nullptr;
  134|     99|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|    256|                                 const PointCloudDecoder *decoder) {
  188|    256|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|    256|      method, att_id, decoder, TransformT());
  190|    256|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|    256|                                 const TransformT &transform) {
  156|    256|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 256]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|    256|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|    256|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 256, 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|    256|    const MeshDecoder *const mesh_decoder =
  167|    256|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|    256|    auto ret = CreateMeshPredictionScheme<
  170|    256|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|    256|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|    256|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|    256|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 223, False: 33]
  ------------------
  174|    223|      return ret;
  175|    223|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|    256|  }
  178|       |  // Create delta decoder.
  179|     33|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|     33|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|    256|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|    135|      uint16_t bitstream_version) {
  143|    135|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|    135|        method, attribute, transform, mesh_data, bitstream_version);
  145|    135|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|    135|        uint16_t bitstream_version) {
  111|    135|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 135, False: 0]
  ------------------
  112|    135|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|    135|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|    135|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|    135|                                                  mesh_data));
  116|    135|      }
  117|      0|      return nullptr;
  118|    135|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|     88|      uint16_t bitstream_version) {
  143|     88|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|     88|        method, attribute, transform, mesh_data, bitstream_version);
  145|     88|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE3EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
  110|     88|        uint16_t bitstream_version) {
  111|     88|      if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (111:11): [True: 88, False: 0]
  ------------------
  112|     88|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  113|     88|            new MeshPredictionSchemeGeometricNormalDecoder<
  114|     88|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
  115|     88|                                                  mesh_data));
  116|     88|      }
  117|      0|      return nullptr;
  118|     88|    }
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderE:
  187|  2.96k|                                 const PointCloudDecoder *decoder) {
  188|  2.96k|  return CreatePredictionSchemeForDecoder<DataTypeT, TransformT>(
  189|  2.96k|      method, att_id, decoder, TransformT());
  190|  2.96k|}
_ZN5draco32CreatePredictionSchemeForDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIT_T0_EENS3_14default_deleteIS8_EEEENS_22PredictionSchemeMethodEiPKNS_17PointCloudDecoderERKS7_:
  155|  2.96k|                                 const TransformT &transform) {
  156|  2.96k|  if (method == PREDICTION_NONE) {
  ------------------
  |  Branch (156:7): [True: 0, False: 2.96k]
  ------------------
  157|      0|    return nullptr;
  158|      0|  }
  159|  2.96k|  const PointAttribute *const att = decoder->point_cloud()->attribute(att_id);
  160|  2.96k|  if (decoder->GetGeometryType() == TRIANGULAR_MESH) {
  ------------------
  |  Branch (160:7): [True: 2.96k, 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|  2.96k|    const MeshDecoder *const mesh_decoder =
  167|  2.96k|        static_cast<const MeshDecoder *>(decoder);
  168|       |
  169|  2.96k|    auto ret = CreateMeshPredictionScheme<
  170|  2.96k|        MeshDecoder, PredictionSchemeDecoder<DataTypeT, TransformT>,
  171|  2.96k|        MeshPredictionSchemeDecoderFactory<DataTypeT>>(
  172|  2.96k|        mesh_decoder, method, att_id, transform, decoder->bitstream_version());
  173|  2.96k|    if (ret) {
  ------------------
  |  Branch (173:9): [True: 2.73k, False: 230]
  ------------------
  174|  2.73k|      return ret;
  175|  2.73k|    }
  176|       |    // Otherwise try to create another prediction scheme.
  177|  2.96k|  }
  178|       |  // Create delta decoder.
  179|    230|  return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
  180|    230|      new PredictionSchemeDeltaDecoder<DataTypeT, TransformT>(att, transform));
  181|  2.96k|}
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  1.40k|      uint16_t bitstream_version) {
  143|  1.40k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  1.40k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  1.40k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_24MeshAttributeCornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  1.40k|        uint16_t bitstream_version) {
   53|  1.40k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 503, False: 898]
  ------------------
   54|    503|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    503|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    503|                                                         MeshDataT>(
   57|    503|                attribute, transform, mesh_data));
   58|    503|      }
   59|    898|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|    898|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 102, False: 796]
  ------------------
   61|    102|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    102|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    102|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    102|                                                  mesh_data));
   65|    102|      }
   66|    796|#endif
   67|    796|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 170, False: 626]
  ------------------
   68|    170|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    170|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    170|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    170|                                                  mesh_data));
   72|    170|      }
   73|    626|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    626|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 146, False: 480]
  ------------------
   75|    146|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|    146|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|    146|                                                     MeshDataT>(
   78|    146|                attribute, transform, mesh_data, bitstream_version));
   79|    146|      }
   80|    480|#endif
   81|    480|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 134, False: 346]
  ------------------
   82|    134|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    134|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    134|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    134|                                                  mesh_data));
   86|    134|      }
   87|    346|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    346|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 346, False: 0]
  ------------------
   89|    346|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    346|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    346|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    346|                                                  mesh_data));
   93|    346|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  1.40k|    }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiEclINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEEEENSt3__110unique_ptrINS_23PredictionSchemeDecoderIiT_EENS8_14default_deleteISC_EEEENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKSB_RKT0_t:
  142|  1.32k|      uint16_t bitstream_version) {
  143|  1.32k|    return DispatchFunctor<TransformT, MeshDataT, TransformT::GetType()>()(
  144|  1.32k|        method, attribute, transform, mesh_data, bitstream_version);
  145|  1.32k|  }
_ZN5draco34MeshPredictionSchemeDecoderFactoryIiE15DispatchFunctorINS_37PredictionSchemeWrapDecodingTransformIiiEENS_24MeshPredictionSchemeDataINS_11CornerTableEEELNS_29PredictionSchemeTransformTypeE1EEclENS_22PredictionSchemeMethodEPKNS_14PointAttributeERKS4_RKS7_t:
   52|  1.32k|        uint16_t bitstream_version) {
   53|  1.32k|      if (method == MESH_PREDICTION_PARALLELOGRAM) {
  ------------------
  |  Branch (53:11): [True: 273, False: 1.05k]
  ------------------
   54|    273|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   55|    273|            new MeshPredictionSchemeParallelogramDecoder<DataTypeT, TransformT,
   56|    273|                                                         MeshDataT>(
   57|    273|                attribute, transform, mesh_data));
   58|    273|      }
   59|  1.05k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   60|  1.05k|      else if (method == MESH_PREDICTION_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (60:16): [True: 322, False: 734]
  ------------------
   61|    322|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   62|    322|            new MeshPredictionSchemeMultiParallelogramDecoder<
   63|    322|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   64|    322|                                                  mesh_data));
   65|    322|      }
   66|    734|#endif
   67|    734|      else if (method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM) {
  ------------------
  |  Branch (67:16): [True: 151, False: 583]
  ------------------
   68|    151|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   69|    151|            new MeshPredictionSchemeConstrainedMultiParallelogramDecoder<
   70|    151|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   71|    151|                                                  mesh_data));
   72|    151|      }
   73|    583|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   74|    583|      else if (method == MESH_PREDICTION_TEX_COORDS_DEPRECATED) {
  ------------------
  |  Branch (74:16): [True: 87, False: 496]
  ------------------
   75|     87|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   76|     87|            new MeshPredictionSchemeTexCoordsDecoder<DataTypeT, TransformT,
   77|     87|                                                     MeshDataT>(
   78|     87|                attribute, transform, mesh_data, bitstream_version));
   79|     87|      }
   80|    496|#endif
   81|    496|      else if (method == MESH_PREDICTION_TEX_COORDS_PORTABLE) {
  ------------------
  |  Branch (81:16): [True: 134, False: 362]
  ------------------
   82|    134|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   83|    134|            new MeshPredictionSchemeTexCoordsPortableDecoder<
   84|    134|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   85|    134|                                                  mesh_data));
   86|    134|      }
   87|    362|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
   88|    362|      else if (method == MESH_PREDICTION_GEOMETRIC_NORMAL) {
  ------------------
  |  Branch (88:16): [True: 362, False: 0]
  ------------------
   89|    362|        return std::unique_ptr<PredictionSchemeDecoder<DataTypeT, TransformT>>(
   90|    362|            new MeshPredictionSchemeGeometricNormalDecoder<
   91|    362|                DataTypeT, TransformT, MeshDataT>(attribute, transform,
   92|    362|                                                  mesh_data));
   93|    362|      }
   94|      0|#endif
   95|      0|      return nullptr;
   96|  1.32k|    }

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

_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_49PredictionSchemeNormalOctahedronDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    276|    uint16_t bitstream_version) {
   38|    276|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    276|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 276, False: 0]
  ------------------
   40|    276|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 24, False: 252]
  ------------------
   41|    252|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 1, False: 251]
  ------------------
   42|    251|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 1, False: 250]
  ------------------
   43|    250|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 0, False: 250]
  ------------------
   44|    250|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 247, False: 3]
  ------------------
   45|    274|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 1, False: 2]
  ------------------
   46|    274|    const CornerTable *const ct = source->GetCornerTable();
   47|    274|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    274|        source->GetAttributeEncodingData(att_id);
   49|    274|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 11, False: 263]
  |  Branch (49:26): [True: 0, False: 263]
  ------------------
   50|       |      // No connectivity data found.
   51|     11|      return nullptr;
   52|     11|    }
   53|       |    // Connectivity data exists.
   54|    263|    const MeshAttributeCornerTable *const att_ct =
   55|    263|        source->GetAttributeCornerTable(att_id);
   56|    263|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 164, False: 99]
  ------------------
   57|    164|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    164|      MeshData md;
   59|    164|      md.Set(source->mesh(), att_ct,
   60|    164|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    164|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    164|      MeshPredictionSchemeFactoryT factory;
   63|    164|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    164|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 147, False: 17]
  ------------------
   65|    147|        return ret;
   66|    147|      }
   67|    164|    } else {
   68|     99|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|     99|      MeshData md;
   70|     99|      md.Set(source->mesh(), ct,
   71|     99|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|     99|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|     99|      MeshPredictionSchemeFactoryT factory;
   74|     99|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|     99|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 97, False: 2]
  ------------------
   76|     97|        return ret;
   77|     97|      }
   78|     99|    }
   79|    263|  }
   80|     21|  return nullptr;
   81|    276|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_62PredictionSchemeNormalOctahedronCanonicalizedDecodingTransformIiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|    256|    uint16_t bitstream_version) {
   38|    256|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|    256|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 256, False: 0]
  ------------------
   40|    256|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 3, False: 253]
  ------------------
   41|    253|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 3, False: 250]
  ------------------
   42|    250|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 0, False: 250]
  ------------------
   43|    250|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 1, False: 249]
  ------------------
   44|    249|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 225, False: 24]
  ------------------
   45|    236|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 4, False: 20]
  ------------------
   46|    236|    const CornerTable *const ct = source->GetCornerTable();
   47|    236|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|    236|        source->GetAttributeEncodingData(att_id);
   49|    236|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 13, False: 223]
  |  Branch (49:26): [True: 0, False: 223]
  ------------------
   50|       |      // No connectivity data found.
   51|     13|      return nullptr;
   52|     13|    }
   53|       |    // Connectivity data exists.
   54|    223|    const MeshAttributeCornerTable *const att_ct =
   55|    223|        source->GetAttributeCornerTable(att_id);
   56|    223|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 135, False: 88]
  ------------------
   57|    135|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|    135|      MeshData md;
   59|    135|      md.Set(source->mesh(), att_ct,
   60|    135|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|    135|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|    135|      MeshPredictionSchemeFactoryT factory;
   63|    135|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|    135|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 135, False: 0]
  ------------------
   65|    135|        return ret;
   66|    135|      }
   67|    135|    } else {
   68|     88|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|     88|      MeshData md;
   70|     88|      md.Set(source->mesh(), ct,
   71|     88|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|     88|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|     88|      MeshPredictionSchemeFactoryT factory;
   74|     88|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|     88|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 88, False: 0]
  ------------------
   76|     88|        return ret;
   77|     88|      }
   78|     88|    }
   79|    223|  }
   80|     20|  return nullptr;
   81|    256|}
_ZN5draco26CreateMeshPredictionSchemeINS_11MeshDecoderENS_23PredictionSchemeDecoderIiNS_37PredictionSchemeWrapDecodingTransformIiiEEEENS_34MeshPredictionSchemeDecoderFactoryIiEEEENSt3__110unique_ptrIT0_NS8_14default_deleteISA_EEEEPKT_NS_22PredictionSchemeMethodEiRKNSA_9TransformEt:
   37|  2.96k|    uint16_t bitstream_version) {
   38|  2.96k|  const PointAttribute *const att = source->point_cloud()->attribute(att_id);
   39|  2.96k|  if (source->GetGeometryType() == TRIANGULAR_MESH &&
  ------------------
  |  Branch (39:7): [True: 2.96k, False: 0]
  ------------------
   40|  2.96k|      (method == MESH_PREDICTION_PARALLELOGRAM ||
  ------------------
  |  Branch (40:8): [True: 824, False: 2.13k]
  ------------------
   41|  2.13k|       method == MESH_PREDICTION_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (41:8): [True: 444, False: 1.69k]
  ------------------
   42|  1.69k|       method == MESH_PREDICTION_CONSTRAINED_MULTI_PARALLELOGRAM ||
  ------------------
  |  Branch (42:8): [True: 325, False: 1.36k]
  ------------------
   43|  1.36k|       method == MESH_PREDICTION_TEX_COORDS_PORTABLE ||
  ------------------
  |  Branch (43:8): [True: 269, False: 1.09k]
  ------------------
   44|  1.09k|       method == MESH_PREDICTION_GEOMETRIC_NORMAL ||
  ------------------
  |  Branch (44:8): [True: 708, False: 390]
  ------------------
   45|  2.80k|       method == MESH_PREDICTION_TEX_COORDS_DEPRECATED)) {
  ------------------
  |  Branch (45:8): [True: 234, False: 156]
  ------------------
   46|  2.80k|    const CornerTable *const ct = source->GetCornerTable();
   47|  2.80k|    const MeshAttributeIndicesEncodingData *const encoding_data =
   48|  2.80k|        source->GetAttributeEncodingData(att_id);
   49|  2.80k|    if (ct == nullptr || encoding_data == nullptr) {
  ------------------
  |  Branch (49:9): [True: 74, False: 2.73k]
  |  Branch (49:26): [True: 0, False: 2.73k]
  ------------------
   50|       |      // No connectivity data found.
   51|     74|      return nullptr;
   52|     74|    }
   53|       |    // Connectivity data exists.
   54|  2.73k|    const MeshAttributeCornerTable *const att_ct =
   55|  2.73k|        source->GetAttributeCornerTable(att_id);
   56|  2.73k|    if (att_ct != nullptr) {
  ------------------
  |  Branch (56:9): [True: 1.40k, False: 1.32k]
  ------------------
   57|  1.40k|      typedef MeshPredictionSchemeData<MeshAttributeCornerTable> MeshData;
   58|  1.40k|      MeshData md;
   59|  1.40k|      md.Set(source->mesh(), att_ct,
   60|  1.40k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   61|  1.40k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   62|  1.40k|      MeshPredictionSchemeFactoryT factory;
   63|  1.40k|      auto ret = factory(method, att, transform, md, bitstream_version);
   64|  1.40k|      if (ret) {
  ------------------
  |  Branch (64:11): [True: 1.40k, False: 0]
  ------------------
   65|  1.40k|        return ret;
   66|  1.40k|      }
   67|  1.40k|    } else {
   68|  1.32k|      typedef MeshPredictionSchemeData<CornerTable> MeshData;
   69|  1.32k|      MeshData md;
   70|  1.32k|      md.Set(source->mesh(), ct,
   71|  1.32k|             &encoding_data->encoded_attribute_value_index_to_corner_map,
   72|  1.32k|             &encoding_data->vertex_to_encoded_attribute_value_index_map);
   73|  1.32k|      MeshPredictionSchemeFactoryT factory;
   74|  1.32k|      auto ret = factory(method, att, transform, md, bitstream_version);
   75|  1.32k|      if (ret) {
  ------------------
  |  Branch (75:11): [True: 1.32k, False: 0]
  ------------------
   76|  1.32k|        return ret;
   77|  1.32k|      }
   78|  1.32k|    }
   79|  2.73k|  }
   80|    156|  return nullptr;
   81|  2.96k|}

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

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

_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE14IsInBottomLeftERKNS_7VectorDIiLi2EEE:
   92|   783k|  bool IsInBottomLeft(const Point2 &p) const {
   93|   783k|    if (p[0] == 0 && p[1] == 0) {
  ------------------
  |  Branch (93:9): [True: 650k, False: 133k]
  |  Branch (93:22): [True: 642k, False: 7.15k]
  ------------------
   94|   642k|      return true;
   95|   642k|    }
   96|   140k|    return (p[0] < 0 && p[1] <= 0);
  ------------------
  |  Branch (96:13): [True: 60.7k, False: 79.8k]
  |  Branch (96:25): [True: 29.9k, False: 30.8k]
  ------------------
   97|   783k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE16GetRotationCountENS_7VectorDIiLi2EEE:
   50|   783k|  int32_t GetRotationCount(Point2 pred) const {
   51|   783k|    const DataType sign_x = pred[0];
   52|   783k|    const DataType sign_y = pred[1];
   53|       |
   54|   783k|    int32_t rotation_count = 0;
   55|   783k|    if (sign_x == 0) {
  ------------------
  |  Branch (55:9): [True: 650k, False: 133k]
  ------------------
   56|   650k|      if (sign_y == 0) {
  ------------------
  |  Branch (56:11): [True: 642k, False: 7.15k]
  ------------------
   57|   642k|        rotation_count = 0;
   58|   642k|      } else if (sign_y > 0) {
  ------------------
  |  Branch (58:18): [True: 3.87k, False: 3.28k]
  ------------------
   59|  3.87k|        rotation_count = 3;
   60|  3.87k|      } else {
   61|  3.28k|        rotation_count = 1;
   62|  3.28k|      }
   63|   650k|    } else if (sign_x > 0) {
  ------------------
  |  Branch (63:16): [True: 72.6k, False: 60.7k]
  ------------------
   64|  72.6k|      if (sign_y >= 0) {
  ------------------
  |  Branch (64:11): [True: 40.8k, False: 31.7k]
  ------------------
   65|  40.8k|        rotation_count = 2;
   66|  40.8k|      } else {
   67|  31.7k|        rotation_count = 1;
   68|  31.7k|      }
   69|  72.6k|    } else {
   70|  60.7k|      if (sign_y <= 0) {
  ------------------
  |  Branch (70:11): [True: 29.9k, False: 30.8k]
  ------------------
   71|  29.9k|        rotation_count = 0;
   72|  30.8k|      } else {
   73|  30.8k|        rotation_count = 3;
   74|  30.8k|      }
   75|  60.7k|    }
   76|   783k|    return rotation_count;
   77|   783k|  }
_ZNK5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiE11RotatePointENS_7VectorDIiLi2EEEi:
   79|   221k|  Point2 RotatePoint(Point2 p, int32_t rotation_count) const {
   80|   221k|    switch (rotation_count) {
   81|  69.7k|      case 1:
  ------------------
  |  Branch (81:7): [True: 69.7k, False: 151k]
  ------------------
   82|  69.7k|        return Point2(p[1], -p[0]);
   83|  81.7k|      case 2:
  ------------------
  |  Branch (83:7): [True: 81.7k, False: 139k]
  ------------------
   84|  81.7k|        return Point2(-p[0], -p[1]);
   85|  69.7k|      case 3:
  ------------------
  |  Branch (85:7): [True: 69.7k, False: 151k]
  ------------------
   86|  69.7k|        return Point2(-p[1], p[0]);
   87|      0|      default:
  ------------------
  |  Branch (87:7): [True: 0, False: 221k]
  ------------------
   88|      0|        return p;
   89|   221k|    }
   90|   221k|  }
_ZN5draco58PredictionSchemeNormalOctahedronCanonicalizedTransformBaseIiEC2Ev:
   40|    256|  PredictionSchemeNormalOctahedronCanonicalizedTransformBase() : Base() {}

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

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

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

_ZNK5draco33PredictionSchemeWrapTransformBaseIiE22AreCorrectionsPositiveEv:
   60|  2.82k|  bool AreCorrectionsPositive() const { return false; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_min_valueERKi:
  100|  2.55k|  inline void set_min_value(const DataTypeT &v) { min_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE13set_max_valueERKi:
  102|  2.55k|  inline void set_max_value(const DataTypeT &v) { max_value_ = v; }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE20InitCorrectionBoundsEv:
   83|  2.55k|  bool InitCorrectionBounds() {
   84|  2.55k|    const int64_t dif =
   85|  2.55k|        static_cast<int64_t>(max_value_) - static_cast<int64_t>(min_value_);
   86|  2.55k|    if (dif < 0 || dif >= std::numeric_limits<DataTypeT>::max()) {
  ------------------
  |  Branch (86:9): [True: 0, False: 2.55k]
  |  Branch (86:20): [True: 7, False: 2.54k]
  ------------------
   87|      7|      return false;
   88|      7|    }
   89|  2.54k|    max_dif_ = 1 + static_cast<DataTypeT>(dif);
   90|  2.54k|    max_correction_ = max_dif_ / 2;
   91|  2.54k|    min_correction_ = -max_correction_;
   92|  2.54k|    if ((max_dif_ & 1) == 0) {
  ------------------
  |  Branch (92:9): [True: 984, False: 1.56k]
  ------------------
   93|    984|      max_correction_ -= 1;
   94|    984|    }
   95|  2.54k|    return true;
   96|  2.55k|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiE4InitEi:
   55|  1.88k|  void Init(int num_components) {
   56|  1.88k|    num_components_ = num_components;
   57|  1.88k|    clamped_value_.resize(num_components);
   58|  1.88k|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE19ClampPredictedValueEPKi:
   63|  4.69M|      const DataTypeT *predicted_val) const {
   64|  70.1M|    for (int i = 0; i < this->num_components(); ++i) {
  ------------------
  |  Branch (64:21): [True: 65.4M, False: 4.69M]
  ------------------
   65|  65.4M|      if (predicted_val[i] > max_value_) {
  ------------------
  |  Branch (65:11): [True: 715k, False: 64.7M]
  ------------------
   66|   715k|        clamped_value_[i] = max_value_;
   67|  64.7M|      } else if (predicted_val[i] < min_value_) {
  ------------------
  |  Branch (67:18): [True: 527k, False: 64.1M]
  ------------------
   68|   527k|        clamped_value_[i] = min_value_;
   69|  64.1M|      } else {
   70|  64.1M|        clamped_value_[i] = predicted_val[i];
   71|  64.1M|      }
   72|  65.4M|    }
   73|  4.69M|    return clamped_value_.data();
   74|  4.69M|  }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE14num_componentsEv:
   98|   140M|  inline int num_components() const { return num_components_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9max_valueEv:
  101|  65.4M|  inline DataTypeT max_value() const { return max_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE7max_difEv:
  103|   923k|  inline DataTypeT max_dif() const { return max_dif_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE9min_valueEv:
   99|  64.9M|  inline DataTypeT min_value() const { return min_value_; }
_ZNK5draco33PredictionSchemeWrapTransformBaseIiE17quantization_bitsEv:
   77|    595|  int quantization_bits() const {
   78|    595|    DRACO_DCHECK(false);
   79|    595|    return -1;
   80|    595|  }
_ZN5draco33PredictionSchemeWrapTransformBaseIiEC2Ev:
   44|  2.96k|      : num_components_(0),
   45|  2.96k|        min_value_(0),
   46|  2.96k|        max_value_(0),
   47|  2.96k|        max_dif_(0),
   48|  2.96k|        max_correction_(0),
   49|  2.96k|        min_correction_(0) {}

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

_ZNK5draco26SequentialAttributeDecoder9attributeEv:
   53|  6.89k|  const PointAttribute *attribute() const { return attribute_; }
_ZN5draco26SequentialAttributeDecoder9attributeEv:
   54|   961k|  PointAttribute *attribute() { return attribute_; }
_ZNK5draco26SequentialAttributeDecoder12attribute_idEv:
   55|  3.49k|  int attribute_id() const { return attribute_id_; }
_ZNK5draco26SequentialAttributeDecoder7decoderEv:
   56|  23.8k|  PointCloudDecoder *decoder() const { return decoder_; }
_ZN5draco26SequentialAttributeDecoder20SetPortableAttributeENSt3__110unique_ptrINS_14PointAttributeENS1_14default_deleteIS3_EEEE:
   69|  7.44k|  void SetPortableAttribute(std::unique_ptr<PointAttribute> att) {
   70|  7.44k|    portable_attribute_ = std::move(att);
   71|  7.44k|  }
_ZN5draco26SequentialAttributeDecoder18portable_attributeEv:
   73|  27.1k|  PointAttribute *portable_attribute() { return portable_attribute_.get(); }
_ZN5draco26SequentialAttributeDecoderD2Ev:
   29|  17.1k|  virtual ~SequentialAttributeDecoder() = default;

_ZN5draco37SequentialAttributeDecodersControllerC2ENSt3__110unique_ptrINS_15PointsSequencerENS1_14default_deleteIS3_EEEE:
   26|  19.5k|    : sequencer_(std::move(sequencer)) {}
_ZN5draco37SequentialAttributeDecodersController27DecodeAttributesDecoderDataEPNS_13DecoderBufferE:
   29|  5.79k|    DecoderBuffer *buffer) {
   30|  5.79k|  if (!AttributesDecoder::DecodeAttributesDecoderData(buffer)) {
  ------------------
  |  Branch (30:7): [True: 107, False: 5.68k]
  ------------------
   31|    107|    return false;
   32|    107|  }
   33|       |  // Decode unique ids of all sequential encoders and create them.
   34|  5.68k|  const int32_t num_attributes = GetNumAttributes();
   35|  5.68k|  sequential_decoders_.resize(num_attributes);
   36|  22.8k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (36:19): [True: 17.1k, False: 5.66k]
  ------------------
   37|  17.1k|    uint8_t decoder_type;
   38|  17.1k|    if (!buffer->Decode(&decoder_type)) {
  ------------------
  |  Branch (38:9): [True: 8, False: 17.1k]
  ------------------
   39|      8|      return false;
   40|      8|    }
   41|       |    // Create the decoder from the id.
   42|  17.1k|    sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
   43|  17.1k|    if (!sequential_decoders_[i]) {
  ------------------
  |  Branch (43:9): [True: 12, False: 17.1k]
  ------------------
   44|     12|      return false;
   45|     12|    }
   46|  17.1k|    if (!sequential_decoders_[i]->Init(GetDecoder(), GetAttributeId(i))) {
  ------------------
  |  Branch (46:9): [True: 3, False: 17.1k]
  ------------------
   47|      3|      return false;
   48|      3|    }
   49|  17.1k|  }
   50|  5.66k|  return true;
   51|  5.68k|}
_ZN5draco37SequentialAttributeDecodersController16DecodeAttributesEPNS_13DecoderBufferE:
   54|  3.12k|    DecoderBuffer *buffer) {
   55|  3.12k|  if (!sequencer_ || !sequencer_->GenerateSequence(&point_ids_)) {
  ------------------
  |  Branch (55:7): [True: 0, False: 3.12k]
  |  Branch (55:22): [True: 3, False: 3.12k]
  ------------------
   56|      3|    return false;
   57|      3|  }
   58|       |  // Initialize point to attribute value mapping for all decoded attributes.
   59|  3.12k|  const int32_t num_attributes = GetNumAttributes();
   60|  14.6k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (60:19): [True: 11.5k, False: 3.12k]
  ------------------
   61|  11.5k|    PointAttribute *const pa =
   62|  11.5k|        GetDecoder()->point_cloud()->attribute(GetAttributeId(i));
   63|  11.5k|    if (!sequencer_->UpdatePointToAttributeIndexMapping(pa)) {
  ------------------
  |  Branch (63:9): [True: 2, False: 11.5k]
  ------------------
   64|      2|      return false;
   65|      2|    }
   66|  11.5k|  }
   67|  3.12k|  return AttributesDecoder::DecodeAttributes(buffer);
   68|  3.12k|}
_ZN5draco37SequentialAttributeDecodersController24DecodePortableAttributesEPNS_13DecoderBufferE:
   71|  3.12k|    DecoderBuffer *in_buffer) {
   72|  3.12k|  const int32_t num_attributes = GetNumAttributes();
   73|  10.2k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (73:19): [True: 8.36k, False: 1.93k]
  ------------------
   74|  8.36k|    if (!sequential_decoders_[i]->DecodePortableAttribute(point_ids_,
  ------------------
  |  Branch (74:9): [True: 1.19k, False: 7.17k]
  ------------------
   75|  8.36k|                                                          in_buffer)) {
   76|  1.19k|      return false;
   77|  1.19k|    }
   78|  8.36k|  }
   79|  1.93k|  return true;
   80|  3.12k|}
_ZN5draco37SequentialAttributeDecodersController36DecodeDataNeededByPortableTransformsEPNS_13DecoderBufferE:
   83|  1.93k|    DecodeDataNeededByPortableTransforms(DecoderBuffer *in_buffer) {
   84|  1.93k|  const int32_t num_attributes = GetNumAttributes();
   85|  5.94k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (85:19): [True: 4.44k, False: 1.50k]
  ------------------
   86|  4.44k|    if (!sequential_decoders_[i]->DecodeDataNeededByPortableTransform(
  ------------------
  |  Branch (86:9): [True: 429, False: 4.01k]
  ------------------
   87|  4.44k|            point_ids_, in_buffer)) {
   88|    429|      return false;
   89|    429|    }
   90|  4.44k|  }
   91|  1.50k|  return true;
   92|  1.93k|}
_ZN5draco37SequentialAttributeDecodersController35TransformAttributesToOriginalFormatEv:
   95|  1.50k|    TransformAttributesToOriginalFormat() {
   96|  1.50k|  const int32_t num_attributes = GetNumAttributes();
   97|  4.87k|  for (int i = 0; i < num_attributes; ++i) {
  ------------------
  |  Branch (97:19): [True: 3.51k, False: 1.35k]
  ------------------
   98|       |    // Check whether the attribute transform should be skipped.
   99|  3.51k|    if (GetDecoder()->options()) {
  ------------------
  |  Branch (99:9): [True: 3.51k, False: 0]
  ------------------
  100|  3.51k|      const PointAttribute *const attribute =
  101|  3.51k|          sequential_decoders_[i]->attribute();
  102|  3.51k|      const PointAttribute *const portable_attribute =
  103|  3.51k|          sequential_decoders_[i]->GetPortableAttribute();
  104|  3.51k|      if (portable_attribute &&
  ------------------
  |  Branch (104:11): [True: 3.21k, False: 299]
  |  Branch (104:11): [True: 494, False: 3.02k]
  ------------------
  105|  3.21k|          GetDecoder()->options()->GetAttributeBool(
  ------------------
  |  Branch (105:11): [True: 494, False: 2.72k]
  ------------------
  106|  3.21k|              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|    494|        sequential_decoders_[i]->attribute()->CopyFrom(*portable_attribute);
  113|    494|        continue;
  114|    494|      }
  115|  3.51k|    }
  116|  3.02k|    if (!sequential_decoders_[i]->TransformAttributeToOriginalFormat(
  ------------------
  |  Branch (116:9): [True: 148, False: 2.87k]
  ------------------
  117|  3.02k|            point_ids_)) {
  118|    148|      return false;
  119|    148|    }
  120|  3.02k|  }
  121|  1.35k|  return true;
  122|  1.50k|}
_ZN5draco37SequentialAttributeDecodersController23CreateSequentialDecoderEh:
  126|  17.1k|    uint8_t decoder_type) {
  127|  17.1k|  switch (decoder_type) {
  128|  1.60k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
  ------------------
  |  Branch (128:5): [True: 1.60k, False: 15.5k]
  ------------------
  129|  1.60k|      return std::unique_ptr<SequentialAttributeDecoder>(
  130|  1.60k|          new SequentialAttributeDecoder());
  131|  14.7k|    case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
  ------------------
  |  Branch (131:5): [True: 14.7k, False: 2.45k]
  ------------------
  132|  14.7k|      return std::unique_ptr<SequentialAttributeDecoder>(
  133|  14.7k|          new SequentialIntegerAttributeDecoder());
  134|    264|    case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
  ------------------
  |  Branch (134:5): [True: 264, False: 16.8k]
  ------------------
  135|    264|      return std::unique_ptr<SequentialAttributeDecoder>(
  136|    264|          new SequentialQuantizationAttributeDecoder());
  137|      0|#ifdef DRACO_NORMAL_ENCODING_SUPPORTED
  138|    578|    case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
  ------------------
  |  Branch (138:5): [True: 578, False: 16.5k]
  ------------------
  139|    578|      return std::unique_ptr<SequentialNormalAttributeDecoder>(
  140|    578|          new SequentialNormalAttributeDecoder());
  141|      0|#endif
  142|     12|    default:
  ------------------
  |  Branch (142:5): [True: 12, False: 17.1k]
  ------------------
  143|     12|      break;
  144|  17.1k|  }
  145|       |  // Unknown or unsupported decoder type.
  146|     12|  return nullptr;
  147|  17.1k|}

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

_ZN5draco33SequentialIntegerAttributeDecoderC2Ev:
   23|  15.5k|SequentialIntegerAttributeDecoder::SequentialIntegerAttributeDecoder() {}
_ZN5draco33SequentialIntegerAttributeDecoder4InitEPNS_17PointCloudDecoderEi:
   26|  15.5k|                                             int attribute_id) {
   27|  15.5k|  if (!SequentialAttributeDecoder::Init(decoder, attribute_id)) {
  ------------------
  |  Branch (27:7): [True: 0, False: 15.5k]
  ------------------
   28|      0|    return false;
   29|      0|  }
   30|  15.5k|  return true;
   31|  15.5k|}
_ZN5draco33SequentialIntegerAttributeDecoder34TransformAttributeToOriginalFormatERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEE:
   34|  2.72k|    const std::vector<PointIndex> &point_ids) {
   35|  2.72k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   36|  2.72k|  if (decoder() &&
  ------------------
  |  Branch (36:7): [True: 2.72k, False: 0]
  ------------------
   37|  2.72k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  2.72k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (37:7): [True: 4, False: 2.72k]
  ------------------
   38|      4|    return true;  // Don't revert the transform here for older files.
   39|      4|  }
   40|  2.72k|#endif
   41|  2.72k|  return StoreValues(static_cast<uint32_t>(point_ids.size()));
   42|  2.72k|}
_ZN5draco33SequentialIntegerAttributeDecoder12DecodeValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
   45|  7.76k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
   46|       |  // Decode prediction scheme.
   47|  7.76k|  int8_t prediction_scheme_method;
   48|  7.76k|  if (!in_buffer->Decode(&prediction_scheme_method)) {
  ------------------
  |  Branch (48:7): [True: 90, False: 7.67k]
  ------------------
   49|     90|    return false;
   50|     90|  }
   51|       |  // Check that decoded prediction scheme method type is valid.
   52|  7.67k|  if (prediction_scheme_method < PREDICTION_NONE ||
  ------------------
  |  Branch (52:7): [True: 24, False: 7.65k]
  ------------------
   53|  7.65k|      prediction_scheme_method >= NUM_PREDICTION_SCHEMES) {
  ------------------
  |  Branch (53:7): [True: 89, False: 7.56k]
  ------------------
   54|    113|    return false;
   55|    113|  }
   56|  7.56k|  if (prediction_scheme_method != PREDICTION_NONE) {
  ------------------
  |  Branch (56:7): [True: 7.40k, False: 154]
  ------------------
   57|  7.40k|    int8_t prediction_transform_type;
   58|  7.40k|    if (!in_buffer->Decode(&prediction_transform_type)) {
  ------------------
  |  Branch (58:9): [True: 56, False: 7.35k]
  ------------------
   59|     56|      return false;
   60|     56|    }
   61|       |    // Check that decoded prediction scheme transform type is valid.
   62|  7.35k|    if (prediction_transform_type < PREDICTION_TRANSFORM_NONE ||
  ------------------
  |  Branch (62:9): [True: 11, False: 7.34k]
  ------------------
   63|  7.34k|        prediction_transform_type >= NUM_PREDICTION_SCHEME_TRANSFORM_TYPES) {
  ------------------
  |  Branch (63:9): [True: 48, False: 7.29k]
  ------------------
   64|     59|      return false;
   65|     59|    }
   66|  7.29k|    prediction_scheme_ = CreateIntPredictionScheme(
   67|  7.29k|        static_cast<PredictionSchemeMethod>(prediction_scheme_method),
   68|  7.29k|        static_cast<PredictionSchemeTransformType>(prediction_transform_type));
   69|  7.29k|  }
   70|       |
   71|  7.44k|  if (prediction_scheme_) {
  ------------------
  |  Branch (71:7): [True: 3.49k, False: 3.95k]
  ------------------
   72|  3.49k|    if (!InitPredictionScheme(prediction_scheme_.get())) {
  ------------------
  |  Branch (72:9): [True: 5, False: 3.48k]
  ------------------
   73|      5|      return false;
   74|      5|    }
   75|  3.49k|  }
   76|       |
   77|  7.44k|  if (!DecodeIntegerValues(point_ids, in_buffer)) {
  ------------------
  |  Branch (77:7): [True: 797, False: 6.64k]
  ------------------
   78|    797|    return false;
   79|    797|  }
   80|       |
   81|  6.64k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   82|  6.64k|  const int32_t num_values = static_cast<uint32_t>(point_ids.size());
   83|  6.64k|  if (decoder() &&
  ------------------
  |  Branch (83:7): [True: 6.64k, False: 0]
  ------------------
   84|  6.64k|      decoder()->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|  6.64k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (84:7): [True: 9, False: 6.63k]
  ------------------
   85|       |    // For older files, revert the transform right after we decode the data.
   86|      9|    if (!StoreValues(num_values)) {
  ------------------
  |  Branch (86:9): [True: 0, False: 9]
  ------------------
   87|      0|      return false;
   88|      0|    }
   89|      9|  }
   90|  6.64k|#endif
   91|  6.64k|  return true;
   92|  6.64k|}
_ZN5draco33SequentialIntegerAttributeDecoder25CreateIntPredictionSchemeENS_22PredictionSchemeMethodENS_29PredictionSchemeTransformTypeE:
   97|  6.74k|    PredictionSchemeTransformType transform_type) {
   98|  6.74k|  if (transform_type != PREDICTION_TRANSFORM_WRAP) {
  ------------------
  |  Branch (98:7): [True: 3.78k, False: 2.96k]
  ------------------
   99|  3.78k|    return nullptr;  // For now we support only wrap transform.
  100|  3.78k|  }
  101|  2.96k|  return CreatePredictionSchemeForDecoder<
  102|  2.96k|      int32_t, PredictionSchemeWrapDecodingTransform<int32_t>>(
  103|  2.96k|      method, attribute_id(), decoder());
  104|  6.74k|}
_ZN5draco33SequentialIntegerAttributeDecoder19DecodeIntegerValuesERKNSt3__16vectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_9allocatorIS5_EEEEPNS_13DecoderBufferE:
  107|  7.44k|    const std::vector<PointIndex> &point_ids, DecoderBuffer *in_buffer) {
  108|  7.44k|  const int num_components = GetNumValueComponents();
  109|  7.44k|  if (num_components <= 0) {
  ------------------
  |  Branch (109:7): [True: 0, False: 7.44k]
  ------------------
  110|      0|    return false;
  111|      0|  }
  112|  7.44k|  const size_t num_entries = point_ids.size();
  113|  7.44k|  const size_t num_values = num_entries * num_components;
  114|  7.44k|  PreparePortableAttribute(static_cast<int>(num_entries), num_components);
  115|  7.44k|  int32_t *const portable_attribute_data = GetPortableAttributeData();
  116|  7.44k|  if (portable_attribute_data == nullptr) {
  ------------------
  |  Branch (116:7): [True: 10, False: 7.43k]
  ------------------
  117|     10|    return false;
  118|     10|  }
  119|  7.43k|  uint8_t compressed;
  120|  7.43k|  if (!in_buffer->Decode(&compressed)) {
  ------------------
  |  Branch (120:7): [True: 18, False: 7.41k]
  ------------------
  121|     18|    return false;
  122|     18|  }
  123|  7.41k|  if (compressed > 0) {
  ------------------
  |  Branch (123:7): [True: 314, False: 7.09k]
  ------------------
  124|       |    // Decode compressed values.
  125|    314|    if (!DecodeSymbols(static_cast<uint32_t>(num_values), num_components,
  ------------------
  |  Branch (125:9): [True: 161, False: 153]
  ------------------
  126|    314|                       in_buffer,
  127|    314|                       reinterpret_cast<uint32_t *>(portable_attribute_data))) {
  128|    161|      return false;
  129|    161|    }
  130|  7.09k|  } else {
  131|       |    // Decode the integer data directly.
  132|       |    // Get the number of bytes for a given entry.
  133|  7.09k|    uint8_t num_bytes;
  134|  7.09k|    if (!in_buffer->Decode(&num_bytes)) {
  ------------------
  |  Branch (134:9): [True: 8, False: 7.09k]
  ------------------
  135|      8|      return false;
  136|      8|    }
  137|  7.09k|    if (num_bytes == DataTypeLength(DT_INT32)) {
  ------------------
  |  Branch (137:9): [True: 218, False: 6.87k]
  ------------------
  138|    218|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (138:11): [True: 0, False: 218]
  ------------------
  139|    218|          sizeof(int32_t) * num_values) {
  140|      0|        return false;
  141|      0|      }
  142|    218|      if (!in_buffer->Decode(portable_attribute_data,
  ------------------
  |  Branch (142:11): [True: 2, False: 216]
  ------------------
  143|    218|                             sizeof(int32_t) * num_values)) {
  144|      2|        return false;
  145|      2|      }
  146|  6.87k|    } else {
  147|  6.87k|      if (portable_attribute()->buffer()->data_size() <
  ------------------
  |  Branch (147:11): [True: 20, False: 6.85k]
  ------------------
  148|  6.87k|          num_bytes * num_values) {
  149|     20|        return false;
  150|     20|      }
  151|  6.85k|      if (in_buffer->remaining_size() <
  ------------------
  |  Branch (151:11): [True: 12, False: 6.84k]
  ------------------
  152|  6.85k|          static_cast<int64_t>(num_bytes) * static_cast<int64_t>(num_values)) {
  153|     12|        return false;
  154|     12|      }
  155|   190M|      for (size_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (155:26): [True: 190M, False: 6.84k]
  ------------------
  156|   190M|        if (!in_buffer->Decode(portable_attribute_data + i, num_bytes)) {
  ------------------
  |  Branch (156:13): [True: 0, False: 190M]
  ------------------
  157|      0|          return false;
  158|      0|        }
  159|   190M|      }
  160|  6.84k|    }
  161|  7.09k|  }
  162|       |
  163|  7.20k|  if (num_values > 0 && (prediction_scheme_ == nullptr ||
  ------------------
  |  Branch (163:7): [True: 7.20k, False: 0]
  |  Branch (163:26): [True: 3.86k, False: 3.34k]
  ------------------
  164|  6.68k|                         !prediction_scheme_->AreCorrectionsPositive())) {
  ------------------
  |  Branch (164:26): [True: 2.82k, False: 525]
  ------------------
  165|       |    // Convert the values back to the original signed format.
  166|  6.68k|    ConvertSymbolsToSignedInts(
  167|  6.68k|        reinterpret_cast<const uint32_t *>(portable_attribute_data),
  168|  6.68k|        static_cast<int>(num_values), portable_attribute_data);
  169|  6.68k|  }
  170|       |
  171|       |  // If the data was encoded with a prediction scheme, we must revert it.
  172|  7.20k|  if (prediction_scheme_) {
  ------------------
  |  Branch (172:7): [True: 3.34k, False: 3.86k]
  ------------------
  173|  3.34k|    if (!prediction_scheme_->DecodePredictionData(in_buffer)) {
  ------------------
  |  Branch (173:9): [True: 397, False: 2.95k]
  ------------------
  174|    397|      return false;
  175|    397|    }
  176|       |
  177|  2.95k|    if (num_values > 0) {
  ------------------
  |  Branch (177:9): [True: 2.95k, False: 0]
  ------------------
  178|  2.95k|      if (!prediction_scheme_->ComputeOriginalValues(
  ------------------
  |  Branch (178:11): [True: 167, False: 2.78k]
  ------------------
  179|  2.95k|              portable_attribute_data, portable_attribute_data,
  180|  2.95k|              static_cast<int>(num_values), num_components, point_ids.data())) {
  181|    167|        return false;
  182|    167|      }
  183|  2.95k|    }
  184|  2.95k|  }
  185|  6.64k|  return true;
  186|  7.20k|}
_ZN5draco33SequentialIntegerAttributeDecoder11StoreValuesEj:
  188|  2.53k|bool SequentialIntegerAttributeDecoder::StoreValues(uint32_t num_values) {
  189|  2.53k|  switch (attribute()->data_type()) {
  190|     66|    case DT_UINT8:
  ------------------
  |  Branch (190:5): [True: 66, False: 2.46k]
  ------------------
  191|     66|      StoreTypedValues<uint8_t>(num_values);
  192|     66|      break;
  193|  2.18k|    case DT_INT8:
  ------------------
  |  Branch (193:5): [True: 2.18k, False: 344]
  ------------------
  194|  2.18k|      StoreTypedValues<int8_t>(num_values);
  195|  2.18k|      break;
  196|     24|    case DT_UINT16:
  ------------------
  |  Branch (196:5): [True: 24, False: 2.50k]
  ------------------
  197|     24|      StoreTypedValues<uint16_t>(num_values);
  198|     24|      break;
  199|     85|    case DT_INT16:
  ------------------
  |  Branch (199:5): [True: 85, False: 2.44k]
  ------------------
  200|     85|      StoreTypedValues<int16_t>(num_values);
  201|     85|      break;
  202|     39|    case DT_UINT32:
  ------------------
  |  Branch (202:5): [True: 39, False: 2.49k]
  ------------------
  203|     39|      StoreTypedValues<uint32_t>(num_values);
  204|     39|      break;
  205|     74|    case DT_INT32:
  ------------------
  |  Branch (205:5): [True: 74, False: 2.45k]
  ------------------
  206|     74|      StoreTypedValues<int32_t>(num_values);
  207|     74|      break;
  208|     56|    default:
  ------------------
  |  Branch (208:5): [True: 56, False: 2.47k]
  ------------------
  209|     56|      return false;
  210|  2.53k|  }
  211|  2.47k|  return true;
  212|  2.53k|}
_ZN5draco33SequentialIntegerAttributeDecoder24PreparePortableAttributeEii:
  236|  7.44k|    int num_entries, int num_components) {
  237|  7.44k|  GeometryAttribute ga;
  238|  7.44k|  ga.Init(attribute()->attribute_type(), nullptr, num_components, DT_INT32,
  239|  7.44k|          false, num_components * DataTypeLength(DT_INT32), 0);
  240|  7.44k|  std::unique_ptr<PointAttribute> port_att(new PointAttribute(ga));
  241|  7.44k|  port_att->SetIdentityMapping();
  242|  7.44k|  port_att->Reset(num_entries);
  243|  7.44k|  port_att->set_unique_id(attribute()->unique_id());
  244|  7.44k|  SetPortableAttribute(std::move(port_att));
  245|  7.44k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIhEEvj:
  215|     66|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     66|  const int num_components = attribute()->num_components();
  217|     66|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     66|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     66|      new AttributeTypeT[num_components]);
  220|     66|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     66|  int val_id = 0;
  222|     66|  int out_byte_pos = 0;
  223|   144k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 144k, False: 66]
  ------------------
  224|  4.53M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 4.38M, False: 144k]
  ------------------
  225|  4.38M|      const AttributeTypeT value =
  226|  4.38M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  4.38M|      att_val[c] = value;
  228|  4.38M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   144k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   144k|    out_byte_pos += entry_size;
  232|   144k|  }
  233|     66|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIaEEvj:
  215|  2.18k|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|  2.18k|  const int num_components = attribute()->num_components();
  217|  2.18k|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|  2.18k|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|  2.18k|      new AttributeTypeT[num_components]);
  220|  2.18k|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|  2.18k|  int val_id = 0;
  222|  2.18k|  int out_byte_pos = 0;
  223|   208k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 206k, False: 2.18k]
  ------------------
  224|  8.40M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 8.19M, False: 206k]
  ------------------
  225|  8.19M|      const AttributeTypeT value =
  226|  8.19M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  8.19M|      att_val[c] = value;
  228|  8.19M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   206k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   206k|    out_byte_pos += entry_size;
  232|   206k|  }
  233|  2.18k|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesItEEvj:
  215|     24|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     24|  const int num_components = attribute()->num_components();
  217|     24|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     24|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     24|      new AttributeTypeT[num_components]);
  220|     24|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     24|  int val_id = 0;
  222|     24|  int out_byte_pos = 0;
  223|  93.5k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 93.4k, False: 24]
  ------------------
  224|  8.48M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 8.39M, False: 93.4k]
  ------------------
  225|  8.39M|      const AttributeTypeT value =
  226|  8.39M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  8.39M|      att_val[c] = value;
  228|  8.39M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|  93.4k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|  93.4k|    out_byte_pos += entry_size;
  232|  93.4k|  }
  233|     24|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIsEEvj:
  215|     85|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     85|  const int num_components = attribute()->num_components();
  217|     85|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     85|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     85|      new AttributeTypeT[num_components]);
  220|     85|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     85|  int val_id = 0;
  222|     85|  int out_byte_pos = 0;
  223|   117k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 117k, False: 85]
  ------------------
  224|  6.04M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 5.92M, False: 117k]
  ------------------
  225|  5.92M|      const AttributeTypeT value =
  226|  5.92M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  5.92M|      att_val[c] = value;
  228|  5.92M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   117k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   117k|    out_byte_pos += entry_size;
  232|   117k|  }
  233|     85|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIjEEvj:
  215|     39|void SequentialIntegerAttributeDecoder::StoreTypedValues(uint32_t num_values) {
  216|     39|  const int num_components = attribute()->num_components();
  217|     39|  const int entry_size = sizeof(AttributeTypeT) * num_components;
  218|     39|  const std::unique_ptr<AttributeTypeT[]> att_val(
  219|     39|      new AttributeTypeT[num_components]);
  220|     39|  const int32_t *const portable_attribute_data = GetPortableAttributeData();
  221|     39|  int val_id = 0;
  222|     39|  int out_byte_pos = 0;
  223|   257k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 257k, False: 39]
  ------------------
  224|  44.0M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 43.7M, False: 257k]
  ------------------
  225|  43.7M|      const AttributeTypeT value =
  226|  43.7M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  43.7M|      att_val[c] = value;
  228|  43.7M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   257k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   257k|    out_byte_pos += entry_size;
  232|   257k|  }
  233|     39|}
_ZN5draco33SequentialIntegerAttributeDecoder16StoreTypedValuesIiEEvj:
  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|   116k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (223:24): [True: 116k, False: 74]
  ------------------
  224|  9.48M|    for (int c = 0; c < num_components; ++c) {
  ------------------
  |  Branch (224:21): [True: 9.36M, False: 116k]
  ------------------
  225|  9.36M|      const AttributeTypeT value =
  226|  9.36M|          static_cast<AttributeTypeT>(portable_attribute_data[val_id++]);
  227|  9.36M|      att_val[c] = value;
  228|  9.36M|    }
  229|       |    // Store the integer value into the attribute buffer.
  230|   116k|    attribute()->buffer()->Write(out_byte_pos, att_val.get(), entry_size);
  231|   116k|    out_byte_pos += entry_size;
  232|   116k|  }
  233|     74|}

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

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

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

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

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

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

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

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

_ZN5draco10AnsDecoderC2Ev:
   56|  14.9k|  AnsDecoder() : buf(nullptr), buf_offset(0), state(0) {}
rans_bit_decoder.cc:_ZN5dracoL13ans_read_initEPNS_10AnsDecoderEPKhi:
  300|  10.3k|                                const uint8_t *const buf, int offset) {
  301|  10.3k|  unsigned x;
  302|  10.3k|  if (offset < 1) {
  ------------------
  |  Branch (302:7): [True: 19, False: 10.3k]
  ------------------
  303|     19|    return 1;
  304|     19|  }
  305|  10.3k|  ans->buf = buf;
  306|  10.3k|  x = buf[offset - 1] >> 6;
  307|  10.3k|  if (x == 0) {
  ------------------
  |  Branch (307:7): [True: 9.06k, False: 1.31k]
  ------------------
  308|  9.06k|    ans->buf_offset = offset - 1;
  309|  9.06k|    ans->state = buf[offset - 1] & 0x3F;
  310|  9.06k|  } else if (x == 1) {
  ------------------
  |  Branch (310:14): [True: 1.13k, False: 172]
  ------------------
  311|  1.13k|    if (offset < 2) {
  ------------------
  |  Branch (311:9): [True: 4, False: 1.13k]
  ------------------
  312|      4|      return 1;
  313|      4|    }
  314|  1.13k|    ans->buf_offset = offset - 2;
  315|  1.13k|    ans->state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  316|  1.13k|  } else if (x == 2) {
  ------------------
  |  Branch (316:14): [True: 167, False: 5]
  ------------------
  317|    167|    if (offset < 3) {
  ------------------
  |  Branch (317:9): [True: 1, False: 166]
  ------------------
  318|      1|      return 1;
  319|      1|    }
  320|    166|    ans->buf_offset = offset - 3;
  321|    166|    ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  322|    166|  } else {
  323|      5|    return 1;
  324|      5|  }
  325|  10.3k|  ans->state += DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  10.3k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  326|  10.3k|  if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   64|  10.3k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
                if (ans->state >= DRACO_ANS_L_BASE * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|  10.3k|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (326:7): [True: 4, False: 10.3k]
  ------------------
  327|      4|    return 1;
  328|      4|  }
  329|  10.3k|  return 0;
  330|  10.3k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|  1.13k|static uint32_t mem_get_le16(const void *vmem) {
   68|  1.13k|  uint32_t val;
   69|  1.13k|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|  1.13k|  val = mem[1] << 8;
   72|  1.13k|  val |= mem[0];
   73|  1.13k|  return val;
   74|  1.13k|}
rans_bit_decoder.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    166|static uint32_t mem_get_le24(const void *vmem) {
   77|    166|  uint32_t val;
   78|    166|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    166|  val = mem[2] << 16;
   81|    166|  val |= mem[1] << 8;
   82|    166|  val |= mem[0];
   83|    166|  return val;
   84|    166|}
rans_bit_decoder.cc:_ZN5dracoL14rabs_desc_readEPNS_10AnsDecoderEh:
  166|  7.99G|static inline int rabs_desc_read(struct AnsDecoder *ans, AnsP8 p0) {
  167|  7.99G|  int val;
  168|       |#if DRACO_ANS_IMPL1
  169|       |  unsigned l_s;
  170|       |#else
  171|  7.99G|  unsigned quot, rem, x, xn;
  172|  7.99G|#endif
  173|  7.99G|  const AnsP8 p = DRACO_ANS_P8_PRECISION - p0;
  ------------------
  |  |   63|  7.99G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  174|  7.99G|  if (ans->state < DRACO_ANS_L_BASE && ans->buf_offset > 0) {
  ------------------
  |  |   64|  15.9G|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  |  Branch (174:7): [True: 7.11G, False: 884M]
  |  Branch (174:40): [True: 169k, False: 7.10G]
  ------------------
  175|   169k|    ans->state = ans->state * DRACO_ANS_IO_BASE + ans->buf[--ans->buf_offset];
  ------------------
  |  |   65|   169k|#define DRACO_ANS_IO_BASE 256
  ------------------
  176|   169k|  }
  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|  7.99G|  x = ans->state;
  184|  7.99G|  quot = x / DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  7.99G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  185|  7.99G|  rem = x % DRACO_ANS_P8_PRECISION;
  ------------------
  |  |   63|  7.99G|#define DRACO_ANS_P8_PRECISION 256u
  ------------------
  186|  7.99G|  xn = quot * p;
  187|  7.99G|  val = rem < p;
  188|  7.99G|  if (UNPREDICTABLE(val)) {
  ------------------
  |  |  165|  15.9G|#define UNPREDICTABLE(x) x
  |  |  ------------------
  |  |  |  Branch (165:26): [True: 7.13G, False: 857M]
  |  |  ------------------
  ------------------
  189|  7.13G|    ans->state = xn + rem;
  190|  7.13G|  } else {
  191|       |    // ans->state = quot * p0 + rem - p;
  192|   857M|    ans->state = x - xn - p;
  193|   857M|  }
  194|  7.99G|#endif
  195|  7.99G|  return val;
  196|  7.99G|}
rans_bit_decoder.cc:_ZN5dracoL12ans_read_endEPNS_10AnsDecoderE:
  332|  22.5k|static inline int ans_read_end(struct AnsDecoder *const ans) {
  333|  22.5k|  return ans->state == DRACO_ANS_L_BASE;
  ------------------
  |  |   64|  22.5k|#define DRACO_ANS_L_BASE (4096u)
  ------------------
  334|  22.5k|}
_ZN5draco11RAnsDecoderILi12EEC2Ev:
  416|  1.68k|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi12EE24rans_build_look_up_tableEPKjj:
  481|    907|                                       uint32_t num_symbols) {
  482|    907|    lut_table_.resize(rans_precision);
  483|    907|    probability_table_.resize(num_symbols);
  484|    907|    uint32_t cum_prob = 0;
  485|    907|    uint32_t act_prob = 0;
  486|  7.20k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 6.37k, False: 827]
  ------------------
  487|  6.37k|      probability_table_[i].prob = token_probs[i];
  488|  6.37k|      probability_table_[i].cum_prob = cum_prob;
  489|  6.37k|      cum_prob += token_probs[i];
  490|  6.37k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 80, False: 6.29k]
  ------------------
  491|     80|        return false;
  492|     80|      }
  493|  2.86M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 2.85M, False: 6.29k]
  ------------------
  494|  2.85M|        lut_table_[j] = i;
  495|  2.85M|      }
  496|  6.29k|      act_prob = cum_prob;
  497|  6.29k|    }
  498|    827|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 156, False: 671]
  ------------------
  499|    156|      return false;
  500|    156|    }
  501|    671|    return true;
  502|    827|  }
_ZN5draco11RAnsDecoderILi12EE9read_initEPKhi:
  421|    631|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    631|    unsigned x;
  423|    631|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 42, False: 589]
  ------------------
  424|     42|      return 1;
  425|     42|    }
  426|    589|    ans_.buf = buf;
  427|    589|    x = buf[offset - 1] >> 6;
  428|    589|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 365, False: 224]
  ------------------
  429|    365|      ans_.buf_offset = offset - 1;
  430|    365|      ans_.state = buf[offset - 1] & 0x3F;
  431|    365|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 98, False: 126]
  ------------------
  432|     98|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 5, False: 93]
  ------------------
  433|      5|        return 1;
  434|      5|      }
  435|     93|      ans_.buf_offset = offset - 2;
  436|     93|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|    126|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 85, False: 41]
  ------------------
  438|     85|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 85]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|     85|      ans_.buf_offset = offset - 3;
  442|     85|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     85|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 41, False: 0]
  ------------------
  444|     41|      ans_.buf_offset = offset - 4;
  445|     41|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     41|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    584|    ans_.state += l_rans_base;
  450|    584|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    584|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 40, False: 544]
  ------------------
  451|     40|      return 1;
  452|     40|    }
  453|    544|    return 0;
  454|    584|  }
symbol_decoding.cc:_ZN5dracoL12mem_get_le16EPKv:
   67|    147|static uint32_t mem_get_le16(const void *vmem) {
   68|    147|  uint32_t val;
   69|    147|  const uint8_t *mem = (const uint8_t *)vmem;
   70|       |
   71|    147|  val = mem[1] << 8;
   72|    147|  val |= mem[0];
   73|    147|  return val;
   74|    147|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le24EPKv:
   76|    134|static uint32_t mem_get_le24(const void *vmem) {
   77|    134|  uint32_t val;
   78|    134|  const uint8_t *mem = (const uint8_t *)vmem;
   79|       |
   80|    134|  val = mem[2] << 16;
   81|    134|  val |= mem[1] << 8;
   82|    134|  val |= mem[0];
   83|    134|  return val;
   84|    134|}
symbol_decoding.cc:_ZN5dracoL12mem_get_le32EPKv:
   86|    144|static inline uint32_t mem_get_le32(const void *vmem) {
   87|    144|  uint32_t val;
   88|    144|  const uint8_t *mem = (const uint8_t *)vmem;
   89|       |
   90|    144|  val = mem[3] << 24;
   91|    144|  val |= mem[2] << 16;
   92|    144|  val |= mem[1] << 8;
   93|    144|  val |= mem[0];
   94|    144|  return val;
   95|    144|}
_ZN5draco11RAnsDecoderILi12EE9rans_readEv:
  462|  38.3M|  inline int rans_read() {
  463|  38.3M|    unsigned rem;
  464|  38.3M|    unsigned quo;
  465|  38.3M|    struct rans_dec_sym sym;
  466|  38.3M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 28.5M, False: 9.80M]
  |  Branch (466:40): [True: 28.7k, False: 28.5M]
  ------------------
  467|  28.7k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  28.7k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  28.7k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  38.3M|    quo = ans_.state / rans_precision;
  472|  38.3M|    rem = ans_.state % rans_precision;
  473|  38.3M|    fetch_sym(&sym, rem);
  474|  38.3M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  38.3M|    return sym.val;
  476|  38.3M|  }
_ZN5draco11RAnsDecoderILi12EE9fetch_symEPNS_12rans_dec_symEj:
  505|  38.3M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  38.3M|    uint32_t symbol = lut_table_[rem];
  507|  38.3M|    out->val = symbol;
  508|  38.3M|    out->prob = probability_table_[symbol].prob;
  509|  38.3M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  38.3M|  }
_ZN5draco11RAnsDecoderILi12EE8read_endEv:
  456|    502|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi13EEC2Ev:
  416|    118|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi13EE24rans_build_look_up_tableEPKjj:
  481|     65|                                       uint32_t num_symbols) {
  482|     65|    lut_table_.resize(rans_precision);
  483|     65|    probability_table_.resize(num_symbols);
  484|     65|    uint32_t cum_prob = 0;
  485|     65|    uint32_t act_prob = 0;
  486|  1.33k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 1.27k, False: 58]
  ------------------
  487|  1.27k|      probability_table_[i].prob = token_probs[i];
  488|  1.27k|      probability_table_[i].cum_prob = cum_prob;
  489|  1.27k|      cum_prob += token_probs[i];
  490|  1.27k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 7, False: 1.26k]
  ------------------
  491|      7|        return false;
  492|      7|      }
  493|   472k|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 471k, False: 1.26k]
  ------------------
  494|   471k|        lut_table_[j] = i;
  495|   471k|      }
  496|  1.26k|      act_prob = cum_prob;
  497|  1.26k|    }
  498|     58|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 5, False: 53]
  ------------------
  499|      5|      return false;
  500|      5|    }
  501|     53|    return true;
  502|     58|  }
_ZN5draco11RAnsDecoderILi13EE9read_initEPKhi:
  421|     42|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     42|    unsigned x;
  423|     42|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 3, False: 39]
  ------------------
  424|      3|      return 1;
  425|      3|    }
  426|     39|    ans_.buf = buf;
  427|     39|    x = buf[offset - 1] >> 6;
  428|     39|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 30, False: 9]
  ------------------
  429|     30|      ans_.buf_offset = offset - 1;
  430|     30|      ans_.state = buf[offset - 1] & 0x3F;
  431|     30|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 6, False: 3]
  ------------------
  432|      6|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 6]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      6|      ans_.buf_offset = offset - 2;
  436|      6|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|      6|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 2, False: 1]
  ------------------
  438|      2|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 2]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      2|      ans_.buf_offset = offset - 3;
  442|      2|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      2|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 1, False: 0]
  ------------------
  444|      1|      ans_.buf_offset = offset - 4;
  445|      1|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      1|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     39|    ans_.state += l_rans_base;
  450|     39|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     39|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 1, False: 38]
  ------------------
  451|      1|      return 1;
  452|      1|    }
  453|     38|    return 0;
  454|     39|  }
_ZN5draco11RAnsDecoderILi13EE9rans_readEv:
  462|  10.5M|  inline int rans_read() {
  463|  10.5M|    unsigned rem;
  464|  10.5M|    unsigned quo;
  465|  10.5M|    struct rans_dec_sym sym;
  466|  10.5M|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 10.5M, False: 6.06k]
  |  Branch (466:40): [True: 1.83k, False: 10.5M]
  ------------------
  467|  1.83k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.83k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.83k|    }
  469|       |    // |rans_precision| is a power of two compile time constant, and the below
  470|       |    // division and modulo are going to be optimized by the compiler.
  471|  10.5M|    quo = ans_.state / rans_precision;
  472|  10.5M|    rem = ans_.state % rans_precision;
  473|  10.5M|    fetch_sym(&sym, rem);
  474|  10.5M|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  10.5M|    return sym.val;
  476|  10.5M|  }
_ZN5draco11RAnsDecoderILi13EE9fetch_symEPNS_12rans_dec_symEj:
  505|  10.5M|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  10.5M|    uint32_t symbol = lut_table_[rem];
  507|  10.5M|    out->val = symbol;
  508|  10.5M|    out->prob = probability_table_[symbol].prob;
  509|  10.5M|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  10.5M|  }
_ZN5draco11RAnsDecoderILi13EE8read_endEv:
  456|     38|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi15EEC2Ev:
  416|     84|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi15EE24rans_build_look_up_tableEPKjj:
  481|     51|                                       uint32_t num_symbols) {
  482|     51|    lut_table_.resize(rans_precision);
  483|     51|    probability_table_.resize(num_symbols);
  484|     51|    uint32_t cum_prob = 0;
  485|     51|    uint32_t act_prob = 0;
  486|  4.87k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 4.83k, False: 45]
  ------------------
  487|  4.83k|      probability_table_[i].prob = token_probs[i];
  488|  4.83k|      probability_table_[i].cum_prob = cum_prob;
  489|  4.83k|      cum_prob += token_probs[i];
  490|  4.83k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 6, False: 4.82k]
  ------------------
  491|      6|        return false;
  492|      6|      }
  493|  1.32M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 1.32M, False: 4.82k]
  ------------------
  494|  1.32M|        lut_table_[j] = i;
  495|  1.32M|      }
  496|  4.82k|      act_prob = cum_prob;
  497|  4.82k|    }
  498|     45|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 9, False: 36]
  ------------------
  499|      9|      return false;
  500|      9|    }
  501|     36|    return true;
  502|     45|  }
_ZN5draco11RAnsDecoderILi15EE9read_initEPKhi:
  421|     19|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     19|    unsigned x;
  423|     19|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 19]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     19|    ans_.buf = buf;
  427|     19|    x = buf[offset - 1] >> 6;
  428|     19|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 6, False: 13]
  ------------------
  429|      6|      ans_.buf_offset = offset - 1;
  430|      6|      ans_.state = buf[offset - 1] & 0x3F;
  431|     13|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 3, False: 10]
  ------------------
  432|      3|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 3]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      3|      ans_.buf_offset = offset - 2;
  436|      3|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     10|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 5, False: 5]
  ------------------
  438|      5|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 5]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      5|      ans_.buf_offset = offset - 3;
  442|      5|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      5|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 5, False: 0]
  ------------------
  444|      5|      ans_.buf_offset = offset - 4;
  445|      5|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      5|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     19|    ans_.state += l_rans_base;
  450|     19|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     19|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 5, False: 14]
  ------------------
  451|      5|      return 1;
  452|      5|    }
  453|     14|    return 0;
  454|     19|  }
_ZN5draco11RAnsDecoderILi15EE9rans_readEv:
  462|   162k|  inline int rans_read() {
  463|   162k|    unsigned rem;
  464|   162k|    unsigned quo;
  465|   162k|    struct rans_dec_sym sym;
  466|   163k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 35.4k, False: 127k]
  |  Branch (466:40): [True: 679, False: 34.7k]
  ------------------
  467|    679|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    679|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    679|    }
  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|   162k|    quo = ans_.state / rans_precision;
  472|   162k|    rem = ans_.state % rans_precision;
  473|   162k|    fetch_sym(&sym, rem);
  474|   162k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   162k|    return sym.val;
  476|   162k|  }
_ZN5draco11RAnsDecoderILi15EE9fetch_symEPNS_12rans_dec_symEj:
  505|   162k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   162k|    uint32_t symbol = lut_table_[rem];
  507|   162k|    out->val = symbol;
  508|   162k|    out->prob = probability_table_[symbol].prob;
  509|   162k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   162k|  }
_ZN5draco11RAnsDecoderILi15EE8read_endEv:
  456|     14|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi16EEC2Ev:
  416|    120|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi16EE24rans_build_look_up_tableEPKjj:
  481|     74|                                       uint32_t num_symbols) {
  482|     74|    lut_table_.resize(rans_precision);
  483|     74|    probability_table_.resize(num_symbols);
  484|     74|    uint32_t cum_prob = 0;
  485|     74|    uint32_t act_prob = 0;
  486|  1.59k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 1.53k, False: 68]
  ------------------
  487|  1.53k|      probability_table_[i].prob = token_probs[i];
  488|  1.53k|      probability_table_[i].cum_prob = cum_prob;
  489|  1.53k|      cum_prob += token_probs[i];
  490|  1.53k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 6, False: 1.52k]
  ------------------
  491|      6|        return false;
  492|      6|      }
  493|  4.29M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 4.29M, False: 1.52k]
  ------------------
  494|  4.29M|        lut_table_[j] = i;
  495|  4.29M|      }
  496|  1.52k|      act_prob = cum_prob;
  497|  1.52k|    }
  498|     68|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 8, False: 60]
  ------------------
  499|      8|      return false;
  500|      8|    }
  501|     60|    return true;
  502|     68|  }
_ZN5draco11RAnsDecoderILi16EE9read_initEPKhi:
  421|     37|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     37|    unsigned x;
  423|     37|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 6, False: 31]
  ------------------
  424|      6|      return 1;
  425|      6|    }
  426|     31|    ans_.buf = buf;
  427|     31|    x = buf[offset - 1] >> 6;
  428|     31|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 7, False: 24]
  ------------------
  429|      7|      ans_.buf_offset = offset - 1;
  430|      7|      ans_.state = buf[offset - 1] & 0x3F;
  431|     24|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 8, False: 16]
  ------------------
  432|      8|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 8]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      8|      ans_.buf_offset = offset - 2;
  436|      8|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     16|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 11, False: 5]
  ------------------
  438|     11|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 11]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|     11|      ans_.buf_offset = offset - 3;
  442|     11|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     11|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 5, False: 0]
  ------------------
  444|      5|      ans_.buf_offset = offset - 4;
  445|      5|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      5|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     31|    ans_.state += l_rans_base;
  450|     31|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     31|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 1, False: 30]
  ------------------
  451|      1|      return 1;
  452|      1|    }
  453|     30|    return 0;
  454|     31|  }
_ZN5draco11RAnsDecoderILi16EE9rans_readEv:
  462|   154k|  inline int rans_read() {
  463|   154k|    unsigned rem;
  464|   154k|    unsigned quo;
  465|   154k|    struct rans_dec_sym sym;
  466|   155k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 40.6k, False: 115k]
  |  Branch (466:40): [True: 1.16k, False: 39.4k]
  ------------------
  467|  1.16k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.16k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.16k|    }
  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|   154k|    quo = ans_.state / rans_precision;
  472|   154k|    rem = ans_.state % rans_precision;
  473|   154k|    fetch_sym(&sym, rem);
  474|   154k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   154k|    return sym.val;
  476|   154k|  }
_ZN5draco11RAnsDecoderILi16EE9fetch_symEPNS_12rans_dec_symEj:
  505|   154k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   154k|    uint32_t symbol = lut_table_[rem];
  507|   154k|    out->val = symbol;
  508|   154k|    out->prob = probability_table_[symbol].prob;
  509|   154k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   154k|  }
_ZN5draco11RAnsDecoderILi16EE8read_endEv:
  456|     30|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi18EEC2Ev:
  416|    129|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi18EE24rans_build_look_up_tableEPKjj:
  481|     81|                                       uint32_t num_symbols) {
  482|     81|    lut_table_.resize(rans_precision);
  483|     81|    probability_table_.resize(num_symbols);
  484|     81|    uint32_t cum_prob = 0;
  485|     81|    uint32_t act_prob = 0;
  486|  2.22k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 2.15k, False: 73]
  ------------------
  487|  2.15k|      probability_table_[i].prob = token_probs[i];
  488|  2.15k|      probability_table_[i].cum_prob = cum_prob;
  489|  2.15k|      cum_prob += token_probs[i];
  490|  2.15k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 8, False: 2.14k]
  ------------------
  491|      8|        return false;
  492|      8|      }
  493|  18.4M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 18.4M, False: 2.14k]
  ------------------
  494|  18.4M|        lut_table_[j] = i;
  495|  18.4M|      }
  496|  2.14k|      act_prob = cum_prob;
  497|  2.14k|    }
  498|     73|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 10, False: 63]
  ------------------
  499|     10|      return false;
  500|     10|    }
  501|     63|    return true;
  502|     73|  }
_ZN5draco11RAnsDecoderILi18EE9read_initEPKhi:
  421|     26|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     26|    unsigned x;
  423|     26|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 26]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     26|    ans_.buf = buf;
  427|     26|    x = buf[offset - 1] >> 6;
  428|     26|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 11, False: 15]
  ------------------
  429|     11|      ans_.buf_offset = offset - 1;
  430|     11|      ans_.state = buf[offset - 1] & 0x3F;
  431|     15|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 2, False: 13]
  ------------------
  432|      2|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 2]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      2|      ans_.buf_offset = offset - 2;
  436|      2|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     13|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 8, False: 5]
  ------------------
  438|      8|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 8]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      8|      ans_.buf_offset = offset - 3;
  442|      8|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|      8|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 5, False: 0]
  ------------------
  444|      5|      ans_.buf_offset = offset - 4;
  445|      5|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|      5|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     26|    ans_.state += l_rans_base;
  450|     26|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     26|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 5, False: 21]
  ------------------
  451|      5|      return 1;
  452|      5|    }
  453|     21|    return 0;
  454|     26|  }
_ZN5draco11RAnsDecoderILi18EE9rans_readEv:
  462|  48.9k|  inline int rans_read() {
  463|  48.9k|    unsigned rem;
  464|  48.9k|    unsigned quo;
  465|  48.9k|    struct rans_dec_sym sym;
  466|  49.6k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 41.4k, False: 8.21k]
  |  Branch (466:40): [True: 693, False: 40.7k]
  ------------------
  467|    693|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|    693|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|    693|    }
  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|  48.9k|    quo = ans_.state / rans_precision;
  472|  48.9k|    rem = ans_.state % rans_precision;
  473|  48.9k|    fetch_sym(&sym, rem);
  474|  48.9k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  48.9k|    return sym.val;
  476|  48.9k|  }
_ZN5draco11RAnsDecoderILi18EE9fetch_symEPNS_12rans_dec_symEj:
  505|  48.9k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  48.9k|    uint32_t symbol = lut_table_[rem];
  507|  48.9k|    out->val = symbol;
  508|  48.9k|    out->prob = probability_table_[symbol].prob;
  509|  48.9k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  48.9k|  }
_ZN5draco11RAnsDecoderILi18EE8read_endEv:
  456|     21|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi19EEC2Ev:
  416|    142|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi19EE24rans_build_look_up_tableEPKjj:
  481|     87|                                       uint32_t num_symbols) {
  482|     87|    lut_table_.resize(rans_precision);
  483|     87|    probability_table_.resize(num_symbols);
  484|     87|    uint32_t cum_prob = 0;
  485|     87|    uint32_t act_prob = 0;
  486|  2.17k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 2.08k, False: 84]
  ------------------
  487|  2.08k|      probability_table_[i].prob = token_probs[i];
  488|  2.08k|      probability_table_[i].cum_prob = cum_prob;
  489|  2.08k|      cum_prob += token_probs[i];
  490|  2.08k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 3, False: 2.08k]
  ------------------
  491|      3|        return false;
  492|      3|      }
  493|  42.2M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 42.2M, False: 2.08k]
  ------------------
  494|  42.2M|        lut_table_[j] = i;
  495|  42.2M|      }
  496|  2.08k|      act_prob = cum_prob;
  497|  2.08k|    }
  498|     84|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 7, False: 77]
  ------------------
  499|      7|      return false;
  500|      7|    }
  501|     77|    return true;
  502|     84|  }
_ZN5draco11RAnsDecoderILi19EE9read_initEPKhi:
  421|     40|  inline int read_init(const uint8_t *const buf, int offset) {
  422|     40|    unsigned x;
  423|     40|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 0, False: 40]
  ------------------
  424|      0|      return 1;
  425|      0|    }
  426|     40|    ans_.buf = buf;
  427|     40|    x = buf[offset - 1] >> 6;
  428|     40|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 7, False: 33]
  ------------------
  429|      7|      ans_.buf_offset = offset - 1;
  430|      7|      ans_.state = buf[offset - 1] & 0x3F;
  431|     33|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 0, False: 33]
  ------------------
  432|      0|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 0]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|      0|      ans_.buf_offset = offset - 2;
  436|      0|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     33|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 2, False: 31]
  ------------------
  438|      2|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 0, False: 2]
  ------------------
  439|      0|        return 1;
  440|      0|      }
  441|      2|      ans_.buf_offset = offset - 3;
  442|      2|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     31|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 31, False: 0]
  ------------------
  444|     31|      ans_.buf_offset = offset - 4;
  445|     31|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     31|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|     40|    ans_.state += l_rans_base;
  450|     40|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|     40|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 8, False: 32]
  ------------------
  451|      8|      return 1;
  452|      8|    }
  453|     32|    return 0;
  454|     40|  }
_ZN5draco11RAnsDecoderILi19EE9rans_readEv:
  462|  91.9k|  inline int rans_read() {
  463|  91.9k|    unsigned rem;
  464|  91.9k|    unsigned quo;
  465|  91.9k|    struct rans_dec_sym sym;
  466|  93.3k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 72.2k, False: 21.0k]
  |  Branch (466:40): [True: 1.34k, False: 70.8k]
  ------------------
  467|  1.34k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  1.34k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  1.34k|    }
  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|  91.9k|    quo = ans_.state / rans_precision;
  472|  91.9k|    rem = ans_.state % rans_precision;
  473|  91.9k|    fetch_sym(&sym, rem);
  474|  91.9k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|  91.9k|    return sym.val;
  476|  91.9k|  }
_ZN5draco11RAnsDecoderILi19EE9fetch_symEPNS_12rans_dec_symEj:
  505|  91.9k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|  91.9k|    uint32_t symbol = lut_table_[rem];
  507|  91.9k|    out->val = symbol;
  508|  91.9k|    out->prob = probability_table_[symbol].prob;
  509|  91.9k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|  91.9k|  }
_ZN5draco11RAnsDecoderILi19EE8read_endEv:
  456|     32|  inline int read_end() { return ans_.state == l_rans_base; }
_ZN5draco11RAnsDecoderILi20EEC2Ev:
  416|    601|  RAnsDecoder() {}
_ZN5draco11RAnsDecoderILi20EE24rans_build_look_up_tableEPKjj:
  481|    375|                                       uint32_t num_symbols) {
  482|    375|    lut_table_.resize(rans_precision);
  483|    375|    probability_table_.resize(num_symbols);
  484|    375|    uint32_t cum_prob = 0;
  485|    375|    uint32_t act_prob = 0;
  486|  12.6k|    for (uint32_t i = 0; i < num_symbols; ++i) {
  ------------------
  |  Branch (486:26): [True: 12.2k, False: 354]
  ------------------
  487|  12.2k|      probability_table_[i].prob = token_probs[i];
  488|  12.2k|      probability_table_[i].cum_prob = cum_prob;
  489|  12.2k|      cum_prob += token_probs[i];
  490|  12.2k|      if (cum_prob > rans_precision) {
  ------------------
  |  Branch (490:11): [True: 21, False: 12.2k]
  ------------------
  491|     21|        return false;
  492|     21|      }
  493|   356M|      for (uint32_t j = act_prob; j < cum_prob; ++j) {
  ------------------
  |  Branch (493:35): [True: 356M, False: 12.2k]
  ------------------
  494|   356M|        lut_table_[j] = i;
  495|   356M|      }
  496|  12.2k|      act_prob = cum_prob;
  497|  12.2k|    }
  498|    354|    if (cum_prob != rans_precision) {
  ------------------
  |  Branch (498:9): [True: 24, False: 330]
  ------------------
  499|     24|      return false;
  500|     24|    }
  501|    330|    return true;
  502|    354|  }
_ZN5draco11RAnsDecoderILi20EE9read_initEPKhi:
  421|    155|  inline int read_init(const uint8_t *const buf, int offset) {
  422|    155|    unsigned x;
  423|    155|    if (offset < 1) {
  ------------------
  |  Branch (423:9): [True: 2, False: 153]
  ------------------
  424|      2|      return 1;
  425|      2|    }
  426|    153|    ans_.buf = buf;
  427|    153|    x = buf[offset - 1] >> 6;
  428|    153|    if (x == 0) {
  ------------------
  |  Branch (428:9): [True: 34, False: 119]
  ------------------
  429|     34|      ans_.buf_offset = offset - 1;
  430|     34|      ans_.state = buf[offset - 1] & 0x3F;
  431|    119|    } else if (x == 1) {
  ------------------
  |  Branch (431:16): [True: 35, False: 84]
  ------------------
  432|     35|      if (offset < 2) {
  ------------------
  |  Branch (432:11): [True: 0, False: 35]
  ------------------
  433|      0|        return 1;
  434|      0|      }
  435|     35|      ans_.buf_offset = offset - 2;
  436|     35|      ans_.state = mem_get_le16(buf + offset - 2) & 0x3FFF;
  437|     84|    } else if (x == 2) {
  ------------------
  |  Branch (437:16): [True: 28, False: 56]
  ------------------
  438|     28|      if (offset < 3) {
  ------------------
  |  Branch (438:11): [True: 7, False: 21]
  ------------------
  439|      7|        return 1;
  440|      7|      }
  441|     21|      ans_.buf_offset = offset - 3;
  442|     21|      ans_.state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
  443|     56|    } else if (x == 3) {
  ------------------
  |  Branch (443:16): [True: 56, False: 0]
  ------------------
  444|     56|      ans_.buf_offset = offset - 4;
  445|     56|      ans_.state = mem_get_le32(buf + offset - 4) & 0x3FFFFFFF;
  446|     56|    } else {
  447|      0|      return 1;
  448|      0|    }
  449|    146|    ans_.state += l_rans_base;
  450|    146|    if (ans_.state >= l_rans_base * DRACO_ANS_IO_BASE) {
  ------------------
  |  |   65|    146|#define DRACO_ANS_IO_BASE 256
  ------------------
  |  Branch (450:9): [True: 21, False: 125]
  ------------------
  451|     21|      return 1;
  452|     21|    }
  453|    125|    return 0;
  454|    146|  }
_ZN5draco11RAnsDecoderILi20EE9rans_readEv:
  462|   462k|  inline int rans_read() {
  463|   462k|    unsigned rem;
  464|   462k|    unsigned quo;
  465|   462k|    struct rans_dec_sym sym;
  466|   465k|    while (ans_.state < l_rans_base && ans_.buf_offset > 0) {
  ------------------
  |  Branch (466:12): [True: 343k, False: 122k]
  |  Branch (466:40): [True: 3.29k, False: 339k]
  ------------------
  467|  3.29k|      ans_.state = ans_.state * DRACO_ANS_IO_BASE + ans_.buf[--ans_.buf_offset];
  ------------------
  |  |   65|  3.29k|#define DRACO_ANS_IO_BASE 256
  ------------------
  468|  3.29k|    }
  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|   462k|    quo = ans_.state / rans_precision;
  472|   462k|    rem = ans_.state % rans_precision;
  473|   462k|    fetch_sym(&sym, rem);
  474|   462k|    ans_.state = quo * sym.prob + rem - sym.cum_prob;
  475|   462k|    return sym.val;
  476|   462k|  }
_ZN5draco11RAnsDecoderILi20EE9fetch_symEPNS_12rans_dec_symEj:
  505|   462k|  inline void fetch_sym(struct rans_dec_sym *out, uint32_t rem) {
  506|   462k|    uint32_t symbol = lut_table_[rem];
  507|   462k|    out->val = symbol;
  508|   462k|    out->prob = probability_table_[symbol].prob;
  509|   462k|    out->cum_prob = probability_table_[symbol].cum_prob;
  510|   462k|  }
_ZN5draco11RAnsDecoderILi20EE8read_endEv:
  456|    125|  inline int read_end() { return ans_.state == l_rans_base; }

_ZN5draco17RAnsSymbolDecoderILi5EEC2Ev:
   33|    547|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi5EE6CreateEPNS_13DecoderBufferE:
   59|    547|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    547|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 547]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    547|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    547|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    547|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 47, False: 500]
  ------------------
   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|    500|#endif
   73|    500|  {
   74|    500|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 7, False: 493]
  ------------------
   75|      7|      return false;
   76|      7|    }
   77|    500|  }
   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|    539|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 40, False: 499]
  ------------------
   83|     40|    return false;
   84|     40|  }
   85|    499|  probability_table_.resize(num_symbols_);
   86|    499|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 117, False: 382]
  ------------------
   87|    117|    return true;
   88|    117|  }
   89|       |  // Decode the table.
   90|  72.2k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 72.0k, False: 216]
  ------------------
   91|  72.0k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  72.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 18, False: 72.0k]
  ------------------
   95|     18|      return false;
   96|     18|    }
   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|  72.0k|    const int token = prob_data & 3;
  102|  72.0k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 15.6k, False: 56.3k]
  ------------------
  103|  15.6k|      const uint32_t offset = prob_data >> 2;
  104|  15.6k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 138, False: 15.5k]
  ------------------
  105|    138|        return false;
  106|    138|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   521k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 505k, False: 15.5k]
  ------------------
  109|   505k|        probability_table_[i + j] = 0;
  110|   505k|      }
  111|  15.5k|      i += offset;
  112|  56.3k|    } else {
  113|  56.3k|      const int extra_bytes = token;
  114|  56.3k|      uint32_t prob = prob_data >> 2;
  115|  90.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 33.9k, False: 56.3k]
  ------------------
  116|  33.9k|        uint8_t eb;
  117|  33.9k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 33.9k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  33.9k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  33.9k|      }
  124|  56.3k|      probability_table_[i] = prob;
  125|  56.3k|    }
  126|  72.0k|  }
  127|    216|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 73, False: 143]
  ------------------
  128|     73|    return false;
  129|     73|  }
  130|    143|  return true;
  131|    216|}
_ZN5draco17RAnsSymbolDecoderILi5EE13StartDecodingEPNS_13DecoderBufferE:
  135|    232|    DecoderBuffer *buffer) {
  136|    232|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    232|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    232|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    232|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 16, False: 216]
  ------------------
  140|     16|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 16]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     16|  } else
  145|    216|#endif
  146|    216|  {
  147|    216|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 216]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    216|  }
  151|    232|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 23, False: 209]
  ------------------
  152|     23|    return false;
  153|     23|  }
  154|    209|  const uint8_t *const data_head =
  155|    209|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|    209|  buffer->Advance(bytes_encoded);
  158|    209|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 45, False: 164]
  ------------------
  159|     45|    return false;
  160|     45|  }
  161|    164|  return true;
  162|    209|}
_ZNK5draco17RAnsSymbolDecoderILi5EE11num_symbolsEv:
   38|    192|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi5EE12DecodeSymbolEv:
   43|  12.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi5EE11EndDecodingEv:
  165|    122|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|    122|  ans_.read_end();
  167|    122|}
_ZN5draco17RAnsSymbolDecoderILi1EEC2Ev:
   33|    318|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi1EE6CreateEPNS_13DecoderBufferE:
   59|    318|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    318|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 318]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    318|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    318|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    318|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 34, False: 284]
  ------------------
   67|     34|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 33]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     34|  } else
   72|    284|#endif
   73|    284|  {
   74|    284|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 283]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    284|  }
   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: 27, False: 289]
  ------------------
   83|     27|    return false;
   84|     27|  }
   85|    289|  probability_table_.resize(num_symbols_);
   86|    289|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 19, False: 270]
  ------------------
   87|     19|    return true;
   88|     19|  }
   89|       |  // Decode the table.
   90|  1.01M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.01M, False: 190]
  ------------------
   91|  1.01M|    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.01M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 25, False: 1.01M]
  ------------------
   95|     25|      return false;
   96|     25|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.01M|    const int token = prob_data & 3;
  102|  1.01M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 563k, False: 449k]
  ------------------
  103|   563k|      const uint32_t offset = prob_data >> 2;
  104|   563k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 42, False: 563k]
  ------------------
  105|     42|        return false;
  106|     42|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  28.7M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 28.2M, False: 563k]
  ------------------
  109|  28.2M|        probability_table_[i + j] = 0;
  110|  28.2M|      }
  111|   563k|      i += offset;
  112|   563k|    } else {
  113|   449k|      const int extra_bytes = token;
  114|   449k|      uint32_t prob = prob_data >> 2;
  115|   784k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 335k, False: 449k]
  ------------------
  116|   335k|        uint8_t eb;
  117|   335k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 13, False: 335k]
  ------------------
  118|     13|          return false;
  119|     13|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   335k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   335k|      }
  124|   449k|      probability_table_[i] = prob;
  125|   449k|    }
  126|  1.01M|  }
  127|    190|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 117, False: 73]
  ------------------
  128|    117|    return false;
  129|    117|  }
  130|     73|  return true;
  131|    190|}
_ZNK5draco17RAnsSymbolDecoderILi1EE11num_symbolsEv:
   38|     92|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi1EE13StartDecodingEPNS_13DecoderBufferE:
  135|     73|    DecoderBuffer *buffer) {
  136|     73|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     73|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     73|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     73|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 1, False: 72]
  ------------------
  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|     72|#endif
  146|     72|  {
  147|     72|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 72]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     72|  }
  151|     73|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 7, False: 66]
  ------------------
  152|      7|    return false;
  153|      7|  }
  154|     66|  const uint8_t *const data_head =
  155|     66|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     66|  buffer->Advance(bytes_encoded);
  158|     66|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 9, False: 57]
  ------------------
  159|      9|    return false;
  160|      9|  }
  161|     57|  return true;
  162|     66|}
_ZN5draco17RAnsSymbolDecoderILi1EE12DecodeSymbolEv:
   43|  5.14M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi1EE11EndDecodingEv:
  165|     57|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     57|  ans_.read_end();
  167|     57|}
_ZN5draco17RAnsSymbolDecoderILi2EEC2Ev:
   33|    198|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi2EE6CreateEPNS_13DecoderBufferE:
   59|    198|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    198|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 198]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    198|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    198|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    198|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 32, False: 166]
  ------------------
   67|     32|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 32]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     32|  } else
   72|    166|#endif
   73|    166|  {
   74|    166|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 166]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    166|  }
   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|    198|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 186]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    186|  probability_table_.resize(num_symbols_);
   86|    186|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 4, False: 182]
  ------------------
   87|      4|    return true;
   88|      4|  }
   89|       |  // Decode the table.
   90|   560k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 560k, False: 131]
  ------------------
   91|   560k|    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|   560k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 16, False: 560k]
  ------------------
   95|     16|      return false;
   96|     16|    }
   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|   560k|    const int token = prob_data & 3;
  102|   560k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 130k, False: 429k]
  ------------------
  103|   130k|      const uint32_t offset = prob_data >> 2;
  104|   130k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 15, False: 130k]
  ------------------
  105|     15|        return false;
  106|     15|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  5.13M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 5.00M, False: 130k]
  ------------------
  109|  5.00M|        probability_table_[i + j] = 0;
  110|  5.00M|      }
  111|   130k|      i += offset;
  112|   429k|    } else {
  113|   429k|      const int extra_bytes = token;
  114|   429k|      uint32_t prob = prob_data >> 2;
  115|   838k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 408k, False: 429k]
  ------------------
  116|   408k|        uint8_t eb;
  117|   408k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 20, False: 408k]
  ------------------
  118|     20|          return false;
  119|     20|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   408k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   408k|      }
  124|   429k|      probability_table_[i] = prob;
  125|   429k|    }
  126|   560k|  }
  127|    131|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 16, False: 115]
  ------------------
  128|     16|    return false;
  129|     16|  }
  130|    115|  return true;
  131|    131|}
_ZNK5draco17RAnsSymbolDecoderILi2EE11num_symbolsEv:
   38|    119|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi2EE13StartDecodingEPNS_13DecoderBufferE:
  135|    115|    DecoderBuffer *buffer) {
  136|    115|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|    115|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|    115|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    115|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 7, False: 108]
  ------------------
  140|      7|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 7]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      7|  } else
  145|    108|#endif
  146|    108|  {
  147|    108|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 108]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|    108|  }
  151|    115|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 19, False: 96]
  ------------------
  152|     19|    return false;
  153|     19|  }
  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: 9, False: 87]
  ------------------
  159|      9|    return false;
  160|      9|  }
  161|     87|  return true;
  162|     96|}
_ZN5draco17RAnsSymbolDecoderILi2EE12DecodeSymbolEv:
   43|  2.47M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi2EE11EndDecodingEv:
  165|     87|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     87|  ans_.read_end();
  167|     87|}
_ZN5draco17RAnsSymbolDecoderILi3EEC2Ev:
   33|    148|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi3EE6CreateEPNS_13DecoderBufferE:
   59|    148|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    148|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 148]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    148|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    148|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    148|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 31, False: 117]
  ------------------
   67|     31|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 31]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     31|  } else
   72|    117|#endif
   73|    117|  {
   74|    117|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 116]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    117|  }
   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|    147|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 147]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|    147|  probability_table_.resize(num_symbols_);
   86|    147|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 145]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|  32.1k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 32.0k, False: 101]
  ------------------
   91|  32.0k|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  32.0k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 17, False: 31.9k]
  ------------------
   95|     17|      return false;
   96|     17|    }
   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.9k|    const int token = prob_data & 3;
  102|  31.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 6.92k, False: 25.0k]
  ------------------
  103|  6.92k|      const uint32_t offset = prob_data >> 2;
  104|  6.92k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 21, False: 6.90k]
  ------------------
  105|     21|        return false;
  106|     21|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   237k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 231k, False: 6.90k]
  ------------------
  109|   231k|        probability_table_[i + j] = 0;
  110|   231k|      }
  111|  6.90k|      i += offset;
  112|  25.0k|    } else {
  113|  25.0k|      const int extra_bytes = token;
  114|  25.0k|      uint32_t prob = prob_data >> 2;
  115|  48.1k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 23.0k, False: 25.0k]
  ------------------
  116|  23.0k|        uint8_t eb;
  117|  23.0k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 6, False: 23.0k]
  ------------------
  118|      6|          return false;
  119|      6|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  23.0k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  23.0k|      }
  124|  25.0k|      probability_table_[i] = prob;
  125|  25.0k|    }
  126|  31.9k|  }
  127|    101|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 9, False: 92]
  ------------------
  128|      9|    return false;
  129|      9|  }
  130|     92|  return true;
  131|    101|}
_ZNK5draco17RAnsSymbolDecoderILi3EE11num_symbolsEv:
   38|     94|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi3EE13StartDecodingEPNS_13DecoderBufferE:
  135|     92|    DecoderBuffer *buffer) {
  136|     92|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     92|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     92|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     92|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 29, False: 63]
  ------------------
  140|     29|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 29]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     29|  } else
  145|     63|#endif
  146|     63|  {
  147|     63|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 63]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     63|  }
  151|     92|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 24, False: 68]
  ------------------
  152|     24|    return false;
  153|     24|  }
  154|     68|  const uint8_t *const data_head =
  155|     68|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     68|  buffer->Advance(bytes_encoded);
  158|     68|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 5, False: 63]
  ------------------
  159|      5|    return false;
  160|      5|  }
  161|     63|  return true;
  162|     68|}
_ZN5draco17RAnsSymbolDecoderILi3EE12DecodeSymbolEv:
   43|   431k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi3EE11EndDecodingEv:
  165|     63|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     63|  ans_.read_end();
  167|     63|}
_ZN5draco17RAnsSymbolDecoderILi4EEC2Ev:
   33|    145|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi4EE6CreateEPNS_13DecoderBufferE:
   59|    145|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    145|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 145]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    145|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    145|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    145|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 9, False: 136]
  ------------------
   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|    136|#endif
   73|    136|  {
   74|    136|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 135]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|    136|  }
   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|    144|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 5, False: 139]
  ------------------
   83|      5|    return false;
   84|      5|  }
   85|    139|  probability_table_.resize(num_symbols_);
   86|    139|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 3, False: 136]
  ------------------
   87|      3|    return true;
   88|      3|  }
   89|       |  // Decode the table.
   90|   533k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 533k, False: 99]
  ------------------
   91|   533k|    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|   533k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 14, False: 533k]
  ------------------
   95|     14|      return false;
   96|     14|    }
   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|   533k|    const int token = prob_data & 3;
  102|   533k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 468k, False: 64.8k]
  ------------------
  103|   468k|      const uint32_t offset = prob_data >> 2;
  104|   468k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 19, False: 468k]
  ------------------
  105|     19|        return false;
  106|     19|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  26.7M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 26.2M, False: 468k]
  ------------------
  109|  26.2M|        probability_table_[i + j] = 0;
  110|  26.2M|      }
  111|   468k|      i += offset;
  112|   468k|    } else {
  113|  64.8k|      const int extra_bytes = token;
  114|  64.8k|      uint32_t prob = prob_data >> 2;
  115|   107k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 42.7k, False: 64.8k]
  ------------------
  116|  42.7k|        uint8_t eb;
  117|  42.7k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 4, False: 42.7k]
  ------------------
  118|      4|          return false;
  119|      4|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  42.7k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  42.7k|      }
  124|  64.8k|      probability_table_[i] = prob;
  125|  64.8k|    }
  126|   533k|  }
  127|     99|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 2, False: 97]
  ------------------
  128|      2|    return false;
  129|      2|  }
  130|     97|  return true;
  131|     99|}
_ZNK5draco17RAnsSymbolDecoderILi4EE11num_symbolsEv:
   38|    100|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi4EE13StartDecodingEPNS_13DecoderBufferE:
  135|     97|    DecoderBuffer *buffer) {
  136|     97|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     97|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     97|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     97|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 97]
  ------------------
  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|     97|#endif
  146|     97|  {
  147|     97|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 97]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     97|  }
  151|     97|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 3, False: 94]
  ------------------
  152|      3|    return false;
  153|      3|  }
  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: 10, False: 84]
  ------------------
  159|     10|    return false;
  160|     10|  }
  161|     84|  return true;
  162|     94|}
_ZN5draco17RAnsSymbolDecoderILi4EE12DecodeSymbolEv:
   43|  6.86M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi4EE11EndDecodingEv:
  165|     84|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     84|  ans_.read_end();
  167|     84|}
_ZN5draco17RAnsSymbolDecoderILi6EEC2Ev:
   33|    111|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi6EE6CreateEPNS_13DecoderBufferE:
   59|    111|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    111|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 111]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    111|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    111|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    111|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 29, False: 82]
  ------------------
   67|     29|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 29]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     29|  } else
   72|     82|#endif
   73|     82|  {
   74|     82|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 81]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|     82|  }
   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|    110|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 13, False: 97]
  ------------------
   83|     13|    return false;
   84|     13|  }
   85|     97|  probability_table_.resize(num_symbols_);
   86|     97|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 97]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  18.5k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 18.4k, False: 68]
  ------------------
   91|  18.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|  18.4k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 13, False: 18.4k]
  ------------------
   95|     13|      return false;
   96|     13|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  18.4k|    const int token = prob_data & 3;
  102|  18.4k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 10.8k, False: 7.59k]
  ------------------
  103|  10.8k|      const uint32_t offset = prob_data >> 2;
  104|  10.8k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 9, False: 10.8k]
  ------------------
  105|      9|        return false;
  106|      9|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   345k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 334k, False: 10.8k]
  ------------------
  109|   334k|        probability_table_[i + j] = 0;
  110|   334k|      }
  111|  10.8k|      i += offset;
  112|  10.8k|    } else {
  113|  7.59k|      const int extra_bytes = token;
  114|  7.59k|      uint32_t prob = prob_data >> 2;
  115|  13.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 5.77k, False: 7.58k]
  ------------------
  116|  5.77k|        uint8_t eb;
  117|  5.77k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 5.76k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  5.76k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  5.76k|      }
  124|  7.58k|      probability_table_[i] = prob;
  125|  7.58k|    }
  126|  18.4k|  }
  127|     68|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 4, False: 64]
  ------------------
  128|      4|    return false;
  129|      4|  }
  130|     64|  return true;
  131|     68|}
_ZNK5draco17RAnsSymbolDecoderILi6EE11num_symbolsEv:
   38|     64|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi6EE13StartDecodingEPNS_13DecoderBufferE:
  135|     64|    DecoderBuffer *buffer) {
  136|     64|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     64|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     64|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     64|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 12, False: 52]
  ------------------
  140|     12|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 12]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     12|  } else
  145|     52|#endif
  146|     52|  {
  147|     52|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 52]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     52|  }
  151|     64|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 19, False: 45]
  ------------------
  152|     19|    return false;
  153|     19|  }
  154|     45|  const uint8_t *const data_head =
  155|     45|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     45|  buffer->Advance(bytes_encoded);
  158|     45|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 5, False: 40]
  ------------------
  159|      5|    return false;
  160|      5|  }
  161|     40|  return true;
  162|     45|}
_ZN5draco17RAnsSymbolDecoderILi6EE12DecodeSymbolEv:
   43|  4.56M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi6EE11EndDecodingEv:
  165|     40|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     40|  ans_.read_end();
  167|     40|}
_ZN5draco17RAnsSymbolDecoderILi7EEC2Ev:
   33|    111|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi7EE6CreateEPNS_13DecoderBufferE:
   59|    111|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    111|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 111]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    111|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    111|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    111|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 40, False: 71]
  ------------------
   67|     40|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 40]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     40|  } else
   72|     71|#endif
   73|     71|  {
   74|     71|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 71]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     71|  }
   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|    111|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 111]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|    111|  probability_table_.resize(num_symbols_);
   86|    111|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 111]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  2.41M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 2.41M, False: 48]
  ------------------
   91|  2.41M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  2.41M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 33, False: 2.41M]
  ------------------
   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|  2.41M|    const int token = prob_data & 3;
  102|  2.41M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 616k, False: 1.80M]
  ------------------
  103|   616k|      const uint32_t offset = prob_data >> 2;
  104|   616k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 11, False: 616k]
  ------------------
  105|     11|        return false;
  106|     11|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  27.7M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 27.1M, False: 616k]
  ------------------
  109|  27.1M|        probability_table_[i + j] = 0;
  110|  27.1M|      }
  111|   616k|      i += offset;
  112|  1.80M|    } else {
  113|  1.80M|      const int extra_bytes = token;
  114|  1.80M|      uint32_t prob = prob_data >> 2;
  115|  2.87M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.07M, False: 1.80M]
  ------------------
  116|  1.07M|        uint8_t eb;
  117|  1.07M|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 19, False: 1.07M]
  ------------------
  118|     19|          return false;
  119|     19|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.07M|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.07M|      }
  124|  1.80M|      probability_table_[i] = prob;
  125|  1.80M|    }
  126|  2.41M|  }
  127|     48|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 9, False: 39]
  ------------------
  128|      9|    return false;
  129|      9|  }
  130|     39|  return true;
  131|     48|}
_ZNK5draco17RAnsSymbolDecoderILi7EE11num_symbolsEv:
   38|     39|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi7EE13StartDecodingEPNS_13DecoderBufferE:
  135|     39|    DecoderBuffer *buffer) {
  136|     39|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     39|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     39|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     39|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 10, False: 29]
  ------------------
  140|     10|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 10]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     10|  } else
  145|     29|#endif
  146|     29|  {
  147|     29|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 29]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     29|  }
  151|     39|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 12, False: 27]
  ------------------
  152|     12|    return false;
  153|     12|  }
  154|     27|  const uint8_t *const data_head =
  155|     27|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     27|  buffer->Advance(bytes_encoded);
  158|     27|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 26]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|     26|  return true;
  162|     27|}
_ZN5draco17RAnsSymbolDecoderILi7EE12DecodeSymbolEv:
   43|  4.01M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi7EE11EndDecodingEv:
  165|     26|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     26|  ans_.read_end();
  167|     26|}
_ZN5draco17RAnsSymbolDecoderILi8EEC2Ev:
   33|    102|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi8EE6CreateEPNS_13DecoderBufferE:
   59|    102|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    102|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 102]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    102|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    102|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    102|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 39, False: 63]
  ------------------
   67|     39|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 39]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     39|  } else
   72|     63|#endif
   73|     63|  {
   74|     63|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 63]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     63|  }
   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|    102|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 3, False: 99]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|     99|  probability_table_.resize(num_symbols_);
   86|     99|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 99]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  1.05M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.05M, False: 54]
  ------------------
   91|  1.05M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  1.05M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 21, False: 1.05M]
  ------------------
   95|     21|      return false;
   96|     21|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  1.05M|    const int token = prob_data & 3;
  102|  1.05M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 266k, False: 786k]
  ------------------
  103|   266k|      const uint32_t offset = prob_data >> 2;
  104|   266k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 13, False: 266k]
  ------------------
  105|     13|        return false;
  106|     13|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  13.2M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 12.9M, False: 266k]
  ------------------
  109|  12.9M|        probability_table_[i + j] = 0;
  110|  12.9M|      }
  111|   266k|      i += offset;
  112|   786k|    } else {
  113|   786k|      const int extra_bytes = token;
  114|   786k|      uint32_t prob = prob_data >> 2;
  115|  1.19M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 408k, False: 786k]
  ------------------
  116|   408k|        uint8_t eb;
  117|   408k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 11, False: 408k]
  ------------------
  118|     11|          return false;
  119|     11|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   408k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   408k|      }
  124|   786k|      probability_table_[i] = prob;
  125|   786k|    }
  126|  1.05M|  }
  127|     54|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 6, False: 48]
  ------------------
  128|      6|    return false;
  129|      6|  }
  130|     48|  return true;
  131|     54|}
_ZNK5draco17RAnsSymbolDecoderILi8EE11num_symbolsEv:
   38|     48|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi8EE13StartDecodingEPNS_13DecoderBufferE:
  135|     48|    DecoderBuffer *buffer) {
  136|     48|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     48|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     48|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     48|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 17, False: 31]
  ------------------
  140|     17|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 17]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     17|  } else
  145|     31|#endif
  146|     31|  {
  147|     31|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 31]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     31|  }
  151|     48|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 22, False: 26]
  ------------------
  152|     22|    return false;
  153|     22|  }
  154|     26|  const uint8_t *const data_head =
  155|     26|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     26|  buffer->Advance(bytes_encoded);
  158|     26|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 3, False: 23]
  ------------------
  159|      3|    return false;
  160|      3|  }
  161|     23|  return true;
  162|     26|}
_ZN5draco17RAnsSymbolDecoderILi8EE12DecodeSymbolEv:
   43|  2.25M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi8EE11EndDecodingEv:
  165|     23|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     23|  ans_.read_end();
  167|     23|}
_ZN5draco17RAnsSymbolDecoderILi9EEC2Ev:
   33|    118|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi9EE6CreateEPNS_13DecoderBufferE:
   59|    118|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    118|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 118]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    118|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    118|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    118|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 21, False: 97]
  ------------------
   67|     21|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 21]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     21|  } else
   72|     97|#endif
   73|     97|  {
   74|     97|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 1, False: 96]
  ------------------
   75|      1|      return false;
   76|      1|    }
   77|     97|  }
   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|    117|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 8, False: 109]
  ------------------
   83|      8|    return false;
   84|      8|  }
   85|    109|  probability_table_.resize(num_symbols_);
   86|    109|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 2, False: 107]
  ------------------
   87|      2|    return true;
   88|      2|  }
   89|       |  // Decode the table.
   90|   185k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 185k, False: 65]
  ------------------
   91|   185k|    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|   185k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 13, False: 185k]
  ------------------
   95|     13|      return false;
   96|     13|    }
   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|   185k|    const int token = prob_data & 3;
  102|   185k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 24.9k, False: 160k]
  ------------------
  103|  24.9k|      const uint32_t offset = prob_data >> 2;
  104|  24.9k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 22, False: 24.9k]
  ------------------
  105|     22|        return false;
  106|     22|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   799k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 774k, False: 24.9k]
  ------------------
  109|   774k|        probability_table_[i + j] = 0;
  110|   774k|      }
  111|  24.9k|      i += offset;
  112|   160k|    } else {
  113|   160k|      const int extra_bytes = token;
  114|   160k|      uint32_t prob = prob_data >> 2;
  115|   284k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 123k, False: 160k]
  ------------------
  116|   123k|        uint8_t eb;
  117|   123k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 123k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  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|   160k|      probability_table_[i] = prob;
  125|   160k|    }
  126|   185k|  }
  127|     65|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 12, False: 53]
  ------------------
  128|     12|    return false;
  129|     12|  }
  130|     53|  return true;
  131|     65|}
_ZNK5draco17RAnsSymbolDecoderILi9EE11num_symbolsEv:
   38|     55|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi9EE13StartDecodingEPNS_13DecoderBufferE:
  135|     53|    DecoderBuffer *buffer) {
  136|     53|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     53|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     53|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     53|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 4, False: 49]
  ------------------
  140|      4|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 4]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      4|  } else
  145|     49|#endif
  146|     49|  {
  147|     49|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 49]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     49|  }
  151|     53|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 11, False: 42]
  ------------------
  152|     11|    return false;
  153|     11|  }
  154|     42|  const uint8_t *const data_head =
  155|     42|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     42|  buffer->Advance(bytes_encoded);
  158|     42|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 4, False: 38]
  ------------------
  159|      4|    return false;
  160|      4|  }
  161|     38|  return true;
  162|     42|}
_ZN5draco17RAnsSymbolDecoderILi9EE12DecodeSymbolEv:
   43|  10.5M|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi9EE11EndDecodingEv:
  165|     38|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     38|  ans_.read_end();
  167|     38|}
_ZN5draco17RAnsSymbolDecoderILi10EEC2Ev:
   33|     84|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi10EE6CreateEPNS_13DecoderBufferE:
   59|     84|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|     84|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 84]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|     84|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|     84|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     84|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 19, False: 65]
  ------------------
   67|     19|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 19]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     19|  } else
   72|     65|#endif
   73|     65|  {
   74|     65|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 65]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     65|  }
   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|     84|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 0, False: 84]
  ------------------
   83|      0|    return false;
   84|      0|  }
   85|     84|  probability_table_.resize(num_symbols_);
   86|     84|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 84]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   406k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 406k, False: 51]
  ------------------
   91|   406k|    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|   406k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 14, False: 406k]
  ------------------
   95|     14|      return false;
   96|     14|    }
   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|   406k|    const int token = prob_data & 3;
  102|   406k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 66.2k, False: 340k]
  ------------------
  103|  66.2k|      const uint32_t offset = prob_data >> 2;
  104|  66.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 9, False: 66.2k]
  ------------------
  105|      9|        return false;
  106|      9|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  2.11M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 2.05M, False: 66.2k]
  ------------------
  109|  2.05M|        probability_table_[i + j] = 0;
  110|  2.05M|      }
  111|  66.2k|      i += offset;
  112|   340k|    } else {
  113|   340k|      const int extra_bytes = token;
  114|   340k|      uint32_t prob = prob_data >> 2;
  115|   674k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 333k, False: 340k]
  ------------------
  116|   333k|        uint8_t eb;
  117|   333k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 10, False: 333k]
  ------------------
  118|     10|          return false;
  119|     10|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   333k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   333k|      }
  124|   340k|      probability_table_[i] = prob;
  125|   340k|    }
  126|   406k|  }
  127|     51|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 15, False: 36]
  ------------------
  128|     15|    return false;
  129|     15|  }
  130|     36|  return true;
  131|     51|}
_ZNK5draco17RAnsSymbolDecoderILi10EE11num_symbolsEv:
   38|     36|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi10EE13StartDecodingEPNS_13DecoderBufferE:
  135|     36|    DecoderBuffer *buffer) {
  136|     36|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     36|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     36|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     36|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 12, False: 24]
  ------------------
  140|     12|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 12]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     12|  } else
  145|     24|#endif
  146|     24|  {
  147|     24|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 24]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     24|  }
  151|     36|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 17, False: 19]
  ------------------
  152|     17|    return false;
  153|     17|  }
  154|     19|  const uint8_t *const data_head =
  155|     19|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     19|  buffer->Advance(bytes_encoded);
  158|     19|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 5, False: 14]
  ------------------
  159|      5|    return false;
  160|      5|  }
  161|     14|  return true;
  162|     19|}
_ZN5draco17RAnsSymbolDecoderILi10EE12DecodeSymbolEv:
   43|   162k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi10EE11EndDecodingEv:
  165|     14|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     14|  ans_.read_end();
  167|     14|}
_ZN5draco17RAnsSymbolDecoderILi11EEC2Ev:
   33|    120|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi11EE6CreateEPNS_13DecoderBufferE:
   59|    120|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    120|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 120]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    120|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    120|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    120|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 19, False: 101]
  ------------------
   67|     19|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 19]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     19|  } else
   72|    101|#endif
   73|    101|  {
   74|    101|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 101]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    101|  }
   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|    120|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 5, False: 115]
  ------------------
   83|      5|    return false;
   84|      5|  }
   85|    115|  probability_table_.resize(num_symbols_);
   86|    115|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 114]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|   826k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 826k, False: 74]
  ------------------
   91|   826k|    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|   826k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 14, False: 826k]
  ------------------
   95|     14|      return false;
   96|     14|    }
   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|   826k|    const int token = prob_data & 3;
  102|   826k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 592k, False: 233k]
  ------------------
  103|   592k|      const uint32_t offset = prob_data >> 2;
  104|   592k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 18, False: 592k]
  ------------------
  105|     18|        return false;
  106|     18|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  34.2M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 33.6M, False: 592k]
  ------------------
  109|  33.6M|        probability_table_[i + j] = 0;
  110|  33.6M|      }
  111|   592k|      i += offset;
  112|   592k|    } else {
  113|   233k|      const int extra_bytes = token;
  114|   233k|      uint32_t prob = prob_data >> 2;
  115|   392k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 159k, False: 233k]
  ------------------
  116|   159k|        uint8_t eb;
  117|   159k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 8, False: 159k]
  ------------------
  118|      8|          return false;
  119|      8|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   159k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   159k|      }
  124|   233k|      probability_table_[i] = prob;
  125|   233k|    }
  126|   826k|  }
  127|     74|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 14, False: 60]
  ------------------
  128|     14|    return false;
  129|     14|  }
  130|     60|  return true;
  131|     74|}
_ZNK5draco17RAnsSymbolDecoderILi11EE11num_symbolsEv:
   38|     61|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi11EE13StartDecodingEPNS_13DecoderBufferE:
  135|     60|    DecoderBuffer *buffer) {
  136|     60|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     60|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     60|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     60|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 60]
  ------------------
  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|     60|#endif
  146|     60|  {
  147|     60|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 3, False: 57]
  ------------------
  148|      3|      return false;
  149|      3|    }
  150|     60|  }
  151|     57|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 20, False: 37]
  ------------------
  152|     20|    return false;
  153|     20|  }
  154|     37|  const uint8_t *const data_head =
  155|     37|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     37|  buffer->Advance(bytes_encoded);
  158|     37|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 7, False: 30]
  ------------------
  159|      7|    return false;
  160|      7|  }
  161|     30|  return true;
  162|     37|}
_ZN5draco17RAnsSymbolDecoderILi11EE12DecodeSymbolEv:
   43|   154k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi11EE11EndDecodingEv:
  165|     30|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     30|  ans_.read_end();
  167|     30|}
_ZN5draco17RAnsSymbolDecoderILi12EEC2Ev:
   33|    129|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi12EE6CreateEPNS_13DecoderBufferE:
   59|    129|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    129|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 129]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    129|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    129|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    129|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 42, False: 87]
  ------------------
   67|     42|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 42]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     42|  } else
   72|     87|#endif
   73|     87|  {
   74|     87|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 87]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     87|  }
   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|    129|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 3, False: 126]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|    126|  probability_table_.resize(num_symbols_);
   86|    126|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 126]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   273k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 272k, False: 81]
  ------------------
   91|   272k|    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|   272k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 17, False: 272k]
  ------------------
   95|     17|      return false;
   96|     17|    }
   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|   272k|    const int token = prob_data & 3;
  102|   272k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 25.2k, False: 247k]
  ------------------
  103|  25.2k|      const uint32_t offset = prob_data >> 2;
  104|  25.2k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 16, False: 25.2k]
  ------------------
  105|     16|        return false;
  106|     16|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  1.03M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 1.00M, False: 25.2k]
  ------------------
  109|  1.00M|        probability_table_[i + j] = 0;
  110|  1.00M|      }
  111|  25.2k|      i += offset;
  112|   247k|    } else {
  113|   247k|      const int extra_bytes = token;
  114|   247k|      uint32_t prob = prob_data >> 2;
  115|   485k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 238k, False: 247k]
  ------------------
  116|   238k|        uint8_t eb;
  117|   238k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 238k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   238k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   238k|      }
  124|   247k|      probability_table_[i] = prob;
  125|   247k|    }
  126|   272k|  }
  127|     81|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 18, False: 63]
  ------------------
  128|     18|    return false;
  129|     18|  }
  130|     63|  return true;
  131|     81|}
_ZNK5draco17RAnsSymbolDecoderILi12EE11num_symbolsEv:
   38|     63|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi12EE13StartDecodingEPNS_13DecoderBufferE:
  135|     63|    DecoderBuffer *buffer) {
  136|     63|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     63|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     63|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     63|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 22, False: 41]
  ------------------
  140|     22|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 22]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     22|  } else
  145|     41|#endif
  146|     41|  {
  147|     41|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 41]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     41|  }
  151|     63|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 37, False: 26]
  ------------------
  152|     37|    return false;
  153|     37|  }
  154|     26|  const uint8_t *const data_head =
  155|     26|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     26|  buffer->Advance(bytes_encoded);
  158|     26|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 5, False: 21]
  ------------------
  159|      5|    return false;
  160|      5|  }
  161|     21|  return true;
  162|     26|}
_ZN5draco17RAnsSymbolDecoderILi12EE12DecodeSymbolEv:
   43|  48.9k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi12EE11EndDecodingEv:
  165|     21|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     21|  ans_.read_end();
  167|     21|}
_ZN5draco17RAnsSymbolDecoderILi13EEC2Ev:
   33|    142|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi13EE6CreateEPNS_13DecoderBufferE:
   59|    142|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    142|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 142]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    142|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    142|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    142|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 24, False: 118]
  ------------------
   67|     24|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 24]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     24|  } else
   72|    118|#endif
   73|    118|  {
   74|    118|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 118]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    118|  }
   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|    142|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 130]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|    130|  probability_table_.resize(num_symbols_);
   86|    130|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 130]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   914k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 914k, False: 87]
  ------------------
   91|   914k|    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|   914k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 23, False: 914k]
  ------------------
   95|     23|      return false;
   96|     23|    }
   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|   914k|    const int token = prob_data & 3;
  102|   914k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 524k, False: 389k]
  ------------------
  103|   524k|      const uint32_t offset = prob_data >> 2;
  104|   524k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 14, False: 524k]
  ------------------
  105|     14|        return false;
  106|     14|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  28.7M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 28.2M, False: 524k]
  ------------------
  109|  28.2M|        probability_table_[i + j] = 0;
  110|  28.2M|      }
  111|   524k|      i += offset;
  112|   524k|    } else {
  113|   389k|      const int extra_bytes = token;
  114|   389k|      uint32_t prob = prob_data >> 2;
  115|   569k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 180k, False: 389k]
  ------------------
  116|   180k|        uint8_t eb;
  117|   180k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 6, False: 180k]
  ------------------
  118|      6|          return false;
  119|      6|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   180k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   180k|      }
  124|   389k|      probability_table_[i] = prob;
  125|   389k|    }
  126|   914k|  }
  127|     87|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 10, False: 77]
  ------------------
  128|     10|    return false;
  129|     10|  }
  130|     77|  return true;
  131|     87|}
_ZNK5draco17RAnsSymbolDecoderILi13EE11num_symbolsEv:
   38|     77|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi13EE13StartDecodingEPNS_13DecoderBufferE:
  135|     77|    DecoderBuffer *buffer) {
  136|     77|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     77|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     77|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     77|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 0, False: 77]
  ------------------
  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|     77|#endif
  146|     77|  {
  147|     77|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 77]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     77|  }
  151|     77|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 37, False: 40]
  ------------------
  152|     37|    return false;
  153|     37|  }
  154|     40|  const uint8_t *const data_head =
  155|     40|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     40|  buffer->Advance(bytes_encoded);
  158|     40|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 8, False: 32]
  ------------------
  159|      8|    return false;
  160|      8|  }
  161|     32|  return true;
  162|     40|}
_ZN5draco17RAnsSymbolDecoderILi13EE12DecodeSymbolEv:
   43|  91.9k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi13EE11EndDecodingEv:
  165|     32|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     32|  ans_.read_end();
  167|     32|}
_ZN5draco17RAnsSymbolDecoderILi14EEC2Ev:
   33|    108|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi14EE6CreateEPNS_13DecoderBufferE:
   59|    108|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    108|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 108]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    108|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    108|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    108|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 23, False: 85]
  ------------------
   67|     23|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 23]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     23|  } else
   72|     85|#endif
   73|     85|  {
   74|     85|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 85]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     85|  }
   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|    108|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 3, False: 105]
  ------------------
   83|      3|    return false;
   84|      3|  }
   85|    105|  probability_table_.resize(num_symbols_);
   86|    105|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 105]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   348k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 348k, False: 51]
  ------------------
   91|   348k|    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|   348k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 11, False: 348k]
  ------------------
   95|     11|      return false;
   96|     11|    }
   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|   348k|    const int token = prob_data & 3;
  102|   348k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 234k, False: 113k]
  ------------------
  103|   234k|      const uint32_t offset = prob_data >> 2;
  104|   234k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 31, False: 234k]
  ------------------
  105|     31|        return false;
  106|     31|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  10.0M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 9.85M, False: 234k]
  ------------------
  109|  9.85M|        probability_table_[i + j] = 0;
  110|  9.85M|      }
  111|   234k|      i += offset;
  112|   234k|    } else {
  113|   113k|      const int extra_bytes = token;
  114|   113k|      uint32_t prob = prob_data >> 2;
  115|   186k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 72.8k, False: 113k]
  ------------------
  116|  72.8k|        uint8_t eb;
  117|  72.8k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 72.8k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  72.8k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  72.8k|      }
  124|   113k|      probability_table_[i] = prob;
  125|   113k|    }
  126|   348k|  }
  127|     51|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 10, False: 41]
  ------------------
  128|     10|    return false;
  129|     10|  }
  130|     41|  return true;
  131|     51|}
_ZNK5draco17RAnsSymbolDecoderILi14EE11num_symbolsEv:
   38|     41|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi14EE13StartDecodingEPNS_13DecoderBufferE:
  135|     41|    DecoderBuffer *buffer) {
  136|     41|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     41|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     41|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     41|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 8, False: 33]
  ------------------
  140|      8|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 8]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      8|  } else
  145|     33|#endif
  146|     33|  {
  147|     33|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 1, False: 32]
  ------------------
  148|      1|      return false;
  149|      1|    }
  150|     33|  }
  151|     40|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 17, False: 23]
  ------------------
  152|     17|    return false;
  153|     17|  }
  154|     23|  const uint8_t *const data_head =
  155|     23|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     23|  buffer->Advance(bytes_encoded);
  158|     23|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 0, False: 23]
  ------------------
  159|      0|    return false;
  160|      0|  }
  161|     23|  return true;
  162|     23|}
_ZN5draco17RAnsSymbolDecoderILi14EE12DecodeSymbolEv:
   43|  56.6k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi14EE11EndDecodingEv:
  165|     23|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     23|  ans_.read_end();
  167|     23|}
_ZN5draco17RAnsSymbolDecoderILi15EEC2Ev:
   33|    146|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi15EE6CreateEPNS_13DecoderBufferE:
   59|    146|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    146|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 146]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    146|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    146|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    146|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 65, False: 81]
  ------------------
   67|     65|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 1, False: 64]
  ------------------
   68|      1|      return false;
   69|      1|    }
   70|       |
   71|     65|  } else
   72|     81|#endif
   73|     81|  {
   74|     81|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 81]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     81|  }
   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|    145|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 136]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|    136|  probability_table_.resize(num_symbols_);
   86|    136|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 136]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  2.67M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 2.67M, False: 94]
  ------------------
   91|  2.67M|    uint8_t prob_data = 0;
   92|       |    // Decode the first byte and extract the number of extra bytes we need to
   93|       |    // get, or the offset to the next symbol with non-zero probability.
   94|  2.67M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 14, False: 2.67M]
  ------------------
   95|     14|      return false;
   96|     14|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  2.67M|    const int token = prob_data & 3;
  102|  2.67M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 2.27M, False: 399k]
  ------------------
  103|  2.27M|      const uint32_t offset = prob_data >> 2;
  104|  2.27M|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 21, False: 2.27M]
  ------------------
  105|     21|        return false;
  106|     21|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   132M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 130M, False: 2.27M]
  ------------------
  109|   130M|        probability_table_[i + j] = 0;
  110|   130M|      }
  111|  2.27M|      i += offset;
  112|  2.27M|    } else {
  113|   399k|      const int extra_bytes = token;
  114|   399k|      uint32_t prob = prob_data >> 2;
  115|   661k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 262k, False: 399k]
  ------------------
  116|   262k|        uint8_t eb;
  117|   262k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 7, False: 262k]
  ------------------
  118|      7|          return false;
  119|      7|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|   262k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|   262k|      }
  124|   399k|      probability_table_[i] = prob;
  125|   399k|    }
  126|  2.67M|  }
  127|     94|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 4, False: 90]
  ------------------
  128|      4|    return false;
  129|      4|  }
  130|     90|  return true;
  131|     94|}
_ZNK5draco17RAnsSymbolDecoderILi15EE11num_symbolsEv:
   38|     90|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi15EE13StartDecodingEPNS_13DecoderBufferE:
  135|     90|    DecoderBuffer *buffer) {
  136|     90|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     90|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     90|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     90|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 39, False: 51]
  ------------------
  140|     39|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 1, False: 38]
  ------------------
  141|      1|      return false;
  142|      1|    }
  143|       |
  144|     39|  } else
  145|     51|#endif
  146|     51|  {
  147|     51|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 51]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     51|  }
  151|     89|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 44, False: 45]
  ------------------
  152|     44|    return false;
  153|     44|  }
  154|     45|  const uint8_t *const data_head =
  155|     45|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     45|  buffer->Advance(bytes_encoded);
  158|     45|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 15, False: 30]
  ------------------
  159|     15|    return false;
  160|     15|  }
  161|     30|  return true;
  162|     45|}
_ZN5draco17RAnsSymbolDecoderILi15EE12DecodeSymbolEv:
   43|   192k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi15EE11EndDecodingEv:
  165|     30|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     30|  ans_.read_end();
  167|     30|}
_ZN5draco17RAnsSymbolDecoderILi16EEC2Ev:
   33|    122|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi16EE6CreateEPNS_13DecoderBufferE:
   59|    122|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    122|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 122]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    122|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    122|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    122|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 10, False: 112]
  ------------------
   67|     10|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 10]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     10|  } else
   72|    112|#endif
   73|    112|  {
   74|    112|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 112]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|    112|  }
   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|    122|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 1, False: 121]
  ------------------
   83|      1|    return false;
   84|      1|  }
   85|    121|  probability_table_.resize(num_symbols_);
   86|    121|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 121]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|   176k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 176k, False: 82]
  ------------------
   91|   176k|    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|   176k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 20, False: 176k]
  ------------------
   95|     20|      return false;
   96|     20|    }
   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|   176k|    const int token = prob_data & 3;
  102|   176k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 28.0k, False: 147k]
  ------------------
  103|  28.0k|      const uint32_t offset = prob_data >> 2;
  104|  28.0k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 7, False: 28.0k]
  ------------------
  105|      7|        return false;
  106|      7|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   987k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 959k, False: 28.0k]
  ------------------
  109|   959k|        probability_table_[i + j] = 0;
  110|   959k|      }
  111|  28.0k|      i += offset;
  112|   147k|    } else {
  113|   147k|      const int extra_bytes = token;
  114|   147k|      uint32_t prob = prob_data >> 2;
  115|   282k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 134k, False: 147k]
  ------------------
  116|   134k|        uint8_t eb;
  117|   134k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 12, False: 134k]
  ------------------
  118|     12|          return false;
  119|     12|        }
  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|   147k|      probability_table_[i] = prob;
  125|   147k|    }
  126|   176k|  }
  127|     82|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 14, False: 68]
  ------------------
  128|     14|    return false;
  129|     14|  }
  130|     68|  return true;
  131|     82|}
_ZNK5draco17RAnsSymbolDecoderILi16EE11num_symbolsEv:
   38|     68|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi16EE13StartDecodingEPNS_13DecoderBufferE:
  135|     68|    DecoderBuffer *buffer) {
  136|     68|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     68|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     68|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     68|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 2, False: 66]
  ------------------
  140|      2|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 2]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|      2|  } else
  145|     66|#endif
  146|     66|  {
  147|     66|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 66]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     66|  }
  151|     68|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 40, False: 28]
  ------------------
  152|     40|    return false;
  153|     40|  }
  154|     28|  const uint8_t *const data_head =
  155|     28|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     28|  buffer->Advance(bytes_encoded);
  158|     28|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 27]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|     27|  return true;
  162|     28|}
_ZN5draco17RAnsSymbolDecoderILi16EE12DecodeSymbolEv:
   43|  69.8k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi16EE11EndDecodingEv:
  165|     27|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     27|  ans_.read_end();
  167|     27|}
_ZN5draco17RAnsSymbolDecoderILi17EEC2Ev:
   33|    122|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi17EE6CreateEPNS_13DecoderBufferE:
   59|    122|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    122|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 122]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    122|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    122|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    122|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 30, False: 92]
  ------------------
   67|     30|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 30]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     30|  } else
   72|     92|#endif
   73|     92|  {
   74|     92|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 3, False: 89]
  ------------------
   75|      3|      return false;
   76|      3|    }
   77|     92|  }
   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|    119|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 9, False: 110]
  ------------------
   83|      9|    return false;
   84|      9|  }
   85|    110|  probability_table_.resize(num_symbols_);
   86|    110|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 1, False: 109]
  ------------------
   87|      1|    return true;
   88|      1|  }
   89|       |  // Decode the table.
   90|  44.0k|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 43.9k, False: 85]
  ------------------
   91|  43.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|  43.9k|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 12, False: 43.9k]
  ------------------
   95|     12|      return false;
   96|     12|    }
   97|       |    // Token is stored in the first two bits of the first byte. Values 0-2 are
   98|       |    // used to indicate the number of extra bytes, and value 3 is a special
   99|       |    // symbol used to denote run-length coding of zero probability entries.
  100|       |    // See rans_symbol_encoder.h for more details.
  101|  43.9k|    const int token = prob_data & 3;
  102|  43.9k|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 11.1k, False: 32.8k]
  ------------------
  103|  11.1k|      const uint32_t offset = prob_data >> 2;
  104|  11.1k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 8, False: 11.1k]
  ------------------
  105|      8|        return false;
  106|      8|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|   405k|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 394k, False: 11.1k]
  ------------------
  109|   394k|        probability_table_[i + j] = 0;
  110|   394k|      }
  111|  11.1k|      i += offset;
  112|  32.8k|    } else {
  113|  32.8k|      const int extra_bytes = token;
  114|  32.8k|      uint32_t prob = prob_data >> 2;
  115|  63.3k|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 30.5k, False: 32.8k]
  ------------------
  116|  30.5k|        uint8_t eb;
  117|  30.5k|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 4, False: 30.5k]
  ------------------
  118|      4|          return false;
  119|      4|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  30.5k|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  30.5k|      }
  124|  32.8k|      probability_table_[i] = prob;
  125|  32.8k|    }
  126|  43.9k|  }
  127|     85|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 6, False: 79]
  ------------------
  128|      6|    return false;
  129|      6|  }
  130|     79|  return true;
  131|     85|}
_ZNK5draco17RAnsSymbolDecoderILi17EE11num_symbolsEv:
   38|     80|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi17EE13StartDecodingEPNS_13DecoderBufferE:
  135|     79|    DecoderBuffer *buffer) {
  136|     79|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     79|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     79|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     79|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 23, False: 56]
  ------------------
  140|     23|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 23]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     23|  } else
  145|     56|#endif
  146|     56|  {
  147|     56|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 56]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     56|  }
  151|     79|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 29, False: 50]
  ------------------
  152|     29|    return false;
  153|     29|  }
  154|     50|  const uint8_t *const data_head =
  155|     50|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|     50|  buffer->Advance(bytes_encoded);
  158|     50|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 13, False: 37]
  ------------------
  159|     13|    return false;
  160|     13|  }
  161|     37|  return true;
  162|     50|}
_ZN5draco17RAnsSymbolDecoderILi17EE12DecodeSymbolEv:
   43|   128k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi17EE11EndDecodingEv:
  165|     37|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|     37|  ans_.read_end();
  167|     37|}
_ZN5draco17RAnsSymbolDecoderILi18EEC2Ev:
   33|    103|  RAnsSymbolDecoder() : num_symbols_(0) {}
_ZN5draco17RAnsSymbolDecoderILi18EE6CreateEPNS_13DecoderBufferE:
   59|    103|    DecoderBuffer *buffer) {
   60|       |  // Check that the DecoderBuffer version is set.
   61|    103|  if (buffer->bitstream_version() == 0) {
  ------------------
  |  Branch (61:7): [True: 0, False: 103]
  ------------------
   62|      0|    return false;
   63|      0|  }
   64|       |  // Decode the number of alphabet symbols.
   65|    103|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   66|    103|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|    103|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (66:7): [True: 47, False: 56]
  ------------------
   67|     47|    if (!buffer->Decode(&num_symbols_)) {
  ------------------
  |  Branch (67:9): [True: 0, False: 47]
  ------------------
   68|      0|      return false;
   69|      0|    }
   70|       |
   71|     47|  } else
   72|     56|#endif
   73|     56|  {
   74|     56|    if (!DecodeVarint(&num_symbols_, buffer)) {
  ------------------
  |  Branch (74:9): [True: 0, False: 56]
  ------------------
   75|      0|      return false;
   76|      0|    }
   77|     56|  }
   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|    103|  if (num_symbols_ / 64 > buffer->remaining_size()) {
  ------------------
  |  Branch (82:7): [True: 12, False: 91]
  ------------------
   83|     12|    return false;
   84|     12|  }
   85|     91|  probability_table_.resize(num_symbols_);
   86|     91|  if (num_symbols_ == 0) {
  ------------------
  |  Branch (86:7): [True: 0, False: 91]
  ------------------
   87|      0|    return true;
   88|      0|  }
   89|       |  // Decode the table.
   90|  1.70M|  for (uint32_t i = 0; i < num_symbols_; ++i) {
  ------------------
  |  Branch (90:24): [True: 1.70M, False: 63]
  ------------------
   91|  1.70M|    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.70M|    if (!buffer->Decode(&prob_data)) {
  ------------------
  |  Branch (94:9): [True: 15, False: 1.70M]
  ------------------
   95|     15|      return false;
   96|     15|    }
   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.70M|    const int token = prob_data & 3;
  102|  1.70M|    if (token == 3) {
  ------------------
  |  Branch (102:9): [True: 556k, False: 1.14M]
  ------------------
  103|   556k|      const uint32_t offset = prob_data >> 2;
  104|   556k|      if (i + offset >= num_symbols_) {
  ------------------
  |  Branch (104:11): [True: 5, False: 556k]
  ------------------
  105|      5|        return false;
  106|      5|      }
  107|       |      // Set zero probability for all symbols in the specified range.
  108|  27.0M|      for (uint32_t j = 0; j < offset + 1; ++j) {
  ------------------
  |  Branch (108:28): [True: 26.5M, False: 556k]
  ------------------
  109|  26.5M|        probability_table_[i + j] = 0;
  110|  26.5M|      }
  111|   556k|      i += offset;
  112|  1.14M|    } else {
  113|  1.14M|      const int extra_bytes = token;
  114|  1.14M|      uint32_t prob = prob_data >> 2;
  115|  2.23M|      for (int b = 0; b < extra_bytes; ++b) {
  ------------------
  |  Branch (115:23): [True: 1.08M, False: 1.14M]
  ------------------
  116|  1.08M|        uint8_t eb;
  117|  1.08M|        if (!buffer->Decode(&eb)) {
  ------------------
  |  Branch (117:13): [True: 8, False: 1.08M]
  ------------------
  118|      8|          return false;
  119|      8|        }
  120|       |        // Shift 8 bits for each extra byte and subtract 2 for the two first
  121|       |        // bits.
  122|  1.08M|        prob |= static_cast<uint32_t>(eb) << (8 * (b + 1) - 2);
  123|  1.08M|      }
  124|  1.14M|      probability_table_[i] = prob;
  125|  1.14M|    }
  126|  1.70M|  }
  127|     63|  if (!ans_.rans_build_look_up_table(&probability_table_[0], num_symbols_)) {
  ------------------
  |  Branch (127:7): [True: 11, False: 52]
  ------------------
  128|     11|    return false;
  129|     11|  }
  130|     52|  return true;
  131|     63|}
_ZNK5draco17RAnsSymbolDecoderILi18EE11num_symbolsEv:
   38|     52|  uint32_t num_symbols() const { return num_symbols_; }
_ZN5draco17RAnsSymbolDecoderILi18EE13StartDecodingEPNS_13DecoderBufferE:
  135|     52|    DecoderBuffer *buffer) {
  136|     52|  uint64_t bytes_encoded;
  137|       |  // Decode the number of bytes encoded by the encoder.
  138|     52|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  139|     52|  if (buffer->bitstream_version() < DRACO_BITSTREAM_VERSION(2, 0)) {
  ------------------
  |  |  115|     52|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (139:7): [True: 27, False: 25]
  ------------------
  140|     27|    if (!buffer->Decode(&bytes_encoded)) {
  ------------------
  |  Branch (140:9): [True: 0, False: 27]
  ------------------
  141|      0|      return false;
  142|      0|    }
  143|       |
  144|     27|  } else
  145|     25|#endif
  146|     25|  {
  147|     25|    if (!DecodeVarint<uint64_t>(&bytes_encoded, buffer)) {
  ------------------
  |  Branch (147:9): [True: 0, False: 25]
  ------------------
  148|      0|      return false;
  149|      0|    }
  150|     25|  }
  151|     52|  if (bytes_encoded > static_cast<uint64_t>(buffer->remaining_size())) {
  ------------------
  |  Branch (151:7): [True: 43, False: 9]
  ------------------
  152|     43|    return false;
  153|     43|  }
  154|      9|  const uint8_t *const data_head =
  155|      9|      reinterpret_cast<const uint8_t *>(buffer->data_head());
  156|       |  // Advance the buffer past the rANS data.
  157|      9|  buffer->Advance(bytes_encoded);
  158|      9|  if (ans_.read_init(data_head, static_cast<int>(bytes_encoded)) != 0) {
  ------------------
  |  Branch (158:7): [True: 1, False: 8]
  ------------------
  159|      1|    return false;
  160|      1|  }
  161|      8|  return true;
  162|      9|}
_ZN5draco17RAnsSymbolDecoderILi18EE12DecodeSymbolEv:
   43|  14.5k|  uint32_t DecodeSymbol() { return ans_.rans_read(); }
_ZN5draco17RAnsSymbolDecoderILi18EE11EndDecodingEv:
  165|      8|void RAnsSymbolDecoder<unique_symbols_bit_length_t>::EndDecoding() {
  166|      8|  ans_.read_end();
  167|      8|}

_ZN5draco13DecodeSymbolsEjiPNS_13DecoderBufferEPj:
   33|  4.48k|                   DecoderBuffer *src_buffer, uint32_t *out_values) {
   34|  4.48k|  if (num_values == 0) {
  ------------------
  |  Branch (34:7): [True: 10, False: 4.47k]
  ------------------
   35|     10|    return true;
   36|     10|  }
   37|       |  // Decode which scheme to use.
   38|  4.47k|  uint8_t scheme;
   39|  4.47k|  if (!src_buffer->Decode(&scheme)) {
  ------------------
  |  Branch (39:7): [True: 9, False: 4.46k]
  ------------------
   40|      9|    return false;
   41|      9|  }
   42|  4.46k|  if (scheme == SYMBOL_CODING_TAGGED) {
  ------------------
  |  Branch (42:7): [True: 462, False: 4.00k]
  ------------------
   43|    462|    return DecodeTaggedSymbols<RAnsSymbolDecoder>(num_values, num_components,
   44|    462|                                                  src_buffer, out_values);
   45|  4.00k|  } else if (scheme == SYMBOL_CODING_RAW) {
  ------------------
  |  Branch (45:14): [True: 2.64k, False: 1.35k]
  ------------------
   46|  2.64k|    return DecodeRawSymbols<RAnsSymbolDecoder>(num_values, src_buffer,
   47|  2.64k|                                               out_values);
   48|  2.64k|  }
   49|  1.35k|  return false;
   50|  4.46k|}
_ZN5draco19DecodeTaggedSymbolsINS_17RAnsSymbolDecoderEEEbjiPNS_13DecoderBufferEPj:
   54|    462|                         DecoderBuffer *src_buffer, uint32_t *out_values) {
   55|       |  // Decode the encoded data.
   56|    462|  SymbolDecoderT<5> tag_decoder;
   57|    462|  if (!tag_decoder.Create(src_buffer)) {
  ------------------
  |  Branch (57:7): [True: 276, False: 186]
  ------------------
   58|    276|    return false;
   59|    276|  }
   60|       |
   61|    186|  if (!tag_decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (61:7): [True: 68, False: 118]
  ------------------
   62|     68|    return false;
   63|     68|  }
   64|       |
   65|    118|  if (num_values > 0 && tag_decoder.num_symbols() == 0) {
  ------------------
  |  Branch (65:7): [True: 118, False: 0]
  |  Branch (65:25): [True: 28, False: 90]
  ------------------
   66|     28|    return false;  // Wrong number of symbols.
   67|     28|  }
   68|       |
   69|       |  // src_buffer now points behind the encoded tag data (to the place where the
   70|       |  // values are encoded).
   71|     90|  src_buffer->StartBitDecoding(false, nullptr);
   72|     90|  int value_id = 0;
   73|  8.34M|  for (uint32_t i = 0; i < num_values; i += num_components) {
  ------------------
  |  Branch (73:24): [True: 8.34M, False: 76]
  ------------------
   74|       |    // Decode the tag.
   75|  8.34M|    const uint32_t bit_length = tag_decoder.DecodeSymbol();
   76|       |    // Decode the actual value.
   77|  18.0M|    for (int j = 0; j < num_components; ++j) {
  ------------------
  |  Branch (77:21): [True: 9.66M, False: 8.34M]
  ------------------
   78|  9.66M|      uint32_t val;
   79|  9.66M|      if (!src_buffer->DecodeLeastSignificantBits32(bit_length, &val)) {
  ------------------
  |  Branch (79:11): [True: 14, False: 9.66M]
  ------------------
   80|     14|        return false;
   81|     14|      }
   82|  9.66M|      out_values[value_id++] = val;
   83|  9.66M|    }
   84|  8.34M|  }
   85|     76|  tag_decoder.EndDecoding();
   86|     76|  src_buffer->EndBitDecoding();
   87|     76|  return true;
   88|     90|}
_ZN5draco16DecodeRawSymbolsINS_17RAnsSymbolDecoderEEEbjPNS_13DecoderBufferEPj:
  116|  2.64k|                      uint32_t *out_values) {
  117|  2.64k|  uint8_t max_bit_length;
  118|  2.64k|  if (!src_buffer->Decode(&max_bit_length)) {
  ------------------
  |  Branch (118:7): [True: 0, False: 2.64k]
  ------------------
  119|      0|    return false;
  120|      0|  }
  121|  2.64k|  switch (max_bit_length) {
  122|    318|    case 1:
  ------------------
  |  Branch (122:5): [True: 318, False: 2.32k]
  ------------------
  123|    318|      return DecodeRawSymbolsInternal<SymbolDecoderT<1>>(num_values, src_buffer,
  124|    318|                                                         out_values);
  125|    198|    case 2:
  ------------------
  |  Branch (125:5): [True: 198, False: 2.44k]
  ------------------
  126|    198|      return DecodeRawSymbolsInternal<SymbolDecoderT<2>>(num_values, src_buffer,
  127|    198|                                                         out_values);
  128|    148|    case 3:
  ------------------
  |  Branch (128:5): [True: 148, False: 2.49k]
  ------------------
  129|    148|      return DecodeRawSymbolsInternal<SymbolDecoderT<3>>(num_values, src_buffer,
  130|    148|                                                         out_values);
  131|    145|    case 4:
  ------------------
  |  Branch (131:5): [True: 145, False: 2.50k]
  ------------------
  132|    145|      return DecodeRawSymbolsInternal<SymbolDecoderT<4>>(num_values, src_buffer,
  133|    145|                                                         out_values);
  134|     85|    case 5:
  ------------------
  |  Branch (134:5): [True: 85, False: 2.56k]
  ------------------
  135|     85|      return DecodeRawSymbolsInternal<SymbolDecoderT<5>>(num_values, src_buffer,
  136|     85|                                                         out_values);
  137|    111|    case 6:
  ------------------
  |  Branch (137:5): [True: 111, False: 2.53k]
  ------------------
  138|    111|      return DecodeRawSymbolsInternal<SymbolDecoderT<6>>(num_values, src_buffer,
  139|    111|                                                         out_values);
  140|    111|    case 7:
  ------------------
  |  Branch (140:5): [True: 111, False: 2.53k]
  ------------------
  141|    111|      return DecodeRawSymbolsInternal<SymbolDecoderT<7>>(num_values, src_buffer,
  142|    111|                                                         out_values);
  143|    102|    case 8:
  ------------------
  |  Branch (143:5): [True: 102, False: 2.54k]
  ------------------
  144|    102|      return DecodeRawSymbolsInternal<SymbolDecoderT<8>>(num_values, src_buffer,
  145|    102|                                                         out_values);
  146|    118|    case 9:
  ------------------
  |  Branch (146:5): [True: 118, False: 2.52k]
  ------------------
  147|    118|      return DecodeRawSymbolsInternal<SymbolDecoderT<9>>(num_values, src_buffer,
  148|    118|                                                         out_values);
  149|     84|    case 10:
  ------------------
  |  Branch (149:5): [True: 84, False: 2.56k]
  ------------------
  150|     84|      return DecodeRawSymbolsInternal<SymbolDecoderT<10>>(
  151|     84|          num_values, src_buffer, out_values);
  152|    120|    case 11:
  ------------------
  |  Branch (152:5): [True: 120, False: 2.52k]
  ------------------
  153|    120|      return DecodeRawSymbolsInternal<SymbolDecoderT<11>>(
  154|    120|          num_values, src_buffer, out_values);
  155|    129|    case 12:
  ------------------
  |  Branch (155:5): [True: 129, False: 2.51k]
  ------------------
  156|    129|      return DecodeRawSymbolsInternal<SymbolDecoderT<12>>(
  157|    129|          num_values, src_buffer, out_values);
  158|    142|    case 13:
  ------------------
  |  Branch (158:5): [True: 142, False: 2.50k]
  ------------------
  159|    142|      return DecodeRawSymbolsInternal<SymbolDecoderT<13>>(
  160|    142|          num_values, src_buffer, out_values);
  161|    108|    case 14:
  ------------------
  |  Branch (161:5): [True: 108, False: 2.53k]
  ------------------
  162|    108|      return DecodeRawSymbolsInternal<SymbolDecoderT<14>>(
  163|    108|          num_values, src_buffer, out_values);
  164|    146|    case 15:
  ------------------
  |  Branch (164:5): [True: 146, False: 2.50k]
  ------------------
  165|    146|      return DecodeRawSymbolsInternal<SymbolDecoderT<15>>(
  166|    146|          num_values, src_buffer, out_values);
  167|    122|    case 16:
  ------------------
  |  Branch (167:5): [True: 122, False: 2.52k]
  ------------------
  168|    122|      return DecodeRawSymbolsInternal<SymbolDecoderT<16>>(
  169|    122|          num_values, src_buffer, out_values);
  170|    122|    case 17:
  ------------------
  |  Branch (170:5): [True: 122, False: 2.52k]
  ------------------
  171|    122|      return DecodeRawSymbolsInternal<SymbolDecoderT<17>>(
  172|    122|          num_values, src_buffer, out_values);
  173|    103|    case 18:
  ------------------
  |  Branch (173:5): [True: 103, False: 2.54k]
  ------------------
  174|    103|      return DecodeRawSymbolsInternal<SymbolDecoderT<18>>(
  175|    103|          num_values, src_buffer, out_values);
  176|    234|    default:
  ------------------
  |  Branch (176:5): [True: 234, False: 2.41k]
  ------------------
  177|    234|      return false;
  178|  2.64k|  }
  179|  2.64k|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi1EEEEEbjPNS_13DecoderBufferEPj:
   92|    318|                              uint32_t *out_values) {
   93|    318|  SymbolDecoderT decoder;
   94|    318|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 226, False: 92]
  ------------------
   95|    226|    return false;
   96|    226|  }
   97|       |
   98|     92|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 92, False: 0]
  |  Branch (98:25): [True: 19, False: 73]
  ------------------
   99|     19|    return false;  // Wrong number of symbols.
  100|     19|  }
  101|       |
  102|     73|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 16, False: 57]
  ------------------
  103|     16|    return false;
  104|     16|  }
  105|  5.14M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 5.14M, False: 57]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  5.14M|    const uint32_t value = decoder.DecodeSymbol();
  108|  5.14M|    out_values[i] = value;
  109|  5.14M|  }
  110|     57|  decoder.EndDecoding();
  111|     57|  return true;
  112|     73|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi2EEEEEbjPNS_13DecoderBufferEPj:
   92|    198|                              uint32_t *out_values) {
   93|    198|  SymbolDecoderT decoder;
   94|    198|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 79, False: 119]
  ------------------
   95|     79|    return false;
   96|     79|  }
   97|       |
   98|    119|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 119, False: 0]
  |  Branch (98:25): [True: 4, False: 115]
  ------------------
   99|      4|    return false;  // Wrong number of symbols.
  100|      4|  }
  101|       |
  102|    115|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 28, False: 87]
  ------------------
  103|     28|    return false;
  104|     28|  }
  105|  2.47M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.47M, False: 87]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.47M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.47M|    out_values[i] = value;
  109|  2.47M|  }
  110|     87|  decoder.EndDecoding();
  111|     87|  return true;
  112|    115|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi3EEEEEbjPNS_13DecoderBufferEPj:
   92|    148|                              uint32_t *out_values) {
   93|    148|  SymbolDecoderT decoder;
   94|    148|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 54, False: 94]
  ------------------
   95|     54|    return false;
   96|     54|  }
   97|       |
   98|     94|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 94, False: 0]
  |  Branch (98:25): [True: 2, False: 92]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|     92|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 29, False: 63]
  ------------------
  103|     29|    return false;
  104|     29|  }
  105|   431k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 431k, False: 63]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   431k|    const uint32_t value = decoder.DecodeSymbol();
  108|   431k|    out_values[i] = value;
  109|   431k|  }
  110|     63|  decoder.EndDecoding();
  111|     63|  return true;
  112|     92|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi4EEEEEbjPNS_13DecoderBufferEPj:
   92|    145|                              uint32_t *out_values) {
   93|    145|  SymbolDecoderT decoder;
   94|    145|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 45, False: 100]
  ------------------
   95|     45|    return false;
   96|     45|  }
   97|       |
   98|    100|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 100, False: 0]
  |  Branch (98:25): [True: 3, False: 97]
  ------------------
   99|      3|    return false;  // Wrong number of symbols.
  100|      3|  }
  101|       |
  102|     97|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 13, False: 84]
  ------------------
  103|     13|    return false;
  104|     13|  }
  105|  6.86M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 6.86M, False: 84]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  6.86M|    const uint32_t value = decoder.DecodeSymbol();
  108|  6.86M|    out_values[i] = value;
  109|  6.86M|  }
  110|     84|  decoder.EndDecoding();
  111|     84|  return true;
  112|     97|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi5EEEEEbjPNS_13DecoderBufferEPj:
   92|     85|                              uint32_t *out_values) {
   93|     85|  SymbolDecoderT decoder;
   94|     85|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 11, False: 74]
  ------------------
   95|     11|    return false;
   96|     11|  }
   97|       |
   98|     74|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 74, False: 0]
  |  Branch (98:25): [True: 28, False: 46]
  ------------------
   99|     28|    return false;  // Wrong number of symbols.
  100|     28|  }
  101|       |
  102|     46|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 0, False: 46]
  ------------------
  103|      0|    return false;
  104|      0|  }
  105|  4.24M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.24M, False: 46]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.24M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.24M|    out_values[i] = value;
  109|  4.24M|  }
  110|     46|  decoder.EndDecoding();
  111|     46|  return true;
  112|     46|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi6EEEEEbjPNS_13DecoderBufferEPj:
   92|    111|                              uint32_t *out_values) {
   93|    111|  SymbolDecoderT decoder;
   94|    111|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 47, False: 64]
  ------------------
   95|     47|    return false;
   96|     47|  }
   97|       |
   98|     64|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 64, False: 0]
  |  Branch (98:25): [True: 0, False: 64]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     64|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 24, False: 40]
  ------------------
  103|     24|    return false;
  104|     24|  }
  105|  4.56M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.56M, False: 40]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.56M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.56M|    out_values[i] = value;
  109|  4.56M|  }
  110|     40|  decoder.EndDecoding();
  111|     40|  return true;
  112|     64|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi7EEEEEbjPNS_13DecoderBufferEPj:
   92|    111|                              uint32_t *out_values) {
   93|    111|  SymbolDecoderT decoder;
   94|    111|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 72, False: 39]
  ------------------
   95|     72|    return false;
   96|     72|  }
   97|       |
   98|     39|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 39, False: 0]
  |  Branch (98:25): [True: 0, False: 39]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     39|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 13, False: 26]
  ------------------
  103|     13|    return false;
  104|     13|  }
  105|  4.01M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 4.01M, False: 26]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  4.01M|    const uint32_t value = decoder.DecodeSymbol();
  108|  4.01M|    out_values[i] = value;
  109|  4.01M|  }
  110|     26|  decoder.EndDecoding();
  111|     26|  return true;
  112|     39|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi8EEEEEbjPNS_13DecoderBufferEPj:
   92|    102|                              uint32_t *out_values) {
   93|    102|  SymbolDecoderT decoder;
   94|    102|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 54, False: 48]
  ------------------
   95|     54|    return false;
   96|     54|  }
   97|       |
   98|     48|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 48, False: 0]
  |  Branch (98:25): [True: 0, False: 48]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     48|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 25, False: 23]
  ------------------
  103|     25|    return false;
  104|     25|  }
  105|  2.25M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 2.25M, False: 23]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  2.25M|    const uint32_t value = decoder.DecodeSymbol();
  108|  2.25M|    out_values[i] = value;
  109|  2.25M|  }
  110|     23|  decoder.EndDecoding();
  111|     23|  return true;
  112|     48|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi9EEEEEbjPNS_13DecoderBufferEPj:
   92|    118|                              uint32_t *out_values) {
   93|    118|  SymbolDecoderT decoder;
   94|    118|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 63, False: 55]
  ------------------
   95|     63|    return false;
   96|     63|  }
   97|       |
   98|     55|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 55, False: 0]
  |  Branch (98:25): [True: 2, False: 53]
  ------------------
   99|      2|    return false;  // Wrong number of symbols.
  100|      2|  }
  101|       |
  102|     53|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 15, False: 38]
  ------------------
  103|     15|    return false;
  104|     15|  }
  105|  10.5M|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 10.5M, False: 38]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  10.5M|    const uint32_t value = decoder.DecodeSymbol();
  108|  10.5M|    out_values[i] = value;
  109|  10.5M|  }
  110|     38|  decoder.EndDecoding();
  111|     38|  return true;
  112|     53|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi10EEEEEbjPNS_13DecoderBufferEPj:
   92|     84|                              uint32_t *out_values) {
   93|     84|  SymbolDecoderT decoder;
   94|     84|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 48, False: 36]
  ------------------
   95|     48|    return false;
   96|     48|  }
   97|       |
   98|     36|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 36, False: 0]
  |  Branch (98:25): [True: 0, False: 36]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     36|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 22, False: 14]
  ------------------
  103|     22|    return false;
  104|     22|  }
  105|   162k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 162k, False: 14]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   162k|    const uint32_t value = decoder.DecodeSymbol();
  108|   162k|    out_values[i] = value;
  109|   162k|  }
  110|     14|  decoder.EndDecoding();
  111|     14|  return true;
  112|     36|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi11EEEEEbjPNS_13DecoderBufferEPj:
   92|    120|                              uint32_t *out_values) {
   93|    120|  SymbolDecoderT decoder;
   94|    120|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 59, False: 61]
  ------------------
   95|     59|    return false;
   96|     59|  }
   97|       |
   98|     61|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 61, False: 0]
  |  Branch (98:25): [True: 1, False: 60]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     60|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 30, False: 30]
  ------------------
  103|     30|    return false;
  104|     30|  }
  105|   154k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 154k, False: 30]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   154k|    const uint32_t value = decoder.DecodeSymbol();
  108|   154k|    out_values[i] = value;
  109|   154k|  }
  110|     30|  decoder.EndDecoding();
  111|     30|  return true;
  112|     60|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi12EEEEEbjPNS_13DecoderBufferEPj:
   92|    129|                              uint32_t *out_values) {
   93|    129|  SymbolDecoderT decoder;
   94|    129|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 66, False: 63]
  ------------------
   95|     66|    return false;
   96|     66|  }
   97|       |
   98|     63|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 63, False: 0]
  |  Branch (98:25): [True: 0, False: 63]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     63|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 42, False: 21]
  ------------------
  103|     42|    return false;
  104|     42|  }
  105|  48.9k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 48.9k, False: 21]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  48.9k|    const uint32_t value = decoder.DecodeSymbol();
  108|  48.9k|    out_values[i] = value;
  109|  48.9k|  }
  110|     21|  decoder.EndDecoding();
  111|     21|  return true;
  112|     63|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi13EEEEEbjPNS_13DecoderBufferEPj:
   92|    142|                              uint32_t *out_values) {
   93|    142|  SymbolDecoderT decoder;
   94|    142|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 65, False: 77]
  ------------------
   95|     65|    return false;
   96|     65|  }
   97|       |
   98|     77|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 77, False: 0]
  |  Branch (98:25): [True: 0, False: 77]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     77|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 45, False: 32]
  ------------------
  103|     45|    return false;
  104|     45|  }
  105|  92.0k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 91.9k, False: 32]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  91.9k|    const uint32_t value = decoder.DecodeSymbol();
  108|  91.9k|    out_values[i] = value;
  109|  91.9k|  }
  110|     32|  decoder.EndDecoding();
  111|     32|  return true;
  112|     77|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi14EEEEEbjPNS_13DecoderBufferEPj:
   92|    108|                              uint32_t *out_values) {
   93|    108|  SymbolDecoderT decoder;
   94|    108|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 67, False: 41]
  ------------------
   95|     67|    return false;
   96|     67|  }
   97|       |
   98|     41|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 41, False: 0]
  |  Branch (98:25): [True: 0, False: 41]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     41|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 18, False: 23]
  ------------------
  103|     18|    return false;
  104|     18|  }
  105|  56.6k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 56.6k, False: 23]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  56.6k|    const uint32_t value = decoder.DecodeSymbol();
  108|  56.6k|    out_values[i] = value;
  109|  56.6k|  }
  110|     23|  decoder.EndDecoding();
  111|     23|  return true;
  112|     41|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi15EEEEEbjPNS_13DecoderBufferEPj:
   92|    146|                              uint32_t *out_values) {
   93|    146|  SymbolDecoderT decoder;
   94|    146|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 56, False: 90]
  ------------------
   95|     56|    return false;
   96|     56|  }
   97|       |
   98|     90|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 90, False: 0]
  |  Branch (98:25): [True: 0, False: 90]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     90|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 60, False: 30]
  ------------------
  103|     60|    return false;
  104|     60|  }
  105|   192k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 192k, False: 30]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   192k|    const uint32_t value = decoder.DecodeSymbol();
  108|   192k|    out_values[i] = value;
  109|   192k|  }
  110|     30|  decoder.EndDecoding();
  111|     30|  return true;
  112|     90|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi16EEEEEbjPNS_13DecoderBufferEPj:
   92|    122|                              uint32_t *out_values) {
   93|    122|  SymbolDecoderT decoder;
   94|    122|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 54, False: 68]
  ------------------
   95|     54|    return false;
   96|     54|  }
   97|       |
   98|     68|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 68, False: 0]
  |  Branch (98:25): [True: 0, False: 68]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     68|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 41, False: 27]
  ------------------
  103|     41|    return false;
  104|     41|  }
  105|  69.8k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 69.8k, False: 27]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  69.8k|    const uint32_t value = decoder.DecodeSymbol();
  108|  69.8k|    out_values[i] = value;
  109|  69.8k|  }
  110|     27|  decoder.EndDecoding();
  111|     27|  return true;
  112|     68|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi17EEEEEbjPNS_13DecoderBufferEPj:
   92|    122|                              uint32_t *out_values) {
   93|    122|  SymbolDecoderT decoder;
   94|    122|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 42, False: 80]
  ------------------
   95|     42|    return false;
   96|     42|  }
   97|       |
   98|     80|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 80, False: 0]
  |  Branch (98:25): [True: 1, False: 79]
  ------------------
   99|      1|    return false;  // Wrong number of symbols.
  100|      1|  }
  101|       |
  102|     79|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 42, False: 37]
  ------------------
  103|     42|    return false;
  104|     42|  }
  105|   128k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 128k, False: 37]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|   128k|    const uint32_t value = decoder.DecodeSymbol();
  108|   128k|    out_values[i] = value;
  109|   128k|  }
  110|     37|  decoder.EndDecoding();
  111|     37|  return true;
  112|     79|}
_ZN5draco24DecodeRawSymbolsInternalINS_17RAnsSymbolDecoderILi18EEEEEbjPNS_13DecoderBufferEPj:
   92|    103|                              uint32_t *out_values) {
   93|    103|  SymbolDecoderT decoder;
   94|    103|  if (!decoder.Create(src_buffer)) {
  ------------------
  |  Branch (94:7): [True: 51, False: 52]
  ------------------
   95|     51|    return false;
   96|     51|  }
   97|       |
   98|     52|  if (num_values > 0 && decoder.num_symbols() == 0) {
  ------------------
  |  Branch (98:7): [True: 52, False: 0]
  |  Branch (98:25): [True: 0, False: 52]
  ------------------
   99|      0|    return false;  // Wrong number of symbols.
  100|      0|  }
  101|       |
  102|     52|  if (!decoder.StartDecoding(src_buffer)) {
  ------------------
  |  Branch (102:7): [True: 44, False: 8]
  ------------------
  103|     44|    return false;
  104|     44|  }
  105|  14.5k|  for (uint32_t i = 0; i < num_values; ++i) {
  ------------------
  |  Branch (105:24): [True: 14.5k, False: 8]
  ------------------
  106|       |    // Decode a symbol into the value.
  107|  14.5k|    const uint32_t value = decoder.DecodeSymbol();
  108|  14.5k|    out_values[i] = value;
  109|  14.5k|  }
  110|      8|  decoder.EndDecoding();
  111|      8|  return true;
  112|     52|}

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

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

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

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

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

_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE10GetDecoderEv:
   65|  3.63k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE14GetCornerTableEv:
   66|  1.59k|  const CornerTable *GetCornerTable() const override {
   67|  1.59k|    return corner_table_.get();
   68|  1.59k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  12.8M|                       int *out_encoder_split_symbol_id) {
   87|  12.8M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 1.93M, False: 10.9M]
  ------------------
   88|  1.93M|      return false;
   89|  1.93M|    }
   90|  10.9M|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 21, False: 10.9M]
  ------------------
   91|  10.9M|        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|     21|      *out_encoder_split_symbol_id = -1;
   98|     21|      return true;
   99|     21|    }
  100|  10.9M|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 10.9M, False: 964]
  ------------------
  101|  10.9M|      return false;
  102|  10.9M|    }
  103|    964|    *out_face_edge =
  104|    964|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|    964|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|    964|    topology_split_data_.pop_back();
  108|    964|    return true;
  109|  10.9M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  44.5M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  44.5M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  44.5M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  44.5M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_31MeshEdgebreakerTraversalDecoderEE13AttributeDataC2Ev:
  210|  3.79k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE10GetDecoderEv:
   65|  2.86k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE14GetCornerTableEv:
   66|  2.33k|  const CornerTable *GetCornerTable() const override {
   67|  2.33k|    return corner_table_.get();
   68|  2.33k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  31.4M|                       int *out_encoder_split_symbol_id) {
   87|  31.4M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 30.9M, False: 460k]
  ------------------
   88|  30.9M|      return false;
   89|  30.9M|    }
   90|   460k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 24, False: 460k]
  ------------------
   91|   460k|        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|     24|      *out_encoder_split_symbol_id = -1;
   98|     24|      return true;
   99|     24|    }
  100|   460k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 459k, False: 1.15k]
  ------------------
  101|   459k|      return false;
  102|   459k|    }
  103|  1.15k|    *out_face_edge =
  104|  1.15k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  1.15k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  1.15k|    topology_split_data_.pop_back();
  108|  1.15k|    return true;
  109|   460k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  90.8M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  90.8M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  90.8M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  90.8M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_41MeshEdgebreakerTraversalPredictiveDecoderEE13AttributeDataC2Ev:
  210|  4.15k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE10GetDecoderEv:
   65|  4.97k|  MeshEdgebreakerDecoder *GetDecoder() const override { return decoder_; }
_ZNK5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE14GetCornerTableEv:
   66|  1.11k|  const CornerTable *GetCornerTable() const override {
   67|  1.11k|    return corner_table_.get();
   68|  1.11k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE15IsTopologySplitEiPNS_12EdgeFaceNameEPi:
   86|  16.2M|                       int *out_encoder_split_symbol_id) {
   87|  16.2M|    if (topology_split_data_.size() == 0) {
  ------------------
  |  Branch (87:9): [True: 15.9M, False: 289k]
  ------------------
   88|  15.9M|      return false;
   89|  15.9M|    }
   90|   289k|    if (topology_split_data_.back().source_symbol_id >
  ------------------
  |  Branch (90:9): [True: 15, False: 289k]
  ------------------
   91|   289k|        static_cast<uint32_t>(encoder_symbol_id)) {
   92|       |      // Something is wrong; if the desired source symbol is greater than the
   93|       |      // current encoder_symbol_id, we missed it, or the input was tampered
   94|       |      // (|encoder_symbol_id| keeps decreasing).
   95|       |      // Return invalid symbol id to notify the decoder that there was an
   96|       |      // error.
   97|     15|      *out_encoder_split_symbol_id = -1;
   98|     15|      return true;
   99|     15|    }
  100|   289k|    if (topology_split_data_.back().source_symbol_id != encoder_symbol_id) {
  ------------------
  |  Branch (100:9): [True: 287k, False: 2.16k]
  ------------------
  101|   287k|      return false;
  102|   287k|    }
  103|  2.16k|    *out_face_edge =
  104|  2.16k|        static_cast<EdgeFaceName>(topology_split_data_.back().source_edge);
  105|  2.16k|    *out_encoder_split_symbol_id = topology_split_data_.back().split_symbol_id;
  106|       |    // Remove the latest split event.
  107|  2.16k|    topology_split_data_.pop_back();
  108|  2.16k|    return true;
  109|   289k|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE18SetOppositeCornersENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES5_:
  133|  16.8M|  void SetOppositeCorners(CornerIndex corner_0, CornerIndex corner_1) {
  134|  16.8M|    corner_table_->SetOppositeCorner(corner_0, corner_1);
  135|  16.8M|    corner_table_->SetOppositeCorner(corner_1, corner_0);
  136|  16.8M|  }
_ZN5draco26MeshEdgebreakerDecoderImplINS_38MeshEdgebreakerTraversalValenceDecoderEE13AttributeDataC2Ev:
  210|  1.68k|    AttributeData() : decoder_id(-1), is_connectivity_used(true) {}

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

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

_ZN5draco31MeshEdgebreakerTraversalDecoderC2Ev:
   33|  3.30k|      : attribute_connectivity_decoders_(nullptr),
   34|  3.30k|        num_attribute_data_(0),
   35|  3.30k|        decoder_impl_(nullptr) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder4InitEPNS_35MeshEdgebreakerDecoderImplInterfaceE:
   36|  3.04k|  void Init(MeshEdgebreakerDecoderImplInterface *decoder) {
   37|  3.04k|    decoder_impl_ = decoder;
   38|  3.04k|    buffer_.Init(decoder->GetDecoder()->buffer()->data_head(),
   39|  3.04k|                 decoder->GetDecoder()->buffer()->remaining_size(),
   40|  3.04k|                 decoder->GetDecoder()->buffer()->bitstream_version());
   41|  3.04k|  }
_ZNK5draco31MeshEdgebreakerTraversalDecoder16BitstreamVersionEv:
   44|  2.34k|  uint16_t BitstreamVersion() const {
   45|  2.34k|    return decoder_impl_->GetDecoder()->bitstream_version();
   46|  2.34k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder21SetNumEncodedVerticesEi:
   50|  1.21k|  void SetNumEncodedVertices(int /* num_vertices */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19SetNumAttributeDataEi:
   54|  3.04k|  void SetNumAttributeData(int num_data) { num_attribute_data_ = num_data; }
_ZN5draco31MeshEdgebreakerTraversalDecoder5StartEPNS_13DecoderBufferE:
   59|  2.16k|  bool Start(DecoderBuffer *out_buffer) {
   60|       |    // Decode symbols from the main buffer decoder and face configurations from
   61|       |    // the start_face_buffer decoder.
   62|  2.16k|    if (!DecodeTraversalSymbols()) {
  ------------------
  |  Branch (62:9): [True: 20, False: 2.14k]
  ------------------
   63|     20|      return false;
   64|     20|    }
   65|       |
   66|  2.14k|    if (!DecodeStartFaces()) {
  ------------------
  |  Branch (66:9): [True: 8, False: 2.13k]
  ------------------
   67|      8|      return false;
   68|      8|    }
   69|       |
   70|  2.13k|    if (!DecodeAttributeSeams()) {
  ------------------
  |  Branch (70:9): [True: 5, False: 2.13k]
  ------------------
   71|      5|      return false;
   72|      5|    }
   73|  2.13k|    *out_buffer = buffer_;
   74|  2.13k|    return true;
   75|  2.13k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder28DecodeStartFaceConfigurationEv:
   78|  3.87M|  inline bool DecodeStartFaceConfiguration() {
   79|  3.87M|    uint32_t face_configuration;
   80|  3.87M|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
   81|  3.87M|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.87M|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (81:9): [True: 706, False: 3.87M]
  ------------------
   82|    706|      start_face_buffer_.DecodeLeastSignificantBits32(1, &face_configuration);
   83|       |
   84|    706|    } else
   85|  3.87M|#endif
   86|  3.87M|    {
   87|  3.87M|      face_configuration = start_face_decoder_.DecodeNextBit();
   88|  3.87M|    }
   89|  3.87M|    return face_configuration;
   90|  3.87M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder12DecodeSymbolEv:
   93|  31.0M|  inline uint32_t DecodeSymbol() {
   94|  31.0M|    uint32_t symbol;
   95|  31.0M|    symbol_buffer_.DecodeLeastSignificantBits32(1, &symbol);
   96|  31.0M|    if (symbol == TOPOLOGY_C) {
  ------------------
  |  Branch (96:9): [True: 13.7M, False: 17.2M]
  ------------------
   97|  13.7M|      return symbol;
   98|  13.7M|    }
   99|       |    // Else decode two additional bits.
  100|  17.2M|    uint32_t symbol_suffix;
  101|  17.2M|    symbol_buffer_.DecodeLeastSignificantBits32(2, &symbol_suffix);
  102|  17.2M|    symbol |= (symbol_suffix << 1);
  103|  17.2M|    return symbol;
  104|  31.0M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder22NewActiveCornerReachedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|  30.8M|  inline void NewActiveCornerReached(CornerIndex /* corner */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder13MergeVerticesENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_:
  111|  4.27M|  inline void MergeVertices(VertexIndex /* dest */, VertexIndex /* source */) {}
_ZN5draco31MeshEdgebreakerTraversalDecoder19DecodeAttributeSeamEi:
  117|  10.7M|  inline bool DecodeAttributeSeam(int attribute) {
  118|  10.7M|    return attribute_connectivity_decoders_[attribute].DecodeNextBit();
  119|  10.7M|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder4DoneEv:
  122|  2.08k|  void Done() {
  123|  2.08k|    if (symbol_buffer_.bit_decoder_active()) {
  ------------------
  |  Branch (123:9): [True: 1.89k, False: 184]
  ------------------
  124|  1.89k|      symbol_buffer_.EndBitDecoding();
  125|  1.89k|    }
  126|  2.08k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  127|  2.08k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  2.08k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (127:9): [True: 472, False: 1.60k]
  ------------------
  128|    472|      start_face_buffer_.EndBitDecoding();
  129|       |
  130|    472|    } else
  131|  1.60k|#endif
  132|  1.60k|    {
  133|  1.60k|      start_face_decoder_.EndDecoding();
  134|  1.60k|    }
  135|  2.08k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder6bufferEv:
  138|    841|  DecoderBuffer *buffer() { return &buffer_; }
_ZN5draco31MeshEdgebreakerTraversalDecoder22DecodeTraversalSymbolsEv:
  140|  2.30k|  bool DecodeTraversalSymbols() {
  141|  2.30k|    uint64_t traversal_size;
  142|  2.30k|    symbol_buffer_ = buffer_;
  143|  2.30k|    if (!symbol_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (143:9): [True: 8, False: 2.29k]
  ------------------
  144|      8|      return false;
  145|      8|    }
  146|  2.29k|    buffer_ = symbol_buffer_;
  147|  2.29k|    if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (147:9): [True: 25, False: 2.26k]
  ------------------
  148|     25|      return false;
  149|     25|    }
  150|  2.26k|    buffer_.Advance(traversal_size);
  151|  2.26k|    return true;
  152|  2.29k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder16DecodeStartFacesEv:
  154|  3.00k|  bool DecodeStartFaces() {
  155|       |    // Create a decoder that is set to the end of the encoded traversal data.
  156|  3.00k|#ifdef DRACO_BACKWARDS_COMPATIBILITY_SUPPORTED
  157|  3.00k|    if (buffer_.bitstream_version() < DRACO_BITSTREAM_VERSION(2, 2)) {
  ------------------
  |  |  115|  3.00k|  ((static_cast<uint16_t>(MAJOR) << 8) | MINOR)
  ------------------
  |  Branch (157:9): [True: 627, False: 2.38k]
  ------------------
  158|    627|      start_face_buffer_ = buffer_;
  159|    627|      uint64_t traversal_size;
  160|    627|      if (!start_face_buffer_.StartBitDecoding(true, &traversal_size)) {
  ------------------
  |  Branch (160:11): [True: 0, False: 627]
  ------------------
  161|      0|        return false;
  162|      0|      }
  163|    627|      buffer_ = start_face_buffer_;
  164|    627|      if (traversal_size > static_cast<uint64_t>(buffer_.remaining_size())) {
  ------------------
  |  Branch (164:11): [True: 23, False: 604]
  ------------------
  165|     23|        return false;
  166|     23|      }
  167|    604|      buffer_.Advance(traversal_size);
  168|    604|      return true;
  169|    627|    }
  170|  2.38k|#endif
  171|  2.38k|    return start_face_decoder_.StartDecoding(&buffer_);
  172|  3.00k|  }
_ZN5draco31MeshEdgebreakerTraversalDecoder20DecodeAttributeSeamsEv:
  174|  2.98k|  bool DecodeAttributeSeams() {
  175|       |    // Prepare attribute decoding.
  176|  2.98k|    if (num_attribute_data_ > 0) {
  ------------------
  |  Branch (176:9): [True: 2.09k, False: 889]
  ------------------
  177|  2.09k|      attribute_connectivity_decoders_ = std::unique_ptr<BinaryDecoder[]>(
  178|  2.09k|          new BinaryDecoder[num_attribute_data_]);
  179|  7.20k|      for (int i = 0; i < num_attribute_data_; ++i) {
  ------------------
  |  Branch (179:23): [True: 5.11k, False: 2.08k]
  ------------------
  180|  5.11k|        if (!attribute_connectivity_decoders_[i].StartDecoding(&buffer_)) {
  ------------------
  |  Branch (180:13): [True: 9, False: 5.11k]
  ------------------
  181|      9|          return false;
  182|      9|        }
  183|  5.11k|      }
  184|  2.09k|    }
  185|  2.97k|    return true;
  186|  2.98k|  }

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

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

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

_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|    745|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  1.24M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  1.24M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 1.18M, False: 59.8k]
  ------------------
   61|  1.18M|      return true;  // Already traversed.
   62|  1.18M|    }
   63|       |
   64|  59.8k|    corner_traversal_stack_.clear();
   65|  59.8k|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  59.8k|    const VertexIndex next_vert =
   69|  59.8k|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  59.8k|    const VertexIndex prev_vert =
   71|  59.8k|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  59.8k|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 59.8k]
  |  Branch (72:45): [True: 0, False: 59.8k]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  59.8k|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 59.4k, False: 406]
  ------------------
   76|  59.4k|      this->MarkVertexVisited(next_vert);
   77|  59.4k|      this->traversal_observer().OnNewVertexVisited(
   78|  59.4k|          next_vert, this->corner_table()->Next(corner_id));
   79|  59.4k|    }
   80|  59.8k|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 2.06k, False: 57.8k]
  ------------------
   81|  2.06k|      this->MarkVertexVisited(prev_vert);
   82|  2.06k|      this->traversal_observer().OnNewVertexVisited(
   83|  2.06k|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  2.06k|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|   126k|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 66.2k, False: 59.8k]
  ------------------
   88|       |      // Currently processed corner.
   89|  66.2k|      corner_id = corner_traversal_stack_.back();
   90|  66.2k|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  66.2k|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 66.2k]
  |  Branch (92:47): [True: 391, False: 65.8k]
  ------------------
   93|       |        // This face has been already traversed.
   94|    391|        corner_traversal_stack_.pop_back();
   95|    391|        continue;
   96|    391|      }
   97|  1.24M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 1.24M, Folded]
  ------------------
   98|  1.24M|        this->MarkFaceVisited(face_id);
   99|  1.24M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  1.24M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  1.24M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 1.24M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  1.24M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 600k, False: 648k]
  ------------------
  105|   600k|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|   600k|          this->MarkVertexVisited(vert_id);
  107|   600k|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|   600k|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 589k, False: 10.3k]
  ------------------
  109|   589k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   589k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   589k|            continue;
  112|   589k|          }
  113|   600k|        }
  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|   659k|        const CornerIndex right_corner_id =
  118|   659k|            this->corner_table()->GetRightCorner(corner_id);
  119|   659k|        const CornerIndex left_corner_id =
  120|   659k|            this->corner_table()->GetLeftCorner(corner_id);
  121|   659k|        const FaceIndex right_face_id(
  122|   659k|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 7.92k, False: 651k]
  ------------------
  123|   659k|                 ? kInvalidFaceIndex
  124|   659k|                 : FaceIndex(right_corner_id.value() / 3)));
  125|   659k|        const FaceIndex left_face_id(
  126|   659k|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 61.6k, False: 597k]
  ------------------
  127|   659k|                 ? kInvalidFaceIndex
  128|   659k|                 : FaceIndex(left_corner_id.value() / 3)));
  129|   659k|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 623k, False: 35.8k]
  ------------------
  130|       |          // Right face has been already visited.
  131|   623k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 62.6k, False: 560k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  62.6k|            corner_traversal_stack_.pop_back();
  134|  62.6k|            break;  // Break from the while (true) loop.
  135|   560k|          } else {
  136|       |            // Go to the left face.
  137|   560k|            corner_id = left_corner_id;
  138|   560k|            face_id = left_face_id;
  139|   560k|          }
  140|   623k|        } else {
  141|       |          // Right face was not visited.
  142|  35.8k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 32.7k, False: 3.17k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  32.7k|            corner_id = right_corner_id;
  145|  32.7k|            face_id = right_face_id;
  146|  32.7k|          } 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|  3.17k|            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|  3.17k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  3.17k|            break;
  159|  3.17k|          }
  160|  35.8k|        }
  161|   659k|      }
  162|  65.8k|    }
  163|  59.8k|    return true;
  164|  59.8k|  }
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|    745|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  1.53k|  DepthFirstTraverser() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE16OnTraversalStartEv:
   54|  1.00k|  void OnTraversalStart() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18TraverseFromCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   59|  2.69M|  bool TraverseFromCorner(CornerIndex corner_id) {
   60|  2.69M|    if (this->IsFaceVisited(corner_id)) {
  ------------------
  |  Branch (60:9): [True: 966k, False: 1.72M]
  ------------------
   61|   966k|      return true;  // Already traversed.
   62|   966k|    }
   63|       |
   64|  1.72M|    corner_traversal_stack_.clear();
   65|  1.72M|    corner_traversal_stack_.push_back(corner_id);
   66|       |    // For the first face, check the remaining corners as they may not be
   67|       |    // processed yet.
   68|  1.72M|    const VertexIndex next_vert =
   69|  1.72M|        this->corner_table()->Vertex(this->corner_table()->Next(corner_id));
   70|  1.72M|    const VertexIndex prev_vert =
   71|  1.72M|        this->corner_table()->Vertex(this->corner_table()->Previous(corner_id));
   72|  1.72M|    if (next_vert == kInvalidVertexIndex || prev_vert == kInvalidVertexIndex) {
  ------------------
  |  Branch (72:9): [True: 0, False: 1.72M]
  |  Branch (72:45): [True: 0, False: 1.72M]
  ------------------
   73|      0|      return false;
   74|      0|    }
   75|  1.72M|    if (!this->IsVertexVisited(next_vert)) {
  ------------------
  |  Branch (75:9): [True: 1.72M, False: 1.35k]
  ------------------
   76|  1.72M|      this->MarkVertexVisited(next_vert);
   77|  1.72M|      this->traversal_observer().OnNewVertexVisited(
   78|  1.72M|          next_vert, this->corner_table()->Next(corner_id));
   79|  1.72M|    }
   80|  1.72M|    if (!this->IsVertexVisited(prev_vert)) {
  ------------------
  |  Branch (80:9): [True: 1.67M, False: 51.1k]
  ------------------
   81|  1.67M|      this->MarkVertexVisited(prev_vert);
   82|  1.67M|      this->traversal_observer().OnNewVertexVisited(
   83|  1.67M|          prev_vert, this->corner_table()->Previous(corner_id));
   84|  1.67M|    }
   85|       |
   86|       |    // Start the actual traversal.
   87|  3.49M|    while (!corner_traversal_stack_.empty()) {
  ------------------
  |  Branch (87:12): [True: 1.76M, False: 1.72M]
  ------------------
   88|       |      // Currently processed corner.
   89|  1.76M|      corner_id = corner_traversal_stack_.back();
   90|  1.76M|      FaceIndex face_id(corner_id.value() / 3);
   91|       |      // Make sure the face hasn't been visited yet.
   92|  1.76M|      if (corner_id == kInvalidCornerIndex || this->IsFaceVisited(face_id)) {
  ------------------
  |  Branch (92:11): [True: 0, False: 1.76M]
  |  Branch (92:47): [True: 3.91k, False: 1.76M]
  ------------------
   93|       |        // This face has been already traversed.
   94|  3.91k|        corner_traversal_stack_.pop_back();
   95|  3.91k|        continue;
   96|  3.91k|      }
   97|  2.69M|      while (true) {
  ------------------
  |  Branch (97:14): [True: 2.69M, Folded]
  ------------------
   98|  2.69M|        this->MarkFaceVisited(face_id);
   99|  2.69M|        this->traversal_observer().OnNewFaceVisited(face_id);
  100|  2.69M|        const VertexIndex vert_id = this->corner_table()->Vertex(corner_id);
  101|  2.69M|        if (vert_id == kInvalidVertexIndex) {
  ------------------
  |  Branch (101:13): [True: 0, False: 2.69M]
  ------------------
  102|      0|          return false;
  103|      0|        }
  104|  2.69M|        if (!this->IsVertexVisited(vert_id)) {
  ------------------
  |  Branch (104:13): [True: 2.17M, False: 519k]
  ------------------
  105|  2.17M|          const bool on_boundary = this->corner_table()->IsOnBoundary(vert_id);
  106|  2.17M|          this->MarkVertexVisited(vert_id);
  107|  2.17M|          this->traversal_observer().OnNewVertexVisited(vert_id, corner_id);
  108|  2.17M|          if (!on_boundary) {
  ------------------
  |  Branch (108:15): [True: 458k, False: 1.71M]
  ------------------
  109|   458k|            corner_id = this->corner_table()->GetRightCorner(corner_id);
  110|   458k|            face_id = FaceIndex(corner_id.value() / 3);
  111|   458k|            continue;
  112|   458k|          }
  113|  2.17M|        }
  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.23M|        const CornerIndex right_corner_id =
  118|  2.23M|            this->corner_table()->GetRightCorner(corner_id);
  119|  2.23M|        const CornerIndex left_corner_id =
  120|  2.23M|            this->corner_table()->GetLeftCorner(corner_id);
  121|  2.23M|        const FaceIndex right_face_id(
  122|  2.23M|            (right_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (122:14): [True: 1.69M, False: 536k]
  ------------------
  123|  2.23M|                 ? kInvalidFaceIndex
  124|  2.23M|                 : FaceIndex(right_corner_id.value() / 3)));
  125|  2.23M|        const FaceIndex left_face_id(
  126|  2.23M|            (left_corner_id == kInvalidCornerIndex
  ------------------
  |  Branch (126:14): [True: 1.74M, False: 492k]
  ------------------
  127|  2.23M|                 ? kInvalidFaceIndex
  128|  2.23M|                 : FaceIndex(left_corner_id.value() / 3)));
  129|  2.23M|        if (this->IsFaceVisited(right_face_id)) {
  ------------------
  |  Branch (129:13): [True: 2.16M, False: 70.9k]
  ------------------
  130|       |          // Right face has been already visited.
  131|  2.16M|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (131:15): [True: 1.74M, False: 419k]
  ------------------
  132|       |            // Both neighboring faces are visited. End reached.
  133|  1.74M|            corner_traversal_stack_.pop_back();
  134|  1.74M|            break;  // Break from the while (true) loop.
  135|  1.74M|          } else {
  136|       |            // Go to the left face.
  137|   419k|            corner_id = left_corner_id;
  138|   419k|            face_id = left_face_id;
  139|   419k|          }
  140|  2.16M|        } else {
  141|       |          // Right face was not visited.
  142|  70.9k|          if (this->IsFaceVisited(left_face_id)) {
  ------------------
  |  Branch (142:15): [True: 49.9k, False: 21.0k]
  ------------------
  143|       |            // Left face visited, go to the right one.
  144|  49.9k|            corner_id = right_corner_id;
  145|  49.9k|            face_id = right_face_id;
  146|  49.9k|          } else {
  147|       |            // Both neighboring faces are unvisited, we need to visit both of
  148|       |            // them.
  149|       |
  150|       |            // Split the traversal.
  151|       |            // First make the top of the current corner stack point to the left
  152|       |            // face (this one will be processed second).
  153|  21.0k|            corner_traversal_stack_.back() = left_corner_id;
  154|       |            // Add a new corner to the top of the stack (right face needs to
  155|       |            // be traversed first).
  156|  21.0k|            corner_traversal_stack_.push_back(right_corner_id);
  157|       |            // Break from the while (true) loop.
  158|  21.0k|            break;
  159|  21.0k|          }
  160|  70.9k|        }
  161|  2.23M|      }
  162|  1.76M|    }
  163|  1.72M|    return true;
  164|  1.72M|  }
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE14OnTraversalEndEv:
   57|  1.00k|  void OnTraversalEnd() {}
_ZN5draco19DepthFirstTraverserINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   51|  2.06k|  DepthFirstTraverser() {}

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

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

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

_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  2.06k|  virtual ~TraverserBase() = default;
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  11.8M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  5.87M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  5.87M|    return is_vertex_visited_[vert_id.value()];
   65|  5.87M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  1.08M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  1.08M|    is_vertex_visited_[vert_id.value()] = true;
   68|  1.08M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  3.15M|  inline TraversalObserverT &traversal_observer() {
   75|  3.15M|    return traversal_observer_;
   76|  3.15M|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  4.68M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  4.68M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 87.0k, False: 4.59M]
  ------------------
   47|  87.0k|      return true;  // Invalid faces are always considered as visited.
   48|  87.0k|    }
   49|  4.59M|    return is_face_visited_[face_id.value()];
   50|  4.68M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  2.07M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  2.07M|    is_face_visited_[face_id.value()] = true;
   62|  2.07M|  }
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  1.85k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEED2Ev:
   33|  1.85k|  virtual ~TraverserBase() = default;
_ZN5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|    929|                    TraversalObserver traversal_observer) {
   37|    929|    corner_table_ = corner_table;
   38|    929|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|    929|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|    929|    traversal_observer_ = traversal_observer;
   41|    929|  }
_ZNK5draco13TraverserBaseINS_11CornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  1.24M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  1.24M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 1.24M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  1.24M|    return is_face_visited_[corner_id.value() / 3];
   58|  1.24M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE12corner_tableEv:
   70|  20.0M|  inline const CornerTable *corner_table() const { return corner_table_; }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   53|  2.69M|  inline bool IsFaceVisited(CornerIndex corner_id) const {
   54|  2.69M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (54:9): [True: 0, False: 2.69M]
  ------------------
   55|      0|      return true;  // Invalid faces are always considered as visited.
   56|      0|    }
   57|  2.69M|    return is_face_visited_[corner_id.value() / 3];
   58|  2.69M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15IsVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   63|  6.14M|  inline bool IsVertexVisited(VertexIndex vert_id) const {
   64|  6.14M|    return is_vertex_visited_[vert_id.value()];
   65|  6.14M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE17MarkVertexVisitedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
   66|  5.57M|  inline void MarkVertexVisited(VertexIndex vert_id) {
   67|  5.57M|    is_vertex_visited_[vert_id.value()] = true;
   68|  5.57M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE18traversal_observerEv:
   74|  8.26M|  inline TraversalObserverT &traversal_observer() {
   75|  8.26M|    return traversal_observer_;
   76|  8.26M|  }
_ZNK5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE13IsFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   45|  6.23M|  inline bool IsFaceVisited(FaceIndex face_id) const {
   46|  6.23M|    if (face_id == kInvalidFaceIndex) {
  ------------------
  |  Branch (46:9): [True: 3.43M, False: 2.79M]
  ------------------
   47|  3.43M|      return true;  // Invalid faces are always considered as visited.
   48|  3.43M|    }
   49|  2.79M|    return is_face_visited_[face_id.value()];
   50|  6.23M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE15MarkFaceVisitedENS_9IndexTypeIjNS_19FaceIndex_tag_type_EEE:
   60|  2.69M|  inline void MarkFaceVisited(FaceIndex face_id) {
   61|  2.69M|    is_face_visited_[face_id.value()] = true;
   62|  2.69M|  }
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEEC2Ev:
   32|  2.06k|  TraverserBase() : corner_table_(nullptr) {}
_ZN5draco13TraverserBaseINS_24MeshAttributeCornerTableENS_36MeshAttributeIndicesEncodingObserverIS1_EEE4InitEPKS1_S3_:
   36|  1.03k|                    TraversalObserver traversal_observer) {
   37|  1.03k|    corner_table_ = corner_table;
   38|  1.03k|    is_face_visited_.assign(corner_table->num_faces(), false);
   39|  1.03k|    is_vertex_visited_.assign(corner_table_->num_vertices(), false);
   40|  1.03k|    traversal_observer_ = traversal_observer;
   41|  1.03k|  }

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

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

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

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

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

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

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

_ZN5draco13DecoderBuffer28DecodeLeastSignificantBits32EjPj:
   57|  57.9M|  bool DecodeLeastSignificantBits32(uint32_t nbits, uint32_t *out_value) {
   58|  57.9M|    if (!bit_decoder_active()) {
  ------------------
  |  Branch (58:9): [True: 0, False: 57.9M]
  ------------------
   59|      0|      return false;
   60|      0|    }
   61|  57.9M|    return bit_decoder_.GetBits(nbits, out_value);
   62|  57.9M|  }
_ZN5draco13DecoderBuffer6DecodeEPvm:
   76|   191M|  bool Decode(void *out_data, size_t size_to_decode) {
   77|   191M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (77:9): [True: 220, False: 191M]
  ------------------
   78|    220|      return false;  // Buffer overflow.
   79|    220|    }
   80|   191M|    memcpy(out_data, (data_ + pos_), size_to_decode);
   81|   191M|    pos_ += size_to_decode;
   82|   191M|    return true;
   83|   191M|  }
_ZN5draco13DecoderBuffer7AdvanceEl:
  105|  14.6k|  void Advance(int64_t bytes) { pos_ += bytes; }
_ZN5draco13DecoderBuffer21set_bitstream_versionEt:
  111|  4.63k|  void set_bitstream_version(uint16_t version) { bitstream_version_ = version; }
_ZNK5draco13DecoderBuffer9data_headEv:
  114|  21.6k|  const char *data_head() const { return data_ + pos_; }
_ZNK5draco13DecoderBuffer14remaining_sizeEv:
  115|   249k|  int64_t remaining_size() const { return data_size_ - pos_; }
_ZNK5draco13DecoderBuffer12decoded_sizeEv:
  116|  3.04k|  int64_t decoded_size() const { return pos_; }
_ZNK5draco13DecoderBuffer18bit_decoder_activeEv:
  117|  57.9M|  bool bit_decoder_active() const { return bit_mode_; }
_ZNK5draco13DecoderBuffer17bitstream_versionEv:
  120|  3.90M|  uint16_t bitstream_version() const { return bitstream_version_; }
_ZN5draco13DecoderBuffer10BitDecoder5resetEPKvm:
  130|  4.33k|    inline void reset(const void *b, size_t s) {
  131|  4.33k|      bit_offset_ = 0;
  132|  4.33k|      bit_buffer_ = static_cast<const uint8_t *>(b);
  133|  4.33k|      bit_buffer_end_ = bit_buffer_ + s;
  134|  4.33k|    }
_ZNK5draco13DecoderBuffer10BitDecoder11BitsDecodedEv:
  137|  3.77k|    inline uint64_t BitsDecoded() const {
  138|  3.77k|      return static_cast<uint64_t>(bit_offset_);
  139|  3.77k|    }
_ZN5draco13DecoderBuffer10BitDecoder7GetBitsEjPj:
  160|  57.9M|    inline bool GetBits(uint32_t nbits, uint32_t *x) {
  161|  57.9M|      if (nbits > 32) {
  ------------------
  |  Branch (161:11): [True: 14, False: 57.9M]
  ------------------
  162|     14|        return false;
  163|     14|      }
  164|  57.9M|      uint32_t value = 0;
  165|   129M|      for (uint32_t bit = 0; bit < nbits; ++bit) {
  ------------------
  |  Branch (165:30): [True: 71.8M, False: 57.9M]
  ------------------
  166|  71.8M|        value |= GetBit() << bit;
  167|  71.8M|      }
  168|  57.9M|      *x = value;
  169|  57.9M|      return true;
  170|  57.9M|    }
_ZN5draco13DecoderBuffer10BitDecoder6GetBitEv:
  175|  71.8M|    inline int GetBit() {
  176|  71.8M|      const size_t off = bit_offset_;
  177|  71.8M|      const size_t byte_offset = off >> 3;
  178|  71.8M|      const int bit_shift = static_cast<int>(off & 0x7);
  179|  71.8M|      if (bit_buffer_ + byte_offset < bit_buffer_end_) {
  ------------------
  |  Branch (179:11): [True: 62.2M, False: 9.55M]
  ------------------
  180|  62.2M|        const int bit = (bit_buffer_[byte_offset] >> bit_shift) & 1;
  181|  62.2M|        bit_offset_ = off + 1;
  182|  62.2M|        return bit;
  183|  62.2M|      }
  184|  9.55M|      return 0;
  185|  71.8M|    }
_ZN5draco13DecoderBuffer6DecodeIhEEbPT_:
   68|  20.3M|  bool Decode(T *out_val) {
   69|  20.3M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 1.19k, False: 20.3M]
  ------------------
   70|  1.19k|      return false;
   71|  1.19k|    }
   72|  20.3M|    pos_ += sizeof(T);
   73|  20.3M|    return true;
   74|  20.3M|  }
_ZN5draco13DecoderBuffer4PeekIhEEbPT_:
   87|  20.3M|  bool Peek(T *out_val) {
   88|  20.3M|    const size_t size_to_decode = sizeof(T);
   89|  20.3M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 1.19k, False: 20.3M]
  ------------------
   90|  1.19k|      return false;  // Buffer overflow.
   91|  1.19k|    }
   92|  20.3M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  20.3M|    return true;
   94|  20.3M|  }
_ZN5draco13DecoderBuffer6DecodeIiEEbPT_:
   68|  7.44k|  bool Decode(T *out_val) {
   69|  7.44k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 28, False: 7.41k]
  ------------------
   70|     28|      return false;
   71|     28|    }
   72|  7.41k|    pos_ += sizeof(T);
   73|  7.41k|    return true;
   74|  7.44k|  }
_ZN5draco13DecoderBuffer4PeekIiEEbPT_:
   87|  7.44k|  bool Peek(T *out_val) {
   88|  7.44k|    const size_t size_to_decode = sizeof(T);
   89|  7.44k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 28, False: 7.41k]
  ------------------
   90|     28|      return false;  // Buffer overflow.
   91|     28|    }
   92|  7.41k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  7.41k|    return true;
   94|  7.44k|  }
_ZN5draco13DecoderBuffer6DecodeIjEEbPT_:
   68|   935k|  bool Decode(T *out_val) {
   69|   935k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 74, False: 935k]
  ------------------
   70|     74|      return false;
   71|     74|    }
   72|   935k|    pos_ += sizeof(T);
   73|   935k|    return true;
   74|   935k|  }
_ZN5draco13DecoderBuffer4PeekIjEEbPT_:
   87|   935k|  bool Peek(T *out_val) {
   88|   935k|    const size_t size_to_decode = sizeof(T);
   89|   935k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 74, False: 935k]
  ------------------
   90|     74|      return false;  // Buffer overflow.
   91|     74|    }
   92|   935k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|   935k|    return true;
   94|   935k|  }
_ZN5draco13DecoderBuffer6DecodeIaEEbPT_:
   68|  17.3k|  bool Decode(T *out_val) {
   69|  17.3k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 154, False: 17.2k]
  ------------------
   70|    154|      return false;
   71|    154|    }
   72|  17.2k|    pos_ += sizeof(T);
   73|  17.2k|    return true;
   74|  17.3k|  }
_ZN5draco13DecoderBuffer4PeekIaEEbPT_:
   87|  17.3k|  bool Peek(T *out_val) {
   88|  17.3k|    const size_t size_to_decode = sizeof(T);
   89|  17.3k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 154, False: 17.2k]
  ------------------
   90|    154|      return false;  // Buffer overflow.
   91|    154|    }
   92|  17.2k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  17.2k|    return true;
   94|  17.3k|  }
_ZN5draco13DecoderBuffer6DecodeINS_13HoleEventDataEEEbPT_:
   68|  1.34M|  bool Decode(T *out_val) {
   69|  1.34M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 84, False: 1.34M]
  ------------------
   70|     84|      return false;
   71|     84|    }
   72|  1.34M|    pos_ += sizeof(T);
   73|  1.34M|    return true;
   74|  1.34M|  }
_ZN5draco13DecoderBuffer4PeekINS_13HoleEventDataEEEbPT_:
   87|  1.34M|  bool Peek(T *out_val) {
   88|  1.34M|    const size_t size_to_decode = sizeof(T);
   89|  1.34M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 84, False: 1.34M]
  ------------------
   90|     84|      return false;  // Buffer overflow.
   91|     84|    }
   92|  1.34M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.34M|    return true;
   94|  1.34M|  }
_ZN5draco13DecoderBuffer6DecodeItEEbPT_:
   68|  1.62M|  bool Decode(T *out_val) {
   69|  1.62M|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 7, False: 1.62M]
  ------------------
   70|      7|      return false;
   71|      7|    }
   72|  1.62M|    pos_ += sizeof(T);
   73|  1.62M|    return true;
   74|  1.62M|  }
_ZN5draco13DecoderBuffer4PeekItEEbPT_:
   87|  1.62M|  bool Peek(T *out_val) {
   88|  1.62M|    const size_t size_to_decode = sizeof(T);
   89|  1.62M|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 7, False: 1.62M]
  ------------------
   90|      7|      return false;  // Buffer overflow.
   91|      7|    }
   92|  1.62M|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.62M|    return true;
   94|  1.62M|  }
_ZN5draco13DecoderBuffer6DecodeImEEbPT_:
   68|  1.50k|  bool Decode(T *out_val) {
   69|  1.50k|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 1, False: 1.50k]
  ------------------
   70|      1|      return false;
   71|      1|    }
   72|  1.50k|    pos_ += sizeof(T);
   73|  1.50k|    return true;
   74|  1.50k|  }
_ZN5draco13DecoderBuffer4PeekImEEbPT_:
   87|  1.50k|  bool Peek(T *out_val) {
   88|  1.50k|    const size_t size_to_decode = sizeof(T);
   89|  1.50k|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 1, False: 1.50k]
  ------------------
   90|      1|      return false;  // Buffer overflow.
   91|      1|    }
   92|  1.50k|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|  1.50k|    return true;
   94|  1.50k|  }
_ZN5draco13DecoderBuffer6DecodeIfEEbPT_:
   68|    151|  bool Decode(T *out_val) {
   69|    151|    if (!Peek(out_val)) {
  ------------------
  |  Branch (69:9): [True: 5, False: 146]
  ------------------
   70|      5|      return false;
   71|      5|    }
   72|    146|    pos_ += sizeof(T);
   73|    146|    return true;
   74|    151|  }
_ZN5draco13DecoderBuffer4PeekIfEEbPT_:
   87|    151|  bool Peek(T *out_val) {
   88|    151|    const size_t size_to_decode = sizeof(T);
   89|    151|    if (data_size_ < static_cast<int64_t>(pos_ + size_to_decode)) {
  ------------------
  |  Branch (89:9): [True: 5, False: 146]
  ------------------
   90|      5|      return false;  // Buffer overflow.
   91|      5|    }
   92|    146|    memcpy(out_val, (data_ + pos_), size_to_decode);
   93|    146|    return true;
   94|    151|  }

_ZNK5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EE5valueEv:
   73|  63.2M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EE5valueEv:
   73|  74.2M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEgeERKj:
   98|  5.79M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  5.79M|    return value_ >= val;
  100|  5.79M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EE5valueEv:
   73|   190M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EE5valueEv:
   73|  2.45G|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKj:
   90|  15.6M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEaSERKS2_:
  151|  62.6M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  62.6M|    value_ = i.value_;
  153|  62.6M|    return *this;
  154|  62.6M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKS2_:
  151|   502M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   502M|    value_ = i.value_;
  153|   502M|    return *this;
  154|   502M|  }
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEppEv:
  102|  15.6M|  inline ThisIndexType &operator++() {
  103|  15.6M|    ++value_;
  104|  15.6M|    return *this;
  105|  15.6M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEeqERKS2_:
   75|  1.77G|  constexpr bool operator==(const IndexType &i) const {
   76|  1.77G|    return value_ == i.value_;
   77|  1.77G|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EE5valueEv:
   73|   693M|  constexpr ValueTypeT value() const { return value_; }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKS2_:
   87|  11.2k|  constexpr bool operator<(const IndexType &i) const {
   88|  11.2k|    return value_ < i.value_;
   89|  11.2k|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEeqERKS2_:
   75|   124M|  constexpr bool operator==(const IndexType &i) const {
   76|   124M|    return value_ == i.value_;
   77|   124M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEmiERKj:
  131|   108M|  constexpr ThisIndexType operator-(const ValueTypeT &val) const {
  132|   108M|    return ThisIndexType(value_ - val);
  133|   108M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEplERKj:
  125|   623M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|   623M|    return ThisIndexType(value_ + val);
  127|   623M|  }
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEeqERKS2_:
   75|  10.9M|  constexpr bool operator==(const IndexType &i) const {
   76|  10.9M|    return value_ == i.value_;
   77|  10.9M|  }
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEneERKS2_:
   81|   198M|  constexpr bool operator!=(const IndexType &i) const {
   82|   198M|    return value_ != i.value_;
   83|   198M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEneERKS2_:
   81|   262M|  constexpr bool operator!=(const IndexType &i) const {
   82|   262M|    return value_ != i.value_;
   83|   262M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEppEv:
  102|   431M|  inline ThisIndexType &operator++() {
  103|   431M|    ++value_;
  104|   431M|    return *this;
  105|   431M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEaSERKS2_:
  151|   363M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   363M|    value_ = i.value_;
  153|   363M|    return *this;
  154|   363M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEaSERKS2_:
  151|   844M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|   844M|    value_ = i.value_;
  153|   844M|    return *this;
  154|   844M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEgeERKj:
   98|  29.6M|  constexpr bool operator>=(const ValueTypeT &val) const {
   99|  29.6M|    return value_ >= val;
  100|  29.6M|  }
_ZNK5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEltERKj:
   90|  5.41M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ej:
   71|   884M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2ERKS2_:
   70|  14.3G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2Ej:
   71|   145M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2ERKS2_:
   70|  10.5G|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEC2Ev:
   69|   162M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEplERKj:
  125|  18.0M|  constexpr ThisIndexType operator+(const ValueTypeT &val) const {
  126|  18.0M|    return ThisIndexType(value_ + val);
  127|  18.0M|  }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEC2Ej:
   71|   120M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEltERKS2_:
   87|  14.8M|  constexpr bool operator<(const IndexType &i) const {
   88|  14.8M|    return value_ < i.value_;
   89|  14.8M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2ERKS2_:
   70|   159M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ev:
   69|   504M|  constexpr IndexType() : value_(ValueTypeT()) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEC2ERKS2_:
   70|  39.6M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2Ej:
   71|  45.7M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZN5draco9IndexTypeIjNS_29AttributeValueIndex_tag_type_EEC2ERKS2_:
   70|   194M|  constexpr IndexType(const IndexType &i) : value_(i.value_) {}
_ZN5draco9IndexTypeIjNS_19FaceIndex_tag_type_EEaSERKS2_:
  151|  2.93M|  inline ThisIndexType &operator=(const ThisIndexType &i) {
  152|  2.93M|    value_ = i.value_;
  153|  2.93M|    return *this;
  154|  2.93M|  }
_ZN5draco9IndexTypeIjNS_21CornerIndex_tag_type_EEpLERKj:
  139|  5.41M|  inline ThisIndexType operator+=(const ValueTypeT &val) {
  140|  5.41M|    value_ += val;
  141|  5.41M|    return *this;
  142|  5.41M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEaSERKj:
  155|  19.2M|  inline ThisIndexType &operator=(const ValueTypeT &val) {
  156|  19.2M|    value_ = val;
  157|  19.2M|    return *this;
  158|  19.2M|  }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEC2Ej:
   71|   484M|  constexpr explicit IndexType(ValueTypeT value) : value_(value) {}
_ZNK5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEltERKj:
   90|  3.79M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_21VertexIndex_tag_type_EEppEv:
  102|  3.79M|  inline ThisIndexType &operator++() {
  103|  3.79M|    ++value_;
  104|  3.79M|    return *this;
  105|  3.79M|  }
_ZNK5draco9IndexTypeIjNS_20PointIndex_tag_type_EEltERKj:
   90|  16.0M|  constexpr bool operator<(const ValueTypeT &val) const { return value_ < val; }
_ZN5draco9IndexTypeIjNS_20PointIndex_tag_type_EEppEv:
  102|  16.0M|  inline ThisIndexType &operator++() {
  103|  16.0M|    ++value_;
  104|  16.0M|    return *this;
  105|  16.0M|  }

_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEixERKS3_:
   73|  28.5M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  28.5M|    return vector_[index.value()];
   75|  28.5M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE4sizeEv:
   59|  16.0M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE5clearEv:
   48|  9.44k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEE6resizeEmRKS5_:
   51|  12.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|  45.6M|  inline reference operator[](const IndexTypeT &index) {
   71|  45.6M|    return vector_[index.value()];
   72|  45.6M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE9push_backERKS8_:
   62|   641k|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE4sizeEv:
   59|  11.5M|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEE6resizeEmRKS8_:
   51|  2.08k|  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|  5.79M|  inline reference operator[](const IndexTypeT &index) {
   71|  5.79M|    return vector_[index.value()];
   72|  5.79M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEixERKS3_:
   73|  16.5M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  16.5M|    return vector_[index.value()];
   75|  16.5M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE4sizeEv:
   59|   145M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE4sizeEv:
   59|  7.11M|  size_t size() const { return vector_.size(); }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   73|   243M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   243M|    return vector_[index.value()];
   75|   243M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   73|   607M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|   607M|    return vector_[index.value()];
   75|   607M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEixERKS3_:
   70|   342M|  inline reference operator[](const IndexTypeT &index) {
   71|   342M|    return vector_[index.value()];
   72|   342M|  }
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   73|  58.4M|  inline const_reference operator[](const IndexTypeT &index) const {
   74|  58.4M|    return vector_[index.value()];
   75|  58.4M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EixERKS3_:
   70|   304M|  inline reference operator[](const IndexTypeT &index) {
   71|   304M|    return vector_[index.value()];
   72|   304M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE9push_backERKS5_:
   62|  78.5M|  void push_back(const ValueTypeT &val) { vector_.push_back(val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEixERKS3_:
   70|   186M|  inline reference operator[](const IndexTypeT &index) {
   71|   186M|    return vector_[index.value()];
   72|   186M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE6resizeEmRKi:
   51|  1.00k|  void resize(size_t size, const ValueTypeT &val) { vector_.resize(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEixERKS3_:
   70|  66.1M|  inline reference operator[](const IndexTypeT &index) {
   71|  66.1M|    return vector_[index.value()];
   72|  66.1M|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiEC2Ev:
   39|  21.9k|  IndexTypeVector() {}
_ZNK5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4sizeEv:
   59|   822k|  size_t size() const { return vector_.size(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaEC2Ev:
   39|  20.7k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEEC2Ev:
   39|  3.26k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_EC2Ev:
   39|  3.26k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEEC2Ev:
   39|  3.26k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEES3_EC2Ev:
   39|  3.26k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE5clearEv:
   48|  7.81k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEiE4swapERS4_:
   55|  7.81k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  7.81k|    vector_.swap(arg.vector_);
   57|  7.81k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE5clearEv:
   48|  7.81k|  void clear() { vector_.clear(); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEEaE4swapERS4_:
   55|  7.81k|  void swap(IndexTypeVector<IndexTypeT, ValueTypeT> &arg) {
   56|  7.81k|    vector_.swap(arg.vector_);
   57|  7.81k|  }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEEE6assignEmRKS5_:
   52|  3.26k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_E6assignEmRKS3_:
   52|  3.26k|  void assign(size_t size, const ValueTypeT &val) { vector_.assign(size, val); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEEE7reserveEm:
   49|  3.26k|  void reserve(size_t size) { vector_.reserve(size); }
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_19FaceIndex_tag_type_EEENSt3__15arrayINS1_IjNS_20PointIndex_tag_type_EEELm3EEEEC2Ev:
   39|  4.63k|  IndexTypeVector() {}
_ZN5draco15IndexTypeVectorINS_9IndexTypeIjNS_20PointIndex_tag_type_EEENS1_IjNS_29AttributeValueIndex_tag_type_EEEEC2Ev:
   39|  40.4k|  IndexTypeVector() {}

_ZN5draco14DataTypeLengthENS_8DataTypeE:
   19|  63.3k|int32_t DataTypeLength(DataType dt) {
   20|  63.3k|  switch (dt) {
   21|  34.7k|    case DT_INT8:
  ------------------
  |  Branch (21:5): [True: 34.7k, False: 28.6k]
  ------------------
   22|  36.3k|    case DT_UINT8:
  ------------------
  |  Branch (22:5): [True: 1.65k, False: 61.7k]
  ------------------
   23|  36.3k|      return 1;
   24|  1.17k|    case DT_INT16:
  ------------------
  |  Branch (24:5): [True: 1.17k, False: 62.2k]
  ------------------
   25|  1.28k|    case DT_UINT16:
  ------------------
  |  Branch (25:5): [True: 116, False: 63.2k]
  ------------------
   26|  1.28k|      return 2;
   27|  22.3k|    case DT_INT32:
  ------------------
  |  Branch (27:5): [True: 22.3k, False: 41.0k]
  ------------------
   28|  22.7k|    case DT_UINT32:
  ------------------
  |  Branch (28:5): [True: 361, False: 63.0k]
  ------------------
   29|  22.7k|      return 4;
   30|    353|    case DT_INT64:
  ------------------
  |  Branch (30:5): [True: 353, False: 63.0k]
  ------------------
   31|    656|    case DT_UINT64:
  ------------------
  |  Branch (31:5): [True: 303, False: 63.0k]
  ------------------
   32|    656|      return 8;
   33|  1.92k|    case DT_FLOAT32:
  ------------------
  |  Branch (33:5): [True: 1.92k, False: 61.4k]
  ------------------
   34|  1.92k|      return 4;
   35|    119|    case DT_FLOAT64:
  ------------------
  |  Branch (35:5): [True: 119, False: 63.2k]
  ------------------
   36|    119|      return 8;
   37|    297|    case DT_BOOL:
  ------------------
  |  Branch (37:5): [True: 297, False: 63.0k]
  ------------------
   38|    297|      return 1;
   39|      0|    default:
  ------------------
  |  Branch (39:5): [True: 0, False: 63.3k]
  ------------------
   40|      0|      return -1;
   41|  63.3k|  }
   42|  63.3k|}

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

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

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

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

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

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

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

_ZN5draco12DecodeVarintIjEEbPT_PNS_13DecoderBufferE:
   63|  1.03M|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  1.03M|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 1.03M, Folded]
  ------------------
   65|  1.03M|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 356, False: 1.03M]
  ------------------
   66|    356|      return false;
   67|    356|    }
   68|  1.03M|  } 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.03M|  return true;
   77|  1.03M|}
mesh_edgebreaker_decoder_impl.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   738k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   738k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   738k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 84, False: 738k]
  ------------------
   33|     84|    return false;
   34|     84|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   738k|  uint8_t in;
   39|   738k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 195, False: 737k]
  ------------------
   40|    195|    return false;
   41|    195|  }
   42|   737k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 16.2k, False: 721k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  16.2k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 431, False: 15.8k]
  ------------------
   45|    431|      return false;
   46|    431|    }
   47|       |    // Append decoded info from this byte.
   48|  15.8k|    *out_val <<= 7;
   49|  15.8k|    *out_val |= in & ((1 << 7) - 1);
   50|   721k|  } else {
   51|       |    // Last byte reached
   52|   721k|    *out_val = in;
   53|   721k|  }
   54|   737k|  return true;
   55|   737k|}
mesh_sequential_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.11k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.11k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.11k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 3.11k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.11k|  uint8_t in;
   39|  3.11k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 3, False: 3.11k]
  ------------------
   40|      3|    return false;
   41|      3|  }
   42|  3.11k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 356, False: 2.75k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    356|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 8, False: 348]
  ------------------
   45|      8|      return false;
   46|      8|    }
   47|       |    // Append decoded info from this byte.
   48|    348|    *out_val <<= 7;
   49|    348|    *out_val |= in & ((1 << 7) - 1);
   50|  2.75k|  } else {
   51|       |    // Last byte reached
   52|  2.75k|    *out_val = in;
   53|  2.75k|  }
   54|  3.10k|  return true;
   55|  3.11k|}
_ZN5draco12DecodeVarintImEEbPT_PNS_13DecoderBufferE:
   63|  2.80k|bool DecodeVarint(IntTypeT *out_val, DecoderBuffer *buffer) {
   64|  2.80k|  if (std::is_unsigned<IntTypeT>::value) {
  ------------------
  |  Branch (64:7): [True: 2.80k, Folded]
  ------------------
   65|  2.80k|    if (!DecodeVarintUnsigned<IntTypeT>(1, out_val, buffer)) {
  ------------------
  |  Branch (65:9): [True: 12, False: 2.78k]
  ------------------
   66|     12|      return false;
   67|     12|    }
   68|  2.80k|  } 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|  2.78k|  return true;
   77|  2.80k|}
decoder_buffer.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  1.66k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  1.66k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  1.66k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 0, False: 1.66k]
  ------------------
   33|      0|    return false;
   34|      0|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  1.66k|  uint8_t in;
   39|  1.66k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 8, False: 1.65k]
  ------------------
   40|      8|    return false;
   41|      8|  }
   42|  1.65k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 9, False: 1.64k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|      9|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 0, False: 9]
  ------------------
   45|      0|      return false;
   46|      0|    }
   47|       |    // Append decoded info from this byte.
   48|      9|    *out_val <<= 7;
   49|      9|    *out_val |= in & ((1 << 7) - 1);
   50|  1.64k|  } else {
   51|       |    // Last byte reached
   52|  1.64k|    *out_val = in;
   53|  1.64k|  }
   54|  1.65k|  return true;
   55|  1.65k|}
metadata_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|   263k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|   263k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|   263k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 6, False: 263k]
  ------------------
   33|      6|    return false;
   34|      6|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|   263k|  uint8_t in;
   39|   263k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 29, False: 263k]
  ------------------
   40|     29|    return false;
   41|     29|  }
   42|   263k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.29k, False: 262k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.29k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 32, False: 1.26k]
  ------------------
   45|     32|      return false;
   46|     32|    }
   47|       |    // Append decoded info from this byte.
   48|  1.26k|    *out_val <<= 7;
   49|  1.26k|    *out_val |= in & ((1 << 7) - 1);
   50|   262k|  } else {
   51|       |    // Last byte reached
   52|   262k|    *out_val = in;
   53|   262k|  }
   54|   263k|  return true;
   55|   263k|}
sequential_integer_attribute_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  1.57k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  1.57k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  1.57k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 1.57k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  1.57k|  uint8_t in;
   39|  1.57k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 6, False: 1.56k]
  ------------------
   40|      6|    return false;
   41|      6|  }
   42|  1.56k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 324, False: 1.24k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    324|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 9, False: 315]
  ------------------
   45|      9|      return false;
   46|      9|    }
   47|       |    // Append decoded info from this byte.
   48|    315|    *out_val <<= 7;
   49|    315|    *out_val |= in & ((1 << 7) - 1);
   50|  1.24k|  } else {
   51|       |    // Last byte reached
   52|  1.24k|    *out_val = in;
   53|  1.24k|  }
   54|  1.55k|  return true;
   55|  1.56k|}
rans_bit_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  9.40k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  9.40k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  9.40k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 1, False: 9.39k]
  ------------------
   33|      1|    return false;
   34|      1|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  9.39k|  uint8_t in;
   39|  9.39k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 3, False: 9.39k]
  ------------------
   40|      3|    return false;
   41|      3|  }
   42|  9.39k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 199, False: 9.19k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    199|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 5, False: 194]
  ------------------
   45|      5|      return false;
   46|      5|    }
   47|       |    // Append decoded info from this byte.
   48|    194|    *out_val <<= 7;
   49|    194|    *out_val |= in & ((1 << 7) - 1);
   50|  9.19k|  } else {
   51|       |    // Last byte reached
   52|  9.19k|    *out_val = in;
   53|  9.19k|  }
   54|  9.39k|  return true;
   55|  9.39k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  3.05k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  3.05k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  3.05k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 8, False: 3.04k]
  ------------------
   33|      8|    return false;
   34|      8|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  3.04k|  uint8_t in;
   39|  3.04k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 7, False: 3.03k]
  ------------------
   40|      7|    return false;
   41|      7|  }
   42|  3.03k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 741, False: 2.29k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|    741|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 40, False: 701]
  ------------------
   45|     40|      return false;
   46|     40|    }
   47|       |    // Append decoded info from this byte.
   48|    701|    *out_val <<= 7;
   49|    701|    *out_val |= in & ((1 << 7) - 1);
   50|  2.29k|  } else {
   51|       |    // Last byte reached
   52|  2.29k|    *out_val = in;
   53|  2.29k|  }
   54|  2.99k|  return true;
   55|  3.03k|}
symbol_decoding.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedImEEbiPT_PNS_13DecoderBufferE:
   30|  2.46k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  2.46k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  2.46k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 3, False: 2.46k]
  ------------------
   33|      3|    return false;
   34|      3|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  2.46k|  uint8_t in;
   39|  2.46k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 1, False: 2.46k]
  ------------------
   40|      1|    return false;
   41|      1|  }
   42|  2.46k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.31k, False: 1.14k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.31k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 31, False: 1.28k]
  ------------------
   45|     31|      return false;
   46|     31|    }
   47|       |    // Append decoded info from this byte.
   48|  1.28k|    *out_val <<= 7;
   49|  1.28k|    *out_val |= in & ((1 << 7) - 1);
   50|  1.28k|  } else {
   51|       |    // Last byte reached
   52|  1.14k|    *out_val = in;
   53|  1.14k|  }
   54|  2.43k|  return true;
   55|  2.46k|}
attributes_decoder.cc:_ZN5draco12_GLOBAL__N_120DecodeVarintUnsignedIjEEbiPT_PNS_13DecoderBufferE:
   30|  39.7k|bool DecodeVarintUnsigned(int depth, IntTypeT *out_val, DecoderBuffer *buffer) {
   31|  39.7k|  constexpr IntTypeT max_depth = sizeof(IntTypeT) + 1 + (sizeof(IntTypeT) >> 3);
   32|  39.7k|  if (depth > max_depth) {
  ------------------
  |  Branch (32:7): [True: 4, False: 39.7k]
  ------------------
   33|      4|    return false;
   34|      4|  }
   35|       |  // Coding of unsigned values.
   36|       |  // 0-6 bit - data
   37|       |  // 7 bit - next byte?
   38|  39.7k|  uint8_t in;
   39|  39.7k|  if (!buffer->Decode(&in)) {
  ------------------
  |  Branch (39:7): [True: 8, False: 39.7k]
  ------------------
   40|      8|    return false;
   41|      8|  }
   42|  39.7k|  if (in & (1 << 7)) {
  ------------------
  |  Branch (42:7): [True: 1.06k, False: 38.7k]
  ------------------
   43|       |    // Next byte is available, decode it first.
   44|  1.06k|    if (!DecodeVarintUnsigned<IntTypeT>(depth + 1, out_val, buffer)) {
  ------------------
  |  Branch (44:9): [True: 20, False: 1.04k]
  ------------------
   45|     20|      return false;
   46|     20|    }
   47|       |    // Append decoded info from this byte.
   48|  1.04k|    *out_val <<= 7;
   49|  1.04k|    *out_val |= in & ((1 << 7) - 1);
   50|  38.7k|  } else {
   51|       |    // Last byte reached
   52|  38.7k|    *out_val = in;
   53|  38.7k|  }
   54|  39.7k|  return true;
   55|  39.7k|}

_ZNK5draco7VectorDIfLi3EEixEi:
  113|   142k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIfLi3EEixEi:
  112|   181k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIfLi3EEmiERKS1_:
  137|  15.0k|  Self operator-(const Self &o) const {
  138|  15.0k|    Self ret;
  139|  60.3k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 45.2k, False: 15.0k]
  ------------------
  140|  45.2k|      ret[i] = (*this)[i] - o[i];
  141|  45.2k|    }
  142|  15.0k|    return ret;
  143|  15.0k|  }
_ZN5draco7VectorDIfLi3EEC2Ev:
   40|  37.4k|  VectorD() {
   41|   149k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 112k, False: 37.4k]
  ------------------
   42|   112k|      (*this)[i] = Scalar(0);
   43|   112k|    }
   44|  37.4k|  }
_ZNK5draco7VectorDIlLi3EEixEi:
  113|   122M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIlLi3EEmiERKS1_:
  137|  10.1M|  Self operator-(const Self &o) const {
  138|  10.1M|    Self ret;
  139|  40.7M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 30.5M, False: 10.1M]
  ------------------
  140|  30.5M|      ret[i] = (*this)[i] - o[i];
  141|  30.5M|    }
  142|  10.1M|    return ret;
  143|  10.1M|  }
_ZN5draco12CrossProductIlEENS_7VectorDIT_Li3EEERKS3_S5_:
  318|  5.07M|                                 const VectorD<ScalarT, 3> &v) {
  319|       |  // Preventing accidental use with uint32_t and the like.
  320|  5.07M|  static_assert(std::is_signed<ScalarT>::value,
  321|  5.07M|                "ScalarT must be a signed type. ");
  322|  5.07M|  VectorD<ScalarT, 3> r;
  323|  5.07M|  r[0] = (u[1] * v[2]) - (u[2] * v[1]);
  324|  5.07M|  r[1] = (u[2] * v[0]) - (u[0] * v[2]);
  325|  5.07M|  r[2] = (u[0] * v[1]) - (u[1] * v[0]);
  326|  5.07M|  return r;
  327|  5.07M|}
_ZN5draco7VectorDIlLi3EE4dataEv:
  282|  5.07M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE4dataEv:
  283|  5.07M|  const Scalar *data() const { return &(v_[0]); }
_ZNK5draco7VectorDIlLi3EE6AbsSumEv:
  237|  2.32M|  Scalar AbsSum() const {
  238|  2.32M|    Scalar result(0);
  239|  9.27M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (239:21): [True: 6.96M, False: 2.30M]
  ------------------
  240|  6.96M|      Scalar next_value = std::abs(v_[i]);
  241|  6.96M|      if (result > std::numeric_limits<Scalar>::max() - next_value) {
  ------------------
  |  Branch (241:11): [True: 13.9k, False: 6.95M]
  ------------------
  242|       |        // Return the max if adding would have caused an overflow.
  243|  13.9k|        return std::numeric_limits<Scalar>::max();
  244|  13.9k|      }
  245|  6.95M|      result += next_value;
  246|  6.95M|    }
  247|  2.30M|    return result;
  248|  2.32M|  }
_ZNK5draco7VectorDIlLi3EEdvERKl:
  182|   230k|  Self operator/(const Scalar &o) const {
  183|   230k|    Self ret;
  184|   923k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 692k, False: 230k]
  ------------------
  185|   692k|      ret[i] = (*this)[i] / o;
  186|   692k|    }
  187|   230k|    return ret;
  188|   230k|  }
_ZN5draco7VectorDIlLi3EEixEi:
  112|   157M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEixEi:
  112|  8.85M|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EE4dataEv:
  282|  6.97M|  Scalar *data() { return &(v_[0]); }
_ZNK5draco7VectorDIiLi3EEngEv:
  120|  1.47M|  Self operator-() const {
  121|  1.47M|    Self ret;
  122|  5.90M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (122:21): [True: 4.42M, False: 1.47M]
  ------------------
  123|  4.42M|      ret[i] = -(*this)[i];
  124|  4.42M|    }
  125|  1.47M|    return ret;
  126|  1.47M|  }
_ZNK5draco7VectorDIiLi3EEixEi:
  113|  4.42M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEmiERKS1_:
  137|  1.08M|  Self operator-(const Self &o) const {
  138|  1.08M|    Self ret;
  139|  3.26M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.17M, False: 1.08M]
  ------------------
  140|  2.17M|      ret[i] = (*this)[i] - o[i];
  141|  2.17M|    }
  142|  1.08M|    return ret;
  143|  1.08M|  }
_ZN5draco7VectorDIjLi2EEixEi:
  112|  13.0M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEixEi:
  113|  19.5M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIiLi2EEixEi:
  112|  30.8M|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIjLi2EEplERKS1_:
  129|  2.17M|  Self operator+(const Self &o) const {
  130|  2.17M|    Self ret;
  131|  6.53M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 4.35M, False: 2.17M]
  ------------------
  132|  4.35M|      ret[i] = (*this)[i] + o[i];
  133|  4.35M|    }
  134|  2.17M|    return ret;
  135|  2.17M|  }
_ZNK5draco7VectorDIiLi2EEixEi:
  113|  32.0M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIiLi2EEmiERKS1_:
  137|   783k|  Self operator-(const Self &o) const {
  138|   783k|    Self ret;
  139|  2.35M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 1.56M, False: 783k]
  ------------------
  140|  1.56M|      ret[i] = (*this)[i] - o[i];
  141|  1.56M|    }
  142|   783k|    return ret;
  143|   783k|  }
_ZNK5draco7VectorDIiLi2EEplERKS1_:
  129|   783k|  Self operator+(const Self &o) const {
  130|   783k|    Self ret;
  131|  2.35M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.56M, False: 783k]
  ------------------
  132|  1.56M|      ret[i] = (*this)[i] + o[i];
  133|  1.56M|    }
  134|   783k|    return ret;
  135|   783k|  }
_ZNK5draco7VectorDIfLi2EEeqERKS1_:
  206|   298k|  bool operator==(const Self &o) const {
  207|   881k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 590k, False: 291k]
  ------------------
  208|   590k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 7.27k, False: 582k]
  ------------------
  209|  7.27k|        return false;
  210|  7.27k|      }
  211|   590k|    }
  212|   291k|    return true;
  213|   298k|  }
_ZNK5draco7VectorDIfLi2EEixEi:
  113|  3.50M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZNK5draco7VectorDIfLi3EE11SquaredNormEv:
  234|  7.81k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIfLi3EE3DotERKS1_:
  250|  8.35k|  Scalar Dot(const Self &o) const {
  251|  8.35k|    Scalar ret(0);
  252|  33.4k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 25.0k, False: 8.35k]
  ------------------
  253|  25.0k|      ret += (*this)[i] * o[i];
  254|  25.0k|    }
  255|  8.35k|    return ret;
  256|  8.35k|  }
_ZNK5draco7VectorDIfLi3EEmlERKf:
  174|    542|  Self operator*(const Scalar &o) const {
  175|    542|    Self ret;
  176|  2.16k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 1.62k, False: 542]
  ------------------
  177|  1.62k|      ret[i] = (*this)[i] * o;
  178|  1.62k|    }
  179|    542|    return ret;
  180|    542|  }
_ZNK5draco7VectorDIfLi2EEmiERKS1_:
  137|  7.27k|  Self operator-(const Self &o) const {
  138|  7.27k|    Self ret;
  139|  21.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 14.5k, False: 7.27k]
  ------------------
  140|  14.5k|      ret[i] = (*this)[i] - o[i];
  141|  14.5k|    }
  142|  7.27k|    return ret;
  143|  7.27k|  }
_ZN5draco7VectorDIfLi2EEC2Ev:
   40|  14.5k|  VectorD() {
   41|  43.6k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 29.0k, False: 14.5k]
  ------------------
   42|  29.0k|      (*this)[i] = Scalar(0);
   43|  29.0k|    }
   44|  14.5k|  }
_ZN5draco7VectorDIfLi2EEC2ERKfS3_:
   52|   604k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   604k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   604k|    v_[0] = c0;
   55|   604k|    v_[1] = c1;
   56|   604k|  }
_ZN5draco7VectorDIfLi2EEixEi:
  112|  58.1k|  Scalar &operator[](int i) { return v_[i]; }
_ZNK5draco7VectorDIlLi2EEeqERKS1_:
  206|   339k|  bool operator==(const Self &o) const {
  207|   967k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (207:21): [True: 653k, False: 313k]
  ------------------
  208|   653k|      if ((*this)[i] != o[i]) {
  ------------------
  |  Branch (208:11): [True: 25.2k, False: 628k]
  ------------------
  209|  25.2k|        return false;
  210|  25.2k|      }
  211|   653k|    }
  212|   313k|    return true;
  213|   339k|  }
_ZNK5draco7VectorDIlLi2EEixEi:
  113|  1.98M|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDIlLi3EEC2Ev:
   40|  30.3M|  VectorD() {
   41|   121M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 91.1M, False: 30.3M]
  ------------------
   42|  91.1M|      (*this)[i] = Scalar(0);
   43|  91.1M|    }
   44|  30.3M|  }
_ZNK5draco7VectorDIlLi3EE11SquaredNormEv:
  234|  27.2k|  Scalar SquaredNorm() const { return this->Dot(*this); }
_ZNK5draco7VectorDIlLi3EE3DotERKS1_:
  250|  29.2k|  Scalar Dot(const Self &o) const {
  251|  29.2k|    Scalar ret(0);
  252|   117k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (252:21): [True: 87.8k, False: 29.2k]
  ------------------
  253|  87.8k|      ret += (*this)[i] * o[i];
  254|  87.8k|    }
  255|  29.2k|    return ret;
  256|  29.2k|  }
_ZNK5draco7VectorDIlLi2EEmiERKS1_:
  137|  2.04k|  Self operator-(const Self &o) const {
  138|  2.04k|    Self ret;
  139|  6.12k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 4.08k, False: 2.04k]
  ------------------
  140|  4.08k|      ret[i] = (*this)[i] - o[i];
  141|  4.08k|    }
  142|  2.04k|    return ret;
  143|  2.04k|  }
_ZNK5draco7VectorDIlLi2EEmlERKl:
  174|  5.95k|  Self operator*(const Scalar &o) const {
  175|  5.95k|    Self ret;
  176|  17.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 11.9k, False: 5.95k]
  ------------------
  177|  11.9k|      ret[i] = (*this)[i] * o;
  178|  11.9k|    }
  179|  5.95k|    return ret;
  180|  5.95k|  }
_ZNK5draco7VectorDIlLi2EEplERKS1_:
  129|  1.98k|  Self operator+(const Self &o) const {
  130|  1.98k|    Self ret;
  131|  5.96k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 3.97k, False: 1.98k]
  ------------------
  132|  3.97k|      ret[i] = (*this)[i] + o[i];
  133|  3.97k|    }
  134|  1.98k|    return ret;
  135|  1.98k|  }
_ZN5dracomlIlLi2EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  1.98k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  1.98k|  return v * o;
  294|  1.98k|}
_ZNK5draco7VectorDIlLi3EEplERKS1_:
  129|  1.97k|  Self operator+(const Self &o) const {
  130|  1.97k|    Self ret;
  131|  7.89k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 5.92k, False: 1.97k]
  ------------------
  132|  5.92k|      ret[i] = (*this)[i] + o[i];
  133|  5.92k|    }
  134|  1.97k|    return ret;
  135|  1.97k|  }
_ZN5dracomlIlLi3EEENS_7VectorDIT_XT0_EEERKS2_RKS3_:
  292|  1.97k|    const ScalarT &o, const VectorD<ScalarT, dimension_t> &v) {
  293|  1.97k|  return v * o;
  294|  1.97k|}
_ZNK5draco7VectorDIlLi3EEmlERKl:
  174|  1.97k|  Self operator*(const Scalar &o) const {
  175|  1.97k|    Self ret;
  176|  7.89k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (176:21): [True: 5.92k, False: 1.97k]
  ------------------
  177|  5.92k|      ret[i] = (*this)[i] * o;
  178|  5.92k|    }
  179|  1.97k|    return ret;
  180|  1.97k|  }
_ZN5draco7VectorDIlLi2EEC2ERKlS3_:
   52|   680k|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|   680k|    DRACO_DCHECK_EQ(dimension, 2);
   54|   680k|    v_[0] = c0;
   55|   680k|    v_[1] = c1;
   56|   680k|  }
_ZN5draco7VectorDIlLi2EEC2Ev:
   40|  13.9k|  VectorD() {
   41|  41.7k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 27.8k, False: 13.9k]
  ------------------
   42|  27.8k|      (*this)[i] = Scalar(0);
   43|  27.8k|    }
   44|  13.9k|  }
_ZN5draco7VectorDImLi2EEC2IlLi2EEERKNS0_IT_XT0_EEE:
  102|  3.94k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  11.8k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 7.89k, False: 3.94k]
  ------------------
  104|  7.89k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 7.89k, False: 0]
  ------------------
  105|  7.89k|        v_[i] = Scalar(src_vector[i]);
  106|  7.89k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  7.89k|    }
  110|  3.94k|  }
_ZNK5draco7VectorDImLi2EEplERKS1_:
  129|    670|  Self operator+(const Self &o) const {
  130|    670|    Self ret;
  131|  2.01k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (131:21): [True: 1.34k, False: 670]
  ------------------
  132|  1.34k|      ret[i] = (*this)[i] + o[i];
  133|  1.34k|    }
  134|    670|    return ret;
  135|    670|  }
_ZN5draco7VectorDImLi2EEC2Ev:
   40|  1.97k|  VectorD() {
   41|  5.91k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.94k, False: 1.97k]
  ------------------
   42|  3.94k|      (*this)[i] = Scalar(0);
   43|  3.94k|    }
   44|  1.97k|  }
_ZNK5draco7VectorDImLi2EEixEi:
  113|  11.8k|  const Scalar &operator[](int i) const { return v_[i]; }
_ZN5draco7VectorDImLi2EEixEi:
  112|  7.89k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIlLi2EEC2ImLi2EEERKNS0_IT_XT0_EEE:
  102|  1.97k|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  5.91k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 3.94k, False: 1.97k]
  ------------------
  104|  3.94k|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 3.94k, False: 0]
  ------------------
  105|  3.94k|        v_[i] = Scalar(src_vector[i]);
  106|  3.94k|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  3.94k|    }
  110|  1.97k|  }
_ZNK5draco7VectorDIlLi2EEdvERKl:
  182|  1.97k|  Self operator/(const Scalar &o) const {
  183|  1.97k|    Self ret;
  184|  5.91k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (184:21): [True: 3.94k, False: 1.97k]
  ------------------
  185|  3.94k|      ret[i] = (*this)[i] / o;
  186|  3.94k|    }
  187|  1.97k|    return ret;
  188|  1.97k|  }
_ZNK5draco7VectorDImLi2EEmiERKS1_:
  137|  1.30k|  Self operator-(const Self &o) const {
  138|  1.30k|    Self ret;
  139|  3.90k|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (139:21): [True: 2.60k, False: 1.30k]
  ------------------
  140|  2.60k|      ret[i] = (*this)[i] - o[i];
  141|  2.60k|    }
  142|  1.30k|    return ret;
  143|  1.30k|  }
_ZN5draco7VectorDIlLi2EEixEi:
  112|  55.7k|  Scalar &operator[](int i) { return v_[i]; }
_ZN5draco7VectorDIiLi3EEC2Ev:
   40|  1.47M|  VectorD() {
   41|  5.90M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 4.43M, False: 1.47M]
  ------------------
   42|  4.43M|      (*this)[i] = Scalar(0);
   43|  4.43M|    }
   44|  1.47M|  }
_ZN5draco7VectorDIiLi2EEC2ERKiS3_:
   52|  6.62M|  VectorD(const Scalar &c0, const Scalar &c1) : v_({{c0, c1}}) {
   53|  6.62M|    DRACO_DCHECK_EQ(dimension, 2);
   54|  6.62M|    v_[0] = c0;
   55|  6.62M|    v_[1] = c1;
   56|  6.62M|  }
_ZN5draco7VectorDIjLi2EEC2IiLi2EEERKNS0_IT_XT0_EEE:
  102|  6.53M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  19.5M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 13.0M, False: 6.53M]
  ------------------
  104|  13.0M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 13.0M, False: 0]
  ------------------
  105|  13.0M|        v_[i] = Scalar(src_vector[i]);
  106|  13.0M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  13.0M|    }
  110|  6.53M|  }
_ZN5draco7VectorDIjLi2EEC2Ev:
   40|  3.26M|  VectorD() {
   41|  9.79M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 6.53M, False: 3.26M]
  ------------------
   42|  6.53M|      (*this)[i] = Scalar(0);
   43|  6.53M|    }
   44|  3.26M|  }
_ZN5draco7VectorDIiLi2EEC2IjLi2EEERKNS0_IT_XT0_EEE:
  102|  3.26M|  explicit VectorD(const VectorD<OtherScalarT, other_dimension_t> &src_vector) {
  103|  9.79M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (103:21): [True: 6.53M, False: 3.26M]
  ------------------
  104|  6.53M|      if (i < other_dimension_t) {
  ------------------
  |  Branch (104:11): [True: 6.53M, False: 0]
  ------------------
  105|  6.53M|        v_[i] = Scalar(src_vector[i]);
  106|  6.53M|      } else {
  107|      0|        v_[i] = Scalar(0);
  108|      0|      }
  109|  6.53M|    }
  110|  3.26M|  }
_ZN5draco7VectorDIiLi2EEC2ERKS1_:
   88|  3.66M|  VectorD(const Self &o) {
   89|  10.9M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (89:21): [True: 7.32M, False: 3.66M]
  ------------------
   90|  7.32M|      (*this)[i] = o[i];
   91|  7.32M|    }
   92|  3.66M|  }
_ZN5draco7VectorDIiLi2EEC2Ev:
   40|  1.56M|  VectorD() {
   41|  4.70M|    for (int i = 0; i < dimension; ++i) {
  ------------------
  |  Branch (41:21): [True: 3.13M, False: 1.56M]
  ------------------
   42|  3.13M|      (*this)[i] = Scalar(0);
   43|  3.13M|    }
   44|  1.56M|  }

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

_ZNK5draco11CornerTable12num_verticesEv:
   73|  67.2M|  inline int num_vertices() const {
   74|  67.2M|    return static_cast<int>(vertex_corners_.size());
   75|  67.2M|  }
_ZNK5draco11CornerTable11num_cornersEv:
   76|  5.42M|  inline int num_corners() const {
   77|  5.42M|    return static_cast<int>(corner_to_vertex_map_.size());
   78|  5.42M|  }
_ZNK5draco11CornerTable9num_facesEv:
   79|  1.68M|  inline int num_faces() const {
   80|  1.68M|    return static_cast<int>(corner_to_vertex_map_.size() / 3);
   81|  1.68M|  }
_ZNK5draco11CornerTable8OppositeENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   83|   243M|  inline CornerIndex Opposite(CornerIndex corner) const {
   84|   243M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (84:9): [True: 0, False: 243M]
  ------------------
   85|      0|      return corner;
   86|      0|    }
   87|   243M|    return opposite_corners_[corner];
   88|   243M|  }
_ZNK5draco11CornerTable4NextENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   89|   442M|  inline CornerIndex Next(CornerIndex corner) const {
   90|   442M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (90:9): [True: 11.1M, False: 431M]
  ------------------
   91|  11.1M|      return corner;
   92|  11.1M|    }
   93|   431M|    return LocalIndex(++corner) ? corner : corner - 3;
  ------------------
  |  Branch (93:12): [True: 393M, False: 37.0M]
  ------------------
   94|   442M|  }
_ZNK5draco11CornerTable8PreviousENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
   95|   306M|  inline CornerIndex Previous(CornerIndex corner) const {
   96|   306M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (96:9): [True: 3.21M, False: 303M]
  ------------------
   97|  3.21M|      return corner;
   98|  3.21M|    }
   99|   303M|    return LocalIndex(corner) ? corner - 1 : corner + 2;
  ------------------
  |  Branch (99:12): [True: 71.3M, False: 232M]
  ------------------
  100|   306M|  }
_ZNK5draco11CornerTable6VertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  101|   607M|  inline VertexIndex Vertex(CornerIndex corner) const {
  102|   607M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (102:9): [True: 0, False: 607M]
  ------------------
  103|      0|      return kInvalidVertexIndex;
  104|      0|    }
  105|   607M|    return ConfidentVertex(corner);
  106|   607M|  }
_ZNK5draco11CornerTable15ConfidentVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  107|   607M|  inline VertexIndex ConfidentVertex(CornerIndex corner) const {
  108|   607M|    DRACO_DCHECK_GE(corner.value(), 0);
  109|   607M|    DRACO_DCHECK_LT(corner.value(), num_corners());
  110|   607M|    return corner_to_vertex_map_[corner];
  111|   607M|  }
_ZNK5draco11CornerTable4FaceENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  112|  19.8M|  inline FaceIndex Face(CornerIndex corner) const {
  113|  19.8M|    if (corner == kInvalidCornerIndex) {
  ------------------
  |  Branch (113:9): [True: 0, False: 19.8M]
  ------------------
  114|      0|      return kInvalidFaceIndex;
  115|      0|    }
  116|  19.8M|    return FaceIndex(corner.value() / 3);
  117|  19.8M|  }
_ZNK5draco11CornerTable10LocalIndexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  128|   734M|  inline int LocalIndex(CornerIndex corner) const { return corner.value() % 3; }
_ZNK5draco11CornerTable14LeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  150|  58.4M|  inline CornerIndex LeftMostCorner(VertexIndex v) const {
  151|  58.4M|    return vertex_corners_[v];
  152|  58.4M|  }
_ZNK5draco11CornerTable12IsOnBoundaryENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  185|   600k|  inline bool IsOnBoundary(VertexIndex vert) const {
  186|   600k|    const CornerIndex corner = LeftMostCorner(vert);
  187|   600k|    if (SwingLeft(corner) == kInvalidCornerIndex) {
  ------------------
  |  Branch (187:9): [True: 10.3k, False: 589k]
  ------------------
  188|  10.3k|      return true;
  189|  10.3k|    }
  190|   589k|    return false;
  191|   600k|  }
_ZNK5draco11CornerTable10SwingRightENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  200|  41.4M|  inline CornerIndex SwingRight(CornerIndex corner) const {
  201|  41.4M|    return Previous(Opposite(Previous(corner)));
  202|  41.4M|  }
_ZNK5draco11CornerTable9SwingLeftENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  205|  15.9M|  inline CornerIndex SwingLeft(CornerIndex corner) const {
  206|  15.9M|    return Next(Opposite(Next(corner)));
  207|  15.9M|  }
_ZNK5draco11CornerTable13GetLeftCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  217|  1.48M|  inline CornerIndex GetLeftCorner(CornerIndex corner_id) const {
  218|  1.48M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (218:9): [True: 0, False: 1.48M]
  ------------------
  219|      0|      return kInvalidCornerIndex;
  220|      0|    }
  221|  1.48M|    return Opposite(Previous(corner_id));
  222|  1.48M|  }
_ZNK5draco11CornerTable14GetRightCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  223|  2.07M|  inline CornerIndex GetRightCorner(CornerIndex corner_id) const {
  224|  2.07M|    if (corner_id == kInvalidCornerIndex) {
  ------------------
  |  Branch (224:9): [True: 0, False: 2.07M]
  ------------------
  225|      0|      return kInvalidCornerIndex;
  226|      0|    }
  227|  2.07M|    return Opposite(Next(corner_id));
  228|  2.07M|  }
_ZN5draco11CornerTable17SetOppositeCornerENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEES3_:
  248|   304M|                                CornerIndex opp_corner_id) {
  249|   304M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  250|   304M|    opposite_corners_[corner_id] = opp_corner_id;
  251|   304M|  }
_ZN5draco11CornerTable17MapCornerToVertexENS_9IndexTypeIjNS_21CornerIndex_tag_type_EEENS1_IjNS_21VertexIndex_tag_type_EEE:
  265|   342M|  inline void MapCornerToVertex(CornerIndex corner_id, VertexIndex vert_id) {
  266|   342M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  267|   342M|    corner_to_vertex_map_[corner_id] = vert_id;
  268|   342M|  }
_ZN5draco11CornerTable12AddNewVertexEv:
  270|  78.5M|  VertexIndex AddNewVertex() {
  271|  78.5M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  272|       |    // Add a new invalid vertex.
  273|  78.5M|    vertex_corners_.push_back(kInvalidCornerIndex);
  274|  78.5M|    return VertexIndex(static_cast<uint32_t>(vertex_corners_.size() - 1));
  275|  78.5M|  }
_ZN5draco11CornerTable17SetLeftMostCornerENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEENS1_IjNS_21CornerIndex_tag_type_EEE:
  292|   182M|  void SetLeftMostCorner(VertexIndex vert, CornerIndex corner) {
  293|   182M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  294|   182M|    if (vert != kInvalidVertexIndex) {
  ------------------
  |  Branch (294:9): [True: 182M, False: 0]
  ------------------
  295|   182M|      vertex_corners_[vert] = corner;
  296|   182M|    }
  297|   182M|  }
_ZN5draco11CornerTable18MakeVertexIsolatedENS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  328|  4.30M|  void MakeVertexIsolated(VertexIndex vert) {
  329|  4.30M|    DRACO_DCHECK(GetValenceCache().IsCacheEmpty());
  330|  4.30M|    vertex_corners_[vert] = kInvalidCornerIndex;
  331|  4.30M|  }

_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21VertexIndex_tag_type_EEE:
  228|  9.74k|      : corner_table_(table),
  229|  9.74k|        start_corner_(table->LeftMostCorner(vert_id)),
  230|  9.74k|        corner_(start_corner_),
  231|  9.74k|        left_traversal_(true) {}
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE3EndEv:
  244|  3.10M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEppEv:
  267|  79.9k|  VertexCornersIterator &operator++() {
  268|  79.9k|    Next();
  269|  79.9k|    return *this;
  270|  79.9k|  }
_ZN5draco21VertexCornersIteratorINS_11CornerTableEE4NextEv:
  247|  2.65M|  void Next() {
  248|  2.65M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 2.59M, False: 60.9k]
  ------------------
  249|  2.59M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  2.59M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 14.7k, False: 2.58M]
  ------------------
  251|       |        // Open boundary reached.
  252|  14.7k|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  14.7k|        left_traversal_ = false;
  254|  2.58M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 430k, False: 2.15M]
  ------------------
  255|       |        // End reached.
  256|   430k|        corner_ = kInvalidCornerIndex;
  257|   430k|      }
  258|  2.59M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  60.9k|      corner_ = corner_table_->SwingRight(corner_);
  262|  60.9k|    }
  263|  2.65M|  }
_ZNK5draco21VertexCornersIteratorINS_11CornerTableEE6CornerEv:
  241|  4.59M|  CornerIndex Corner() const { return corner_; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE3EndEv:
  244|  4.38M|  bool End() const { return corner_ == kInvalidCornerIndex; }
_ZNK5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE6CornerEv:
  241|  4.28M|  CornerIndex Corner() const { return corner_; }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEE4NextEv:
  247|  2.49M|  void Next() {
  248|  2.49M|    if (left_traversal_) {
  ------------------
  |  Branch (248:9): [True: 2.47M, False: 23.1k]
  ------------------
  249|  2.47M|      corner_ = corner_table_->SwingLeft(corner_);
  250|  2.47M|      if (corner_ == kInvalidCornerIndex) {
  ------------------
  |  Branch (250:11): [True: 1.77M, False: 703k]
  ------------------
  251|       |        // Open boundary reached.
  252|  1.77M|        corner_ = corner_table_->SwingRight(start_corner_);
  253|  1.77M|        left_traversal_ = false;
  254|  1.77M|      } else if (corner_ == start_corner_) {
  ------------------
  |  Branch (254:18): [True: 114k, False: 588k]
  ------------------
  255|       |        // End reached.
  256|   114k|        corner_ = kInvalidCornerIndex;
  257|   114k|      }
  258|  2.47M|    } else {
  259|       |      // Go to the right until we reach a boundary there (no explicit check
  260|       |      // is needed in this case).
  261|  23.1k|      corner_ = corner_table_->SwingRight(corner_);
  262|  23.1k|    }
  263|  2.49M|  }
_ZN5draco21VertexCornersIteratorINS_24MeshAttributeCornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|  1.88M|      : corner_table_(table),
  236|  1.88M|        start_corner_(corner_id),
  237|  1.88M|        corner_(start_corner_),
  238|  1.88M|        left_traversal_(true) {}
_ZN5draco21VertexCornersIteratorINS_11CornerTableEEC2EPKS1_NS_9IndexTypeIjNS_21CornerIndex_tag_type_EEE:
  235|   435k|      : corner_table_(table),
  236|   435k|        start_corner_(corner_id),
  237|   435k|        corner_(start_corner_),
  238|   435k|        left_traversal_(true) {}

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

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

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

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

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

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

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

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

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

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

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

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

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

